Debian Codegraph @

mysql-test/suite/gcol/t/gcol_keys_innodb.test

raw
1 ################################################################################
2 # t/gcol_keys_innodb.test #
3 # #
4 # Purpose: #
5 # Testing keys, indexes defined upon generated columns. #
6 # #
7 # InnoDB branch #
8 # #
9 #------------------------------------------------------------------------------#
10 # Original Author: Andrey Zhakov #
11 # Original Date: 2008-09-04 #
12 # Change Author: #
13 # Change Date: #
14 # Change: #
15 ################################################################################
16
17 #
18 # NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
19 # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
20 # THE SOURCED FILES ONLY.
21 #
22
23 #------------------------------------------------------------------------------#
24 # General not engine specific settings and requirements
25
26 #------------------------------------------------------------------------------#
27 # Engine specific settings and requirements
28
29 ##### Storage engine to be tested
30 # Set the session storage engine
31 --source include/have_innodb.inc
32 eval SET @@session.default_storage_engine = 'InnoDB';
33
34 ##### Workarounds for known open engine specific bugs
35 # none
36
37 #------------------------------------------------------------------------------#
38 # Execute the tests to be applied to all storage engines
39 let $skip_spatial_index_check = 1;
40 let $support_virtual_index= 1;
41 --source suite/gcol/inc/gcol_keys.inc
42
43 if ($support_virtual_index) {
44 #------------------------------------------------------------------------------#
45 # Execute storage engine specific tests
46 --echo #
47 --echo # BUG#21365158 WL8149:ASSERTION `!TABLE || (!TABLE->WRITE_SET
48 --echo #
49 CREATE TABLE t1 (
50 pk INTEGER AUTO_INCREMENT,
51 col_int_nokey INTEGER NOT NULL,
52 col_varchar_nokey VARCHAR(1),
53 col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
54 (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL,
55 PRIMARY KEY (pk)
56 );
57
58 INSERT INTO t1 ( col_int_nokey, col_varchar_nokey)
59 VALUES (4, 'b'),(9, 'o'),(4, 'k'),(5, 'a'),(5, 'f'),
60 (9, 't'),(3, 'c'),(8, 'c'),(0, 'r'),(98, 'k');
61
62 CREATE TABLE t2 (
63 pk INTEGER AUTO_INCREMENT,
64 col_int_nokey INTEGER NOT NULL,
65 col_varchar_nokey VARCHAR(1) NOT NULL,
66 col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
67 (CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL,
68 PRIMARY KEY (pk),
69 UNIQUE KEY (col_varchar_key)
70 );
71
72 INSERT INTO t2 ( col_int_nokey, col_varchar_nokey)
73 VALUES (1, 'c'),(8, 'm'),(9, 'd'), (6, 'y'),(1, 't'),
74 (2, 's'),(4, 'r');
75
76 SELECT
77 CONCAT( t2.col_varchar_nokey , t2.col_varchar_nokey ) AS f2,
78 t1.col_varchar_key AS f5
79 FROM
80 t2 LEFT JOIN t1 ON t2.col_int_nokey > t1.col_int_nokey
81 ORDER BY f2, f5;
82 DROP TABLE t1,t2;
83
84 --echo #
85
86 }
87 #------------------------------------------------------------------------------#
88 # Cleanup
89 --source suite/gcol/inc/gcol_cleanup.inc