1
1
SET SESSION STORAGE_ENGINE = MEMORY;
2
2
drop table if exists t1,t2,t3,t4;
3
3
drop database if exists mysqltest;
4
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;
4
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;
5
5
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
6
6
select id, code, name from t1 order by id;
215
215
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
216
216
t1 1 skr 1 a A # NULL NULL YES BTREE
218
create table t1 (a int,b varchar(20),key(a)) engine=MyISAM;
218
create TEMPORARY table t1 (a int,b varchar(20),key(a)) engine=MyISAM;
219
219
insert into t1 values (1,""), (2,"testing");
220
220
select * from t1 where a = 1;
224
create TEMPORARY table t1 (
225
225
user_id int DEFAULT '0' NOT NULL,
226
226
name varchar(100),
227
227
phone varchar(100),
254
254
user_id name phone ref_email detail
255
255
10291 sanjeev 29153373 sansh777@hotmail.com xxx
257
CREATE TABLE t1 (a int not null, b int not null,c int not null,
257
create TEMPORARY table t1 (a int not null, b int not null,c int not null,
258
258
key(a),primary key(a,b), unique(c),key(a),unique(b)) ENGINE = MyISAM;
259
259
show index from t1;
260
260
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
265
265
t1 1 a 1 a A # NULL NULL BTREE
266
266
t1 1 a_2 1 a A # NULL NULL BTREE
268
create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)) ENGINE = MEMORY;
268
create TEMPORARY table t1 (col1 int not null, col2 char(4) not null, primary key(col1)) ENGINE = MEMORY;
269
269
alter table t1 engine=MyISAM;
270
270
insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
271
271
select * from t1;
303
create table t1 (a int not null , b int, primary key (a)) engine = MyISAM;
304
create table t2 (a int not null , b int, primary key (a)) engine = MEMORY;
303
create TEMPORARY table t1 (a int not null , b int, primary key (a)) engine = MyISAM;
304
create TEMPORARY table t2 (a int not null , b int, primary key (a)) engine = MEMORY;
305
305
insert into t1 VALUES (1,3) , (2,3), (3,3);
306
306
select * from t1;
604
604
update t1 set sca_pic="test" where sca_pic is null;
605
605
delete from t1 where sca_code='pd';
608
CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=MyISAM;
609
insert into t1 (a) values(1),(2),(3);
610
select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
615
select a from t1 natural join t1 as t2 where b >= @a order by a;
620
update t1 set a=5 where a=1;
627
create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=MyISAM;
608
create TEMPORARY table t1 (a varchar(100) not null, primary key(a), b int not null) engine=MyISAM;
628
609
insert into t1 values("hello",1),("world",2);
629
610
select * from t1 order by b desc;
660
CREATE TABLE t1 (a int NOT NULL) engine=MyISAM;
641
create TEMPORARY table t1 (a int NOT NULL) engine=MyISAM;
661
642
INSERT INTO t1 VALUES (1);
662
643
SELECT * FROM t1;
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;
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;
667
648
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);
668
649
explain select * from t1 where a > 0 and a < 50;
669
650
id select_type table type possible_keys key key_len ref rows Extra
670
651
1 SIMPLE t1 system PRIMARY NULL NULL NULL #
672
create table t1 (a char(20), unique (a(5))) engine=MyISAM;
653
create TEMPORARY table t1 (a char(20), unique (a(5))) engine=MyISAM;
674
create table t1 (a char(20), index (a(5))) engine=MyISAM;
655
create TEMPORARY table t1 (a char(20), index (a(5))) engine=MyISAM;
675
656
show create table t1;
676
657
Table Create Table
677
t1 CREATE TABLE `t1` (
658
t1 CREATE TEMPORARY TABLE `t1` (
678
659
`a` varchar(20) DEFAULT NULL,
716
697
3 three three value 103
718
699
create database mysqltest;
719
create table mysqltest.t1 (a int not null) engine= MyISAM;
700
create TEMPORARY table mysqltest.t1 (a int not null) engine= MyISAM;
720
701
insert into mysqltest.t1 values(1);
721
create table mysqltest.t2 (a int not null) engine= MEMORY;
702
create TEMPORARY table mysqltest.t2 (a int not null) engine= MEMORY;
722
703
insert into mysqltest.t2 values(1);
723
create table mysqltest.t3 (a int not null) engine= MEMORY;
704
create TEMPORARY table mysqltest.t3 (a int not null) engine= MEMORY;
724
705
insert into mysqltest.t3 values(1);
726
707
drop database mysqltest;
727
708
show tables from mysqltest;
728
709
ERROR 42000: Unknown database 'mysqltest'
729
710
set autocommit=0;
730
create table t1 (a int not null) engine= MyISAM;
711
create TEMPORARY table t1 (a int not null) engine= MyISAM;
731
712
insert into t1 values(1),(2);
732
713
truncate table t1;
756
737
select * from t1;
759
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=MyISAM;
740
create TEMPORARY table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=MyISAM;
760
741
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
761
742
explain select * from t1 order by a;
762
743
id select_type table type possible_keys key key_len ref rows Extra
783
764
id select_type table type possible_keys key key_len ref rows Extra
784
765
1 SIMPLE t1 ALL NULL NULL NULL NULL #
786
create table t1 (t int not null default 1, key (t)) engine=MyISAM;
767
create TEMPORARY table t1 (t int not null default 1, key (t)) engine=MyISAM;
788
769
Field Type Null Key Default Extra
772
create TEMPORARY table t1 (
792
773
number bigint NOT NULL default '0',
793
774
cname char(15) NOT NULL default '',
794
775
carrier_id int NOT NULL default '0',
807
788
INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
808
789
INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
809
790
INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
791
create TEMPORARY table t2 (
811
792
number bigint NOT NULL default '0',
812
793
cname char(15) NOT NULL default '',
813
794
carrier_id int NOT NULL default '0',
850
831
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
851
832
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
852
833
drop table t1,t2;
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;
834
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;
855
836
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
856
837
SELECT @@tx_isolation,@@global.tx_isolation;
891
create table t1 (n int, d int) engine=MyISAM;
892
create table t2 (n int, d int) engine=MyISAM;
872
create TEMPORARY table t1 (n int, d int) engine=MyISAM;
873
create TEMPORARY table t2 (n int, d int) engine=MyISAM;
893
874
insert into t1 values(1,1),(1,2);
894
875
insert into t2 values(1,10),(2,20);
895
876
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
904
885
drop table t1,t2;
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;
886
create TEMPORARY table t1 (a varchar(10) not null) engine = MEMORY;
887
create TEMPORARY table t2 (b varchar(10) not null unique) engine=MyISAM;
924
888
select t1.a from t1,t2 where t1.a=t2.b;
926
890
drop table t1,t2;
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;
891
create TEMPORARY table t1 (a int not null, b int, primary key (a)) engine = MyISAM;
892
create TEMPORARY table t2 (a int not null, b int, primary key (a)) engine = MyISAM;
929
893
insert into t1 values (10, 20);
930
894
insert into t2 values (10, 20);
931
895
update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
932
896
drop table t1,t2;
933
CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=MyISAM;
897
create TEMPORARY table t1 (a int not null primary key, b int not null, unique (b)) engine=MyISAM;
934
898
INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
935
899
UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
936
900
SELECT * from t1;
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;
912
create TEMPORARY table t1 (a int not null primary key, b int not null, key (b)) engine=MyISAM;
913
create TEMPORARY table t2 (a int not null primary key, b int not null, key (b)) engine=MyISAM;
950
914
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
915
INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
952
916
update t1,t2 set t1.a=t1.a+100;
1035
999
drop table t1,t2;
1036
create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = MyISAM;
1000
create TEMPORARY table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = MyISAM;
1037
1001
insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2);
1038
1002
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;
1009
create TEMPORARY table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=MyISAM;
1010
create TEMPORARY table t2 (a int not null auto_increment primary key, b int) ENGINE = MEMORY;
1047
1011
insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
1048
1012
insert into t2 (a) select b from t1;
1049
1013
insert into t1 (b) select b from t2;
1088
create table t1 (a int not null, b int not null, key (a)) engine=MyISAM;
1052
create TEMPORARY table t1 (a int not null, b int not null, key (a)) engine=MyISAM;
1089
1053
insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
1091
1055
update t1 set b=(@tmp:=@tmp+1) order by a;
1110
create table t1 ( c char(8) not null ) engine=MyISAM;
1074
create TEMPORARY table t1 ( c char(8) not null ) engine=MyISAM;
1111
1075
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
1112
1076
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
1113
1077
alter table t1 add b char(8) not null;
1114
1078
alter table t1 add a char(8) not null;
1115
1079
alter table t1 add primary key (a,b,c);
1116
1080
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;
1081
create TEMPORARY 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
1082
insert into t2 select * from t1;
1119
1083
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
1120
1084
drop table t1,t2;
1121
1085
SET AUTOCOMMIT=1;
1122
create table t1 (a integer auto_increment primary key) engine=MyISAM;
1086
create TEMPORARY table t1 (a integer auto_increment primary key) engine=MyISAM;
1123
1087
insert into t1 (a) values (NULL),(NULL);
1124
1088
truncate table t1;
1125
1089
insert into t1 (a) values (NULL),(NULL);
1126
1090
SELECT * from t1;
1131
CREATE TABLE t1 (col1 int)ENGINE=MyISAM;
1132
CREATE TABLE t2 (col1 int,stamp TIMESTAMP,INDEX stamp_idx
1095
create TEMPORARY table t1 (col1 int)ENGINE=MyISAM;
1096
create TEMPORARY table t2 (col1 int,stamp TIMESTAMP,INDEX stamp_idx
1133
1097
(stamp))ENGINE=MyISAM;
1134
1098
insert into t1 values (1),(2),(3);
1135
1099
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
1143
1107
drop table t1,t2;
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;
1108
create TEMPORARY table t1 (a int, b varchar(200), c text not null) checksum=1 engine=MyISAM;
1109
create TEMPORARY table t2 (a int, b varchar(200), c text not null) checksum=0 engine=MyISAM;
1110
create TEMPORARY table t3 (a int, b varchar(200), c varchar(200) not null) checksum=1 engine=MEMORY;
1111
create TEMPORARY table t4 (a int, b varchar(200), c varchar(200) not null) checksum=0 engine=MEMORY;
1112
create TEMPORARY table t5 (a int, b varchar(200), c text not null) checksum=1 engine=MyISAM;
1113
create TEMPORARY table t6 (a int, b varchar(200), c text not null) checksum=0 engine=MyISAM;
1179
1114
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
1180
1115
insert t2 select * from t1;
1181
1116
insert t3 select * from t1;
1217
1152
Error 1146 Table 'test.t7' doesn't exist
1218
1153
drop table t1,t2,t3, t4, t5, t6;
1219
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=MyISAM;
1220
insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
1221
select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
1233
create table t1 (a int) engine=MyISAM;
1154
create TEMPORARY table t1 (a int) engine=MyISAM;
1234
1155
create table t2 like t1;
1235
1156
show create table t2;
1236
1157
Table Create Table
1256
1177
show status like "binlog_cache_disk_use";
1257
1178
Variable_name Value
1259
create table t1 (c char(10), index (c,c)) engine=MyISAM;
1180
create TEMPORARY table t1 (c char(10), index (c,c)) engine=MyISAM;
1260
1181
ERROR 42S21: Duplicate column name 'c'
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;
1182
create TEMPORARY table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=MyISAM;
1183
ERROR 42S21: Duplicate column name 'c1'
1184
create TEMPORARY table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=MyISAM;
1185
ERROR 42S21: Duplicate column name 'c1'
1186
create TEMPORARY table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=MyISAM;
1187
ERROR 42S21: Duplicate column name 'c1'
1188
create TEMPORARY table t1 (c1 char(10), c2 char(10)) engine=MyISAM;
1268
1189
alter table t1 add key (c1,c1);
1269
1190
ERROR 42S21: Duplicate column name 'c1'
1270
1191
alter table t1 add key (c2,c1,c1);
1299
create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=MyISAM;
1220
create TEMPORARY table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=MyISAM;
1300
1221
insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
1301
1222
select * from t1 order by a,b,c,d;
1366
1287
show create table t1;
1367
1288
Table Create Table
1368
t1 CREATE TABLE `t1` (
1289
t1 CREATE TEMPORARY TABLE `t1` (
1369
1290
`v` varchar(10) DEFAULT NULL,
1370
1291
`c` varchar(10) DEFAULT NULL,
1372
1293
) ENGINE=MyISAM
1373
create table t2 like t1;
1294
create TEMPORARY table t2 like t1;
1374
1295
show create table t2;
1375
1296
Table Create Table
1376
t2 CREATE TABLE `t2` (
1297
t2 CREATE TEMPORARY TABLE `t2` (
1377
1298
`v` varchar(10) DEFAULT NULL,
1378
1299
`c` varchar(10) DEFAULT NULL,
1380
1301
) ENGINE=MyISAM
1381
create table t3 select * from t1;
1302
create TEMPORARY table t3 select * from t1;
1382
1303
show create table t3;
1383
1304
Table Create Table
1384
t3 CREATE TABLE `t3` (
1305
t3 CREATE TEMPORARY TABLE `t3` (
1385
1306
`v` varchar(10) DEFAULT NULL,
1386
1307
`c` varchar(10) DEFAULT NULL,
1888
1809
KEY `t` (`t`(5))
1889
1810
) ENGINE=MyISAM
1891
create table t1 (v char(10));
1812
create TEMPORARY table t1 (v char(10));
1892
1813
show create table t1;
1893
1814
Table Create Table
1894
t1 CREATE TABLE `t1` (
1815
t1 CREATE TEMPORARY TABLE `t1` (
1895
1816
`v` varchar(10) DEFAULT NULL
1896
1817
) ENGINE=MyISAM
1898
create table t1 (v varchar(10), c char(10)) row_format=fixed;
1819
create TEMPORARY table t1 (v varchar(10), c char(10)) row_format=fixed;
1899
1820
show create table t1;
1900
1821
Table Create Table
1901
t1 CREATE TABLE `t1` (
1822
t1 CREATE TEMPORARY TABLE `t1` (
1902
1823
`v` varchar(10) DEFAULT NULL,
1903
1824
`c` varchar(10) DEFAULT NULL
1904
1825
) ENGINE=MyISAM ROW_FORMAT=FIXED
1968
create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=MyISAM;
1969
create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=MyISAM;
1889
create TEMPORARY table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=MyISAM;
1890
create TEMPORARY table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=MyISAM;
1970
1891
insert into t2 values ('aa','cc');
1971
1892
insert into t1 values ('aa','bb'),('aa','cc');
1972
1893
delete t1 from t1,t2 where f1=f3 and f4='cc';
1973
1894
select * from t1;
1975
1896
drop table t1,t2;
1976
create table t1(a date) engine=MyISAM;
1977
create table t2(a date, key(a)) engine=MyISAM;
1897
create TEMPORARY table t1(a date) engine=MyISAM;
1898
create TEMPORARY table t2(a date, key(a)) engine=MyISAM;
1978
1899
insert into t1 values('2005-10-01');
1979
1900
insert into t2 values('2005-10-01');
1980
1901
select * from t1, t2
1983
1904
2005-10-01 2005-10-01
1984
1905
drop table t1, t2;
1985
create table t1 (id int not null, f_id int not null, f int not null,
1906
create TEMPORARY table t1 (id int not null, f_id int not null, f int not null,
1986
1907
primary key(f_id, id)) engine=MyISAM;
1987
create table t2 (id int not null,s_id int not null,s varchar(200),
1908
create TEMPORARY table t2 (id int not null,s_id int not null,s varchar(200),
1988
1909
primary key(id)) engine=MyISAM;
1989
1910
INSERT INTO t1 VALUES (8, 1, 3);
1990
1911
INSERT INTO t1 VALUES (1, 2, 1);
1997
1918
where mm.id is null lock in share mode;
1999
1920
drop table t1,t2;
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;
1921
create TEMPORARY table t1 ( a int ) ENGINE=MyISAM;
2016
1923
INSERT INTO t1 VALUES (1);
2017
1924
OPTIMIZE TABLE t1;