~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Test bugs in the MyISAM code
3
#
4
5
# Initialise
6
--disable_warnings
7
drop table if exists t1,t2;
8
--enable_warnings
9
SET SQL_WARNINGS=1;
10
11
#
12
# Test problem with CHECK TABLE;
13
#
14
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
15
CREATE TEMPORARY TABLE t1 (
1 by brian
clean slate
16
  STRING_DATA char(255) default NULL,
17
  KEY string_data (STRING_DATA)
18
) ENGINE=MyISAM;
19
20
INSERT INTO t1 VALUES ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
21
INSERT INTO t1 VALUES ('DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD');
22
INSERT INTO t1 VALUES ('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF');
23
INSERT INTO t1 VALUES ('FGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG');
24
INSERT INTO t1 VALUES ('HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH');
25
INSERT INTO t1 VALUES ('WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW');
26
CHECK TABLE t1;
27
drop table t1;
28
29
#
30
# Test problem with rows that are 65517-65520 bytes long
31
#
32
396 by Brian Aker
Cleanup tiny and small int.
33
create table t1 (a int not null auto_increment, b blob not null, primary key (a));
1 by brian
clean slate
34
35
let $1=100;
36
disable_query_log;
37
--disable_warnings
38
SET SQL_WARNINGS=0;
39
while ($1)
40
{
41
  eval insert into t1 (b) values(repeat(char(65+$1),65550-$1));
42
  dec $1;
43
}
44
SET SQL_WARNINGS=1;
45
--enable_warnings
46
enable_query_log;
47
check table t1;
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
48
49
# @TODO Because there are no notes on what the heck this
50
# is actually testing (which bug?), it's difficult to tell
51
# what the below DELETE statement is doing.  Since we don't
52
# support bitwise operators, I am replacing the delete statement
53
# with a version we support.
54
#delete from t1 where (a & 1);
55
delete from t1 where (a mod 2) = 1;
1 by brian
clean slate
56
check table t1;
57
drop table t1;
58
59
#
60
# Test bug: Two optimize in a row reset index cardinality
61
#
62
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
63
create TEMPORARY table t1 (a int not null auto_increment, b int not null, primary key (a), index(b)) ENGINE=MYISAM;
1 by brian
clean slate
64
insert into t1 (b) values (1),(2),(2),(2),(2);
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
65
alter table t1 engine=MYISAM;
1 by brian
clean slate
66
show index from t1;
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
67
alter table t1 engine=MyISAM;
1 by brian
clean slate
68
show index from t1;
69
drop table t1;
70
71
#
72
# Test of how ORDER BY works when doing it on the whole table
73
#
74
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
75
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
1 by brian
clean slate
76
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
77
explain select * from t1 order by a;
78
explain select * from t1 order by b;
79
explain select * from t1 order by c;
80
explain select a from t1 order by a;
81
explain select b from t1 order by b;
82
explain select a,b from t1 order by b;
83
explain select a,b from t1;
84
explain select a,b,c from t1;
85
drop table t1;
86
87
#
88
# Test of optimize, when only mi_sort_index (but not mi_repair*) is done
89
# in ha_myisam::repair, and index size is changed (decreased).
90
#
91
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
92
create temporary table t1 ( t1 char(255), key(t1(250))) ENGINE=MYISAM;
1 by brian
clean slate
93
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
94
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
95
insert t1 values ('213872387238723872387238723872387238723867376737673767376737673767376737673767');
96
insert t1 values ('242624262426242624262426242624262426242607890789078907890789078907890789078907');
97
insert t1 values ('256025602560256025602560256025602560256011701170117011701170117011701170117011');
98
insert t1 values ('276027602760276027602760276027602760276001610161016101610161016101610161016101');
99
insert t1 values ('281528152815281528152815281528152815281564956495649564956495649564956495649564');
100
insert t1 values ('292129212921292129212921292129212921292102100210021002100210021002100210021002');
101
insert t1 values ('380638063806380638063806380638063806380634483448344834483448344834483448344834');
102
insert t1 values ('411641164116411641164116411641164116411616301630163016301630163016301630163016');
103
insert t1 values ('420842084208420842084208420842084208420899889988998899889988998899889988998899');
104
insert t1 values ('438443844384438443844384438443844384438482448244824482448244824482448244824482');
105
insert t1 values ('443244324432443244324432443244324432443239613961396139613961396139613961396139');
106
insert t1 values ('485448544854485448544854485448544854485477847784778477847784778477847784778477');
107
insert t1 values ('494549454945494549454945494549454945494555275527552755275527552755275527552755');
108
insert t1 values ('538647864786478647864786478647864786478688918891889188918891889188918891889188');
109
insert t1 values ('565556555655565556555655565556555655565554845484548454845484548454845484548454');
110
insert t1 values ('607860786078607860786078607860786078607856665666566656665666566656665666566656');
111
insert t1 values ('640164016401640164016401640164016401640141274127412741274127412741274127412741');
112
insert t1 values ('719471947194719471947194719471947194719478717871787178717871787178717871787178');
113
insert t1 values ('742574257425742574257425742574257425742549604960496049604960496049604960496049');
114
insert t1 values ('887088708870887088708870887088708870887035963596359635963596359635963596359635');
115
insert t1 values ('917791779177917791779177917791779177917773857385738573857385738573857385738573');
116
insert t1 values ('933293329332933293329332933293329332933278987898789878987898789878987898789878');
117
insert t1 values ('963896389638963896389638963896389638963877807780778077807780778077807780778077');
118
delete from t1 where t1>'2';
119
insert t1 values ('70'), ('84'), ('60'), ('20'), ('76'), ('89'), ('49'), ('50'),
120
('88'), ('61'), ('42'), ('98'), ('39'), ('30'), ('25'), ('66'), ('61'), ('48'),
121
('80'), ('84'), ('98'), ('19'), ('91'), ('42'), ('47');
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
122
alter table t1 ENGINE=myisam;
1 by brian
clean slate
123
check table t1;
124
drop table t1;
125
126
#
127
# test of myisam with huge number of packed fields
128
#
129
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
130
create temporary table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
1 by brian
clean slate
131
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
132
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
133
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
134
int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
135
i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
136
int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int,
137
i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68
138
int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int,
139
i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85
140
int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int,
141
i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102
142
int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110
143
int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118
144
int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126
145
int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134
146
int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142
147
int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150
148
int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158
149
int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166
150
int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174
151
int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182
152
int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190
153
int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198
154
int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206
155
int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214
156
int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222
157
int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230
158
int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238
159
int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246
160
int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254
161
int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262
162
int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270
163
int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278
164
int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286
165
int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294
166
int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302
167
int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310
168
int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318
169
int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326
170
int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334
171
int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342
172
int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350
173
int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358
174
int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366
175
int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374
176
int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382
177
int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390
178
int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398
179
int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406
180
int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414
181
int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422
182
int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430
183
int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438
184
int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446
185
int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454
186
int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462
187
int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470
188
int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478
189
int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486
190
int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494
191
int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502
192
int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510
193
int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518
194
int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526
195
int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534
196
int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542
197
int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550
198
int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558
199
int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566
200
int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574
201
int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582
202
int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590
203
int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598
204
int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606
205
int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614
206
int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622
207
int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630
208
int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638
209
int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646
210
int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654
211
int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662
212
int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670
213
int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678
214
int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686
215
int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694
216
int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702
217
int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710
218
int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718
219
int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726
220
int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734
221
int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742
222
int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750
223
int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758
224
int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766
225
int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774
226
int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782
227
int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790
228
int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798
229
int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806
230
int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814
231
int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822
232
int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830
233
int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838
234
int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846
235
int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854
236
int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862
237
int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870
238
int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878
239
int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886
240
int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894
241
int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902
242
int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910
243
int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918
244
int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926
245
int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934
246
int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942
247
int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950
248
int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958
249
int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966
250
int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
251
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
252
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
253
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
254
int, i999 int, i1000 int, b blob) engine=myisam row_format=dynamic;
1 by brian
clean slate
255
insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
256
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
257
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
258
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
259
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
260
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
261
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
262
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
263
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
264
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
265
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
266
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
267
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
268
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
269
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
270
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
271
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
272
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
273
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
274
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
275
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
276
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
277
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
278
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
279
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
280
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
281
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
282
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
283
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
284
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
285
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
286
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
287
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
288
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
289
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
290
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
291
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
292
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
293
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei");
294
update t1 set b=repeat('a',256);
295
update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
296
check table t1;
297
delete from t1 where i8=1;
298
select i1,i2 from t1;
299
check table t1;
300
drop table t1;
301
302
#
303
# Test of REPAIR that once failed
304
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
305
CREATE TEMPORARY TABLE `t1` (
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
306
  `post_id` int NOT NULL auto_increment,
307
  `topic_id` int NOT NULL default '0',
873.1.2 by Jay Pipes
Fixed Field_datetime to never accept any bad datetimes as a string. This broke
308
  `post_time` datetime,
1 by brian
clean slate
309
  `post_text` text NOT NULL,
310
  `icon_url` varchar(10) NOT NULL default '',
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
311
  `sign` int NOT NULL default '0',
1 by brian
clean slate
312
  `post_edit` varchar(150) NOT NULL default '',
313
  `poster_login` varchar(35) NOT NULL default '',
314
  `ip` varchar(15) NOT NULL default '',
315
  PRIMARY KEY  (`post_id`),
316
  KEY `post_time` (`post_time`),
317
  KEY `ip` (`ip`),
318
  KEY `poster_login` (`poster_login`),
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
319
  KEY `topic_id` (`topic_id`)
320
#  FULLTEXT KEY `post_text` (`post_text`)
1 by brian
clean slate
321
) ENGINE=MyISAM;
322
323
INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test');
324
325
CHECK TABLE t1;
326
drop table t1;
327
328
#
329
# Test of creating table with too long key
330
#
331
332
--error 1071
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
333
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300), KEY t1 (a, b, c, d, e)) ENGINE=MyISAM;
334
CREATE TEMPORARY TABLE t1 (a varchar(300), b varchar(300), c varchar(300), d varchar(300), e varchar(300)) ENGINE=MyISAM;
1 by brian
clean slate
335
--error 1071
336
ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
337
DROP TABLE t1;
338
339
#
340
# Test of cardinality of keys with NULL
341
#
342
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
343
CREATE TEMPORARY TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)) ENGINE=MyISAM;
1 by brian
clean slate
344
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
345
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
346
INSERT into t2 values (1,1,1), (2,2,2);
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
347
alter table t1 ENGINE=MYISAM;
1 by brian
clean slate
348
show index from t1;
349
explain select * from t1,t2 where t1.a=t2.a;
350
explain select * from t1,t2 force index(a) where t1.a=t2.a;
351
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
352
explain select * from t1,t2 where t1.b=t2.b;
353
explain select * from t1,t2 force index(c) where t1.a=t2.a;
354
explain select * from t1 where a=0 or a=2;
355
explain select * from t1 force index (a) where a=0 or a=2;
356
explain select * from t1 where c=1;
357
explain select * from t1 use index() where c=1;
358
drop table t1,t2;
359
360
#
361
# Test bug when updating a split dynamic row where keys are not changed
362
#
363
364
create table t1 (a int not null auto_increment primary key, b varchar(255));
365
insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100));
366
update t1 set b=repeat(left(b,1),200) where a=1;
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
367
368
# @TODO Because there are no notes on what the heck this
369
# is actually testing (which bug?), it's difficult to tell
370
# what the below DELETE statement is doing.  Since we don't
371
# support bitwise operators, I am replacing the delete statement
372
# with a version we support.
373
#delete from t1 where (a & 1)= 0;
374
delete from t1 where (a mod 2) = 0;
1 by brian
clean slate
375
update t1 set b=repeat('e',200) where a=1;
376
flush tables;
377
check table t1;
378
379
#
380
# check updating with keys
381
#
382
383
disable_query_log;
384
let $1 = 100;
385
while ($1)
386
{
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
387
  eval insert into t1 (b) values (repeat(char
388
    (
389
      if($1 < 32, 0, 
390
        if($1 >= 64 and $1 <= 95, 0, 32)
391
      )
392
    +65), $1));
1 by brian
clean slate
393
  dec $1;
394
}
395
enable_query_log;
396
update t1 set b=repeat(left(b,1),255) where a between 1 and 5;
397
update t1 set b=repeat(left(b,1),10) where a between 32 and 43;
398
update t1 set b=repeat(left(b,1),2) where a between 64 and 66;
399
update t1 set b=repeat(left(b,1),65) where a between 67 and 70;
400
check table t1;
401
insert into t1 (b) values (repeat('z',100));
402
update t1 set b="test" where left(b,1) > 'n';
403
check table t1;
404
drop table t1;
405
406
#
407
# two bugs in myisam-space-stripping feature
408
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
409
create temporary table t1 ( a text not null, key a (a(20))) engine=myisam;
1 by brian
clean slate
410
insert into t1 values ('aaa   '),('aaa'),('aa');
411
check table t1;
412
select concat(a,'.') from t1 where a='aaa';
413
select concat(a,'.') from t1 where binary a='aaa';
414
update t1 set a='bbb' where a='aaa';
415
select concat(a,'.') from t1;
416
drop table t1;
417
418
#
419
# Third bug in the same code (BUG#2295)
420
#
421
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
422
create temporary table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10))) engine=myisam;
1 by brian
clean slate
423
insert into t1 values('807780', '477', '165');
424
insert into t1 values('807780', '477', '162');
425
insert into t1 values('807780', '472', '162');
426
select * from t1 where a='807780' and b='477' and c='165';
427
drop table t1;
428
429
#
430
# space-stripping in _mi_prefix_search: BUG#5284
431
#
432
DROP TABLE IF EXISTS t1;
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
433
CREATE TEMPORARY TABLE t1 (a varchar(150) NOT NULL, KEY (a)) ENGINE=MyISAM; 
1 by brian
clean slate
434
INSERT t1 VALUES ("can \tcan"); 
435
INSERT t1 VALUES ("can   can"); 
436
INSERT t1 VALUES ("can"); 
437
SELECT * FROM t1;
438
CHECK TABLE t1;
439
DROP TABLE t1;
440
441
#
442
# Verify blob handling
443
#
444
create table t1 (a blob);
445
insert into t1 values('a '),('a');
446
select concat(a,'.') from t1 where a='a';
447
select concat(a,'.') from t1 where a='a ';
448
alter table t1 add key(a(2));
449
select concat(a,'.') from t1 where a='a';
450
select concat(a,'.') from t1 where a='a ';
451
drop table t1;
452
453
#
454
# Test text and unique
455
#
456
create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
457
insert into t1 (b) values ('a'),('b'),('c');
458
select concat(b,'.') from t1;
459
update t1 set b='b ' where a=2;
460
--error ER_DUP_ENTRY
461
update t1 set b='b  ' where a > 1;
462
--error ER_DUP_ENTRY
463
insert into t1 (b) values ('b');
464
select * from t1;
465
delete from t1 where b='b';
466
select a,concat(b,'.') from t1;
467
drop table t1;
468
469
#
470
# Test keys with 0 segments. (Bug #3203)
471
#
472
create table t1 (a int not null);
473
create table t2 (a int not null, primary key (a));
474
insert into t1 values (1);
475
insert into t2 values (1),(2);
476
select sql_big_result distinct t1.a from t1,t2 order by t2.a;
477
select distinct t1.a from t1,t2 order by t2.a;
478
select sql_big_result distinct t1.a from t1,t2;
479
explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
480
explain select distinct t1.a from t1,t2 order by t2.a;
481
drop table t1,t2;
482
483
#
484
# Bug#14616 - Freshly imported table returns error 124 when using LIMIT
485
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
486
create temporary table t1 (
1 by brian
clean slate
487
  c1 varchar(32),
488
  key (c1)
489
) engine=myisam;
490
alter table t1 disable keys;
491
insert into t1 values ('a'), ('b');
492
select c1 from t1 order by c1 limit 1;
493
drop table t1;
494
495
# End of 4.0 tests
496
1117.1.2 by Brian Aker
Remove CHECKSUM option in create table.
497
create table t1 (a int, b varchar(200), c text not null);
498
create table t2 (a int, b varchar(200), c text not null);
1 by brian
clean slate
499
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
500
insert t2 select * from t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
501
checksum table t1, t2, t3;
502
checksum table t1, t2, t3;
503
checksum table t1, t2, t3;
1 by brian
clean slate
504
#show table status;
505
drop table t1,t2;
506
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
507
#@TODO Figure out what the heck the below is testing.
508
#      It bombs the test with unknown system variables...
509
#
510
#create table t1 (a int, key (a));
511
#show keys from t1;
512
#alter table t1 disable keys;
513
#show keys from t1;
514
#create table t2 (a int);
515
#let $i=1000;
516
#set @@rand_seed1=31415926,@@rand_seed2=2718281828;
517
#--disable_query_log
518
#while ($i)
519
#{
520
#  dec $i;
521
#  insert t2 values (rand()*100000);
522
#}
523
#--enable_query_log
524
#insert t1 select * from t2;
525
#show keys from t1;
526
#alter table t1 enable keys;
527
#show keys from t1;
1233.2.1 by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias.
528
#alter table t1 engine=MEMORY;
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
529
#alter table t1 disable keys;
530
#show keys from t1;
531
#drop table t1,t2;
1 by brian
clean slate
532
533
#
534
# index search for NULL in blob. Bug #4816
535
#
536
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
537
insert into t1 values (null,''), (null,'');
538
explain select count(*) from t1 where a is null;
539
select count(*) from t1 where a is null;
540
drop table t1;
541
542
#
543
# bug9188 - Corruption Can't open file: 'table.MYI' (errno: 145)
544
#
545
create table t1 (c1 int, c2 varchar(4) not null default '',
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
546
                 key(c2(3)));
1 by brian
clean slate
547
insert into t1 values (1,'A'), (2, 'B'), (3, 'A');
548
update t1 set c2='A  B' where c1=2;
549
check table t1;
550
drop table t1;
551
552
553
#
554
# Bug#12296 - CHECKSUM TABLE reports 0 for the table
555
# This happened if the first record was marked as deleted.
556
#
557
create table t1 (c1 int);
558
insert into t1 values (1),(2),(3),(4);
559
checksum table t1;
560
delete from t1 where c1 = 1;
561
create table t2 as select * from t1;
562
# The following returns 0 with the bug in place.
563
checksum table t1;
564
# The above should give the same number as the following.
565
checksum table t2;
566
drop table t1, t2;
567
568
# BUG#13814 - key value packed incorrectly for TINYBLOBs
569
570
create table t1(
571
  cip INT NOT NULL,
572
  score INT NOT NULL DEFAULT 0,
573
  bob TINYBLOB
574
);
575
896.5.1 by Jay Pipes
Removes the TIME column type and related time functions.
576
insert into t1 (cip) VALUES (1), (2), (3);
577
insert into t1 (cip, bob) VALUES (4, 'a' ), (5, 'b'), 
578
                                       (6, 'c');
1 by brian
clean slate
579
select * from t1 where bob is null and cip=1;
896.5.1 by Jay Pipes
Removes the TIME column type and related time functions.
580
create index bug on t1 (bob(22), cip);
1 by brian
clean slate
581
select * from t1 where bob is null and cip=1;
582
drop table t1;
583
584
#
585
# Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
586
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
587
create temporary table t1 (
1 by brian
clean slate
588
  id1 int not null auto_increment,
589
  id2 int not null default '0',
590
  t text not null,
591
  primary key  (id1),
592
  key x (id2, t(32))
593
) engine=myisam;
594
insert into t1 (id2, t) values
595
(10, 'abc'), (10, 'abc'), (10, 'abc'),
596
(20, 'abc'), (20, 'abc'), (20, 'def'),
597
(10, 'abc'), (10, 'abc');
598
select count(*)   from t1 where id2 = 10;
599
select count(id1) from t1 where id2 = 10;
600
drop table t1;
601
602
#
603
# BUG##20357 - Got error 124 from storage engine using MIN and MAX functions
604
#              in queries
605
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
606
CREATE TEMPORARY TABLE t1(a int, KEY(a)) ENGINE=MyISAM;
1 by brian
clean slate
607
INSERT INTO t1 VALUES(1);
608
SELECT MAX(a) FROM t1 IGNORE INDEX(a);
609
ALTER TABLE t1 DISABLE KEYS;
610
SELECT MAX(a) FROM t1;
611
SELECT MAX(a) FROM t1 IGNORE INDEX(a);
612
DROP TABLE t1;
613
614
#
615
# Bug#8283 - OPTIMIZE TABLE causes data loss
616
#
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
617
SET GLOBAL myisam_repair_threads=2;
1 by brian
clean slate
618
SHOW VARIABLES LIKE 'myisam_repair%';
619
#
620
# Test OPTIMIZE. This creates a new data file.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
621
CREATE TEMPORARY TABLE t1 (
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
622
  `_id` int NOT NULL default '0',
1 by brian
clean slate
623
  `url` text,
624
  `email` text,
625
  `description` text,
685.4.13 by Jay Pipes
OLAP test now fixed. We throw a syntax error upon seeing WITH CUBE, not
626
  `loverlap` int default NULL,
627
  `roverlap` int default NULL,
628
  `lneighbor_id` int default NULL,
629
  `rneighbor_id` int default NULL,
630
  `length_` int default NULL,
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
631
  `sequence` text,
1 by brian
clean slate
632
  `name` text,
633
  `_obj_class` text NOT NULL,
634
  PRIMARY KEY  (`_id`),
635
  UNIQUE KEY `sequence_name_index` (`name`(50)),
636
  KEY (`length_`)
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
637
) ENGINE=MyISAM;
638
1 by brian
clean slate
639
INSERT INTO t1 VALUES
640
  (1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample1',''),
641
  (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample2',''),
642
  (3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample3',''),
643
  (4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample4',''),
644
  (5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample5',''),
645
  (6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample6',''),
646
  (7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample7',''),
647
  (8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample8',''),
648
  (9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'sample9','');
649
#
650
SELECT _id FROM t1;
651
DELETE FROM t1 WHERE _id < 8;
652
--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
653
SHOW TABLE STATUS LIKE 't1';
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
654
CHECK TABLE t1;
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
655
ALTER TABLE t1 ENGINE=MYISAM;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
656
CHECK TABLE t1;
1 by brian
clean slate
657
--replace_column 6 # 7 # 8 # 9 # 11 # 12 # 13 # 14 # 15 # 16 #
658
SHOW TABLE STATUS LIKE 't1';
659
SELECT _id FROM t1;
660
DROP TABLE t1;
661
#
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
662
SET GLOBAL myisam_repair_threads=1;
1 by brian
clean slate
663
SHOW VARIABLES LIKE 'myisam_repair%';
664
665
#
666
# Bug#24607 - MyISAM pointer size determined incorrectly
667
#
1116.1.2 by Brian Aker
Remove options which are just for internal optimizations.
668
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM;
1 by brian
clean slate
669
--replace_column 5 X 6 X 7 X 9 X 10 X 11 X 12 X 13 X 14 X 16 X
670
SHOW TABLE STATUS LIKE 't1';
671
DROP TABLE t1;
672
673
#
674
# Bug#26231 - select count(*) on myisam table returns wrong value
675
#             when index is used
676
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
677
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
1 by brian
clean slate
678
# Fill at least two key blocks. "Tab, A" must be in both blocks. 
679
INSERT INTO t1 VALUES
680
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
681
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
682
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
683
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
684
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
685
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
686
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
687
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
688
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
689
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
690
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
691
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
692
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
693
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
694
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
695
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
696
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
697
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
698
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
699
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
700
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
701
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
702
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
703
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
704
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
705
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
706
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
707
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
708
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
709
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
710
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
711
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
712
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
713
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
714
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
715
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
716
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
717
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
718
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
719
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
720
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
721
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
722
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
723
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
724
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
725
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
726
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
727
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
728
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
729
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
730
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
731
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
732
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
733
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
734
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
735
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
736
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
737
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
738
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
739
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
740
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
741
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
742
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
743
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
744
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
745
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
746
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
747
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
748
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
749
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
750
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
751
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
752
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
753
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
754
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
755
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
756
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
757
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
758
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
759
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
760
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
761
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
762
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
763
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
764
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
765
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
766
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
767
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
768
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
769
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
770
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
771
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
772
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
773
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
774
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
775
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
776
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
777
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
778
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
779
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
780
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
781
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
782
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
783
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
784
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
785
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
786
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
787
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
788
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
789
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
790
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
791
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
792
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
793
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
794
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
795
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
796
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
797
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
798
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
799
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
800
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
801
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
802
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
803
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
804
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
805
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
806
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
807
  (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)),
808
  (''), (''), (''), (''),
809
  (' B'), (' B'), (' B'), (' B');
810
SELECT DISTINCT COUNT(*) FROM t1 WHERE c1 = '';
811
SELECT DISTINCT length(c1), c1 FROM t1 WHERE c1 = '';
812
SELECT DISTINCT COUNT(*) FROM t1 IGNORE INDEX (c1) WHERE c1 = '';
813
SELECT DISTINCT length(c1), c1 FROM t1 IGNORE INDEX (c1) WHERE c1 = '';
814
SELECT DISTINCT length(c1), c1 FROM t1 ORDER BY c1;
815
DROP TABLE t1;
816
817
--echo End of 4.1 tests
818
819
820
# Test varchar
821
#
822
823
let $default=`select @@storage_engine`;
824
set storage_engine=MyISAM;
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
825
let $temp= TEMPORARY;
1 by brian
clean slate
826
source include/varchar.inc;
827
828
#
829
# Some errors/warnings on create
830
#
831
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
832
--error 1074
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
833
create temporary table t1 (v varchar(65530), key(v));
834
--error 1074
835
create temporary table t1 (v varchar(65536));
836
--error 1074
837
create temporary table t1 (v varchar(65530));
1 by brian
clean slate
838
839
# MyISAM specific varchar tests
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
840
--error 1074
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
841
create temporary table t1 (v varchar(65535));
1 by brian
clean slate
842
843
eval set storage_engine=$default;
844
845
846
# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
847
# different statistics on the same table with NULL values.
848
create table t1 (a int, key(a));
849
850
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
851
analyze table t1;
852
show keys from t1;
853
854
alter table t1 disable keys;
855
alter table t1 enable keys;
856
show keys from t1;
857
858
drop table t1;
859
860
861
#
862
# Bug#28476: force index on a disabled myisam index gives error 124
863
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
864
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1 by brian
clean slate
865
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
866
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
867
ALTER TABLE t1 DISABLE KEYS;
868
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
869
SELECT a FROM t1 USE INDEX (inx) WHERE a=1;
870
SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1;
871
SELECT b FROM t1 USE INDEX (uinx) WHERE b=1;
872
SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1;
873
ALTER TABLE t1 ENABLE KEYS;
874
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
875
DROP TABLE t1;
876
877
#
878
# Bug#4692 - DISABLE/ENABLE KEYS waste a space
879
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
880
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1 by brian
clean slate
881
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
882
SHOW TABLE STATUS LIKE 't1';
883
INSERT INTO t1 VALUES (1,1);
884
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
885
SHOW TABLE STATUS LIKE 't1';
886
ALTER TABLE t1 DISABLE KEYS;
887
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
888
SHOW TABLE STATUS LIKE 't1';
889
ALTER TABLE t1 ENABLE KEYS;
890
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
891
SHOW TABLE STATUS LIKE 't1';
892
ALTER TABLE t1 DISABLE KEYS;
893
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
894
SHOW TABLE STATUS LIKE 't1';
895
ALTER TABLE t1 ENABLE KEYS;
896
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
897
SHOW TABLE STATUS LIKE 't1';
898
#--exec ls -log var/master-data/test/t1.MYI
899
#--exec myisamchk -dvv var/master-data/test/t1.MYI
900
#--exec myisamchk -iev var/master-data/test/t1.MYI
901
--echo # Enable keys with parallel repair
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
902
SET GLOBAL myisam_repair_threads=2;
1 by brian
clean slate
903
ALTER TABLE t1 DISABLE KEYS;
904
ALTER TABLE t1 ENABLE KEYS;
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
905
SET GLOBAL myisam_repair_threads=1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
906
CHECK TABLE t1;
1 by brian
clean slate
907
DROP TABLE t1;
908
909
#
910
# Bug#28837: MyISAM storage engine error (134) doing delete with self-join
911
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
912
# DRIZZLE NOTE: Cannot self join on temp tables.
913
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id));
1 by brian
clean slate
914
CREATE TABLE t2 LIKE t1;
915
916
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
917
INSERT INTO t1 SELECT * FROM t2;
918
919
SELECT * FROM t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
920
SELECT * FROM t1;
921
922
DROP TABLE t1, t2;
923
924
--echo End of 5.0 tests
925
926
927
#
928
# Test of key_block_size
929
#
930
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
931
create temporary table t1 (a int not null, key `a` (a) key_block_size=1024) ENGINE=MyISAM;
932
show create table t1;
933
drop table t1;
934
935
create temporary table t1 (a int not null, key `a` (a) key_block_size=2048) ENGINE=MyISAM;
936
show create table t1;
937
drop table t1;
938
939
create temporary table t1 (a varchar(2048), key `a` (a)) ENGINE=MyISAM;
940
show create table t1;
941
drop table t1;
942
943
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1024) ENGINE=MyISAM;
944
show create table t1;
945
drop table t1;
946
947
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=1024;
1 by brian
clean slate
948
show create table t1;
949
alter table t1 key_block_size=2048;
950
show create table t1;
951
alter table t1 add c int, add key (c);
952
show create table t1;
953
alter table t1 key_block_size=0;
954
alter table t1 add d int, add key (d);
955
show create table t1;
956
drop table t1;
957
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
958
create temporary table t1 (a int not null, b varchar(2048), key (a), key(b)) ENGINE=MyISAM key_block_size=8192;
959
show create table t1;
960
drop table t1;
961
962
create temporary table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) ENGINE=MyISAM key_block_size=8192;
963
show create table t1;
964
drop table t1;
965
966
create temporary table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) ENGINE=MyISAM key_block_size=16384;
1 by brian
clean slate
967
show create table t1;
968
drop table t1;
969
970
971
# Test limits and errors of key_block_size
972
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
973
create temporary table t1 (a int not null, key `a` (a) key_block_size=512) ENGINE=MyISAM;
974
show create table t1;
975
drop table t1;
976
977
create temporary table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000) ENGINE=MyISAM;
978
show create table t1;
979
drop table t1;
980
981
create temporary table t1 (a int not null, key `a` (a) key_block_size=1025) ENGINE=MyISAM;
982
show create table t1;
983
drop table t1;
984
985
--error 1064
986
create temporary table t1 (a int not null, key key_block_size=1024 (a)) ENGINE=MyISAM;
987
--error 1064
988
create temporary table t1 (a int not null, key `a` key_block_size=1024 (a)) ENGINE=MyISAM;
1 by brian
clean slate
989
990
#
991
# Bug#22119 - Changing MI_KEY_BLOCK_LENGTH makes a wrong myisamchk
992
#
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
993
CREATE temporary TABLE t1 (
1 by brian
clean slate
994
  c1 INT,
995
  c2 VARCHAR(300),
996
  KEY (c1) KEY_BLOCK_SIZE 1024,
997
  KEY (c2) KEY_BLOCK_SIZE 8192
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
998
  ) ENGINE=MyISAM;
1 by brian
clean slate
999
INSERT INTO t1 VALUES (10, REPEAT('a', CEIL(RAND(10) * 300))),
1000
  (11, REPEAT('b', CEIL(RAND() * 300))),
1001
  (12, REPEAT('c', CEIL(RAND() * 300))),
1002
  (13, REPEAT('d', CEIL(RAND() * 300))),
1003
  (14, REPEAT('e', CEIL(RAND() * 300))),
1004
  (15, REPEAT('f', CEIL(RAND() * 300))),
1005
  (16, REPEAT('g', CEIL(RAND() * 300))),
1006
  (17, REPEAT('h', CEIL(RAND() * 300))),
1007
  (18, REPEAT('i', CEIL(RAND() * 300))),
1008
  (19, REPEAT('j', CEIL(RAND() * 300))),
1009
  (20, REPEAT('k', CEIL(RAND() * 300))),
1010
  (21, REPEAT('l', CEIL(RAND() * 300))),
1011
  (22, REPEAT('m', CEIL(RAND() * 300))),
1012
  (23, REPEAT('n', CEIL(RAND() * 300))),
1013
  (24, REPEAT('o', CEIL(RAND() * 300))),
1014
  (25, REPEAT('p', CEIL(RAND() * 300))),
1015
  (26, REPEAT('q', CEIL(RAND() * 300))),
1016
  (27, REPEAT('r', CEIL(RAND() * 300))),
1017
  (28, REPEAT('s', CEIL(RAND() * 300))),
1018
  (29, REPEAT('t', CEIL(RAND() * 300))),
1019
  (30, REPEAT('u', CEIL(RAND() * 300))),
1020
  (31, REPEAT('v', CEIL(RAND() * 300))),
1021
  (32, REPEAT('w', CEIL(RAND() * 300))),
1022
  (33, REPEAT('x', CEIL(RAND() * 300))),
1023
  (34, REPEAT('y', CEIL(RAND() * 300))),
1024
  (35, REPEAT('z', CEIL(RAND() * 300)));
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1025
CREATE TEMPORARY TABLE t2 AS SELECT * FROM t1;
1026
INSERT INTO t1 SELECT * FROM t2;
1027
DROP TABLE t2;
1028
CREATE TEMPORARY TABLE t2 AS SELECT * FROM t1;
1029
INSERT INTO t1 SELECT * FROM t2;
1030
DROP TABLE t2;
1 by brian
clean slate
1031
CHECK TABLE t1;
1032
DELETE FROM t1 WHERE c1 >= 10;
1033
CHECK TABLE t1;
1034
DROP TABLE t1;
1035
1036
#
1037
# Bug#33222 - myisam-table drops rows when column is added
1038
#             and a char-field > 128 exists
1039
#
1040
# Test #1 - CHECK TABLE sees wrong record, REPAR TABLE deletes it.
1041
# Using a CHAR column that can have > 127 characters.
1042
# Using a VARCHAR to create a table with dynamic row format.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1043
CREATE temporary TABLE t1 (
1 by brian
clean slate
1044
  c1 CHAR(130),
1045
  c2 VARCHAR(1)
1046
) ENGINE=MyISAM;
1047
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1048
SELECT COUNT(*) FROM t1;
1049
CHECK TABLE t1;
1050
SELECT COUNT(*) FROM t1;
1051
CHECK TABLE t1;
1052
DROP TABLE t1;
1053
#
1054
# Test #2 - same as test #1, but using EXTENDED.
1055
# Using a CHAR column that can have > 127 characters.
1056
# Using a VARCHAR to create a table with dynamic row format.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1057
CREATE temporary TABLE t1 (
1 by brian
clean slate
1058
  c1 CHAR(130),
1059
  c2 VARCHAR(1)
1060
) ENGINE=MyISAM;
1061
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1062
SELECT COUNT(*) FROM t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
1063
CHECK TABLE t1;
1 by brian
clean slate
1064
SELECT COUNT(*) FROM t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
1065
CHECK TABLE t1;
1 by brian
clean slate
1066
DROP TABLE t1;
1067
#
1068
# Test #3 - same as test #1, but using OPTIMIZE TABLE.
1069
# Using a CHAR column that can have > 127 characters.
1070
# Using a VARCHAR to create a table with dynamic row format.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1071
CREATE temporary TABLE t1 (
1 by brian
clean slate
1072
  c1 CHAR(130),
1073
  c2 VARCHAR(1)
1074
) ENGINE=MyISAM;
1075
INSERT INTO t1 VALUES(REPEAT("a",128), 'b');
1076
# Insert more rows and delete one in the middle to force optimize.
1077
INSERT INTO t1 VALUES('b', 'b');
1078
INSERT INTO t1 VALUES('c', 'b');
1079
DELETE FROM t1 WHERE c1='b';
1080
SELECT COUNT(*) FROM t1;
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
1081
ALTER TABLE t1 ENGINE=MyISAM;
1 by brian
clean slate
1082
SELECT COUNT(*) FROM t1;
1083
DROP TABLE t1;
1084
#
1085
# Test #4 - ALTER TABLE deletes rows.
1086
# Using a CHAR column that can have > 127 characters.
1087
# Using a VARCHAR to create a table with dynamic row format.
1088
# Using an index which can be disabled during bulk insert.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1089
CREATE temporary TABLE t1 (
1 by brian
clean slate
1090
  c1 CHAR(130),
1091
  c2 VARCHAR(1),
1092
  KEY (c1)
1093
) ENGINE=MyISAM;
1094
#
1095
# Insert 100 rows. This turns bulk insert on during the copy phase of
1096
# ALTER TABLE. Bulk insert disables keys before the insert and re-enables
1097
# them by repair after the insert.
1098
--disable_query_log
1099
let $count= 100;
1100
--echo # Insert $count rows. Query log disabled.
1101
while ($count)
1102
{
1103
  INSERT INTO t1 VALUES ('a', 'b');
1104
  dec $count;
1105
}
1106
--enable_query_log
1107
#
1108
# Change most of the rows into long character values with > 127 characters.
1109
UPDATE t1 SET c1=REPEAT("a",128) LIMIT 90;
1110
SELECT COUNT(*) FROM t1;
1111
ALTER TABLE t1 ENGINE=MyISAM;
1112
#
1113
# With bug present, this shows that all long rows are gone.
1114
SELECT COUNT(*) FROM t1;
1115
CHECK TABLE t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
1116
CHECK TABLE t1;
1 by brian
clean slate
1117
DROP TABLE t1;
1118
#
1119
# Test #5 - same as test #1 but UTF-8.
1120
# Using a CHAR column that can have > 127 characters.
1121
# Using a VARCHAR to create a table with dynamic row format.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1122
CREATE temporary TABLE t1 (
1 by brian
clean slate
1123
  c1 CHAR(50),
1124
  c2 VARCHAR(1)
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
1125
) ENGINE=MyISAM;
1 by brian
clean slate
1126
# Using Tamil Letter A, Unicode U+0B85
779.3.10 by Monty Taylor
Turned on -Wshadow.
1127
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1 by brian
clean slate
1128
SELECT COUNT(*) FROM t1;
1129
CHECK TABLE t1;
1130
SELECT COUNT(*) FROM t1;
1131
CHECK TABLE t1;
1132
DROP TABLE t1;
1133
#
1134
# Test #6 - same as test #2, but UTF-8.
1135
# Using a CHAR column that can have > 127 characters.
1136
# Using a VARCHAR to create a table with dynamic row format.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1137
CREATE temporary TABLE t1 (
1 by brian
clean slate
1138
  c1 CHAR(50),
1139
  c2 VARCHAR(1)
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
1140
) ENGINE=MyISAM;
1 by brian
clean slate
1141
# Using Tamil Letter A, Unicode U+0B85
779.3.10 by Monty Taylor
Turned on -Wshadow.
1142
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1 by brian
clean slate
1143
SELECT COUNT(*) FROM t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
1144
CHECK TABLE t1;
1 by brian
clean slate
1145
SELECT COUNT(*) FROM t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
1146
CHECK TABLE t1;
1 by brian
clean slate
1147
DROP TABLE t1;
1148
#
1149
# Test #7 - same as test #3, but UTF-8.
1150
# Using a CHAR column that can have > 127 characters.
1151
# Using a VARCHAR to create a table with dynamic row format.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1152
CREATE temporary TABLE t1 (
1 by brian
clean slate
1153
  c1 CHAR(50),
1154
  c2 VARCHAR(1)
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
1155
) ENGINE=MyISAM;
1 by brian
clean slate
1156
# Using Tamil Letter A, Unicode U+0B85
779.3.10 by Monty Taylor
Turned on -Wshadow.
1157
INSERT INTO t1 VALUES(REPEAT( x'e0ae85',43), 'b');
1 by brian
clean slate
1158
# Insert more rows and delete one in the middle to force optimize.
1159
INSERT INTO t1 VALUES('b', 'b');
1160
INSERT INTO t1 VALUES('c', 'b');
1161
DELETE FROM t1 WHERE c1='b';
1162
SELECT COUNT(*) FROM t1;
1222.1.14 by Brian Aker
Remove OPTIMIZE, place in ALTER TABLE (which does the same thing).
1163
ALTER TABLE t1 ENGINE=MyISAM;
1 by brian
clean slate
1164
SELECT COUNT(*) FROM t1;
1165
DROP TABLE t1;
1166
#
1167
# Test #8 - same as test #4, but UTF-8.
1168
# Using a CHAR column that can have > 42 UTF-8 characters.
1169
# Using a VARCHAR to create a table with dynamic row format.
1170
# Using an index which can be disabled during bulk insert.
1063.9.47 by Stewart Smith
fix myisam.test up for MyISAM being temp only.
1171
CREATE temporary TABLE t1 (
1 by brian
clean slate
1172
  c1 CHAR(50),
1173
  c2 VARCHAR(1),
1174
  KEY (c1)
685.4.36 by Jay Pipes
Fixes for the myisam.test. This test is, IMHO, probably hopelessly broken anyway...
1175
) ENGINE=MyISAM;
1 by brian
clean slate
1176
#
1177
# Insert 100 rows. This turns bulk insert on during the copy phase of
1178
# ALTER TABLE. Bulk insert disables keys before the insert and re-enables
1179
# them by repair after the insert.
1180
--disable_query_log
1181
let $count= 100;
1182
--echo # Insert $count rows. Query log disabled.
1183
while ($count)
1184
{
1185
  INSERT INTO t1 VALUES ('a', 'b');
1186
  dec $count;
1187
}
1188
--enable_query_log
1189
#
1190
# Change most of the rows into long character values with > 42 characters.
1191
# Using Tamil Letter A, Unicode U+0B85
779.3.10 by Monty Taylor
Turned on -Wshadow.
1192
UPDATE t1 SET c1=REPEAT( x'e0ae85',43) LIMIT 90;
1 by brian
clean slate
1193
SELECT COUNT(*) FROM t1;
1194
ALTER TABLE t1 ENGINE=MyISAM;
1195
#
1196
# With bug present, this shows that all long rows are gone.
1197
SELECT COUNT(*) FROM t1;
1198
CHECK TABLE t1;
1222.1.10 by Brian Aker
Removes options from DDL left in Cursor for admin operations (they were
1199
CHECK TABLE t1;
1 by brian
clean slate
1200
DROP TABLE t1;
1201
--echo End of 5.1 tests
1202