~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/r/handler_innodb.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SET SESSION STORAGE_ENGINE = InnoDB;
 
2
drop table if exists t1,t3,t4,t5;
 
3
create table t1 (a int, b char(10), key a(a), key b(a,b));
 
4
insert into t1 values
 
5
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
 
6
(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
 
7
(20,"ggg"),(21,"hhh"),(22,"iii");
 
8
handler t1 open as t2;
 
9
handler t2 read a=(SELECT 1);
 
10
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
 
11
handler t2 read a first;
 
12
a       b
 
13
14      aaa
 
14
handler t2 read a next;
 
15
a       b
 
16
15      bbb
 
17
handler t2 read a next;
 
18
a       b
 
19
16      ccc
 
20
handler t2 read a prev;
 
21
a       b
 
22
15      bbb
 
23
handler t2 read a last;
 
24
a       b
 
25
22      iii
 
26
handler t2 read a prev;
 
27
a       b
 
28
21      hhh
 
29
handler t2 read a prev;
 
30
a       b
 
31
20      ggg
 
32
handler t2 read a first;
 
33
a       b
 
34
14      aaa
 
35
handler t2 read a prev;
 
36
a       b
 
37
handler t2 read a last;
 
38
a       b
 
39
22      iii
 
40
handler t2 read a prev;
 
41
a       b
 
42
21      hhh
 
43
handler t2 read a next;
 
44
a       b
 
45
22      iii
 
46
handler t2 read a next;
 
47
a       b
 
48
handler t2 read a=(15);
 
49
a       b
 
50
15      bbb
 
51
handler t2 read a=(16);
 
52
a       b
 
53
16      ccc
 
54
handler t2 read a=(19,"fff");
 
55
ERROR 42000: Too many key parts specified; max 1 parts allowed
 
56
handler t2 read b=(19,"fff");
 
57
a       b
 
58
19      fff
 
59
handler t2 read b=(19,"yyy");
 
60
a       b
 
61
19      yyy
 
62
handler t2 read b=(19);
 
63
a       b
 
64
19      fff
 
65
handler t1 read a last;
 
66
ERROR 42S02: Unknown table 't1' in HANDLER
 
67
handler t2 read a=(11);
 
68
a       b
 
69
handler t2 read a>=(11);
 
70
a       b
 
71
14      aaa
 
72
handler t2 read a=(18);
 
73
a       b
 
74
18      eee
 
75
handler t2 read a>=(18);
 
76
a       b
 
77
18      eee
 
78
handler t2 read a>(18);
 
79
a       b
 
80
19      fff
 
81
handler t2 read a<=(18);
 
82
a       b
 
83
18      eee
 
84
handler t2 read a<(18);
 
85
a       b
 
86
17      ddd
 
87
handler t2 read a first limit 5;
 
88
a       b
 
89
14      aaa
 
90
15      bbb
 
91
16      ccc
 
92
16      xxx
 
93
17      ddd
 
94
handler t2 read a next  limit 3;
 
95
a       b
 
96
18      eee
 
97
19      fff
 
98
19      yyy
 
99
handler t2 read a prev  limit 10;
 
100
a       b
 
101
19      fff
 
102
18      eee
 
103
17      ddd
 
104
16      xxx
 
105
16      ccc
 
106
15      bbb
 
107
14      aaa
 
108
handler t2 read a>=(16) limit 4;
 
109
a       b
 
110
16      ccc
 
111
16      xxx
 
112
17      ddd
 
113
18      eee
 
114
handler t2 read a>=(16) limit 2,2;
 
115
a       b
 
116
17      ddd
 
117
18      eee
 
118
handler t2 read a last  limit 3;
 
119
a       b
 
120
22      iii
 
121
21      hhh
 
122
20      ggg
 
123
handler t2 read a=(19);
 
124
a       b
 
125
19      fff
 
126
handler t2 read a=(19) where b="yyy";
 
127
a       b
 
128
19      yyy
 
129
handler t2 read first;
 
130
a       b
 
131
17      ddd
 
132
handler t2 read next;
 
133
a       b
 
134
18      eee
 
135
handler t2 read next;
 
136
a       b
 
137
19      fff
 
138
handler t2 read last;
 
139
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 
140
handler t2 close;
 
141
handler t1 open;
 
142
handler t1 read a next;
 
143
a       b
 
144
14      aaa
 
145
handler t1 read a next;
 
146
a       b
 
147
15      bbb
 
148
handler t1 close;
 
149
handler t1 open;
 
150
handler t1 read a prev;
 
151
a       b
 
152
22      iii
 
153
handler t1 read a prev;
 
154
a       b
 
155
21      hhh
 
156
handler t1 close;
 
157
handler t1 open as t2;
 
158
handler t2 read first;
 
159
a       b
 
160
17      ddd
 
161
alter table t1 engine = InnoDB;
 
162
handler t2 read first;
 
163
ERROR 42S02: Unknown table 't2' in HANDLER
 
164
handler t1 open as t2;
 
165
drop table t1;
 
166
create table t1 (a int);
 
167
insert into t1 values (17);
 
168
handler t2 read first;
 
169
ERROR 42S02: Unknown table 't2' in HANDLER
 
170
handler t1 open as t2;
 
171
alter table t1 engine=MEMORY;
 
172
handler t2 read first;
 
173
ERROR 42S02: Unknown table 't2' in HANDLER
 
174
drop table t1;
 
175
create table t1 (a int);
 
176
insert into t1 values (1),(2),(3),(4),(5),(6);
 
177
delete from t1 limit 2;
 
178
handler t1 open;
 
179
handler t1 read first;
 
180
a
 
181
3
 
182
handler t1 read first limit 1,1;
 
183
a
 
184
4
 
185
handler t1 read first limit 2,2;
 
186
a
 
187
5
 
188
6
 
189
delete from t1 limit 3;
 
190
handler t1 read first;
 
191
a
 
192
6
 
193
drop table t1;
 
194
create table t1(a int, index(a));
 
195
insert into t1 values (1), (2), (3);
 
196
handler t1 open;
 
197
handler t1 read a=(W);
 
198
ERROR 42S22: Unknown column 'W' in 'field list'
 
199
handler t1 read a=(a);
 
200
ERROR HY000: Incorrect arguments to HANDLER ... READ
 
201
drop table t1;
 
202
create table t1 (a char(5));
 
203
insert into t1 values ("Ok");
 
204
handler t1 open as t;
 
205
handler t read first;
 
206
a
 
207
Ok
 
208
use mysql;
 
209
handler t read first;
 
210
a
 
211
Ok
 
212
handler t close;
 
213
handler test.t1 open as t;
 
214
handler t read first;
 
215
a
 
216
Ok
 
217
handler t close;
 
218
use test;
 
219
drop table t1;
 
220
create table t1 ( a int, b int, INDEX a (a) );
 
221
insert into t1 values (1,2), (2,1);
 
222
handler t1 open;
 
223
handler t1 read a=(1) where b=2;
 
224
a       b
 
225
1       2
 
226
handler t1 read a=(1) where b=3;
 
227
a       b
 
228
handler t1 read a=(1) where b=1;
 
229
a       b
 
230
handler t1 close;
 
231
drop table t1;
 
232
drop database if exists test_test;
 
233
create database test_test;
 
234
use test_test;
 
235
create table t1(table_id char(20) primary key);
 
236
insert into t1 values ('test_test.t1');
 
237
insert into t1 values ('');
 
238
handler t1 open;
 
239
handler t1 read first limit 9;
 
240
table_id
 
241
 
 
242
test_test.t1
 
243
create table t2(table_id char(20) primary key);
 
244
insert into t2 values ('test_test.t2');
 
245
insert into t2 values ('');
 
246
handler t2 open;
 
247
handler t2 read first limit 9;
 
248
table_id
 
249
 
 
250
test_test.t2
 
251
use test;
 
252
drop table if exists t1;
 
253
create table t1(table_id char(20) primary key);
 
254
insert into t1 values ('test.t1');
 
255
insert into t1 values ('');
 
256
handler t1 open;
 
257
ERROR 42000: Not unique table/alias: 't1'
 
258
use test;
 
259
handler test.t1 read first limit 9;
 
260
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1
 
261
handler test_test.t1 read first limit 9;
 
262
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1
 
263
handler t1 read first limit 9;
 
264
table_id
 
265
 
 
266
test_test.t1
 
267
handler test_test.t2 read first limit 9;
 
268
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1
 
269
handler t2 read first limit 9;
 
270
table_id
 
271
 
 
272
test_test.t2
 
273
handler test_test.t1 close;
 
274
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1
 
275
handler t1 close;
 
276
drop table test_test.t1;
 
277
handler test_test.t2 close;
 
278
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1
 
279
handler t2 close;
 
280
drop table test_test.t2;
 
281
drop database test_test;
 
282
use test;
 
283
handler test.t1 close;
 
284
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1
 
285
handler t1 close;
 
286
ERROR 42S02: Unknown table 't1' in HANDLER
 
287
drop table test.t1;
 
288
drop database if exists test_test;
 
289
drop table if exists t1;
 
290
drop table if exists t2;
 
291
drop table if exists t3;
 
292
create database test_test;
 
293
use test_test;
 
294
create table t1 (c1 char(20));
 
295
insert into t1 values ('test_test.t1');
 
296
create table t3 (c1 char(20));
 
297
insert into t3 values ('test_test.t3');
 
298
handler t1 open;
 
299
handler t1 read first limit 9;
 
300
c1
 
301
test_test.t1
 
302
handler t1 open h1;
 
303
handler h1 read first limit 9;
 
304
c1
 
305
test_test.t1
 
306
use test;
 
307
create table t1 (c1 char(20));
 
308
create table t2 (c1 char(20));
 
309
create table t3 (c1 char(20));
 
310
insert into t1 values ('t1');
 
311
insert into t2 values ('t2');
 
312
insert into t3 values ('t3');
 
313
handler t1 open;
 
314
ERROR 42000: Not unique table/alias: 't1'
 
315
handler t2 open t1;
 
316
ERROR 42000: Not unique table/alias: 't1'
 
317
handler t3 open t1;
 
318
ERROR 42000: Not unique table/alias: 't1'
 
319
handler t1 read first limit 9;
 
320
c1
 
321
test_test.t1
 
322
handler test.t1 close;
 
323
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1
 
324
handler test.t1 open h1;
 
325
ERROR 42000: Not unique table/alias: 'h1'
 
326
handler test_test.t1 open h1;
 
327
ERROR 42000: Not unique table/alias: 'h1'
 
328
handler test_test.t3 open h3;
 
329
handler test.t1 open h2;
 
330
handler t1 read first limit 9;
 
331
c1
 
332
test_test.t1
 
333
handler h1 read first limit 9;
 
334
c1
 
335
test_test.t1
 
336
handler h2 read first limit 9;
 
337
c1
 
338
t1
 
339
handler h3 read first limit 9;
 
340
c1
 
341
test_test.t3
 
342
handler h2 read first limit 9;
 
343
c1
 
344
t1
 
345
handler test.h1 close;
 
346
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'close' at line 1
 
347
handler t1 close;
 
348
handler h1 close;
 
349
handler h2 close;
 
350
handler t1 read first limit 9;
 
351
ERROR 42S02: Unknown table 't1' in HANDLER
 
352
handler h1 read first limit 9;
 
353
ERROR 42S02: Unknown table 'h1' in HANDLER
 
354
handler h2 read first limit 9;
 
355
ERROR 42S02: Unknown table 'h2' in HANDLER
 
356
handler h3 read first limit 9;
 
357
c1
 
358
test_test.t3
 
359
handler h3 read first limit 9;
 
360
c1
 
361
test_test.t3
 
362
use test_test;
 
363
handler h3 read first limit 9;
 
364
c1
 
365
test_test.t3
 
366
handler test.h3 read first limit 9;
 
367
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read first limit 9' at line 1
 
368
handler h3 close;
 
369
use test;
 
370
drop table t3;
 
371
drop table t2;
 
372
drop table t1;
 
373
drop database test_test;
 
374
create table t1 (c1 char(20));
 
375
insert into t1 values ("t1");
 
376
handler t1 open as h1;
 
377
handler h1 read first limit 9;
 
378
c1
 
379
t1
 
380
create table t2 (c1 char(20));
 
381
insert into t2 values ("t2");
 
382
handler t2 open as h2;
 
383
handler h2 read first limit 9;
 
384
c1
 
385
t2
 
386
create table t3 (c1 char(20));
 
387
insert into t3 values ("t3");
 
388
handler t3 open as h3;
 
389
handler h3 read first limit 9;
 
390
c1
 
391
t3
 
392
create table t4 (c1 char(20));
 
393
insert into t4 values ("t4");
 
394
handler t4 open as h4;
 
395
handler h4 read first limit 9;
 
396
c1
 
397
t4
 
398
create table t5 (c1 char(20));
 
399
insert into t5 values ("t5");
 
400
handler t5 open as h5;
 
401
handler h5 read first limit 9;
 
402
c1
 
403
t5
 
404
alter table t1 engine=MyISAM;
 
405
handler h1 read first limit 9;
 
406
ERROR 42S02: Unknown table 'h1' in HANDLER
 
407
handler h2 read first limit 9;
 
408
c1
 
409
t2
 
410
handler h3 read first limit 9;
 
411
c1
 
412
t3
 
413
handler h4 read first limit 9;
 
414
c1
 
415
t4
 
416
handler h5 read first limit 9;
 
417
c1
 
418
t5
 
419
alter table t5 engine=MyISAM;
 
420
handler h1 read first limit 9;
 
421
ERROR 42S02: Unknown table 'h1' in HANDLER
 
422
handler h2 read first limit 9;
 
423
c1
 
424
t2
 
425
handler h3 read first limit 9;
 
426
c1
 
427
t3
 
428
handler h4 read first limit 9;
 
429
c1
 
430
t4
 
431
handler h5 read first limit 9;
 
432
ERROR 42S02: Unknown table 'h5' in HANDLER
 
433
alter table t3 engine=MyISAM;
 
434
handler h1 read first limit 9;
 
435
ERROR 42S02: Unknown table 'h1' in HANDLER
 
436
handler h2 read first limit 9;
 
437
c1
 
438
t2
 
439
handler h3 read first limit 9;
 
440
ERROR 42S02: Unknown table 'h3' in HANDLER
 
441
handler h4 read first limit 9;
 
442
c1
 
443
t4
 
444
handler h5 read first limit 9;
 
445
ERROR 42S02: Unknown table 'h5' in HANDLER
 
446
handler h2 close;
 
447
handler h4 close;
 
448
handler t1 open as h1_1;
 
449
handler t1 open as h1_2;
 
450
handler t1 open as h1_3;
 
451
handler h1_1 read first limit 9;
 
452
c1
 
453
t1
 
454
handler h1_2 read first limit 9;
 
455
c1
 
456
t1
 
457
handler h1_3 read first limit 9;
 
458
c1
 
459
t1
 
460
alter table t1 engine=InnoDB;
 
461
handler h1_1 read first limit 9;
 
462
ERROR 42S02: Unknown table 'h1_1' in HANDLER
 
463
handler h1_2 read first limit 9;
 
464
ERROR 42S02: Unknown table 'h1_2' in HANDLER
 
465
handler h1_3 read first limit 9;
 
466
ERROR 42S02: Unknown table 'h1_3' in HANDLER
 
467
drop table t1;
 
468
drop table t2;
 
469
drop table t3;
 
470
drop table t4;
 
471
drop table t5;
 
472
create table t1 (c1 int);
 
473
insert into t1 values (1);
 
474
handler t1 open;
 
475
handler t1 read first;
 
476
c1
 
477
1
 
478
send the below to another connection, do not wait for the result
 
479
optimize table t1;
 
480
proceed with the normal connection
 
481
handler t1 read next;
 
482
c1
 
483
1
 
484
handler t1 close;
 
485
read the result from the other connection
 
486
Table   Op      Msg_type        Msg_text
 
487
test.t1 optimize        note    Table does not support optimize, doing recreate + analyze instead
 
488
test.t1 optimize        status  OK
 
489
proceed with the normal connection
 
490
drop table t1;
 
491
CREATE TABLE t1 (  no1 smallint(5) NOT NULL default '0',  no2 int(10) NOT NULL default '0',  PRIMARY KEY  (no1,no2));
 
492
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
 
493
HANDLER t1 OPEN;
 
494
HANDLER t1 READ `primary` = (1, 1000);
 
495
no1     no2
 
496
HANDLER t1 READ `primary` PREV;
 
497
no1     no2
 
498
1       275
 
499
DROP TABLE t1;
 
500
create table t1 (c1 int);
 
501
insert into t1 values (14397);
 
502
flush tables with read lock;
 
503
drop table t1;
 
504
ERROR HY000: Can't execute the query because you have a conflicting read lock
 
505
send the below to another connection, do not wait for the result
 
506
drop table t1;
 
507
proceed with the normal connection
 
508
select * from t1;
 
509
c1
 
510
14397
 
511
unlock tables;
 
512
read the result from the other connection
 
513
proceed with the normal connection
 
514
select * from t1;
 
515
ERROR 42S02: Table 'test.t1' doesn't exist
 
516
drop table if exists t1;
 
517
Warnings:
 
518
Note    1051    Unknown table 't1'
 
519
drop table if exists t1;
 
520
create table t1 (a int) ENGINE=MEMORY;
 
521
--> client 2
 
522
handler t1 open;
 
523
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
524
--> client 1
 
525
drop table t1;
 
526
drop table if exists t1;
 
527
create table t1 (a int);
 
528
handler t1 open as t1_alias;
 
529
handler t1_alias read a next;
 
530
ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
 
531
handler t1_alias READ a next where inexistent > 0;
 
532
ERROR 42S22: Unknown column 'inexistent' in 'field list'
 
533
handler t1_alias read a next;
 
534
ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
 
535
handler t1_alias READ a next where inexistent > 0;
 
536
ERROR 42S22: Unknown column 'inexistent' in 'field list'
 
537
handler t1_alias close;
 
538
drop table t1;
 
539
drop table if exists t1,t2;
 
540
create table t1 (c1 int);
 
541
create table t2 (c1 int);
 
542
insert into t1 values (1);
 
543
insert into t2 values (2);
 
544
connection: default
 
545
handler t1 open;
 
546
handler t1 read first;
 
547
c1
 
548
1
 
549
connection: flush
 
550
flush tables;;
 
551
connection: default
 
552
handler t2 open;
 
553
handler t2 read first;
 
554
c1
 
555
2
 
556
handler t1 read next;
 
557
c1
 
558
1
 
559
handler t1 close;
 
560
handler t2 close;
 
561
drop table t1,t2;
 
562
drop table if exists t1,t2;
 
563
create table t1 (c1 int);
 
564
connection: default
 
565
handler t1 open;
 
566
handler t1 read first;
 
567
c1
 
568
connection: flush
 
569
rename table t1 to t2;;
 
570
connection: default
 
571
handler t2 open;
 
572
handler t2 read first;
 
573
c1
 
574
handler t1 read next;
 
575
ERROR 42S02: Table 'test.t1' doesn't exist
 
576
handler t1 close;
 
577
handler t2 close;
 
578
drop table t2;
 
579
drop table if exists t1;
 
580
create temporary table t1 (a int, b char(1), key a(a), key b(a,b));
 
581
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
 
582
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
 
583
select a,b from t1;
 
584
a       b
 
585
0       a
 
586
1       b
 
587
2       c
 
588
3       d
 
589
4       e
 
590
5       f
 
591
6       g
 
592
7       h
 
593
8       i
 
594
9       j
 
595
handler t1 open as a1;
 
596
handler a1 read a first;
 
597
a       b
 
598
0       a
 
599
handler a1 read a next;
 
600
a       b
 
601
1       b
 
602
handler a1 read a next;
 
603
a       b
 
604
2       c
 
605
select a,b from t1;
 
606
ERROR HY000: Can't reopen table: 'a1'
 
607
handler a1 read a prev;
 
608
a       b
 
609
1       b
 
610
handler a1 read a prev;
 
611
a       b
 
612
0       a
 
613
handler a1 read a=(6) where b="g";
 
614
a       b
 
615
6       g
 
616
handler a1 close;
 
617
select a,b from t1;
 
618
a       b
 
619
0       a
 
620
1       b
 
621
2       c
 
622
3       d
 
623
4       e
 
624
5       f
 
625
6       g
 
626
7       h
 
627
8       i
 
628
9       j
 
629
handler t1 open as a2;
 
630
handler a2 read a first;
 
631
a       b
 
632
0       a
 
633
handler a2 read a last;
 
634
a       b
 
635
9       j
 
636
handler a2 read a prev;
 
637
a       b
 
638
8       i
 
639
handler a2 close;
 
640
drop table t1;
 
641
drop table if exists t1,t2;
 
642
create table t1 (a int);
 
643
handler t1 open as t1_alias;
 
644
drop table t1;
 
645
create table t1 (a int);
 
646
handler t1 open as t1_alias;
 
647
flush tables;
 
648
drop table t1;
 
649
create table t1 (a int);
 
650
handler t1 open as t1_alias;
 
651
handler t1_alias close;
 
652
drop table t1;
 
653
create table t1 (a int);
 
654
handler t1 open as t1_alias;
 
655
handler t1_alias read first;
 
656
a
 
657
drop table t1;
 
658
handler t1_alias read next;
 
659
ERROR 42S02: Unknown table 't1_alias' in HANDLER
 
660
create table t1 (a int);
 
661
create temporary table t2 (a int, key(a));
 
662
handler t1 open as a1;
 
663
handler t2 open as a2;
 
664
handler a2 read a first;
 
665
a
 
666
drop table t1, t2;
 
667
handler a2 read a next;
 
668
ERROR 42S02: Unknown table 'a2' in HANDLER
 
669
handler a1 close;
 
670
ERROR 42S02: Unknown table 'a1' in HANDLER
 
671
create table t1 (a int, key(a));
 
672
create table t2 like t1;
 
673
handler t1 open as a1;
 
674
handler t2 open as a2;
 
675
handler a1 read a first;
 
676
a
 
677
handler a2 read a first;
 
678
a
 
679
alter table t1 add b int;
 
680
handler a1 close;
 
681
ERROR 42S02: Unknown table 'a1' in HANDLER
 
682
handler a2 close;
 
683
drop table t1, t2;
 
684
create table t1 (a int, key(a));
 
685
handler t1 open as a1;
 
686
handler a1 read a first;
 
687
a
 
688
rename table t1 to t2;
 
689
handler a1 read a first;
 
690
ERROR 42S02: Unknown table 'a1' in HANDLER
 
691
drop table t2;
 
692
create table t1 (a int, key(a));
 
693
create table t2 like t1;
 
694
handler t1 open as a1;
 
695
handler t2 open as a2;
 
696
handler a1 read a first;
 
697
a
 
698
handler a2 read a first;
 
699
a
 
700
optimize table t1;
 
701
Table   Op      Msg_type        Msg_text
 
702
test.t1 optimize        note    Table does not support optimize, doing recreate + analyze instead
 
703
test.t1 optimize        status  OK
 
704
handler a1 close;
 
705
ERROR 42S02: Unknown table 'a1' in HANDLER
 
706
handler a2 close;
 
707
drop table t1, t2;
 
708
create table t1 (a int, b char(1), key a(a), key b(a,b));
 
709
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
 
710
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
 
711
handler t1 open;
 
712
handler t1 read a first;
 
713
a       b
 
714
0       a
 
715
handler t1 read a next;
 
716
a       b
 
717
1       b
 
718
flush tables;
 
719
handler t1 read a next;
 
720
a       b
 
721
0       a
 
722
handler t1 read a next;
 
723
a       b
 
724
1       b
 
725
flush tables with read lock;
 
726
handler t1 read a next;
 
727
a       b
 
728
0       a
 
729
unlock tables;
 
730
drop table t1;
 
731
handler t1 read a next;
 
732
ERROR 42S02: Unknown table 't1' in HANDLER
 
733
drop table if exists t1;
 
734
create table t1 (a int);
 
735
insert into t1 values (1);
 
736
handler t1 open;
 
737
alter table t1 engine=memory;
 
738
handler t1 read a next;
 
739
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
740
handler t1 close;
 
741
drop table t1;
 
742
USE information_schema;
 
743
HANDLER COLUMNS OPEN;
 
744
ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
 
745
USE test;