641
create TEMPORARY table t1 (a int NOT NULL) engine=MyISAM;
660
CREATE TABLE t1 (a int NOT NULL) engine=MyISAM;
642
661
INSERT INTO t1 VALUES (1);
643
662
SELECT * FROM t1;
647
create TEMPORARY table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = MyISAM;
666
create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = MyISAM;
648
667
insert into t1 values (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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
649
668
explain select * from t1 where a > 0 and a < 50;
650
669
id select_type table type possible_keys key key_len ref rows Extra
651
670
1 SIMPLE t1 system PRIMARY NULL NULL NULL #
653
create TEMPORARY table t1 (a char(20), unique (a(5))) engine=MyISAM;
672
create table t1 (a char(20), unique (a(5))) engine=MyISAM;
655
create TEMPORARY table t1 (a char(20), index (a(5))) engine=MyISAM;
674
create table t1 (a char(20), index (a(5))) engine=MyISAM;
656
675
show create table t1;
657
676
Table Create Table
658
t1 CREATE TEMPORARY TABLE `t1` (
677
t1 CREATE TABLE `t1` (
659
678
`a` varchar(20) DEFAULT NULL,
764
783
id select_type table type possible_keys key key_len ref rows Extra
765
784
1 SIMPLE t1 ALL NULL NULL NULL NULL #
767
create TEMPORARY table t1 (t int not null default 1, key (t)) engine=MyISAM;
786
create table t1 (t int not null default 1, key (t)) engine=MyISAM;
769
788
Field Type Null Key Default Extra
772
create TEMPORARY table t1 (id int not null auto_increment, code int not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=MyISAM;
792
number bigint NOT NULL default '0',
793
cname char(15) NOT NULL default '',
794
carrier_id int NOT NULL default '0',
795
privacy int NOT NULL default '0',
796
last_mod_date timestamp NOT NULL,
797
last_mod_id int NOT NULL default '0',
798
last_app_date timestamp NULL,
799
last_app_id int default '-1',
800
version int NOT NULL default '0',
801
assigned_scps int default '0',
802
status int default '0'
804
INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,NULL,-1,2,3,1);
805
INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
806
INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,NULL,-1,1,24,1);
807
INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
808
INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
809
INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
811
number bigint NOT NULL default '0',
812
cname char(15) NOT NULL default '',
813
carrier_id int NOT NULL default '0',
814
privacy int NOT NULL default '0',
815
last_mod_date timestamp NOT NULL,
816
last_mod_id int NOT NULL default '0',
817
last_app_date timestamp NULL,
818
last_app_id int default '-1',
819
version int NOT NULL default '0',
820
assigned_scps int default '0',
821
status int default '0'
823
INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,NULL,-1,2,3,1);
824
INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
825
INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,NULL,-1,1,24,1);
826
INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
828
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
829
4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 NULL -1 2 3 1
830
9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0
831
650 San Francisco 0 0 2001-12-27 11:13:36 342 NULL -1 1 24 1
832
302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0
833
6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0
834
333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0
836
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
837
4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 NULL -1 2 3 1
838
9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0
839
650 San Francisco 90 0 2002-01-09 11:31:58 342 NULL -1 1 24 1
840
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
841
delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null);
843
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
844
6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0
845
333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0
847
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
848
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
850
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
851
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
853
create table t1 (id int not null auto_increment, code int not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=MyISAM;
774
855
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
775
856
SELECT @@tx_isolation,@@global.tx_isolation;
810
create TEMPORARY table t1 (a int not null primary key, b int not null, unique (b)) engine=MyISAM;
891
create table t1 (n int, d int) engine=MyISAM;
892
create table t2 (n int, d int) engine=MyISAM;
893
insert into t1 values(1,1),(1,2);
894
insert into t2 values(1,10),(2,20);
895
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
905
create table t1 (a int, b int) engine=MyISAM;
906
insert into t1 values(20,null);
907
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
909
b ifnull(t2.b,"this is null")
911
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
912
t2.b=t3.a order by 1;
913
b ifnull(t2.b,"this is null")
915
insert into t1 values(10,null);
916
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
917
t2.b=t3.a order by 1;
918
b ifnull(t2.b,"this is null")
922
create table t1 (a varchar(10) not null) engine = MEMORY;
923
create table t2 (b varchar(10) not null unique) engine=MyISAM;
924
select t1.a from t1,t2 where t1.a=t2.b;
927
create table t1 (a int not null, b int, primary key (a)) engine = MyISAM;
928
create table t2 (a int not null, b int, primary key (a)) engine = MyISAM;
929
insert into t1 values (10, 20);
930
insert into t2 values (10, 20);
931
update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
933
CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=MyISAM;
811
934
INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
812
935
UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
813
936
SELECT * from t1;
825
create TEMPORARY table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=MyISAM;
826
create TEMPORARY table t2 (a int not null auto_increment primary key, b int) ENGINE = MEMORY;
948
CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=MyISAM;
949
CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=MyISAM;
950
INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
951
INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
952
update t1,t2 set t1.a=t1.a+100;
967
update t1,t2 set t1.a=t1.a+100 where t1.a=101;
982
update t1,t2 set t1.b=t1.b+10 where t1.b=2;
997
update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
1024
CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MEMORY;
1025
CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=MyISAM;
1027
INSERT INTO t1 ( B_ID ) VALUES ( 1 );
1028
INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
1031
Warning 1196 Some non-transactional changed tables couldn't be rolled back
1036
create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = MyISAM;
1037
insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2);
1038
select distinct parent,child from t1 order by parent;
1045
create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=MyISAM;
1046
create table t2 (a int not null auto_increment primary key, b int) ENGINE = MEMORY;
827
1047
insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
828
1048
insert into t2 (a) select b from t1;
829
1049
insert into t1 (b) select b from t2;
1110
create table t1 ( c char(8) not null ) engine=MyISAM;
1111
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
1112
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
1113
alter table t1 add b char(8) not null;
1114
alter table t1 add a char(8) not null;
1115
alter table t1 add primary key (a,b,c);
1116
update t1 set a=c, b=c;
1117
create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=MyISAM;
1118
insert into t2 select * from t1;
1119
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
890
1121
SET AUTOCOMMIT=1;
891
create TEMPORARY table t1 (a integer auto_increment primary key) engine=MyISAM;
1122
create table t1 (a integer auto_increment primary key) engine=MyISAM;
892
1123
insert into t1 (a) values (NULL),(NULL);
893
1124
truncate table t1;
894
1125
insert into t1 (a) values (NULL),(NULL);
895
1126
SELECT * from t1;
900
create TEMPORARY table t1 (col1 int)ENGINE=MyISAM;
901
create TEMPORARY table t2 (col1 int,stamp TIMESTAMP,INDEX stamp_idx
1131
CREATE TABLE t1 (col1 int)ENGINE=MyISAM;
1132
CREATE TABLE t2 (col1 int,stamp TIMESTAMP,INDEX stamp_idx
902
1133
(stamp))ENGINE=MyISAM;
903
1134
insert into t1 values (1),(2),(3);
904
1135
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
912
1143
drop table t1,t2;
913
create TEMPORARY table t1 (a int, b varchar(200), c text not null) engine=MyISAM;
914
create TEMPORARY table t2 (a int, b varchar(200), c text not null) engine=MyISAM;
915
create TEMPORARY table t3 (a int, b varchar(200), c varchar(200) not null) engine=MEMORY;
916
create TEMPORARY table t4 (a int, b varchar(200), c varchar(200) not null) engine=MEMORY;
917
create TEMPORARY table t5 (a int, b varchar(200), c text not null) engine=MyISAM;
918
create TEMPORARY table t6 (a int, b varchar(200), c text not null) engine=MyISAM;
1145
`id` int NOT NULL auto_increment,
1146
`id_object` int default '0',
1147
`id_version` int NOT NULL default '1',
1148
`label` varchar(100) NOT NULL default '',
1151
KEY `id_object` (`id_object`),
1152
KEY `id_version` (`id_version`)
1154
INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL);
1156
`id` int NOT NULL auto_increment,
1157
`id_version` int NOT NULL default '1',
1159
KEY `id_version` (`id_version`)
1161
INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
1162
SELECT t2.id, t1.`label` FROM t2 INNER JOIN
1163
(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
1164
ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
1171
3525 Fournisseur Test
1173
create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=MyISAM;
1174
create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=MyISAM;
1175
create table t3 (a int, b varchar(200), c varchar(200) not null) checksum=1 engine=MEMORY;
1176
create table t4 (a int, b varchar(200), c varchar(200) not null) checksum=0 engine=MEMORY;
1177
create table t5 (a int, b varchar(200), c text not null) checksum=1 engine=MyISAM;
1178
create table t6 (a int, b varchar(200), c text not null) checksum=0 engine=MyISAM;
919
1179
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
920
1180
insert t2 select * from t1;
921
1181
insert t3 select * from t1;
982
1256
show status like "binlog_cache_disk_use";
983
1257
Variable_name Value
985
create TEMPORARY table t1 (c char(10), index (c,c)) engine=MyISAM;
1259
create table t1 (c char(10), index (c,c)) engine=MyISAM;
986
1260
ERROR 42S21: Duplicate column name 'c'
987
create TEMPORARY table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=MyISAM;
988
ERROR 42S21: Duplicate column name 'c1'
989
create TEMPORARY table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=MyISAM;
990
ERROR 42S21: Duplicate column name 'c1'
991
create TEMPORARY table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=MyISAM;
992
ERROR 42S21: Duplicate column name 'c1'
993
create TEMPORARY table t1 (c1 char(10), c2 char(10)) engine=MyISAM;
1261
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=MyISAM;
1262
ERROR 42S21: Duplicate column name 'c1'
1263
create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=MyISAM;
1264
ERROR 42S21: Duplicate column name 'c1'
1265
create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=MyISAM;
1266
ERROR 42S21: Duplicate column name 'c1'
1267
create table t1 (c1 char(10), c2 char(10)) engine=MyISAM;
994
1268
alter table t1 add key (c1,c1);
995
1269
ERROR 42S21: Duplicate column name 'c1'
996
1270
alter table t1 add key (c2,c1,c1);
1701
1983
2005-10-01 2005-10-01
1702
1984
drop table t1, t2;
1703
create TEMPORARY table t1 (id int not null, f_id int not null, f int not null,
1985
create table t1 (id int not null, f_id int not null, f int not null,
1704
1986
primary key(f_id, id)) engine=MyISAM;
1705
create TEMPORARY table t2 (id int not null,s_id int not null,s varchar(200),
1987
create table t2 (id int not null,s_id int not null,s varchar(200),
1706
1988
primary key(id)) engine=MyISAM;
1707
1989
INSERT INTO t1 VALUES (8, 1, 3);
1708
1990
INSERT INTO t1 VALUES (1, 2, 1);
1709
1991
INSERT INTO t2 VALUES (1, 0, '');
1710
1992
INSERT INTO t2 VALUES (8, 1, '');
1994
DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
1995
WHERE mm.id IS NULL;
1712
1996
select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
1713
1997
where mm.id is null lock in share mode;
1715
1999
drop table t1,t2;
1716
create TEMPORARY table t1 ( a int ) ENGINE=MyISAM;
2000
create table t1(a int not null, b int, primary key(a)) engine=MyISAM;
2001
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
2004
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
2005
update t1 set b = 5 where b = 1;
2007
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
2008
select * from t1 where a = 7 and b = 3 for update;
2014
CREATE TABLE t1 ( a int ) ENGINE=MyISAM;
1718
2016
INSERT INTO t1 VALUES (1);
1719
2017
OPTIMIZE TABLE t1;
1720
2018
Table Op Msg_type Msg_text
1721
test.t1 optimize note The storage engine for the table doesn't support optimize
2019
test.t1 optimize status OK