Debian Codegraph @

mysql-test/suite/storage_engine/index_key_block_size.test

raw
1 #
2 # KEY_BLOCK_SIZE index option.
3 #
4 # The results are likely to be different
5 # depending on the engine
6 #
7
8 --source have_engine.inc
9 --source have_default_index.inc
10
11 --disable_warnings
12 DROP TABLE IF EXISTS t1;
13 --enable_warnings
14
15 let $create_definition =
16 a $int_indexed_col,
17 b $char_col,
18 $default_index (a) KEY_BLOCK_SIZE=8
19 ;
20 --source create_table.inc
21 if ($mysql_errname)
22 {
23 --let $my_last_stmt = $create_statement
24 --source unexpected_result.inc
25 }
26 if (!$mysql_errname)
27 {
28 # Cardinality is not the exact science, so here and further
29 # we'll be masking it
30 --replace_column 6 # 7 # 10 # 11 #
31 SHOW KEYS IN t1;
32
33 DROP TABLE t1;
34 }
35
36
37 let $create_definition =
38 a $int_col,
39 b $char_indexed_col,
40 $default_index ind1(b ASC) KEY_BLOCK_SIZE=0
41 ;
42 --source create_table.inc
43 if ($mysql_errname)
44 {
45 --let $my_last_stmt = $create_statement
46 --let $functionality = Indexes on CHAR columns
47 --source unexpected_result.inc
48 }
49 if (!$mysql_errname)
50 {
51 --replace_column 6 # 7 # 10 # 11 #
52 SHOW INDEX IN t1;
53
54 DROP TABLE t1;
55 }
56
57 let $create_definition =
58 a $int_col,
59 b $char_indexed_col,
60 UNIQUE INDEX ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value'
61 ;
62 --source create_table.inc
63 if ($mysql_errname)
64 {
65 --let $my_last_stmt = $create_statement
66 --let $functionality = Unique keys on char columns
67 --source unexpected_result.inc
68 }
69 if (!$mysql_errname)
70 {
71 --replace_column 6 # 7 # 10 # 11 #
72 SHOW INDEX IN t1;
73
74 DROP TABLE t1;
75 }
76
77 let $create_definition =
78 a $int_indexed_col,
79 b $char_indexed_col,
80 $default_index a_b(a,b) KEY_BLOCK_SIZE=8192
81 ;
82 --source create_table.inc
83 if ($mysql_errname)
84 {
85 --let $my_last_stmt = $create_statement
86 --let $functionality = Multi-part keys
87 --source unexpected_result.inc
88 }
89 if (!$mysql_errname)
90 {
91 --replace_column 6 # 7 # 10 # 11 #
92 SHOW INDEX IN t1;
93
94 DROP TABLE t1;
95 }
96
97 #
98 # ALTER TABLE
99 #
100
101 let $create_definition =
102 a $int_indexed_col,
103 b $char_col
104 ;
105 --source create_table.inc
106 if ($mysql_errname)
107 {
108 --let $my_last_stmt = $create_statement
109 --source unexpected_result.inc
110 }
111 if (!$mysql_errname)
112 {
113 INSERT INTO t1 (a,b) VALUES (100,'z');
114
115 --let $alter_definition = ADD $default_index(a) KEY_BLOCK_SIZE 8192
116 --source alter_table.inc
117 --replace_column 6 # 7 # 10 # 11 #
118 SHOW INDEX FROM t1;
119
120 DROP TABLE t1;
121 }
122
123
124 --source cleanup_engine.inc
125