465
CREATE TABLE t1 (a int NOT NULL default '0', PRIMARY KEY (a));
466
CREATE TABLE t2 (a int default '0', INDEX (a));
470
CREATE TABLE t1 (a int NOT NULL default '0', PRIMARY KEY (a)) ENGINE=MyISAM;
471
CREATE TABLE t2 (a int default '0', INDEX (a)) ENGINE=MyISAM;
467
472
INSERT INTO t1 VALUES (1),(2),(3),(4);
468
473
INSERT INTO t2 VALUES (1),(2),(3);
469
474
SELECT t1.a, t1.a in (select t2.a from t2) FROM t1;
470
475
explain extended SELECT t1.a, t1.a in (select t2.a from t2) FROM t1;
471
CREATE TABLE t3 (a int default '0');
476
CREATE TABLE t3 (a int default '0') ENGINE=MyISAM;
472
477
INSERT INTO t3 VALUES (1),(2),(3);
473
478
SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
474
479
explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
475
480
drop table t1,t2,t3;
477
482
#LIMIT is not supported now
478
create table t1 (a float);
479
select 10.5 IN (SELECT * from t1 LIMIT 1);
480
select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
483
create table t1 (a int, b int, c varchar(10));
484
create table t2 (a int);
485
insert into t1 values (1,2,'a'),(2,3,'b'),(3,4,'c');
486
insert into t2 values (1),(2),(NULL);
487
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t1 where a=t2.a) from t2;
488
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
489
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2;
492
create table t1 (a int, b real, c varchar(10));
493
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
494
select ROW(1, 1, 'a') IN (select a,b,c from t1);
495
select ROW(1, 2, 'a') IN (select a,b,c from t1);
496
select ROW(1, 1, 'a') IN (select b,a,c from t1);
497
select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null);
498
select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null);
499
select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null);
500
select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a');
501
select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
502
select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
503
select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2);
483
#create table t1 (a float) ENGINE=MyISAM;
485
#select 10.5 IN (SELECT * from t1 LIMIT 1);
487
#select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5);
490
#create table t1 (a int, b int, c varchar(10)) ENGINE=MyISAM;
491
#create table t2 (a int) ENGINE=MyISAM;
492
#insert into t1 values (1,2,'a'),(2,3,'b'),(3,4,'c');
493
#insert into t2 values (1),(2),(NULL);
494
#select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t1 where a=t2.a) from t2;
495
#select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
496
#select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2;
499
#create table t1 (a int, b real, c varchar(10)) ENGINE=MyISAM;
500
#insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
501
#select ROW(1, 1, 'a') IN (select a,b,c from t1);
502
#select ROW(1, 2, 'a') IN (select a,b,c from t1);
503
#select ROW(1, 1, 'a') IN (select b,a,c from t1);
504
#select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null);
505
#select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null);
506
#select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null);
507
#select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a');
508
#select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
509
#select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
511
#select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2);
506
514
#test of uncacheable subqueries
507
CREATE TABLE t1 (a int);
515
CREATE TABLE t1 (a int) ENGINE=MyISAM;
508
516
EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1;
509
517
EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1;
513
521
CREATE TABLE `t1` (
514
`mot` varchar(30) character set latin1 NOT NULL default '',
515
`topic` bigint unsigned NOT NULL default '0',
516
`date` date NOT NULL default '0000-00-00',
517
`pseudo` varchar(35) character set latin1 NOT NULL default '',
522
`mot` varchar(30) NOT NULL default '',
523
`topic` bigint NOT NULL default '0',
524
`date` date NULL DEFAULT '2009-01-20',
525
`pseudo` varchar(35) NOT NULL default '',
518
526
PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`),
519
527
KEY `pseudo` (`pseudo`,`date`,`topic`),
520
528
KEY `topic` (`topic`)
521
) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC;
529
) ENGINE=MyISAM ROW_FORMAT=DYNAMIC;
523
531
CREATE TABLE `t2` (
524
`mot` varchar(30) character set latin1 NOT NULL default '',
525
`topic` bigint unsigned NOT NULL default '0',
526
`date` date NOT NULL default '0000-00-00',
527
`pseudo` varchar(35) character set latin1 NOT NULL default '',
532
`mot` varchar(30) NOT NULL default '',
533
`topic` bigint NOT NULL default '0',
534
`date` date NULL default '1997-08-29',
535
`pseudo` varchar(35) NOT NULL default '',
528
536
PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`),
529
537
KEY `pseudo` (`pseudo`,`date`,`topic`),
530
538
KEY `topic` (`topic`)
531
) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC;
539
) ENGINE=MyISAM ROW_FORMAT=DYNAMIC;
533
541
CREATE TABLE `t3` (
534
`numeropost` bigint unsigned NOT NULL auto_increment,
535
`maxnumrep` int unsigned NOT NULL default '0',
542
`numeropost` bigint NOT NULL auto_increment,
543
`maxnumrep` int NOT NULL default '0',
536
544
PRIMARY KEY (`numeropost`),
537
545
UNIQUE KEY `maxnumrep` (`maxnumrep`)
538
) ENGINE=MyISAM CHARSET=latin1;
539
547
INSERT INTO t1 (mot, topic, pseudo) VALUES ('joce','1','joce'),('test','2','test');
541
549
INSERT INTO t2 (mot, topic, pseudo) VALUES ('joce','1','joce'),('test','2','test');
820
CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
821
s2 CHAR(5) COLLATE latin1_swedish_ci);
822
INSERT INTO t1 VALUES ('z','?');
823
select * from t1 where s1 > (select max(s2) from t1);
824
select * from t1 where s1 > any (select max(s2) from t1);
825
#CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
826
# s2 CHAR(5) COLLATE latin1_swedish_ci) ENGINE=MyISAM;
827
#INSERT INTO t1 VALUES ('z','?');
829
#select * from t1 where s1 > (select max(s2) from t1);
831
#select * from t1 where s1 > any (select max(s2) from t1);
828
835
# aggregate functions reinitialization
830
create table t1(toid int,rd int);
831
create table t2(userid int,pmnew int,pmtotal int);
837
create table t1(toid int,rd int) ENGINE=MyISAM;
838
create table t2(userid int,pmnew int,pmtotal int) ENGINE=MyISAM;
832
839
insert into t2 values(1,0,0),(2,0,0);
833
840
insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2);
834
841
select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1);
899
904
# correct used_tables()
902
CREATE TABLE `t1` ( `id` bigint NOT NULL auto_increment, `taskid` bigint NOT NULL default '0', `dbid` int NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ;
907
CREATE TABLE `t1` ( `id` bigint NOT NULL auto_increment, `taskid` bigint NOT NULL default '0', `dbid` int NOT NULL default '0', `create_date` datetime, `last_update` datetime, PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=3 ;
903
908
INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now());
904
CREATE TABLE `t2` (`db_id` int NOT NULL auto_increment,`name` varchar(200) NOT NULL default '',`primary_uid` smallint NOT NULL default '0',`secondary_uid` smallint NOT NULL default '0',PRIMARY KEY (`db_id`),UNIQUE KEY `name_2` (`name`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2147483647;
909
CREATE TABLE `t2` (`db_id` int NOT NULL auto_increment,`name` varchar(200) NOT NULL default '',`primary_uid` int NOT NULL default '0',`secondary_uid` int NOT NULL default '0',PRIMARY KEY (`db_id`),UNIQUE KEY `name_2` (`name`)) ENGINE=MyISAM AUTO_INCREMENT=2147483647;
905
910
INSERT INTO `t2` (`db_id`, `name`, `primary_uid`, `secondary_uid`) VALUES (18, 'Not Set 1', 0, 0),(19, 'Valid', 1, 2),(20, 'Valid 2', 1, 2),(21, 'Should Not Return', 1, 2),(26, 'Not Set 2', 0, 0),(-1, 'ALL DB\'S', 0, 0);
906
CREATE TABLE `t3` (`taskgenid` bigint NOT NULL auto_increment,`dbid` int NOT NULL default '0',`taskid` int NOT NULL default '0',`mon` tinyint NOT NULL default '1',`tues` tinyint NOT NULL default '1',`wed` tinyint NOT NULL default '1',`thur` tinyint NOT NULL default '1',`fri` tinyint NOT NULL default '1',`sat` tinyint NOT NULL default '0',`sun` tinyint NOT NULL default '0',`how_often` smallint NOT NULL default '1',`userid` smallint NOT NULL default '0',`active` tinyint NOT NULL default '1',PRIMARY KEY (`taskgenid`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2 ;
911
CREATE TABLE `t3` (`taskgenid` bigint NOT NULL auto_increment,`dbid` int NOT NULL default '0',`taskid` int NOT NULL default '0',`mon` int NOT NULL default '1',`tues` int NOT NULL default '1',`wed` int NOT NULL default '1',`thur` int NOT NULL default '1',`fri` int NOT NULL default '1',`sat` int NOT NULL default '0',`sun` int NOT NULL default '0',`how_often` int NOT NULL default '1',`userid` int NOT NULL default '0',`active` int NOT NULL default '1',PRIMARY KEY (`taskgenid`)) ENGINE=MyISAM AUTO_INCREMENT=2 ;
907
912
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
908
CREATE TABLE `t4` (`task_id` smallint NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
913
CREATE TABLE `t4` (`task_id` int NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM;
909
914
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
910
915
select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
911
916
SELECT dbid, name FROM t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')) AND t4.task_id = taskid;
977
982
CREATE TABLE `t1` (
978
983
`id` int NOT NULL auto_increment,
979
`id_cns` tinyint unsigned NOT NULL default '0',
984
`id_cns` int NOT NULL default '0',
980
985
`tipo` enum('','UNO','DUE') NOT NULL default '',
981
`anno_dep` smallint unsigned NOT NULL default '0',
982
`particolare` bigint unsigned NOT NULL default '0',
983
`generale` bigint unsigned NOT NULL default '0',
984
`bis` tinyint unsigned NOT NULL default '0',
986
`anno_dep` int NOT NULL default '0',
987
`particolare` bigint NOT NULL default '0',
988
`generale` bigint NOT NULL default '0',
989
`bis` int NOT NULL default '0',
985
990
PRIMARY KEY (`id`),
986
991
UNIQUE KEY `idx_cns_gen_anno` (`anno_dep`,`id_cns`,`generale`,`particolare`),
987
UNIQUE KEY `idx_cns_par_anno` (`id_cns`,`anno_dep`,`tipo`,`particolare`,`bis`)
992
UNIQUE KEY `idx_cns_par_anno` (`id_cns`,`anno_dep`,`tipo`,`particolare`,`bis`))
989
994
INSERT INTO `t1` VALUES (1,16,'UNO',1987,2048,9681,0),(2,50,'UNO',1987,1536,13987,0),(3,16,'UNO',1987,2432,14594,0),(4,16,'UNO',1987,1792,13422,0),(5,16,'UNO',1987,1025,10240,0),(6,16,'UNO',1987,1026,7089,0);
990
995
CREATE TABLE `t2` (
991
`id` tinyint unsigned NOT NULL auto_increment,
992
`max_anno_dep` smallint unsigned NOT NULL default '0',
996
`id` int NOT NULL auto_increment,
997
`max_anno_dep` int NOT NULL default '0',
998
PRIMARY KEY (`id`)) ENGINE=MyISAM;
995
999
INSERT INTO `t2` VALUES (16,1987),(50,1990),(51,1990);
997
1001
SELECT cns.id, cns.max_anno_dep, cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM t2 AS cns;
1029
1033
# ref_or_null replacing with ref
1031
create table t1 (id int not null, text varchar(20) not null default '', primary key (id));
1035
create table t1 (id int not null, text varchar(20) not null default '', primary key (id)) ENGINE=MyISAM;
1032
1036
insert into t1 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text11'), (12, 'text12');
1033
1037
select * from t1 where id not in (select id from t1 where id < 8);
1034
1038
select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
1035
1039
explain extended select * from t1 where id not in (select id from t1 where id < 8);
1036
1040
explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
1037
1041
insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
1038
create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
1042
create table t2 (id int not null, text varchar(20) not null default '', primary key (id)) ENGINE=MyISAM;
1039
1043
insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
1040
1044
select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
1041
1045
explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
1333
1337
# Test of correct maybe_null flag returning by subquwery for temporary table
1336
CREATE TABLE `t1` ( `master` int unsigned NOT NULL default '0', `map` smallint unsigned NOT NULL default '0', `slave` int unsigned NOT NULL default '0', `access` int unsigned NOT NULL default '0', UNIQUE KEY `access_u` (`master`,`map`,`slave`));
1340
CREATE TABLE `t1` ( `master` int NOT NULL default '0', `map` int NOT NULL default '0', `slave` int NOT NULL default '0', `access` int NOT NULL default '0', UNIQUE KEY `access_u` (`master`,`map`,`slave`)) ENGINE=MyISAM;
1337
1341
INSERT INTO `t1` VALUES (1,0,0,700),(1,1,1,400),(1,5,5,400),(1,12,12,400),(1,12,32,400),(4,12,32,400);
1338
CREATE TABLE `t2` ( `id` int unsigned NOT NULL default '0', `pid` int unsigned NOT NULL default '0', `map` smallint unsigned NOT NULL default '0', `level` tinyint unsigned NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ;
1342
CREATE TABLE `t2` ( `id` int NOT NULL default '0', `pid` int NOT NULL default '0', `map` int NOT NULL default '0', `level` int NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ENGINE=MyISAM ;
1339
1343
INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,'a'),(12,5,12,7,'a');
1341
1345
SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b;
1587
1595
# Item_int_with_ref check (BUG#10020)
1590
`itemid` bigint unsigned NOT NULL auto_increment,
1591
`sessionid` bigint unsigned default NULL,
1592
`time` int unsigned NOT NULL default '0',
1593
`data` text collate latin1_general_ci NOT NULL,
1594
PRIMARY KEY (`itemid`)
1595
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
1596
INSERT INTO `t1` VALUES (1, 1, 1, '');
1598
`sessionid` bigint unsigned NOT NULL auto_increment,
1599
`pid` int unsigned NOT NULL default '0',
1600
`date` int unsigned NOT NULL default '0',
1601
`ip` varchar(15) collate latin1_general_ci NOT NULL default '',
1602
PRIMARY KEY (`sessionid`)
1603
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
1604
INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
1605
SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
1597
#CREATE TABLE `t1` (
1598
# `itemid` bigint NOT NULL auto_increment,
1599
# `sessionid` bigint default NULL,
1600
# `time` int NOT NULL default '0',
1601
# `data` text collate latin1_general_ci NOT NULL,
1602
# PRIMARY KEY (`itemid`)
1604
#INSERT INTO `t1` VALUES (1, 1, 1, '');
1605
#CREATE TABLE `t2` (
1606
# `sessionid` bigint NOT NULL auto_increment,
1607
# `pid` int NOT NULL default '0',
1608
# `date` int NOT NULL default '0',
1609
# `ip` varchar(15) collate latin1_general_ci NOT NULL default '',
1610
# PRIMARY KEY (`sessionid`)
1612
#INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1');
1613
#SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30;
1608
1616
# BUG#11821 : Select from subselect using aggregate function on an enum
1610
create table t1 (fld enum('0','1'));
1618
create table t1 (fld enum('0','1')) ENGINE=MyISAM;
1611
1619
insert into t1 values ('1');
1612
1620
select * from (select max(fld) from t1) as foo;
2511
2524
# Bug#27321: Wrong subquery result in a grouping select
2513
CREATE TABLE t1 (a int, b INT, d INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b));
2526
CREATE TABLE t1 (a int, b INT, d INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b)) ENGINE=MyISAM;
2514
2527
INSERT INTO t1 VALUES (1,1,0,'a'), (1,2,0,'b'), (1,3,0,'c'), (1,4,0,'d'),
2515
2528
(1,5,0,'e'), (2,1,0,'f'), (2,2,0,'g'), (2,3,0,'h'), (3,4,0,'i'), (3,3,0,'j'),
2516
2529
(3,2,0,'k'), (3,1,0,'l'), (1,9,0,'m'), (1,0,10,'n'), (2,0,5,'o'), (3,0,7,'p');