diff options
Diffstat (limited to 'mysql-test/r')
293 files changed, 45336 insertions, 2569 deletions
diff --git a/mysql-test/r/alias.result b/mysql-test/r/alias.result index 3d6273144d0..587c21e9129 100644 --- a/mysql-test/r/alias.result +++ b/mysql-test/r/alias.result @@ -47,7 +47,7 @@ KEY prov_hdl_nr(prov_hdl_nr), KEY mcbs_aufnr(mcbs_aufnr), KEY kundentyp(kundentyp), KEY p_nr(p_nr,suffix) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index e7a8d2c7cdf..e85ad303564 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -51,10 +51,10 @@ PRIMARY KEY (GROUP_ID,LANG_ID), KEY NAME (NAME)); ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null; SHOW FULL COLUMNS FROM t1; -Field Type Null Key Default Extra Privileges -GROUP_ID int(10) unsigned PRI 0 select,insert,update,references -LANG_ID smallint(5) unsigned PRI 0 select,insert,update,references -NAME char(80) MUL select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +GROUP_ID int(10) unsigned NULL PRI 0 select,insert,update,references +LANG_ID smallint(5) unsigned NULL PRI 0 select,insert,update,references +NAME char(80) latin1_swedish_ci MUL select,insert,update,references DROP TABLE t1; create table t1 (n int); insert into t1 values(9),(3),(12),(10); @@ -74,10 +74,10 @@ body text NOT NULL, user_id int(11) unsigned NOT NULL default '0', status enum('new','old') NOT NULL default 'new', PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; ALTER TABLE t1 ORDER BY t1.id, t1.status, t1.type_id, t1.user_id, t1.body; DROP TABLE t1; -CREATE TABLE t1 (AnamneseId int(10) unsigned NOT NULL auto_increment,B BLOB,PRIMARY KEY (AnamneseId)) type=myisam; +CREATE TABLE t1 (AnamneseId int(10) unsigned NOT NULL auto_increment,B BLOB,PRIMARY KEY (AnamneseId)) engine=myisam; insert into t1 values (null,"hello"); LOCK TABLES t1 WRITE; ALTER TABLE t1 ADD Column new_col int not null; @@ -108,7 +108,7 @@ select * from mysqltest.t1; name mysqltest alter table t1 rename mysqltest.t1; -Table 't1' already exists +ERROR 42S01: Table 't1' already exists select * from t1; name current @@ -121,9 +121,9 @@ create database mysqltest; create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; -insert command denied to user: 'mysqltest_1@localhost' for table 't2' +ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; create table t1 (n1 int not null, n2 int, n3 int, n4 float, unique(n1), @@ -311,11 +311,89 @@ ALTER TABLE t1 DISABLE KEYS; INSERT DELAYED INTO t1 VALUES(1),(2),(3); ALTER TABLE t1 ENABLE KEYS; drop table t1; +set names koi8r; +create table t1 (a char(10) character set koi8r); +insert into t1 values ('ÔÅÓÔ'); +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ D4C5D3D4 +alter table t1 change a a char(10) character set cp1251; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ F2E5F1F2 +alter table t1 change a a binary(10); +select a,hex(a) from t1; +a hex(a) +òåñò F2E5F1F2 +alter table t1 change a a char(10) character set cp1251; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ F2E5F1F2 +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ D4C5D3D4 +alter table t1 change a a varchar(10) character set cp1251; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ F2E5F1F2 +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ D4C5D3D4 +alter table t1 change a a text character set cp1251; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ F2E5F1F2 +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +a hex(a) +ÔÅÓÔ D4C5D3D4 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set koi8r default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 DEFAULT CHARACTER SET latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set koi8r default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 CONVERT TO CHARACTER SET latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 DEFAULT CHARACTER SET cp1251; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set latin1 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 +drop table t1; +create table t1 (myblob longblob,mytext longtext) +default charset latin1 collate latin1_general_cs; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `myblob` longblob, + `mytext` longtext collate latin1_general_cs +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs +alter table t1 character set latin2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `myblob` longblob, + `mytext` longtext character set latin1 collate latin1_general_cs +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +drop table t1; CREATE TABLE t1 ( Host varchar(16) binary NOT NULL default '', User varchar(16) binary NOT NULL default '', PRIMARY KEY (Host,User) -) TYPE=MyISAM; +) ENGINE=MyISAM; ALTER TABLE t1 DISABLE KEYS; LOCK TABLES t1 WRITE; INSERT INTO t1 VALUES ('localhost','root'),('localhost',''),('games','monty'); @@ -334,7 +412,7 @@ Host varchar(16) binary NOT NULL default '', User varchar(16) binary NOT NULL default '', PRIMARY KEY (Host,User), KEY (Host) -) TYPE=MyISAM; +) ENGINE=MyISAM; ALTER TABLE t1 DISABLE KEYS; SHOW INDEX FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -371,7 +449,7 @@ Host varchar(16) binary NOT NULL default '', User varchar(16) binary NOT NULL default '', PRIMARY KEY (Host,User), KEY (Host) -) TYPE=MyISAM; +) ENGINE=MyISAM; LOCK TABLES t1 WRITE; ALTER TABLE t1 DISABLE KEYS; SHOW INDEX FROM t1; @@ -380,9 +458,27 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE t1 0 PRIMARY 2 User A 0 NULL NULL BTREE t1 1 Host 1 Host A NULL NULL NULL BTREE disabled DROP TABLE t1; +CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE); +ALTER TABLE t1 DROP PRIMARY KEY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `b` int(11) default NULL, + UNIQUE KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 DROP PRIMARY KEY; +ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists +DROP TABLE t1; +create table t1 (a int, b int, key(a)); +insert into t1 values (1,1), (2,2); +alter table t1 drop key no_such_key; +ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists +alter table t1 drop key a; +drop table t1; create table t1 (a int); alter table t1 rename to `t1\\`; -Incorrect table name 't1\\' +ERROR 42000: Incorrect table name 't1\\' rename table t1 to `t1\\`; -Incorrect table name 't1\\' +ERROR 42000: Incorrect table name 't1\\' drop table t1; diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 5e859bb0b7a..b51afab5b54 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -1,26 +1,98 @@ drop table if exists t1,t2; create table t1 (i int, j int, empty_string char(10), bool char(1), d date); insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); +select count(*) from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +count(*) 4 4 1 1 0 0 4.0000 0.0000 ENUM('4') NOT NULL select * from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL -t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL -t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL -t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL -t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +test.t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL +test.t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL select * from t1 procedure analyse(2); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL -t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL -t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL -t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL -t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +test.t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +test.t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL create table t2 select * from t1 procedure analyse(); select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL -t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL -t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL -t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL -t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +test.t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL +test.t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +drop table t1,t2; +EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +create table t1 (a int not null); +create table t2 select * from t1 where 0=1 procedure analyse(); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `Field_name` char(255) NOT NULL default '', + `Min_value` char(255) default NULL, + `Max_value` char(255) default NULL, + `Min_length` bigint(11) NOT NULL default '0', + `Max_length` bigint(11) NOT NULL default '0', + `Empties_or_zeros` bigint(11) NOT NULL default '0', + `Nulls` bigint(11) NOT NULL default '0', + `Avg_value_or_avg_length` char(255) NOT NULL default '', + `Std` char(255) default NULL, + `Optimal_fieldtype` char(64) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1 where 0=1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +insert into t1 values(1); +drop table t2; +create table t2 select * from t1 where 0=1 procedure analyse(); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `Field_name` char(255) NOT NULL default '', + `Min_value` char(255) default NULL, + `Max_value` char(255) default NULL, + `Min_length` bigint(11) NOT NULL default '0', + `Max_length` bigint(11) NOT NULL default '0', + `Empties_or_zeros` bigint(11) NOT NULL default '0', + `Nulls` bigint(11) NOT NULL default '0', + `Avg_value_or_avg_length` char(255) NOT NULL default '', + `Std` char(255) default NULL, + `Optimal_fieldtype` char(64) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t2; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +insert into t2 select * from t1 procedure analyse(); +select * from t2; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.a 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL +insert into t1 values(2); +drop table t2; +create table t2 select * from t1 where 0=1 procedure analyse(); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `Field_name` char(255) NOT NULL default '', + `Min_value` char(255) default NULL, + `Max_value` char(255) default NULL, + `Min_length` bigint(11) NOT NULL default '0', + `Max_length` bigint(11) NOT NULL default '0', + `Empties_or_zeros` bigint(11) NOT NULL default '0', + `Nulls` bigint(11) NOT NULL default '0', + `Avg_value_or_avg_length` char(255) NOT NULL default '', + `Std` char(255) default NULL, + `Optimal_fieldtype` char(64) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t2; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +insert into t2 select * from t1 procedure analyse(); +select * from t2; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL drop table t1,t2; diff --git a/mysql-test/r/ansi.result b/mysql-test/r/ansi.result index f9f96310b73..0b86634f67b 100644 --- a/mysql-test/r/ansi.result +++ b/mysql-test/r/ansi.result @@ -1,4 +1,12 @@ drop table if exists t1; +set sql_mode="MySQL40"; +select @@sql_mode; +@@sql_mode +NO_FIELD_OPTIONS,MYSQL40 +set @@sql_mode="ANSI"; +select @@sql_mode; +@@sql_mode +REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,ANSI SELECT 'A' || 'B'; 'A' || 'B' AB @@ -6,5 +14,6 @@ CREATE TABLE t1 (id INT, id2 int); SELECT id,NULL,1,1.1,'a' FROM t1 GROUP BY id; id NULL 1 1.1 a SELECT id FROM t1 GROUP BY id2; -'t1.id' isn't in GROUP BY +ERROR 42000: 'test.t1.id' isn't in GROUP BY drop table t1; +SET @@SQL_MODE=""; diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result new file mode 100644 index 00000000000..b380ea910de --- /dev/null +++ b/mysql-test/r/archive.result @@ -0,0 +1,1396 @@ +drop table if exists t1,t2; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE=archive; +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL +) ENGINE=archive; +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat',''); +INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); +INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); +INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); +SELECT * FROM t2; +auto fld1 companynr fld3 fld4 fld5 fld6 +1 000001 00 Omaha teethe neat +2 011401 37 breaking dreaded Steinberg W +3 011402 37 Romans scholastics jarring +4 011403 37 intercepted audiology tinily +5 011501 37 bewilderingly wallet balled +6 011701 37 astound parters persist W +7 011702 37 admonishing eschew attainments +8 011703 37 sumac quitter fanatic +9 012001 37 flanking neat measures FAS +10 012003 37 combed Steinberg rightfulness +11 012004 37 subjective jarring capably +12 012005 37 scatterbrain tinily impulsive +13 012301 37 Eulerian balled starlet +14 012302 36 dubbed persist terminators +15 012303 37 Kane attainments untying +16 012304 37 overlay fanatic announces FAS +17 012305 37 perturb measures featherweight FAS +18 012306 37 goblins rightfulness pessimist FAS +19 012501 37 annihilates capably daughter +20 012602 37 Wotan impulsive decliner FAS +21 012603 37 snatching starlet lawgiver +22 012604 37 concludes terminators stated +23 012605 37 laterally untying readable +24 012606 37 yelped announces attrition +25 012701 37 grazing featherweight cascade FAS +26 012702 37 Baird pessimist motors FAS +27 012703 37 celery daughter interrogate +28 012704 37 misunderstander decliner pests W +29 013601 37 handgun lawgiver stairway +30 013602 37 foldout stated dopers FAS +31 013603 37 mystic readable testicle W +32 013604 37 succumbed attrition Parsifal W +33 013605 37 Nabisco cascade leavings +34 013606 37 fingerings motors postulation W +35 013607 37 aging interrogate squeaking +36 013608 37 afield pests contrasted +37 013609 37 ammonium stairway leftover +38 013610 37 boat dopers whiteners +39 013801 37 intelligibility testicle erases W +40 013802 37 Augustine Parsifal Punjab W +41 013803 37 teethe leavings Merritt +42 013804 37 dreaded postulation Quixotism +43 013901 37 scholastics squeaking sweetish FAS +44 016001 37 audiology contrasted dogging FAS +45 016201 37 wallet leftover scornfully FAS +46 016202 37 parters whiteners bellow +47 016301 37 eschew erases bills +48 016302 37 quitter Punjab cupboard FAS +49 016303 37 neat Merritt sureties FAS +50 016304 37 Steinberg Quixotism puddings +51 018001 37 jarring sweetish tapestry +52 018002 37 tinily dogging fetters +53 018003 37 balled scornfully bivalves +54 018004 37 persist bellow incurring +55 018005 37 attainments bills Adolph +56 018007 37 fanatic cupboard pithed +57 018008 37 measures sureties emergency +58 018009 37 rightfulness puddings Miles +59 018010 37 capably tapestry trimmings +60 018012 37 impulsive fetters tragedies W +61 018013 37 starlet bivalves skulking W +62 018014 37 terminators incurring flint +63 018015 37 untying Adolph flopping W +64 018016 37 announces pithed relaxing FAS +65 018017 37 featherweight emergency offload FAS +66 018018 37 pessimist Miles suites W +67 018019 37 daughter trimmings lists FAS +68 018020 37 decliner tragedies animized FAS +69 018021 37 lawgiver skulking multilayer W +70 018022 37 stated flint standardizes FAS +71 018023 37 readable flopping Judas +72 018024 37 attrition relaxing vacuuming W +73 018025 37 cascade offload dentally W +74 018026 37 motors suites humanness W +75 018027 37 interrogate lists inch W +76 018028 37 pests animized Weissmuller W +77 018029 37 stairway multilayer irresponsibly W +78 018030 37 dopers standardizes luckily FAS +79 018032 37 testicle Judas culled W +80 018033 37 Parsifal vacuuming medical FAS +81 018034 37 leavings dentally bloodbath FAS +82 018035 37 postulation humanness subschema W +83 018036 37 squeaking inch animals W +84 018037 37 contrasted Weissmuller Micronesia +85 018038 37 leftover irresponsibly repetitions +86 018039 37 whiteners luckily Antares +87 018040 37 erases culled ventilate W +88 018041 37 Punjab medical pityingly +89 018042 37 Merritt bloodbath interdependent +90 018043 37 Quixotism subschema Graves FAS +91 018044 37 sweetish animals neonatal +92 018045 37 dogging Micronesia scribbled FAS +93 018046 37 scornfully repetitions chafe W +94 018048 37 bellow Antares honoring +95 018049 37 bills ventilate realtor +96 018050 37 cupboard pityingly elite +97 018051 37 sureties interdependent funereal +98 018052 37 puddings Graves abrogating +99 018053 50 tapestry neonatal sorters +100 018054 37 fetters scribbled Conley +101 018055 37 bivalves chafe lectured +102 018056 37 incurring honoring Abraham +103 018057 37 Adolph realtor Hawaii W +104 018058 37 pithed elite cage +105 018059 36 emergency funereal hushes +106 018060 37 Miles abrogating Simla +107 018061 37 trimmings sorters reporters +108 018101 37 tragedies Conley Dutchman FAS +109 018102 37 skulking lectured descendants FAS +110 018103 37 flint Abraham groupings FAS +111 018104 37 flopping Hawaii dissociate +112 018201 37 relaxing cage coexist W +113 018202 37 offload hushes Beebe +114 018402 37 suites Simla Taoism +115 018403 37 lists reporters Connally +116 018404 37 animized Dutchman fetched FAS +117 018405 37 multilayer descendants checkpoints FAS +118 018406 37 standardizes groupings rusting +119 018409 37 Judas dissociate galling +120 018601 37 vacuuming coexist obliterates +121 018602 37 dentally Beebe traitor +122 018603 37 humanness Taoism resumes FAS +123 018801 37 inch Connally analyzable FAS +124 018802 37 Weissmuller fetched terminator FAS +125 018803 37 irresponsibly checkpoints gritty FAS +126 018804 37 luckily rusting firearm W +127 018805 37 culled galling minima +128 018806 37 medical obliterates Selfridge +129 018807 37 bloodbath traitor disable +130 018808 37 subschema resumes witchcraft W +131 018809 37 animals analyzable betroth W +132 018810 37 Micronesia terminator Manhattanize +133 018811 37 repetitions gritty imprint +134 018812 37 Antares firearm peeked +135 019101 37 ventilate minima swelling +136 019102 37 pityingly Selfridge interrelationships W +137 019103 37 interdependent disable riser +138 019201 37 Graves witchcraft Gandhian W +139 030501 37 neonatal betroth peacock A +140 030502 50 scribbled Manhattanize bee A +141 030503 37 chafe imprint kanji +142 030504 37 honoring peeked dental +143 031901 37 realtor swelling scarf FAS +144 036001 37 elite interrelationships chasm A +145 036002 37 funereal riser insolence A +146 036004 37 abrogating Gandhian syndicate +147 036005 37 sorters peacock alike +148 038001 37 Conley bee imperial A +149 038002 37 lectured kanji convulsion A +150 038003 37 Abraham dental railway A +151 038004 37 Hawaii scarf validate A +152 038005 37 cage chasm normalizes A +153 038006 37 hushes insolence comprehensive +154 038007 37 Simla syndicate chewing +155 038008 37 reporters alike denizen +156 038009 37 Dutchman imperial schemer +157 038010 37 descendants convulsion chronicle +158 038011 37 groupings railway Kline +159 038012 37 dissociate validate Anatole +160 038013 37 coexist normalizes partridges +161 038014 37 Beebe comprehensive brunch +162 038015 37 Taoism chewing recruited +163 038016 37 Connally denizen dimensions W +164 038017 37 fetched schemer Chicana W +165 038018 37 checkpoints chronicle announced +166 038101 37 rusting Kline praised FAS +167 038102 37 galling Anatole employing +168 038103 37 obliterates partridges linear +169 038104 37 traitor brunch quagmire +170 038201 37 resumes recruited western A +171 038202 37 analyzable dimensions relishing +172 038203 37 terminator Chicana serving A +173 038204 37 gritty announced scheduling +174 038205 37 firearm praised lore +175 038206 37 minima employing eventful +176 038208 37 Selfridge linear arteriole A +177 042801 37 disable quagmire disentangle +178 042802 37 witchcraft western cured A +179 046101 37 betroth relishing Fenton W +180 048001 37 Manhattanize serving avoidable A +181 048002 37 imprint scheduling drains A +182 048003 37 peeked lore detectably FAS +183 048004 37 swelling eventful husky +184 048005 37 interrelationships arteriole impelling +185 048006 37 riser disentangle undoes +186 048007 37 Gandhian cured evened +187 048008 37 peacock Fenton squeezes +188 048101 37 bee avoidable destroyer FAS +189 048102 37 kanji drains rudeness +190 048201 37 dental detectably beaner FAS +191 048202 37 scarf husky boorish +192 048203 37 chasm impelling Everhart +193 048204 37 insolence undoes encompass A +194 048205 37 syndicate evened mushrooms +195 048301 37 alike squeezes Alison A +196 048302 37 imperial destroyer externally FAS +197 048303 37 convulsion rudeness pellagra +198 048304 37 railway beaner cult +199 048305 37 validate boorish creek A +200 048401 37 normalizes Everhart Huffman +201 048402 37 comprehensive encompass Majorca FAS +202 048403 37 chewing mushrooms governing A +203 048404 37 denizen Alison gadfly FAS +204 048405 37 schemer externally reassigned FAS +205 048406 37 chronicle pellagra intentness W +206 048407 37 Kline cult craziness +207 048408 37 Anatole creek psychic +208 048409 37 partridges Huffman squabbled +209 048410 37 brunch Majorca burlesque +210 048411 37 recruited governing capped +211 048412 37 dimensions gadfly extracted A +212 048413 37 Chicana reassigned DiMaggio +213 048601 37 announced intentness exclamation FAS +214 048602 37 praised craziness subdirectory +215 048603 37 employing psychic fangs +216 048604 37 linear squabbled buyer A +217 048801 37 quagmire burlesque pithing A +218 050901 37 western capped transistorizing A +219 051201 37 relishing extracted nonbiodegradable +220 056002 37 serving DiMaggio dislocate +221 056003 37 scheduling exclamation monochromatic FAS +222 056004 37 lore subdirectory batting +223 056102 37 eventful fangs postcondition A +224 056203 37 arteriole buyer catalog FAS +225 056204 37 disentangle pithing Remus +226 058003 37 cured transistorizing devices A +227 058004 37 Fenton nonbiodegradable bike A +228 058005 37 avoidable dislocate qualify +229 058006 37 drains monochromatic detained +230 058007 37 detectably batting commended +231 058101 37 husky postcondition civilize +232 058102 37 impelling catalog Elmhurst +233 058103 37 undoes Remus anesthetizing +234 058105 37 evened devices deaf +235 058111 37 squeezes bike Brigham +236 058112 37 destroyer qualify title +237 058113 37 rudeness detained coarse +238 058114 37 beaner commended combinations +239 058115 37 boorish civilize grayness +240 058116 37 Everhart Elmhurst innumerable FAS +241 058117 37 encompass anesthetizing Caroline A +242 058118 37 mushrooms deaf fatty FAS +243 058119 37 Alison Brigham eastbound +244 058120 37 externally title inexperienced +245 058121 37 pellagra coarse hoarder A +246 058122 37 cult combinations scotch W +247 058123 37 creek grayness passport A +248 058124 37 Huffman innumerable strategic FAS +249 058125 37 Majorca Caroline gated +250 058126 37 governing fatty flog +251 058127 37 gadfly eastbound Pipestone +252 058128 37 reassigned inexperienced Dar +253 058201 37 intentness hoarder Corcoran +254 058202 37 craziness scotch flyers A +255 058303 37 psychic passport competitions W +256 058304 37 squabbled strategic suppliers FAS +257 058602 37 burlesque gated skips +258 058603 37 capped flog institutes +259 058604 37 extracted Pipestone troop A +260 058605 37 DiMaggio Dar connective W +261 058606 37 exclamation Corcoran denies +262 058607 37 subdirectory flyers polka +263 060401 36 fangs competitions observations FAS +264 061701 36 buyer suppliers askers +265 066201 36 pithing skips homeless FAS +266 066501 36 transistorizing institutes Anna +267 068001 36 nonbiodegradable troop subdirectories W +268 068002 36 dislocate connective decaying FAS +269 068005 36 monochromatic denies outwitting W +270 068006 36 batting polka Harpy W +271 068007 36 postcondition observations crazed +272 068008 36 catalog askers suffocate +273 068009 36 Remus homeless provers FAS +274 068010 36 devices Anna technically +275 068011 36 bike subdirectories Franklinizations +276 068202 36 qualify decaying considered +277 068302 36 detained outwitting tinnily +278 068303 36 commended Harpy uninterruptedly +279 068401 36 civilize crazed whistled A +280 068501 36 Elmhurst suffocate automate +281 068502 36 anesthetizing provers gutting W +282 068503 36 deaf technically surreptitious +283 068602 36 Brigham Franklinizations Choctaw +284 068603 36 title considered cooks +285 068701 36 coarse tinnily millivolt FAS +286 068702 36 combinations uninterruptedly counterpoise +287 068703 36 grayness whistled Gothicism +288 076001 36 innumerable automate feminine +289 076002 36 Caroline gutting metaphysically W +290 076101 36 fatty surreptitious sanding A +291 076102 36 eastbound Choctaw contributorily +292 076103 36 inexperienced cooks receivers FAS +293 076302 36 hoarder millivolt adjourn +294 076303 36 scotch counterpoise straggled A +295 076304 36 passport Gothicism druggists +296 076305 36 strategic feminine thanking FAS +297 076306 36 gated metaphysically ostrich +298 076307 36 flog sanding hopelessness FAS +299 076402 36 Pipestone contributorily Eurydice +300 076501 36 Dar receivers excitation W +301 076502 36 Corcoran adjourn presumes FAS +302 076701 36 flyers straggled imaginable FAS +303 078001 36 competitions druggists concoct W +304 078002 36 suppliers thanking peering W +305 078003 36 skips ostrich Phelps FAS +306 078004 36 institutes hopelessness ferociousness FAS +307 078005 36 troop Eurydice sentences +308 078006 36 connective excitation unlocks +309 078007 36 denies presumes engrossing W +310 078008 36 polka imaginable Ruth +311 078101 36 observations concoct tying +312 078103 36 askers peering exclaimers +313 078104 36 homeless Phelps synergy +314 078105 36 Anna ferociousness Huey W +315 082101 36 subdirectories sentences merging +316 083401 36 decaying unlocks judges A +317 084001 36 outwitting engrossing Shylock W +318 084002 36 Harpy Ruth Miltonism +319 086001 36 crazed tying hen W +320 086102 36 suffocate exclaimers honeybee FAS +321 086201 36 provers synergy towers +322 088001 36 technically Huey dilutes W +323 088002 36 Franklinizations merging numerals FAS +324 088003 36 considered judges democracy FAS +325 088004 36 tinnily Shylock Ibero- +326 088101 36 uninterruptedly Miltonism invalids +327 088102 36 whistled hen behavior +328 088103 36 automate honeybee accruing +329 088104 36 gutting towers relics A +330 088105 36 surreptitious dilutes rackets +331 088106 36 Choctaw numerals Fischbein W +332 088201 36 cooks democracy phony W +333 088203 36 millivolt Ibero- cross FAS +334 088204 36 counterpoise invalids cleanup +335 088302 37 Gothicism behavior conspirator +336 088303 37 feminine accruing label FAS +337 088305 37 metaphysically relics university +338 088402 37 sanding rackets cleansed FAS +339 088501 36 contributorily Fischbein ballgown +340 088502 36 receivers phony starlet +341 088503 36 adjourn cross aqueous +342 098001 58 straggled cleanup portrayal A +343 098002 58 druggists conspirator despising W +344 098003 58 thanking label distort W +345 098004 58 ostrich university palmed +346 098005 58 hopelessness cleansed faced +347 098006 58 Eurydice ballgown silverware +348 141903 29 excitation starlet assessor +349 098008 58 presumes aqueous spiders +350 098009 58 imaginable portrayal artificially +351 098010 58 concoct despising reminiscence +352 098011 58 peering distort Mexican +353 098012 58 Phelps palmed obnoxious +354 098013 58 ferociousness faced fragile +355 098014 58 sentences silverware apprehensible +356 098015 58 unlocks assessor births +357 098016 58 engrossing spiders garages +358 098017 58 Ruth artificially panty +359 098018 58 tying reminiscence anteater +360 098019 58 exclaimers Mexican displacement A +361 098020 58 synergy obnoxious drovers A +362 098021 58 Huey fragile patenting A +363 098022 58 merging apprehensible far A +364 098023 58 judges births shrieks +365 098024 58 Shylock garages aligning W +366 098025 37 Miltonism panty pragmatism +367 106001 36 hen anteater fevers W +368 108001 36 honeybee displacement reexamines A +369 108002 36 towers drovers occupancies +370 108003 36 dilutes patenting sweats FAS +371 108004 36 numerals far modulators +372 108005 36 democracy shrieks demand W +373 108007 36 Ibero- aligning Madeira +374 108008 36 invalids pragmatism Viennese W +375 108009 36 behavior fevers chillier W +376 108010 36 accruing reexamines wildcats FAS +377 108011 36 relics occupancies gentle +378 108012 36 rackets sweats Angles W +379 108101 36 Fischbein modulators accuracies +380 108102 36 phony demand toggle +381 108103 36 cross Madeira Mendelssohn W +382 108111 50 cleanup Viennese behaviorally +383 108105 36 conspirator chillier Rochford +384 108106 36 label wildcats mirror W +385 108107 36 university gentle Modula +386 108108 50 cleansed Angles clobbering +387 108109 36 ballgown accuracies chronography +388 108110 36 starlet toggle Eskimoizeds +389 108201 36 aqueous Mendelssohn British W +390 108202 36 portrayal behaviorally pitfalls +391 108203 36 despising Rochford verify W +392 108204 36 distort mirror scatter FAS +393 108205 36 palmed Modula Aztecan +394 108301 36 faced clobbering acuity W +395 108302 36 silverware chronography sinking W +396 112101 36 assessor Eskimoizeds beasts FAS +397 112102 36 spiders British Witt W +398 113701 36 artificially pitfalls physicists FAS +399 116001 36 reminiscence verify folksong A +400 116201 36 Mexican scatter strokes FAS +401 116301 36 obnoxious Aztecan crowder +402 116302 36 fragile acuity merry +403 116601 36 apprehensible sinking cadenced +404 116602 36 births beasts alimony A +405 116603 36 garages Witt principled A +406 116701 36 panty physicists golfing +407 116702 36 anteater folksong undiscovered +408 118001 36 displacement strokes irritates +409 118002 36 drovers crowder patriots A +410 118003 36 patenting merry rooms FAS +411 118004 36 far cadenced towering W +412 118005 36 shrieks alimony displease +413 118006 36 aligning principled photosensitive +414 118007 36 pragmatism golfing inking +415 118008 36 fevers undiscovered gainers +416 118101 36 reexamines irritates leaning A +417 118102 36 occupancies patriots hydrant A +418 118103 36 sweats rooms preserve +419 118202 36 modulators towering blinded A +420 118203 36 demand displease interactions A +421 118204 36 Madeira photosensitive Barry +422 118302 36 Viennese inking whiteness A +423 118304 36 chillier gainers pastimes W +424 118305 36 wildcats leaning Edenization +425 118306 36 gentle hydrant Muscat +426 118307 36 Angles preserve assassinated +427 123101 36 accuracies blinded labeled +428 123102 36 toggle interactions glacial A +429 123301 36 Mendelssohn Barry implied W +430 126001 36 behaviorally whiteness bibliographies W +431 126002 36 Rochford pastimes Buchanan +432 126003 36 mirror Edenization forgivably FAS +433 126101 36 Modula Muscat innuendo A +434 126301 36 clobbering assassinated den FAS +435 126302 36 chronography labeled submarines W +436 126402 36 Eskimoizeds glacial mouthful A +437 126601 36 British implied expiring +438 126602 36 pitfalls bibliographies unfulfilled FAS +439 126702 36 verify Buchanan precession +440 128001 36 scatter forgivably nullified +441 128002 36 Aztecan innuendo affects +442 128003 36 acuity den Cynthia +443 128004 36 sinking submarines Chablis A +444 128005 36 beasts mouthful betterments FAS +445 128007 36 Witt expiring advertising +446 128008 36 physicists unfulfilled rubies A +447 128009 36 folksong precession southwest FAS +448 128010 36 strokes nullified superstitious A +449 128011 36 crowder affects tabernacle W +450 128012 36 merry Cynthia silk A +451 128013 36 cadenced Chablis handsomest A +452 128014 36 alimony betterments Persian A +453 128015 36 principled advertising analog W +454 128016 36 golfing rubies complex W +455 128017 36 undiscovered southwest Taoist +456 128018 36 irritates superstitious suspend +457 128019 36 patriots tabernacle relegated +458 128020 36 rooms silk awesome W +459 128021 36 towering handsomest Bruxelles +460 128022 36 displease Persian imprecisely A +461 128023 36 photosensitive analog televise +462 128101 36 inking complex braking +463 128102 36 gainers Taoist true FAS +464 128103 36 leaning suspend disappointing FAS +465 128104 36 hydrant relegated navally W +466 128106 36 preserve awesome circus +467 128107 36 blinded Bruxelles beetles +468 128108 36 interactions imprecisely trumps +469 128202 36 Barry televise fourscore W +470 128203 36 whiteness braking Blackfoots +471 128301 36 pastimes true Grady +472 128302 36 Edenization disappointing quiets FAS +473 128303 36 Muscat navally floundered FAS +474 128304 36 assassinated circus profundity W +475 128305 36 labeled beetles Garrisonian W +476 128307 36 glacial trumps Strauss +477 128401 36 implied fourscore cemented FAS +478 128502 36 bibliographies Blackfoots contrition A +479 128503 36 Buchanan Grady mutations +480 128504 36 forgivably quiets exhibits W +481 128505 36 innuendo floundered tits +482 128601 36 den profundity mate A +483 128603 36 submarines Garrisonian arches +484 128604 36 mouthful Strauss Moll +485 128702 36 expiring cemented ropers +486 128703 36 unfulfilled contrition bombast +487 128704 36 precession mutations difficultly A +488 138001 36 nullified exhibits adsorption +489 138002 36 affects tits definiteness FAS +490 138003 36 Cynthia mate cultivation A +491 138004 36 Chablis arches heals A +492 138005 36 betterments Moll Heusen W +493 138006 36 advertising ropers target FAS +494 138007 36 rubies bombast cited A +495 138008 36 southwest difficultly congresswoman W +496 138009 36 superstitious adsorption Katherine +497 138102 36 tabernacle definiteness titter A +498 138103 36 silk cultivation aspire A +499 138104 36 handsomest heals Mardis +500 138105 36 Persian Heusen Nadia W +501 138201 36 analog target estimating FAS +502 138302 36 complex cited stuck A +503 138303 36 Taoist congresswoman fifteenth A +504 138304 36 suspend Katherine Colombo +505 138401 29 relegated titter survey A +506 140102 29 awesome aspire staffing +507 140103 29 Bruxelles Mardis obtain +508 140104 29 imprecisely Nadia loaded +509 140105 29 televise estimating slaughtered +510 140201 29 braking stuck lights A +511 140701 29 true fifteenth circumference +512 141501 29 disappointing Colombo dull A +513 141502 29 navally survey weekly A +514 141901 29 circus staffing wetness +515 141902 29 beetles obtain visualized +516 142101 29 trumps loaded Tannenbaum +517 142102 29 fourscore slaughtered moribund +518 142103 29 Blackfoots lights demultiplex +519 142701 29 Grady circumference lockings +520 143001 29 quiets dull thugs FAS +521 143501 29 floundered weekly unnerves +522 143502 29 profundity wetness abut +523 148001 29 Garrisonian visualized Chippewa A +524 148002 29 Strauss Tannenbaum stratifications A +525 148003 29 cemented moribund signaled +526 148004 29 contrition demultiplex Italianizes A +527 148005 29 mutations lockings algorithmic A +528 148006 29 exhibits thugs paranoid FAS +529 148007 29 tits unnerves camping A +530 148009 29 mate abut signifying A +531 148010 29 arches Chippewa Patrice W +532 148011 29 Moll stratifications search A +533 148012 29 ropers signaled Angeles A +534 148013 29 bombast Italianizes semblance +535 148023 36 difficultly algorithmic taxed +536 148015 29 adsorption paranoid Beatrice +537 148016 29 definiteness camping retrace +538 148017 29 cultivation signifying lockout +539 148018 29 heals Patrice grammatic +540 148019 29 Heusen search helmsman +541 148020 29 target Angeles uniform W +542 148021 29 cited semblance hamming +543 148022 29 congresswoman taxed disobedience +544 148101 29 Katherine Beatrice captivated A +545 148102 29 titter retrace transferals A +546 148201 29 aspire lockout cartographer A +547 148401 29 Mardis grammatic aims FAS +548 148402 29 Nadia helmsman Pakistani +549 148501 29 estimating uniform burglarized FAS +550 148502 29 stuck hamming saucepans A +551 148503 29 fifteenth disobedience lacerating A +552 148504 29 Colombo captivated corny +553 148601 29 survey transferals megabytes FAS +554 148602 29 staffing cartographer chancellor +555 150701 29 obtain aims bulk A +556 152101 29 loaded Pakistani commits A +557 152102 29 slaughtered burglarized meson W +558 155202 36 lights saucepans deputies +559 155203 29 circumference lacerating northeaster A +560 155204 29 dull corny dipole +561 155205 29 weekly megabytes machining 0 +562 156001 29 wetness chancellor therefore +563 156002 29 visualized bulk Telefunken +564 156102 29 Tannenbaum commits salvaging +565 156301 29 moribund meson Corinthianizes A +566 156302 29 demultiplex deputies restlessly A +567 156303 29 lockings northeaster bromides +568 156304 29 thugs dipole generalized A +569 156305 29 unnerves machining mishaps +570 156306 29 abut therefore quelling +571 156501 29 Chippewa Telefunken spiritual A +572 158001 29 stratifications salvaging beguiles FAS +573 158002 29 signaled Corinthianizes Trobriand FAS +574 158101 29 Italianizes restlessly fleeing A +575 158102 29 algorithmic bromides Armour A +576 158103 29 paranoid generalized chin A +577 158201 29 camping mishaps provers A +578 158202 29 signifying quelling aeronautic A +579 158203 29 Patrice spiritual voltage W +580 158204 29 search beguiles sash +581 158301 29 Angeles Trobriand anaerobic A +582 158302 29 semblance fleeing simultaneous A +583 158303 29 taxed Armour accumulating A +584 158304 29 Beatrice chin Medusan A +585 158305 29 retrace provers shouted A +586 158306 29 lockout aeronautic freakish +587 158501 29 grammatic voltage index FAS +588 160301 29 helmsman sash commercially +589 166101 50 uniform anaerobic mistiness A +590 166102 50 hamming simultaneous endpoint +591 168001 29 disobedience accumulating straight A +592 168002 29 captivated Medusan flurried +593 168003 29 transferals shouted denotative A +594 168101 29 cartographer freakish coming FAS +595 168102 29 aims index commencements FAS +596 168103 29 Pakistani commercially gentleman +597 168104 29 burglarized mistiness gifted +598 168202 29 saucepans endpoint Shanghais +599 168301 29 lacerating straight sportswriting A +600 168502 29 corny flurried sloping A +601 168503 29 megabytes denotative navies +602 168601 29 chancellor coming leaflet A +603 173001 40 bulk commencements shooter +604 173701 40 commits gentleman Joplin FAS +605 173702 40 meson gifted babies +606 176001 40 deputies Shanghais subdivision FAS +607 176101 40 northeaster sportswriting burstiness W +608 176201 40 dipole sloping belted FAS +609 176401 40 machining navies assails FAS +610 176501 40 therefore leaflet admiring W +611 176601 40 Telefunken shooter swaying 0 +612 176602 40 salvaging Joplin Goldstine FAS +613 176603 40 Corinthianizes babies fitting +614 178001 40 restlessly subdivision Norwalk W +615 178002 40 bromides burstiness weakening W +616 178003 40 generalized belted analogy FAS +617 178004 40 mishaps assails deludes +618 178005 40 quelling admiring cokes +619 178006 40 spiritual swaying Clayton +620 178007 40 beguiles Goldstine exhausts +621 178008 40 Trobriand fitting causality +622 178101 40 fleeing Norwalk sating FAS +623 178102 40 Armour weakening icon +624 178103 40 chin analogy throttles +625 178201 40 provers deludes communicants FAS +626 178202 40 aeronautic cokes dehydrate FAS +627 178301 40 voltage Clayton priceless FAS +628 178302 40 sash exhausts publicly +629 178401 40 anaerobic causality incidentals FAS +630 178402 40 simultaneous sating commonplace +631 178403 40 accumulating icon mumbles +632 178404 40 Medusan throttles furthermore W +633 178501 40 shouted communicants cautioned W +634 186002 37 freakish dehydrate parametrized A +635 186102 37 index priceless registration A +636 186201 40 commercially publicly sadly FAS +637 186202 40 mistiness incidentals positioning +638 186203 40 endpoint commonplace babysitting +639 186302 37 straight mumbles eternal A +640 188007 37 flurried furthermore hoarder +641 188008 37 denotative cautioned congregates +642 188009 37 coming parametrized rains +643 188010 37 commencements registration workers W +644 188011 37 gentleman sadly sags A +645 188012 37 gifted positioning unplug W +646 188013 37 Shanghais babysitting garage A +647 188014 37 sportswriting eternal boulder A +648 188015 37 sloping hoarder hollowly A +649 188016 37 navies congregates specifics +650 188017 37 leaflet rains Teresa +651 188102 37 shooter workers Winsett +652 188103 37 Joplin sags convenient A +653 188202 37 babies unplug buckboards FAS +654 188301 40 subdivision garage amenities +655 188302 40 burstiness boulder resplendent FAS +656 188303 40 belted hollowly priding FAS +657 188401 37 assails specifics configurations +658 188402 37 admiring Teresa untidiness A +659 188503 37 swaying Winsett Brice W +660 188504 37 Goldstine convenient sews FAS +661 188505 37 fitting buckboards participated +662 190701 37 Norwalk amenities Simon FAS +663 190703 50 weakening resplendent certificates +664 191701 37 analogy priding Fitzpatrick +665 191702 37 deludes configurations Evanston A +666 191703 37 cokes untidiness misted +667 196001 37 Clayton Brice textures A +668 196002 37 exhausts sews save +669 196003 37 causality participated count +670 196101 37 sating Simon rightful A +671 196103 37 icon certificates chaperone +672 196104 37 throttles Fitzpatrick Lizzy A +673 196201 37 communicants Evanston clenched A +674 196202 37 dehydrate misted effortlessly +675 196203 37 priceless textures accessed +676 198001 37 publicly save beaters A +677 198003 37 incidentals count Hornblower FAS +678 198004 37 commonplace rightful vests A +679 198005 37 mumbles chaperone indulgences FAS +680 198006 37 furthermore Lizzy infallibly A +681 198007 37 cautioned clenched unwilling FAS +682 198008 37 parametrized effortlessly excrete FAS +683 198009 37 registration accessed spools A +684 198010 37 sadly beaters crunches FAS +685 198011 37 positioning Hornblower overestimating FAS +686 198012 37 babysitting vests ineffective +687 198013 37 eternal indulgences humiliation A +688 198014 37 hoarder infallibly sophomore +689 198015 37 congregates unwilling star +690 198017 37 rains excrete rifles +691 198018 37 workers spools dialysis +692 198019 37 sags crunches arriving +693 198020 37 unplug overestimating indulge +694 198021 37 garage ineffective clockers +695 198022 37 boulder humiliation languages +696 198023 50 hollowly sophomore Antarctica A +697 198024 37 specifics star percentage +698 198101 37 Teresa rifles ceiling A +699 198103 37 Winsett dialysis specification +700 198105 37 convenient arriving regimented A +701 198106 37 buckboards indulge ciphers +702 198201 37 amenities clockers pictures A +703 198204 37 resplendent languages serpents A +704 198301 53 priding Antarctica allot A +705 198302 53 configurations percentage realized A +706 198303 53 untidiness ceiling mayoral A +707 198304 53 Brice specification opaquely A +708 198401 37 sews regimented hostess FAS +709 198402 37 participated ciphers fiftieth +710 198403 37 Simon pictures incorrectly +711 202101 37 certificates serpents decomposition FAS +712 202301 37 Fitzpatrick allot stranglings +713 202302 37 Evanston realized mixture FAS +714 202303 37 misted mayoral electroencephalography FAS +715 202304 37 textures opaquely similarities FAS +716 202305 37 save hostess charges W +717 202601 37 count fiftieth freest FAS +718 202602 37 rightful incorrectly Greenberg FAS +719 202605 37 chaperone decomposition tinting +720 202606 37 Lizzy stranglings expelled W +721 202607 37 clenched mixture warm +722 202901 37 effortlessly electroencephalography smoothed +723 202902 37 accessed similarities deductions FAS +724 202903 37 beaters charges Romano W +725 202904 37 Hornblower freest bitterroot +726 202907 37 vests Greenberg corset +727 202908 37 indulgences tinting securing +728 203101 37 infallibly expelled environing FAS +729 203103 37 unwilling warm cute +730 203104 37 excrete smoothed Crays +731 203105 37 spools deductions heiress FAS +732 203401 37 crunches Romano inform FAS +733 203402 37 overestimating bitterroot avenge +734 203404 37 ineffective corset universals +735 203901 37 humiliation securing Kinsey W +736 203902 37 sophomore environing ravines FAS +737 203903 37 star cute bestseller +738 203906 37 rifles Crays equilibrium +739 203907 37 dialysis heiress extents 0 +740 203908 37 arriving inform relatively +741 203909 37 indulge avenge pressure FAS +742 206101 37 clockers universals critiques FAS +743 206201 37 languages Kinsey befouled +744 206202 37 Antarctica ravines rightfully FAS +745 206203 37 percentage bestseller mechanizing FAS +746 206206 37 ceiling equilibrium Latinizes +747 206207 37 specification extents timesharing +748 206208 37 regimented relatively Aden +749 208001 37 ciphers pressure embassies +750 208002 37 pictures critiques males FAS +751 208003 37 serpents befouled shapelessly FAS +752 208004 37 allot rightfully genres FAS +753 208008 37 realized mechanizing mastering +754 208009 37 mayoral Latinizes Newtonian +755 208010 37 opaquely timesharing finishers FAS +756 208011 37 hostess Aden abates +757 208101 37 fiftieth embassies teem +758 208102 37 incorrectly males kiting FAS +759 208103 37 decomposition shapelessly stodgy FAS +760 208104 37 stranglings genres scalps FAS +761 208105 37 mixture mastering feed FAS +762 208110 37 electroencephalography Newtonian guitars +763 208111 37 similarities finishers airships +764 208112 37 charges abates store +765 208113 37 freest teem denounces +766 208201 37 Greenberg kiting Pyle FAS +767 208203 37 tinting stodgy Saxony +768 208301 37 expelled scalps serializations FAS +769 208302 37 warm feed Peruvian FAS +770 208305 37 smoothed guitars taxonomically FAS +771 208401 37 deductions airships kingdom A +772 208402 37 Romano store stint A +773 208403 37 bitterroot denounces Sault A +774 208404 37 corset Pyle faithful +775 208501 37 securing Saxony Ganymede FAS +776 208502 37 environing serializations tidiness FAS +777 208503 37 cute Peruvian gainful FAS +778 208504 37 Crays taxonomically contrary FAS +779 208505 37 heiress kingdom Tipperary FAS +780 210101 37 inform stint tropics W +781 210102 37 avenge Sault theorizers +782 210103 37 universals faithful renew 0 +783 210104 37 Kinsey Ganymede already +784 210105 37 ravines tidiness terminal +785 210106 37 bestseller gainful Hegelian +786 210107 37 equilibrium contrary hypothesizer +787 210401 37 extents Tipperary warningly FAS +788 213201 37 relatively tropics journalizing FAS +789 213203 37 pressure theorizers nested +790 213204 37 critiques renew Lars +791 213205 37 befouled already saplings +792 213206 37 rightfully terminal foothill +793 213207 37 mechanizing Hegelian labeled +794 216101 37 Latinizes hypothesizer imperiously FAS +795 216103 37 timesharing warningly reporters FAS +796 218001 37 Aden journalizing furnishings FAS +797 218002 37 embassies nested precipitable FAS +798 218003 37 males Lars discounts FAS +799 218004 37 shapelessly saplings excises FAS +800 143503 50 genres foothill Stalin +801 218006 37 mastering labeled despot FAS +802 218007 37 Newtonian imperiously ripeness FAS +803 218008 37 finishers reporters Arabia +804 218009 37 abates furnishings unruly +805 218010 37 teem precipitable mournfulness +806 218011 37 kiting discounts boom FAS +807 218020 37 stodgy excises slaughter A +808 218021 50 scalps Stalin Sabine +809 218022 37 feed despot handy FAS +810 218023 37 guitars ripeness rural +811 218024 37 airships Arabia organizer +812 218101 37 store unruly shipyard FAS +813 218102 37 denounces mournfulness civics FAS +814 218103 37 Pyle boom inaccuracy FAS +815 218201 37 Saxony slaughter rules FAS +816 218202 37 serializations Sabine juveniles FAS +817 218203 37 Peruvian handy comprised W +818 218204 37 taxonomically rural investigations +819 218205 37 kingdom organizer stabilizes A +820 218301 37 stint shipyard seminaries FAS +821 218302 37 Sault civics Hunter A +822 218401 37 faithful inaccuracy sporty FAS +823 218402 37 Ganymede rules test FAS +824 218403 37 tidiness juveniles weasels +825 218404 37 gainful comprised CERN +826 218407 37 contrary investigations tempering +827 218408 37 Tipperary stabilizes afore FAS +828 218409 37 tropics seminaries Galatean +829 218410 37 theorizers Hunter techniques W +830 226001 37 renew sporty error +831 226002 37 already test veranda +832 226003 37 terminal weasels severely +833 226004 37 Hegelian CERN Cassites FAS +834 226005 37 hypothesizer tempering forthcoming +835 226006 37 warningly afore guides +836 226007 37 journalizing Galatean vanish FAS +837 226008 37 nested techniques lied A +838 226203 37 Lars error sawtooth FAS +839 226204 37 saplings veranda fated FAS +840 226205 37 foothill severely gradually +841 226206 37 labeled Cassites widens +842 226207 37 imperiously forthcoming preclude +843 226208 37 reporters guides Jobrel +844 226209 37 furnishings vanish hooker +845 226210 37 precipitable lied rainstorm +846 226211 37 discounts sawtooth disconnects +847 228001 37 excises fated cruelty +848 228004 37 Stalin gradually exponentials A +849 228005 37 despot widens affective A +850 228006 37 ripeness preclude arteries +851 228007 37 Arabia Jobrel Crosby FAS +852 228008 37 unruly hooker acquaint +853 228009 37 mournfulness rainstorm evenhandedly +854 228101 37 boom disconnects percentage +855 228108 37 slaughter cruelty disobedience +856 228109 37 Sabine exponentials humility +857 228110 37 handy affective gleaning A +858 228111 37 rural arteries petted A +859 228112 37 organizer Crosby bloater A +860 228113 37 shipyard acquaint minion A +861 228114 37 civics evenhandedly marginal A +862 228115 37 inaccuracy percentage apiary A +863 228116 37 rules disobedience measures +864 228117 37 juveniles humility precaution +865 228118 37 comprised gleaning repelled +866 228119 37 investigations petted primary FAS +867 228120 37 stabilizes bloater coverings +868 228121 37 seminaries minion Artemia A +869 228122 37 Hunter marginal navigate +870 228201 37 sporty apiary spatial +871 228206 37 test measures Gurkha +872 228207 37 weasels precaution meanwhile A +873 228208 37 CERN repelled Melinda A +874 228209 37 tempering primary Butterfield +875 228210 37 afore coverings Aldrich A +876 228211 37 Galatean Artemia previewing A +877 228212 37 techniques navigate glut A +878 228213 37 error spatial unaffected +879 228214 37 veranda Gurkha inmate +880 228301 37 severely meanwhile mineral +881 228305 37 Cassites Melinda impending A +882 228306 37 forthcoming Butterfield meditation A +883 228307 37 guides Aldrich ideas +884 228308 37 vanish previewing miniaturizes W +885 228309 37 lied glut lewdly +886 228310 37 sawtooth unaffected title +887 228311 37 fated inmate youthfulness +888 228312 37 gradually mineral creak FAS +889 228313 37 widens impending Chippewa +890 228314 37 preclude meditation clamored +891 228401 65 Jobrel ideas freezes +892 228402 65 hooker miniaturizes forgivably FAS +893 228403 65 rainstorm lewdly reduce FAS +894 228404 65 disconnects title McGovern W +895 228405 65 cruelty youthfulness Nazis W +896 228406 65 exponentials creak epistle W +897 228407 65 affective Chippewa socializes W +898 228408 65 arteries clamored conceptions +899 228409 65 Crosby freezes Kevin +900 228410 65 acquaint forgivably uncovering +901 230301 37 evenhandedly reduce chews FAS +902 230302 37 percentage McGovern appendixes FAS +903 230303 37 disobedience Nazis raining +904 018062 37 humility epistle infest +905 230501 37 gleaning socializes compartment +906 230502 37 petted conceptions minting +907 230503 37 bloater Kevin ducks +908 230504 37 minion uncovering roped A +909 230505 37 marginal chews waltz +910 230506 37 apiary appendixes Lillian +911 230507 37 measures raining repressions A +912 230508 37 precaution infest chillingly +913 230509 37 repelled compartment noncritical +914 230901 37 primary minting lithograph +915 230902 37 coverings ducks spongers +916 230903 37 Artemia roped parenthood +917 230904 37 navigate waltz posed +918 230905 37 spatial Lillian instruments +919 230906 37 Gurkha repressions filial +920 230907 37 meanwhile chillingly fixedly +921 230908 37 Melinda noncritical relives +922 230909 37 Butterfield lithograph Pandora +923 230910 37 Aldrich spongers watering A +924 230911 37 previewing parenthood ungrateful +925 230912 37 glut posed secures +926 230913 37 unaffected instruments chastisers +927 230914 37 inmate filial icon +928 231304 37 mineral fixedly reuniting A +929 231305 37 impending relives imagining A +930 231306 37 meditation Pandora abiding A +931 231307 37 ideas watering omnisciently +932 231308 37 miniaturizes ungrateful Britannic +933 231309 37 lewdly secures scholastics A +934 231310 37 title chastisers mechanics A +935 231311 37 youthfulness icon humidly A +936 231312 37 creak reuniting masterpiece +937 231313 37 Chippewa imagining however +938 231314 37 clamored abiding Mendelian +939 231315 37 freezes omnisciently jarred +940 232102 37 forgivably Britannic scolds +941 232103 37 reduce scholastics infatuate +942 232104 37 McGovern mechanics willed A +943 232105 37 Nazis humidly joyfully +944 232106 37 epistle masterpiece Microsoft +945 232107 37 socializes however fibrosities +946 232108 37 conceptions Mendelian Baltimorean +947 232601 37 Kevin jarred equestrian +948 232602 37 uncovering scolds Goodrich +949 232603 37 chews infatuate apish A +950 232605 37 appendixes willed Adlerian +5950 1232605 37 appendixes willed Adlerian +5951 1232606 37 appendixes willed Adlerian +5952 1232607 37 appendixes willed Adlerian +5953 1232608 37 appendixes willed Adlerian +5954 1232609 37 appendixes willed Adlerian +951 232606 37 raining joyfully Tropez +952 232607 37 infest Microsoft nouns +953 232608 37 compartment fibrosities distracting +954 232609 37 minting Baltimorean mutton +955 236104 37 ducks equestrian bridgeable A +956 236105 37 roped Goodrich stickers A +957 236106 37 waltz apish transcontinental A +958 236107 37 Lillian Adlerian amateurish +959 236108 37 repressions Tropez Gandhian +960 236109 37 chillingly nouns stratified +961 236110 37 noncritical distracting chamberlains +962 236111 37 lithograph mutton creditably +963 236112 37 spongers bridgeable philosophic +964 236113 37 parenthood stickers ores +965 238005 37 posed transcontinental Carleton +966 238006 37 instruments amateurish tape A +967 238007 37 filial Gandhian afloat A +968 238008 37 fixedly stratified goodness A +969 238009 37 relives chamberlains welcoming +970 238010 37 Pandora creditably Pinsky FAS +971 238011 37 watering philosophic halting +972 238012 37 ungrateful ores bibliography +973 238013 37 secures Carleton decoding +974 240401 41 chastisers tape variance A +975 240402 41 icon afloat allowed A +976 240901 41 reuniting goodness dire A +977 240902 41 imagining welcoming dub A +978 241801 41 abiding Pinsky poisoning +979 242101 41 omnisciently halting Iraqis A +980 242102 41 Britannic bibliography heaving +981 242201 41 scholastics decoding population A +982 242202 41 mechanics variance bomb A +983 242501 41 humidly allowed Majorca A +984 242502 41 masterpiece dire Gershwins +985 246201 41 however dub explorers +986 246202 41 Mendelian poisoning libretto A +987 246203 41 jarred Iraqis occurred +988 246204 41 scolds heaving Lagos +989 246205 41 infatuate population rats +990 246301 41 willed bomb bankruptcies A +991 246302 41 joyfully Majorca crying +992 248001 41 Microsoft Gershwins unexpected +993 248002 41 fibrosities explorers accessed A +994 248003 41 Baltimorean libretto colorful A +995 248004 41 equestrian occurred versatility A +996 248005 41 Goodrich Lagos cosy +997 248006 41 apish rats Darius A +998 248007 41 Adlerian bankruptcies mastering A +999 248008 41 Tropez crying Asiaticizations A +1000 248009 41 nouns unexpected offerers A +1001 248010 41 distracting accessed uncles A +1002 248011 41 mutton colorful sleepwalk +1003 248012 41 bridgeable versatility Ernestine +1004 248013 41 stickers cosy checksumming +1005 248014 41 transcontinental Darius stopped +1006 248015 41 amateurish mastering sicker +1007 248016 41 Gandhian Asiaticizations Italianization +1008 248017 41 stratified offerers alphabetic +1009 248018 41 chamberlains uncles pharmaceutic +1010 248019 41 creditably sleepwalk creator +1011 248020 41 philosophic Ernestine chess +1012 248021 41 ores checksumming charcoal +1013 248101 41 Carleton stopped Epiphany A +1014 248102 41 tape sicker bulldozes A +1015 248201 41 afloat Italianization Pygmalion A +1016 248202 41 goodness alphabetic caressing A +1017 248203 41 welcoming pharmaceutic Palestine A +1018 248204 41 Pinsky creator regimented A +1019 248205 41 halting chess scars A +1020 248206 41 bibliography charcoal realest A +1021 248207 41 decoding Epiphany diffusing A +1022 248208 41 variance bulldozes clubroom A +1023 248209 41 allowed Pygmalion Blythe A +1024 248210 41 dire caressing ahead +1025 248211 50 dub Palestine reviver +1026 250501 34 poisoning regimented retransmitting A +1027 250502 34 Iraqis scars landslide +1028 250503 34 heaving realest Eiffel +1029 250504 34 population diffusing absentee +1030 250505 34 bomb clubroom aye +1031 250601 34 Majorca Blythe forked A +1032 250602 34 Gershwins ahead Peruvianizes +1033 250603 34 explorers reviver clerked +1034 250604 34 libretto retransmitting tutor +1035 250605 34 occurred landslide boulevard +1036 251001 34 Lagos Eiffel shuttered +1037 251002 34 rats absentee quotes A +1038 251003 34 bankruptcies aye Caltech +1039 251004 34 crying forked Mossberg +1040 251005 34 unexpected Peruvianizes kept +1041 251301 34 accessed clerked roundly +1042 251302 34 colorful tutor features A +1043 251303 34 versatility boulevard imaginable A +1044 251304 34 cosy shuttered controller +1045 251305 34 Darius quotes racial +1046 251401 34 mastering Caltech uprisings A +1047 251402 34 Asiaticizations Mossberg narrowed A +1048 251403 34 offerers kept cannot A +1049 251404 34 uncles roundly vest +1050 251405 34 sleepwalk features famine +1051 251406 34 Ernestine imaginable sugars +1052 251801 34 checksumming controller exterminated A +1053 251802 34 stopped racial belays +1054 252101 34 sicker uprisings Hodges A +1055 252102 34 Italianization narrowed translatable +1056 252301 34 alphabetic cannot duality A +1057 252302 34 pharmaceutic vest recording A +1058 252303 34 creator famine rouses A +1059 252304 34 chess sugars poison +1060 252305 34 charcoal exterminated attitude +1061 252306 34 Epiphany belays dusted +1062 252307 34 bulldozes Hodges encompasses +1063 252308 34 Pygmalion translatable presentation +1064 252309 34 caressing duality Kantian +1065 256001 34 Palestine recording imprecision A +1066 256002 34 regimented rouses saving +1067 256003 34 scars poison maternal +1068 256004 34 realest attitude hewed +1069 256005 34 diffusing dusted kerosene +1070 258001 34 clubroom encompasses Cubans +1071 258002 34 Blythe presentation photographers +1072 258003 34 ahead Kantian nymph A +1073 258004 34 reviver imprecision bedlam A +1074 258005 34 retransmitting saving north A +1075 258006 34 landslide maternal Schoenberg A +1076 258007 34 Eiffel hewed botany A +1077 258008 34 absentee kerosene curs +1078 258009 34 aye Cubans solidification +1079 258010 34 forked photographers inheritresses +1080 258011 34 Peruvianizes nymph stiller +1081 258101 68 clerked bedlam t1 A +1082 258102 68 tutor north suite A +1083 258103 34 boulevard Schoenberg ransomer +1084 258104 68 shuttered botany Willy +1085 258105 68 quotes curs Rena A +1086 258106 68 Caltech solidification Seattle A +1087 258107 68 Mossberg inheritresses relaxes A +1088 258108 68 kept stiller exclaim +1089 258109 68 roundly t1 implicated A +1090 258110 68 features suite distinguish +1091 258111 68 imaginable ransomer assayed +1092 258112 68 controller Willy homeowner +1093 258113 68 racial Rena and +1094 258201 34 uprisings Seattle stealth +1095 258202 34 narrowed relaxes coinciding A +1096 258203 34 cannot exclaim founder A +1097 258204 34 vest implicated environing +1098 258205 34 famine distinguish jewelry +1099 258301 34 sugars assayed lemons A +1100 258401 34 exterminated homeowner brokenness A +1101 258402 34 belays and bedpost A +1102 258403 34 Hodges stealth assurers A +1103 258404 34 translatable coinciding annoyers +1104 258405 34 duality founder affixed +1105 258406 34 recording environing warbling +1106 258407 34 rouses jewelry seriously +1107 228123 37 poison lemons boasted +1108 250606 34 attitude brokenness Chantilly +1109 208405 37 dusted bedpost Iranizes +1110 212101 37 encompasses assurers violinist +1111 218206 37 presentation annoyers extramarital +1112 150401 37 Kantian affixed spates +1113 248212 41 imprecision warbling cloakroom +1114 128026 00 saving seriously gazer +1115 128024 00 maternal boasted hand +1116 128027 00 hewed Chantilly tucked +1117 128025 00 kerosene Iranizes gems +1118 128109 00 Cubans violinist clinker +1119 128705 00 photographers extramarital refiner +1120 126303 00 nymph spates callus +1121 128308 00 bedlam cloakroom leopards +1122 128204 00 north gazer comfortingly +1123 128205 00 Schoenberg hand generically +1124 128206 00 botany tucked getters +1125 128207 00 curs gems sexually +1126 118205 00 solidification clinker spear +1127 116801 00 inheritresses refiner serums +1128 116803 00 stiller callus Italianization +1129 116804 00 t1 leopards attendants +1130 116802 00 suite comfortingly spies +1131 128605 00 ransomer generically Anthony +1132 118308 00 Willy getters planar +1133 113702 00 Rena sexually cupped +1134 113703 00 Seattle spear cleanser +1135 112103 00 relaxes serums commuters +1136 118009 00 exclaim Italianization honeysuckle +5136 1118009 00 exclaim Italianization honeysuckle +1137 138011 00 implicated attendants orphanage +1138 138010 00 distinguish spies skies +1139 138012 00 assayed Anthony crushers +1140 068304 00 homeowner planar Puritan +1141 078009 00 and cupped squeezer +1142 108013 00 stealth cleanser bruises +1143 084004 00 coinciding commuters bonfire +1144 083402 00 founder honeysuckle Colombo +1145 084003 00 environing orphanage nondecreasing +1146 088504 00 jewelry skies innocents +1147 088005 00 lemons crushers masked +1148 088007 00 brokenness Puritan file +1149 088006 00 bedpost squeezer brush +1150 148025 00 assurers bruises mutilate +1151 148024 00 annoyers bonfire mommy +1152 138305 00 affixed Colombo bulkheads +1153 138306 00 warbling nondecreasing undeclared +1154 152701 00 seriously innocents displacements +1155 148505 00 boasted masked nieces +1156 158003 00 Chantilly file coeducation +1157 156201 00 Iranizes brush brassy +1158 156202 00 violinist mutilate authenticator +1159 158307 00 extramarital mommy Washoe +1160 158402 00 spates bulkheads penny +1161 158401 00 cloakroom undeclared Flagler +1162 068013 00 gazer displacements stoned +1163 068012 00 hand nieces cranes +1164 068203 00 tucked coeducation masterful +1165 088205 00 gems brassy biracial +1166 068704 00 clinker authenticator steamships +1167 068604 00 refiner Washoe windmills +1168 158502 00 callus penny exploit +1169 123103 00 leopards Flagler riverfront +1170 148026 00 comfortingly stoned sisterly +1171 123302 00 generically cranes sharpshoot +1172 076503 00 getters masterful mittens +1173 126304 00 sexually biracial interdependency +1174 068306 00 spear steamships policy +1175 143504 00 serums windmills unleashing +1176 160201 00 Italianization exploit pretenders +1177 148028 00 attendants riverfront overstatements +1178 148027 00 spies sisterly birthed +1179 143505 00 Anthony sharpshoot opportunism +1180 108014 00 planar mittens showroom +1181 076104 00 cupped interdependency compromisingly +1182 078106 00 cleanser policy Medicare +1183 126102 00 commuters unleashing corresponds +1184 128029 00 honeysuckle pretenders hardware +1185 128028 00 orphanage overstatements implant +1186 018410 00 skies birthed Alicia +1187 128110 00 crushers opportunism requesting +1188 148506 00 Puritan showroom produced +1189 123303 00 squeezer compromisingly criticizes +1190 123304 00 bruises Medicare backer +1191 068504 00 bonfire corresponds positively +1192 068305 00 Colombo hardware colicky +1193 000000 00 nondecreasing implant thrillingly +1 000001 00 Omaha teethe neat +2 011401 37 breaking dreaded Steinberg W +3 011402 37 Romans scholastics jarring +4 011403 37 intercepted audiology tinily +drop table t1, t2; diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 2d6b058d9c5..f5ec5f1f852 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -1,5 +1,7 @@ drop table if exists t1; -create table t1 (a int not null auto_increment,b int, primary key (a)) type=myisam auto_increment=3; +drop table if exists t2; +SET SQL_WARNINGS=1; +create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3; insert into t1 values (1,1),(NULL,3),(NULL,4); delete from t1 where a=4; insert into t1 values (NULL,5),(NULL,6); @@ -118,7 +120,7 @@ a 1 2 drop table t1; -create table t1 (a int not null auto_increment primary key) /*!40102 type=heap */; +create table t1 (a int not null auto_increment primary key) /*!40102 engine=heap */; insert into t1 values (NULL); insert into t1 values (-1); select last_insert_id(); @@ -127,7 +129,163 @@ last_insert_id() insert into t1 values (NULL); select * from t1; a +1 -1 +2 +drop table t1; +create table t1 (i tinyint unsigned not null auto_increment primary key); +insert into t1 set i = 254; +insert into t1 set i = null; +select last_insert_id(); +last_insert_id() +255 +explain extended select last_insert_id(); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache last_insert_id() AS `last_insert_id()` +insert into t1 set i = 254; +ERROR 23000: Duplicate entry '254' for key 1 +select last_insert_id(); +last_insert_id() +255 +insert into t1 set i = null; +ERROR 23000: Duplicate entry '255' for key 1 +select last_insert_id(); +last_insert_id() +0 +drop table t1; +create table t1 (i tinyint unsigned not null auto_increment, key (i)); +insert into t1 set i = 254; +insert into t1 set i = null; +select last_insert_id(); +last_insert_id() +255 +insert into t1 set i = null; +Warnings: +Warning 1264 Data truncated; out of range for column 'i' at row 1 +select last_insert_id(); +last_insert_id() +255 +drop table t1; +create table t1 (i tinyint unsigned not null auto_increment primary key, b int, unique (b)); +insert into t1 values (NULL, 10); +select last_insert_id(); +last_insert_id() 1 +insert into t1 values (NULL, 15); +select last_insert_id(); +last_insert_id() 2 +insert into t1 values (NULL, 10); +ERROR 23000: Duplicate entry '10' for key 2 +select last_insert_id(); +last_insert_id() +0 +drop table t1; +create table t1(a int auto_increment,b int null,primary key(a)); +SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; +insert into t1(a,b)values(NULL,1); +insert into t1(a,b)values(200,2); +insert into t1(a,b)values(0,3); +insert into t1(b)values(4); +insert into t1(b)values(5); +insert into t1(b)values(6); +insert into t1(b)values(7); +select * from t1 order by b; +a b +1 1 +200 2 +0 3 +201 4 +202 5 +203 6 +204 7 +alter table t1 modify b mediumint; +select * from t1 order by b; +a b +1 1 +200 2 +0 3 +201 4 +202 5 +203 6 +204 7 +create table t2 (a int); +insert t2 values (1),(2); +alter table t2 add b int auto_increment primary key; +select * from t2; +a b +1 1 +2 2 +drop table t2; +delete from t1 where a=0; +update t1 set a=0 where b=5; +select * from t1 order by b; +a b +1 1 +200 2 +201 4 +0 5 +203 6 +204 7 +delete from t1 where a=0; +update t1 set a=NULL where b=6; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4 +update t1 set a=300 where b=7; +SET SQL_MODE=''; +insert into t1(a,b)values(NULL,8); +insert into t1(a,b)values(400,9); +insert into t1(a,b)values(0,10); +insert into t1(b)values(11); +insert into t1(b)values(12); +insert into t1(b)values(13); +insert into t1(b)values(14); +select * from t1 order by b; +a b +1 1 +200 2 +201 4 +0 6 +300 7 +301 8 +400 9 +401 10 +402 11 +403 12 +404 13 +405 14 +delete from t1 where a=0; +update t1 set a=0 where b=12; +select * from t1 order by b; +a b +1 1 +200 2 +201 4 +300 7 +301 8 +400 9 +401 10 +402 11 +0 12 +404 13 +405 14 +delete from t1 where a=0; +update t1 set a=NULL where b=13; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 9 +update t1 set a=500 where b=14; +select * from t1 order by b; +a b +1 1 +200 2 +201 4 +300 7 +301 8 +400 9 +401 10 +402 11 +0 13 +500 14 drop table t1; diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index 0e0a87172f2..e53c3c3eb55 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -1,4 +1,5 @@ set SQL_LOG_BIN=0; +drop table if exists t1, t2, t3; create table t4(n int); backup table t4 to '../bogus'; Table Op Msg_type Msg_text diff --git a/mysql-test/r/bdb-alter-table-1.result b/mysql-test/r/bdb-alter-table-1.result index 095d89355ad..0401002f1f3 100644 --- a/mysql-test/r/bdb-alter-table-1.result +++ b/mysql-test/r/bdb-alter-table-1.result @@ -1,5 +1,5 @@ drop table if exists t1; -create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) type=BDB; +create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) engine=BDB; insert into t1 values(1, 't1',4,9); insert into t1 values(2, 'metatable',1,9); insert into t1 values(3, 'metaindex',1,9 ); diff --git a/mysql-test/r/bdb-crash.result b/mysql-test/r/bdb-crash.result index 16e51c61504..778890e85e3 100644 --- a/mysql-test/r/bdb-crash.result +++ b/mysql-test/r/bdb-crash.result @@ -14,7 +14,7 @@ ChargeTimeStamp varchar(20), PRIMARY KEY (ChargeID), KEY ServiceID (ServiceID), KEY ChargeDate (ChargeDate) -) type=BDB; +) engine=BDB; BEGIN; INSERT INTO t1 VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now'); diff --git a/mysql-test/r/bdb-deadlock.result b/mysql-test/r/bdb-deadlock.result index 55b3d3ea2a5..9394c90ff00 100644 --- a/mysql-test/r/bdb-deadlock.result +++ b/mysql-test/r/bdb-deadlock.result @@ -1,6 +1,6 @@ drop table if exists t1,t2; -create table t1 (id integer, x integer) type=BDB; -create table t2 (id integer, x integer) type=BDB; +create table t1 (id integer, x integer) engine=BDB; +create table t2 (id integer, x integer) engine=BDB; insert into t1 values(0, 0); insert into t2 values(0, 0); set autocommit=0; @@ -9,7 +9,7 @@ set autocommit=0; update t2 set x = 1 where id = 0; select x from t1 where id = 0; select x from t2 where id = 0; -Deadlock found when trying to get lock; Try restarting transaction +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction commit; x 1 diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 684efc3ef1b..25118702d09 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1,5 +1,5 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8; -create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=bdb; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=bdb; insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); select id, code, name from t1 order by id; id code name @@ -38,7 +38,7 @@ level tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY parent_id (parent_id), KEY level (level) -) type=bdb; +) engine=bdb; INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2); update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; @@ -48,7 +48,7 @@ id parent_id level 15 102 2 update t1 set id=id+1000; update t1 set id=1024 where id=1009; -Duplicate entry '1024' for key 1 +ERROR 23000: Duplicate entry '1024' for key 1 select * from t1; id parent_id level 1001 100 0 @@ -139,14 +139,14 @@ id parent_id level 1010 102 2 1015 102 2 explain select level from t1 where level=1; -table type possible_keys key key_len ref rows Extra -t1 ref level level 1 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const 1 Using where; Using index explain select level,id from t1 where level=1; -table type possible_keys key key_len ref rows Extra -t1 ref level level 1 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const 1 Using where; Using index explain select level,id,parent_id from t1 where level=1; -table type possible_keys key key_len ref rows Extra -t1 ref level level 1 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const 1 Using where select level,id from t1 where level=1; level id 1 1002 @@ -176,7 +176,7 @@ CREATE TABLE t1 ( gesuchnr int(11) DEFAULT '0' NOT NULL, benutzer_id int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (gesuchnr,benutzer_id) -) type=BDB; +) engine=BDB; replace into t1 (gesuchnr,benutzer_id) values (2,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); @@ -185,14 +185,14 @@ gesuchnr benutzer_id 1 1 2 1 drop table t1; -create table t1 (id int not null primary key, x int not null, key (x)) type=bdb; +create table t1 (id int not null primary key, x int not null, key (x)) engine=bdb; insert into t1 (id, x) values (1, 1); replace into t1 (id, x) values (1, 2); select * from t1; id x 1 2 drop table t1; -create table t1 (a int) type=bdb; +create table t1 (a int) engine=bdb; insert into t1 values (1), (2); optimize table t1; Table Op Msg_type Msg_text @@ -203,9 +203,9 @@ a 2 check table t1; Table Op Msg_type Msg_text -test.t1 check error The handler for the table doesn't support check +test.t1 check note The storage engine for the table doesn't support check drop table t1; -create table t1 (a int,b varchar(20)) type=bdb; +create table t1 (a int,b varchar(20)) engine=bdb; insert into t1 values (1,""), (2,"testing"); delete from t1 where a = 1; select * from t1; @@ -220,13 +220,13 @@ show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 skr 1 a A 3 NULL NULL YES BTREE drop table t1; -create table t1 (a int,b varchar(20),key(a)) type=bdb; +create table t1 (a int,b varchar(20),key(a)) engine=bdb; insert into t1 values (1,""), (2,"testing"); select * from t1 where a = 1; a b 1 drop table t1; -create table t1 (a char(10) not null, b int not null auto_increment, primary key(a,b)) type=BDB; +create table t1 (a char(10) not null, b int not null auto_increment, primary key(a,b)) engine=BDB; insert into t1 values ("a",1),("b",2),("a",2),("c",1); insert into t1 values ("a",NULL),("b",NULL),("c",NULL),("e",NULL); insert into t1 (a) values ("a"),("b"),("c"),("d"); @@ -256,7 +256,7 @@ select count(*) from t1; count(*) 16 drop table t1; -create table t1 (n int not null primary key) type=bdb; +create table t1 (n int not null primary key) engine=bdb; set autocommit=0; insert into t1 values (4); rollback; @@ -270,7 +270,7 @@ n after commit commit; insert into t1 values (5); insert into t1 values (4); -Duplicate entry '4' for key 1 +ERROR 23000: Duplicate entry '4' for key 1 commit; select n, "after commit" from t1; n after commit @@ -279,7 +279,7 @@ n after commit set autocommit=1; insert into t1 values (6); insert into t1 values (4); -Duplicate entry '4' for key 1 +ERROR 23000: Duplicate entry '4' for key 1 select n from t1; n 4 @@ -287,7 +287,7 @@ n 6 rollback; drop table t1; -create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=BDB; +create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=BDB; begin; insert into t1 values(1,'hamdouni'); select id as afterbegin_id,nom as afterbegin_nom from t1; @@ -306,10 +306,10 @@ select id as afterrollback_id,nom as afterrollback_nom from t1; afterrollback_id afterrollback_nom set autocommit=1; drop table t1; -CREATE TABLE t1 (id char(8) not null primary key, val int not null) type=bdb; +CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=bdb; insert into t1 values ('pippo', 12); insert into t1 values ('pippo', 12); -Duplicate entry 'pippo' for key 1 +ERROR 23000: Duplicate entry 'pippo' for key 1 delete from t1; delete from t1 where id = 'pippo'; select * from t1; @@ -327,13 +327,13 @@ select * from t1; id val drop table t1; set autocommit=1; -CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) TYPE=BDB; +CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=BDB; INSERT INTO t1 VALUES (1, 'Jochen'); select * from t1; ID NAME 1 Jochen drop table t1; -CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) TYPE=BDB; +CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=BDB; set autocommit=0; INSERT INTO t1 SET _userid='marc@anyware.co.uk'; COMMIT; @@ -352,7 +352,7 @@ phone varchar(100), ref_email varchar(100) DEFAULT '' NOT NULL, detail varchar(200), PRIMARY KEY (user_id,ref_email) -)type=bdb; +)engine=bdb; INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar'); select * from t1 where user_id=10292; user_id name phone ref_email detail @@ -390,7 +390,7 @@ t1 1 a 1 a A NULL NULL NULL BTREE t1 1 a_2 1 a A NULL NULL NULL BTREE drop table t1; create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); -alter table t1 type=BDB; +alter table t1 engine=BDB; insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4'); select * from t1; col1 col2 @@ -424,8 +424,8 @@ col1 col2 co3 4 7 0 5 2 0 drop table t1; -create table t1 (a int not null , b int, primary key (a)) type = BDB; -create table t2 (a int not null , b int, primary key (a)) type = myisam; +create table t1 (a int not null , b int, primary key (a)) engine = BDB; +create table t2 (a int not null , b int, primary key (a)) engine = myisam; insert into t1 VALUES (1,3) , (2,3), (3,3); select * from t1; a b @@ -460,13 +460,13 @@ email varchar(64) DEFAULT '' NOT NULL, passwd varchar(32) binary DEFAULT '' NOT NULL, PRIMARY KEY (id), UNIQUE ggid (ggid) -) TYPE=BDB; +) ENGINE=BDB; insert into t1 (ggid,passwd) values ('test1','xxx'); insert into t1 (ggid,passwd) values ('test2','yyy'); insert into t1 (ggid,passwd) values ('test2','this will fail'); -Duplicate entry 'test2' for key 2 +ERROR 23000: Duplicate entry 'test2' for key 2 insert into t1 (ggid,id) values ('this will fail',1); -Duplicate entry '1' for key 1 +ERROR 23000: Duplicate entry '1' for key 1 select * from t1 where ggid='test1'; id ggid email passwd 1 test1 xxx @@ -479,7 +479,7 @@ id ggid email passwd replace into t1 (ggid,id) values ('this will work',1); replace into t1 (ggid,passwd) values ('test2','this will work'); update t1 set id=100,ggid='test2' where id=1; -Duplicate entry 'test2' for key 2 +ERROR 23000: Duplicate entry 'test2' for key 2 select * from t1; id ggid email passwd 1 this will work @@ -502,7 +502,7 @@ access_time time, approved datetime, dummy_primary_key int(11) NOT NULL auto_increment, PRIMARY KEY (dummy_primary_key) -) TYPE=BDB; +) ENGINE=BDB; INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1); INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2); INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3); @@ -523,7 +523,7 @@ level tinyint(4) DEFAULT '0' NOT NULL, KEY (id), KEY parent_id (parent_id), KEY level (level) -) type=bdb; +) engine=bdb; INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1); INSERT INTO t1 values (179,5,2); update t1 set parent_id=parent_id+100; @@ -624,8 +624,8 @@ id parent_id level 1025 102 2 1016 102 2 explain select level from t1 where level=1; -table type possible_keys key key_len ref rows Extra -t1 ref level level 1 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const 1 Using where; Using index select level,id from t1 where level=1; level id 1 1004 @@ -697,7 +697,7 @@ sca_sdesc varchar(50), sca_sch_desc varchar(16), PRIMARY KEY (sca_code, cat_code, lan_code), INDEX sca_pic (sca_pic) -) type = bdb ; +) engine = bdb ; INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING'); select count(*) from t1 where sca_code = 'PD'; count(*) @@ -730,7 +730,7 @@ update t1 set sca_pic="test" where sca_pic is null; delete from t1 where sca_code='pd'; drop table t1; set @a:=now(); -CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) type=bdb; +CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=bdb; insert into t1 (a) values(1),(2),(3); select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a; a @@ -745,7 +745,7 @@ a 5 drop table t1; flush logs; -create table t1 (b blob, i int, key (b(100)), key (i), key (i, b(20))) type=bdb; +create table t1 (b blob, i int, key (b(100)), key (i), key (i, b(20))) engine=bdb; insert into t1 values ('this is a blob', 1), (null, -1), (null, null),("",1),("",2),("",3); select b from t1 where b = 'this is a blob'; b @@ -774,7 +774,7 @@ updated 1 2 3 drop table t1; -create table t1 (a varchar(100) not null, primary key(a), b int not null) type=bdb; +create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=bdb; insert into t1 values("hello",1),("world",2); select * from t1 order by b desc; a b @@ -787,7 +787,7 @@ show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 a A 2 NULL NULL BTREE drop table t1; -create table t1 (i int, j int )TYPE=BDB; +create table t1 (i int, j int )ENGINE=BDB; insert into t1 values (1,2); select * from t1 where i=1 and j=2; i j @@ -797,7 +797,6 @@ select * from t1 where i=1 and j=2; i j 1 2 drop table t1; -drop table if exists t1, t2, t3, t4, t5, t6, t7; create table t1 ( branch_id int auto_increment primary key, @@ -805,8 +804,7 @@ branch_name varchar(255) not null, branch_active int not null default 1, unique branch_name(branch_name), index branch_active(branch_active) -) type=bdb; -drop table if exists t2 ; +) engine=bdb; create table t2 ( target_id int auto_increment primary key, @@ -814,8 +812,7 @@ target_name varchar(255) not null, target_active int not null default 1, unique target_name(target_name), index target_active(target_active) -) type=bdb; -drop table if exists t3 ; +) engine=bdb; create table t3 ( platform_id int auto_increment primary key, @@ -823,8 +820,7 @@ platform_name varchar(255) not null, platform_active int not null default 1, unique platform_name(platform_name), index platform_active(platform_active) -) type=bdb; -drop table if exists t4 ; +) engine=bdb; create table t4 ( product_id int auto_increment primary key, @@ -833,8 +829,7 @@ version_file varchar(255) not null, product_active int not null default 1, unique product_name(product_name), index product_active(product_active) -) type=bdb; -drop table if exists t5 ; +) engine=bdb; create table t5 ( product_file_id int auto_increment primary key, @@ -846,8 +841,7 @@ module_name varchar(255) not null, file_included int not null default 1, unique product_file(product_id,file_name), index file_included(file_included) -) type=bdb; -drop table if exists t6 ; +) engine=bdb; create table t6 ( file_platform_id int auto_increment primary key, @@ -859,8 +853,7 @@ build_filename varchar(255) not null, /* default filename in the build archive */ archive_filename varchar(255) not null, unique file_platform(product_file_id,platform_id,branch_id) -) type=bdb; -drop table if exists t8 ; +) engine=bdb; create table t8 ( archive_id int auto_increment primary key, @@ -871,8 +864,7 @@ product_id int not null, status_id int not null default 1, unique archive(branch_id,target_id,platform_id,product_id), index status_id(status_id) -) type=bdb; -drop table if exists t7 ; +) engine=bdb; create table t7 ( build_id int auto_increment primary key, @@ -885,7 +877,7 @@ build_tag varchar(255) not null, /* path relative to the build archive root, e.g. 'current' */ build_path text not null, unique build(branch_id,target_id,build_number) -) type=bdb; +) engine=bdb; insert into t1 (branch_name) values ('RealMedia'); insert into t1 (branch_name) @@ -989,7 +981,7 @@ CREATE TABLE t1 ( a tinytext NOT NULL, b tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (a(32),b) -) TYPE=BDB; +) ENGINE=BDB; INSERT INTO t1 VALUES ('a',1),('a',2); SELECT * FROM t1 WHERE a='a' AND b=2; a b @@ -1006,17 +998,17 @@ CREATE TABLE t1 ( a int3 unsigned NOT NULL, b int1 unsigned NOT NULL, UNIQUE (a, b) -) TYPE = BDB; +) ENGINE = BDB; INSERT INTO t1 VALUES (1, 1); SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; MIN(B) MAX(b) 1 1 drop table t1; -create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=bdb; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; insert into t1 values (99,1,2,'D'),(1,1,2,'D'); -Duplicate entry '1-1' for key 1 +ERROR 23000: Duplicate entry '1-1' for key 1 select id from t1; id 0 @@ -1029,12 +1021,12 @@ id 2 UNLOCK TABLES; DROP TABLE t1; -create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=bdb; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; begin; insert into t1 values (99,1,2,'D'),(1,1,2,'D'); -Duplicate entry '1-1' for key 1 +ERROR 23000: Duplicate entry '1-1' for key 1 select id from t1; id 0 @@ -1050,15 +1042,14 @@ id id3 100 2 UNLOCK TABLES; DROP TABLE t1; -CREATE TABLE t1 (SYAIN_NO char(5) NOT NULL default '', KINMU_DATE char(6) NOT NULL default '', PRIMARY KEY (SYAIN_NO,KINMU_DATE)) TYPE=BerkeleyDB; -CREATE TABLE t2 ( SYAIN_NO char(5) NOT NULL default '',STR_DATE char(8) NOT NULL default '',PRIMARY KEY (SYAIN_NO,STR_DATE) ) TYPE=BerkeleyDB; +CREATE TABLE t1 (SYAIN_NO char(5) NOT NULL default '', KINMU_DATE char(6) NOT NULL default '', PRIMARY KEY (SYAIN_NO,KINMU_DATE)) ENGINE=BerkeleyDB; +CREATE TABLE t2 ( SYAIN_NO char(5) NOT NULL default '',STR_DATE char(8) NOT NULL default '',PRIMARY KEY (SYAIN_NO,STR_DATE) ) ENGINE=BerkeleyDB; select T1.KINMU_DATE from t1 T1 ,t2 T2 where T1.SYAIN_NO = '12345' and T1.KINMU_DATE = '200106' and T2.SYAIN_NO = T1.SYAIN_NO; KINMU_DATE select T1.KINMU_DATE from t1 T1 ,t2 T2 where T1.SYAIN_NO = '12345' and T1.KINMU_DATE = '200106' and T2.SYAIN_NO = T1.SYAIN_NO; KINMU_DATE DROP TABLE t1,t2; -drop table if exists t1; -create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb; +create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) engine=bdb; insert into t1 values (1,1), (1,2); select * from t1 where a = 1; a b @@ -1075,9 +1066,9 @@ a b 1 1 1 2 drop table t1; -create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=bdb; insert into t1 values (0,0,0,'ABCDEFGHIJ'); -create table t2 (id int NOT NULL,primary key (id)) type=bdb; +create table t2 (id int NOT NULL,primary key (id)) engine=bdb; LOCK TABLES t1 WRITE, t2 WRITE; insert into t2 values(1); SELECT t1.* FROM t1 WHERE id IN (1); @@ -1087,13 +1078,13 @@ id id2 id3 dummy1 NULL NULL NULL NULL delete from t1 where id3 >= 0 and id3 <= 0; drop table t1,t2; -CREATE TABLE t1 (i varchar(48) NOT NULL default '', p varchar(255) default NULL,s varchar(48) NOT NULL default '', PRIMARY KEY (i), UNIQUE(p,s)) TYPE=BDB; +CREATE TABLE t1 (i varchar(48) NOT NULL default '', p varchar(255) default NULL,s varchar(48) NOT NULL default '', PRIMARY KEY (i), UNIQUE(p,s)) ENGINE=BDB; INSERT INTO t1 VALUES ('00000000-e6c4ddeaa6-003b8-83458387','programs/xxxxxxxx.wmv','00000000-e6c4ddeb32-003bc-83458387'); SELECT * FROM t1 WHERE p='programs/xxxxxxxx.wmv'; i p s 00000000-e6c4ddeaa6-003b8-83458387 programs/xxxxxxxx.wmv 00000000-e6c4ddeb32-003bc-83458387 drop table t1; -CREATE TABLE t1 ( STR_DATE varchar(8) NOT NULL default '',INFO_NOTE varchar(200) default NULL,PRIMARY KEY (STR_DATE) ) TYPE=BerkeleyDB; +CREATE TABLE t1 ( STR_DATE varchar(8) NOT NULL default '',INFO_NOTE varchar(200) default NULL,PRIMARY KEY (STR_DATE) ) ENGINE=BerkeleyDB; select INFO_NOTE from t1 where STR_DATE = '20010610'; INFO_NOTE select INFO_NOTE from t1 where STR_DATE < '20010610'; @@ -1101,8 +1092,8 @@ INFO_NOTE select INFO_NOTE from t1 where STR_DATE > '20010610'; INFO_NOTE drop table t1; -create table t1 (a int not null, b int, primary key (a)) type =bdb; -create table t2 (a int not null, b int, primary key (a)) type =bdb; +create table t1 (a int not null, b int, primary key (a)) engine =bdb; +create table t2 (a int not null, b int, primary key (a)) engine =bdb; insert into t1 values (2, 3),(1, 7),(10, 7); insert into t2 values (2, 3),(1, 7),(10, 7); select * from t1; @@ -1123,7 +1114,7 @@ a b select * from t2; a b drop table t1,t2; -create table t1 (x int not null, index(x)) type=bdb; +create table t1 (x int not null, index(x)) engine=bdb; insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); select * from t1 where x <= 10 and x >= 7; x @@ -1154,37 +1145,37 @@ x 7 6 drop table t1; -create table t1 ( c char(8) not null ) type=bdb; +create table t1 ( c char(8) not null ) engine=bdb; insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); alter table t1 add b char(8) not null; alter table t1 add a char(8) not null; alter table t1 add primary key (a,b,c); update t1 set a=c, b=c; -create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) type=bdb; +create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=bdb; insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb; insert into t1 values ('a',1),('A',2); explain select a from t1; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 2 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 select a from t1; a a A explain select b from t1; -table type possible_keys key key_len ref rows Extra -t1 index NULL b 4 NULL 2 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL 2 Using index select b from t1; b 1 2 alter table t1 modify a char(10) binary; explain select a from t1; -table type possible_keys key key_len ref rows Extra -t1 index NULL a 11 NULL 2 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 11 NULL 2 Using index select a from t1; a A @@ -1224,3 +1215,39 @@ bb b--b 2 2 ccc c--c 2 2 dddd d--d 2 2 drop table t1; +set autocommit=0; +create table t1(b varchar(30)) engine=bdb; +insert into t1 values ('one'); +commit; +select b FROM t1 outer_table where +exists (select 'two' from t1 where 'two' = outer_table.b); +b +drop table t1; +set autocommit=1; +create table t1(a int primary key, b varchar(30)) engine=bdb; +insert into t1 values (1,'one'), (2,'two'), (3,'three'), (4,'four'); +create table t2 like t1; +insert t2 select * from t1; +select a from t1 where a in (select a from t2); +a +1 +2 +3 +4 +delete from t2; +insert into t2 (a, b) +select a, b from t1 where (a, b) in (select a, b from t1); +select * from t2; +a b +1 one +2 two +3 three +4 four +drop table t1, t2; +create table t1 (a int, b varchar(30), primary key(a)) engine = bdb; +insert into t1 values (1,'one'); +commit; +truncate t1; +select * from t1; +a b +drop table t1; diff --git a/mysql-test/r/bdb_cache.result b/mysql-test/r/bdb_cache.result index e5c6923162a..218fd489c6a 100644 --- a/mysql-test/r/bdb_cache.result +++ b/mysql-test/r/bdb_cache.result @@ -1,7 +1,7 @@ drop table if exists t1, t2, t3; flush status; set autocommit=0; -create table t1 (a int not null) type=bdb; +create table t1 (a int not null) engine=bdb; insert into t1 values (1),(2),(3); select * from t1; a @@ -15,7 +15,7 @@ drop table t1; commit; set autocommit=1; begin; -create table t1 (a int not null) type=bdb; +create table t1 (a int not null) engine=bdb; insert into t1 values (1),(2),(3); select * from t1; a @@ -27,9 +27,9 @@ Variable_name Value Qcache_queries_in_cache 0 drop table t1; commit; -create table t1 (a int not null) type=bdb; -create table t2 (a int not null) type=bdb; -create table t3 (a int not null) type=bdb; +create table t1 (a int not null) engine=bdb; +create table t2 (a int not null) engine=bdb; +create table t3 (a int not null) engine=bdb; insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1),(2); @@ -98,3 +98,4 @@ commit; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 +drop table if exists t1, t2, t3; diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result index d414e8e466e..fcc0c0948b3 100644 --- a/mysql-test/r/bench_count_distinct.result +++ b/mysql-test/r/bench_count_distinct.result @@ -3,4 +3,9 @@ create table t1(n int not null, key(n)) delay_key_write = 1; select count(distinct n) from t1; count(distinct n) 100 +explain extended select count(distinct n) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL n 4 NULL 200 Using index +Warnings: +Note 1003 select count(distinct test.t1.n) AS `count(distinct n)` from test.t1 drop table t1; diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 308adc881f2..4c70e72bdfb 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -1,11 +1,12 @@ +drop table if exists t1; select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296; -0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296 +0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296 0 256 65536 2147483647 -2147483648 2147483648 4294967296 select 9223372036854775807,-009223372036854775808; 9223372036854775807 -009223372036854775808 9223372036854775807 -9223372036854775808 select +9999999999999999999,-9999999999999999999; -+9999999999999999999 -9999999999999999999 +9999999999999999999 -9999999999999999999 9999999999999999999 -10000000000000000000 select cast(9223372036854775808 as unsigned)+1; cast(9223372036854775808 as unsigned)+1 @@ -13,7 +14,9 @@ cast(9223372036854775808 as unsigned)+1 select 9223372036854775808+1; 9223372036854775808+1 9223372036854775809 -drop table if exists t1; +select -(0-3),round(-(0-3)), round(9999999999999999999); +-(0-3) round(-(0-3)) round(9999999999999999999) +3 3 10000000000000000000 create table t1 (a bigint unsigned not null, primary key(a)); insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t1; @@ -81,3 +84,6 @@ quantity 10000000000000000000 10000000000000000000 drop table t1; +SELECT '0x8000000000000001'+0; +'0x8000000000000001'+0 +0 diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 054918e8df3..405de1158d6 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -45,30 +45,35 @@ name drop table t1,t2; create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b)); insert into t1 values ("hello ","hello "),("hello2 ","hello2 "); -select * from t1 where a="hello"; -a b -hello hello -select * from t1 where a="hello "; -a b -hello hello -select * from t1 ignore index (a) where a="hello "; -a b -hello hello -select * from t1 where b="hello"; -a b -hello hello -select * from t1 where b="hello "; -a b -hello hello -select * from t1 ignore index (b) where b="hello "; -a b +select concat("-",a,"-",b,"-") from t1 where a="hello"; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 where a="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 where b="hello"; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- alter table t1 modify b tinytext not null, drop key b, add key (b(100)); -select * from t1 where b="hello "; -a b -hello hello -select * from t1 ignore index (b) where b="hello "; -a b -hello hello +select concat("-",a,"-",b,"-") from t1; +concat("-",a,"-",b,"-") +-hello-hello- +-hello2-hello2- +select concat("-",a,"-",b,"-") from t1 where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- drop table t1; create table t1 (b char(8)); insert into t1 values(NULL); @@ -80,6 +85,37 @@ NULL select b from t1 having binary b like ''; b drop table t1; +create table t1 (a char(15) binary, b binary(15)); +insert into t1 values ('aaa','bbb'),('AAA','BBB'); +select upper(a),upper(b) from t1; +upper(a) upper(b) +AAA bbb +AAA BBB +select lower(a),lower(b) from t1; +lower(a) lower(b) +aaa bbb +aaa BBB +select * from t1 where upper(a)='AAA'; +a b +aaa bbb +AAA BBB +select * from t1 where lower(a)='aaa'; +a b +aaa bbb +AAA BBB +select * from t1 where upper(b)='BBB'; +a b +AAA BBB +select * from t1 where lower(b)='bbb'; +a b +aaa bbb +select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1; +charset(a) charset(b) charset(binary 'ccc') +latin1 binary binary +select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; +collation(a) collation(b) collation(binary 'ccc') +latin1_bin binary binary +drop table t1; create table t1( firstname char(20), lastname char(20)); insert into t1 values ("john","doe"),("John","Doe"); select * from t1 where firstname='john' and firstname like binary 'john'; diff --git a/mysql-test/r/bool.result b/mysql-test/r/bool.result index cb82c6baa0f..a054eceec0c 100644 --- a/mysql-test/r/bool.result +++ b/mysql-test/r/bool.result @@ -42,14 +42,10 @@ SELECT * FROM t1 WHERE a=2 OR (NULL AND (@a:=@a+1)); a SELECT * FROM t1 WHERE NOT(a=2 OR (NULL AND (@b:=@b+1))); a -SELECT @a, @b; -@a @b -0 6 DROP TABLE t1; -drop table if exists t; -create table t(a int, b int); -insert into t values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1); -select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t; +create table t1 (a int, b int); +insert into t1 values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1); +select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1; A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB N N N N N N N N N N 0 N 1 N 0 1 1 N N N @@ -60,7 +56,7 @@ N 1 N 0 N N N 1 0 0 0 1 1 0 0 1 1 1 0 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 0 -select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t; +select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1; A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB N N N N N N N N N N 0 N 1 N 0 1 1 N N N @@ -71,4 +67,4 @@ N 1 N 0 N N N 1 0 0 0 1 1 0 0 1 1 1 0 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 0 -drop table t; +drop table t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 4c16b375400..1aa838140fd 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -23,6 +23,11 @@ false select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END; CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END one +explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END; CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END two @@ -57,6 +62,11 @@ fcase count(*) 0 2 2 1 3 1 +explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +Warnings: +Note 1003 select (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase; fcase count(*) nothing 2 @@ -71,3 +81,76 @@ orange yellow green drop table t1; +SET NAMES latin1; +CREATE TABLE t1 SELECT +CASE WHEN 1 THEN _latin1'a' COLLATE latin1_danish_ci ELSE _latin1'a' END AS c1, +CASE WHEN 1 THEN _latin1'a' ELSE _latin1'a' COLLATE latin1_danish_ci END AS c2, +CASE WHEN 1 THEN 'a' ELSE 1 END AS c3, +CASE WHEN 1 THEN 1 ELSE 'a' END AS c4, +CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5, +CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6, +CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7, +CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8, +CASE WHEN 1 THEN 1.0 END AS c9 +; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '', + `c2` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '', + `c3` char(1) NOT NULL default '', + `c4` char(1) NOT NULL default '', + `c5` char(3) NOT NULL default '', + `c6` char(3) NOT NULL default '', + `c7` double(3,1) NOT NULL default '0.0', + `c8` double(3,1) NOT NULL default '0.0', + `c9` double(3,1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +SELECT CASE +WHEN 1 +THEN _latin1'a' COLLATE latin1_danish_ci +ELSE _latin1'a' COLLATE latin1_swedish_ci +END; +ERROR HY000: Illegal mix of collations (latin1_danish_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'case' +SELECT CASE _latin1'a' COLLATE latin1_general_ci +WHEN _latin1'a' COLLATE latin1_danish_ci THEN 1 +WHEN _latin1'a' COLLATE latin1_swedish_ci THEN 2 +END; +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_danish_ci,EXPLICIT), (latin1_swedish_ci,EXPLICIT) for operation 'case' +SELECT +CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END, +CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END, +CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END, +CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END +; +CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END +1 2 1 2 +CREATE TABLE t1 SELECT COALESCE(_latin1'a',_latin2'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'coalesce' +CREATE TABLE t1 SELECT COALESCE('a' COLLATE latin1_swedish_ci,'b' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce' +CREATE TABLE t1 SELECT +COALESCE(1), COALESCE(1.0),COALESCE('a'), +COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'), +COALESCE('a' COLLATE latin1_bin,'b'); +explain extended SELECT +COALESCE(1), COALESCE(1.0),COALESCE('a'), +COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'), +COALESCE('a' COLLATE latin1_bin,'b'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `COALESCE(1)` int(1) NOT NULL default '0', + `COALESCE(1.0)` double(3,1) NOT NULL default '0.0', + `COALESCE('a')` char(1) NOT NULL default '', + `COALESCE(1,1.0)` double(3,1) NOT NULL default '0.0', + `COALESCE(1,'1')` char(1) NOT NULL default '', + `COALESCE(1.1,'1')` char(3) NOT NULL default '', + `COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 572b32c171c..6564a3e392b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -16,24 +16,142 @@ cast(-5 as unsigned) -1 cast(-5 as unsigned) + 1 select ~5, cast(~5 as signed); ~5 cast(~5 as signed) 18446744073709551610 -6 +explain extended select ~5, cast(~5 as signed); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)` select cast(5 as unsigned) -6.0; cast(5 as unsigned) -6.0 -1.0 +select cast(NULL as signed), cast(1/0 as signed); +cast(NULL as signed) cast(1/0 as signed) +NULL NULL +select cast(NULL as unsigned), cast(1/0 as unsigned); +cast(NULL as unsigned) cast(1/0 as unsigned) +NULL NULL select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A"; cast("A" as binary) = "a" cast(BINARY "a" as CHAR) = "A" 0 1 select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME); cast("2001-1-1" as DATE) cast("2001-1-1" as DATETIME) -2001-1-1 2001-1-1 +2001-01-01 2001-01-01 00:00:00 select cast("1:2:3" as TIME); cast("1:2:3" as TIME) -1:2:3 +01:02:03 +select CONVERT("2004-01-22 21:45:33",DATE); +CONVERT("2004-01-22 21:45:33",DATE) +2004-01-22 +select CONVERT(DATE "2004-01-22 21:45:33" USING latin1); +CONVERT(DATE "2004-01-22 21:45:33" USING latin1) +2004-01-22 21:45:33 +select CONVERT(DATE "2004-01-22 21:45:33",CHAR); +CONVERT(DATE "2004-01-22 21:45:33",CHAR) +2004-01-22 21:45:33 +select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4)); +CONVERT(DATE "2004-01-22 21:45:33",CHAR(4)) +2004 +select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4)); +CONVERT(DATE "2004-01-22 21:45:33",BINARY(4)) +2004 +select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)); +CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)) +2004 +set names binary; +select cast(_latin1'test' as char character set latin2); +cast(_latin1'test' as char character set latin2) +test +select cast(_koi8r'ÔÅÓÔ' as char character set cp1251); +cast(_koi8r'ÔÅÓÔ' as char character set cp1251) +òåñò +create table t1 select cast(_koi8r'ÔÅÓÔ' as char character set cp1251) as t; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` char(4) character set cp1251 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select +cast(_latin1'ab' AS char) as c1, +cast(_latin1'a ' AS char) as c2, +cast(_latin1'abc' AS char(2)) as c3, +cast(_latin1'a ' AS char(2)) as c4, +cast(_latin1'a' AS char(2)) as c5; +c1 c2 c3 c4 c5 +ab a ab a a +create table t1 select +cast(_latin1'ab' AS char) as c1, +cast(_latin1'a ' AS char) as c2, +cast(_latin1'abc' AS char(2)) as c3, +cast(_latin1'a ' AS char(2)) as c4, +cast(_latin1'a' AS char(2)) as c5; +select * from t1; +c1 c2 c3 c4 c5 +ab a ab a a +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` binary(2) NOT NULL default '', + `c2` binary(2) NOT NULL default '', + `c3` binary(2) NOT NULL default '', + `c4` binary(2) NOT NULL default '', + `c5` binary(2) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select +cast(_koi8r'ÆÇ' AS nchar) as c1, +cast(_koi8r'Æ ' AS nchar) as c2, +cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3, +cast(_koi8r'Æ ' AS nchar(2)) as c4, +cast(_koi8r'Æ' AS nchar(2)) as c5; +c1 c2 c3 c4 c5 +Ñг Ñ Ñг Ñ Ñ +create table t1 select +cast(_koi8r'ÆÇ' AS nchar) as c1, +cast(_koi8r'Æ ' AS nchar) as c2, +cast(_koi8r'ÆÇÈ' AS nchar(2)) as c3, +cast(_koi8r'Æ ' AS nchar(2)) as c4, +cast(_koi8r'Æ' AS nchar(2)) as c5; +select * from t1; +c1 c2 c3 c4 c5 +Ñг Ñ Ñг Ñ Ñ +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(2) character set utf8 NOT NULL default '', + `c2` char(2) character set utf8 NOT NULL default '', + `c3` char(2) character set utf8 NOT NULL default '', + `c4` char(2) character set utf8 NOT NULL default '', + `c5` char(2) character set utf8 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a binary(10), b char(10) character set koi8r); +insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ'); +select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; +a b cast(a as char character set cp1251) cast(b as binary) +ÔÅÓÔ ÔÅÓÔ ÔÅÓÔ ÔÅÓÔ +set names koi8r; +select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; +a b cast(a as char character set cp1251) cast(b as binary) +ÔÅÓÔ ÔÅÓÔ æåõæ ÔÅÓÔ +set names cp1251; +select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; +a b cast(a as char character set cp1251) cast(b as binary) +ÔÅÓÔ òåñò ÔÅÓÔ ÔÅÓÔ +drop table t1; +set names binary; select cast("2001-1-1" as date) = "2001-01-01"; cast("2001-1-1" as date) = "2001-01-01" -0 +1 select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00"; cast("2001-1-1" as datetime) = "2001-01-01 00:00:00" -0 +1 select cast("1:2:3" as TIME) = "1:02:03"; cast("1:2:3" as TIME) = "1:02:03" 0 +select cast(NULL as DATE); +cast(NULL as DATE) +NULL +select cast(NULL as BINARY); +cast(NULL as BINARY) +NULL diff --git a/mysql-test/r/comments.result b/mysql-test/r/comments.result index 8092f789954..a9106ce0538 100644 --- a/mysql-test/r/comments.result +++ b/mysql-test/r/comments.result @@ -6,7 +6,7 @@ multi line comment */; 1 1 ; -Query was empty +ERROR 42000: Query was empty select 1 /*!32301 +1 */; 1 /*!32301 +1 2 diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index afd2a1a086b..bf8a5106044 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -2,8 +2,8 @@ drop table if exists t1; CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id)); insert into t1 values ('000000000001'),('000000000002'); explain select * from t1 where id=000000000001; -table type possible_keys key key_len ref rows Extra -t1 index PRIMARY PRIMARY 12 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 12 NULL 2 Using where; Using index select * from t1 where id=000000000001; id 000000000001 @@ -12,3 +12,27 @@ select * from t1; id 000000000001 drop table t1; +SELECT 'a' = 'a '; +'a' = 'a ' +1 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +1 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +1 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +CREATE TABLE t1 (a char(10) not null); +INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); +SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; +hex(a) STRCMP(a,'a') STRCMP(a,'a ') +61 0 0 +6100 -1 -1 +6109 -1 -1 +61 0 0 +DROP TABLE t1; diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result new file mode 100644 index 00000000000..edf30e7f6e4 --- /dev/null +++ b/mysql-test/r/connect.result @@ -0,0 +1,67 @@ +show tables; +Tables_in_mysql +columns_priv +db +func +help_category +help_keyword +help_relation +help_topic +host +tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type +user +show tables; +Tables_in_test +grant ALL on *.* to test@localhost identified by "gambling"; +grant ALL on *.* to test@127.0.0.1 identified by "gambling"; +show tables; +Tables_in_mysql +columns_priv +db +func +help_category +help_keyword +help_relation +help_topic +host +tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type +user +show tables; +Tables_in_test +update mysql.user set password=old_password("gambling2") where user=_binary"test"; +flush privileges; +set password=""; +set password='gambling3'; +ERROR HY000: Password hash should be a 41-digit hexadecimal number +set password=old_password('gambling3'); +show tables; +Tables_in_mysql +columns_priv +db +func +help_category +help_keyword +help_relation +help_topic +host +tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type +user +show tables; +Tables_in_test +delete from mysql.user where user=_binary"test"; +flush privileges; diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index 3b41e291e0f..d4d525c8991 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -14,3 +14,16 @@ drop table t1; create table t1 (a int null); insert into t1 values (1),(NULL); drop table t1; +create table t1 (a int null); +alter table t1 add constraint constraint_1 unique (a); +alter table t1 add constraint unique key_1(a); +alter table t1 add constraint constraint_2 unique key_2(a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default NULL, + UNIQUE KEY `constraint_1` (`a`), + UNIQUE KEY `key_1` (`a`), + UNIQUE KEY `key_2` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/convert.result b/mysql-test/r/convert.result deleted file mode 100644 index f8dad8c69ba..00000000000 --- a/mysql-test/r/convert.result +++ /dev/null @@ -1,17 +0,0 @@ -select @@convert_character_set; -@@convert_character_set - -select @@global.convert_character_set; -@@global.convert_character_set - -show variables like "%convert_character_set%"; -Variable_name Value -convert_character_set -SET CHARACTER SET cp1251_koi8; -select @@convert_character_set; -@@convert_character_set -cp1251_koi8 -SET CHARACTER SET DEFAULT; -select @@convert_character_set; -@@convert_character_set - diff --git a/mysql-test/r/count_distinct3.result b/mysql-test/r/count_distinct3.result new file mode 100644 index 00000000000..086e1360b0c --- /dev/null +++ b/mysql-test/r/count_distinct3.result @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER); +SELECT COUNT(*) FROM t1; +COUNT(*) +4181000 +SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp; +DROP TABLE t1; +set @@read_buffer_size=default; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 7cb79d5a990..92c825f547d 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1,4 +1,5 @@ -drop table if exists t1,t2; +drop table if exists t1,t2,t3; +drop database if exists mysqltest; create table t1 (b char(0)); insert into t1 values (""),(null); select * from t1; @@ -9,33 +10,46 @@ drop table if exists t1; create table t1 (b char(0) not null); create table if not exists t1 (b char(0) not null); insert into t1 values (""),(null); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 select * from t1; b -drop table if exists t1; -create table t2 type=heap select * from t1; -Table 'test.t1' doesn't exist +drop table t1; +create table t1 (a int not null auto_increment,primary key (a)) engine=heap; +drop table t1; +create table t2 engine=heap select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist create table t2 select auto+1 from t1; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' create table t1 (b char(0) not null, index(b)); -The used table handler can't index column 'b' -create table t1 (a int not null auto_increment,primary key (a)) type=heap; -The used table type doesn't support AUTO_INCREMENT columns -create table t1 (a int not null,b text) type=heap; -The used table type doesn't support BLOB/TEXT columns +ERROR 42000: The used storage engine can't index column 'b' +create table t1 (a int not null,b text) engine=heap; +ERROR 42000: The used table type doesn't support BLOB/TEXT columns drop table if exists t1; -create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap; -The used table type doesn't support AUTO_INCREMENT columns +Warnings: +Note 1051 Unknown table 't1' +create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap; +ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key create table not_existing_database.test (a int); Got one of the listed errors create table `a/a` (a int); -Incorrect table name 'a/a' +ERROR 42000: Incorrect table name 'a/a' create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); -Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); -Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long +ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long +create table test (a datetime default now()); +ERROR 42000: Invalid default value for 'a' +create table test (a datetime on update now()); +ERROR HY000: Invalid ON UPDATE clause for 'a' column +create table test (a int default 100 auto_increment); +ERROR 42000: Invalid default value for 'a' create table 1ea10 (1a20 int,1e int); insert into 1ea10 values(1,1); select 1ea10.1a20,1e+ 1e+10 from 1ea10; @@ -44,29 +58,32 @@ select 1ea10.1a20,1e+ 1e+10 from 1ea10; drop table 1ea10; create table t1 (t1.index int); drop table t1; -drop database if exists test_$1; -create database test_$1; -create table test_$1.$test1 (a$1 int, $b int, c$ int); -insert into test_$1.$test1 values (1,2,3); -select a$1, $b, c$ from test_$1.$test1; +drop database if exists mysqltest; +Warnings: +Note 1008 Can't drop database 'mysqltest'; database doesn't exist +create database mysqltest; +create table mysqltest.$test1 (a$1 int, $b int, c$ int); +insert into mysqltest.$test1 values (1,2,3); +select a$1, $b, c$ from mysqltest.$test1; a$1 $b c$ 1 2 3 -create table test_$1.test2$ (a int); -drop table test_$1.test2$; -drop database test_$1; +create table mysqltest.test2$ (a int); +drop table mysqltest.test2$; +drop database mysqltest; create table `` (a int); -Incorrect table name '' +ERROR 42000: Incorrect table name '' drop table if exists ``; -Incorrect table name '' +ERROR 42000: Incorrect table name '' create table t1 (`` int); -Incorrect column name '' -drop table if exists t1; +ERROR 42000: Incorrect column name '' +create table t1 (i int, index `` (i)); +ERROR 42000: Incorrect index name '' create table t1 (a int auto_increment not null primary key, B CHAR(20)); insert into t1 (b) values ("hello"),("my"),("world"); create table t2 (key (b)) select * from t1; explain select * from t2 where b="world"; -table type possible_keys key key_len ref rows Extra -t2 ref B B 21 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref B B 21 const 1 Using where select * from t2 where b="world"; a B 3 world @@ -93,10 +110,44 @@ drop table t2; create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt; describe t2; Field Type Null Key Default Extra -d date 0000-00-00 -t time 00:00:00 -dt datetime 0000-00-00 00:00:00 +d date YES NULL +t time YES NULL +dt datetime YES NULL drop table t1,t2; +create table t1 (a tinyint); +create table t2 (a int) select * from t1; +describe t1; +Field Type Null Key Default Extra +a tinyint(4) YES NULL +describe t2; +Field Type Null Key Default Extra +a int(11) YES NULL +drop table if exists t2; +create table t2 (a int, a float) select * from t1; +ERROR 42S21: Duplicate column name 'a' +drop table if exists t2; +Warnings: +Note 1051 Unknown table 't2' +create table t2 (a int) select a as b, a+1 as b from t1; +ERROR 42S21: Duplicate column name 'b' +drop table if exists t2; +Warnings: +Note 1051 Unknown table 't2' +create table t2 (b int) select a as b, a+1 as b from t1; +ERROR 42S21: Duplicate column name 'b' +drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1 (a int not null); +INSERT INTO t1 values (1),(2),(1); +CREATE TABLE t2 (primary key(a)) SELECT * FROM t1; +ERROR 23000: Duplicate entry '1' for key 1 +SELECT * from t2; +ERROR 42S02: Table 'test.t2' doesn't exist +DROP TABLE t1; +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b)); show create table t1; Table Create Table @@ -135,7 +186,7 @@ t1 CREATE TABLE `t1` ( KEY `b_29` (`b`), KEY `b_30` (`b`), KEY `b_31` (`b`) -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select if(1,'1','0'), month("2002-08-02"); drop table t1; @@ -144,44 +195,45 @@ select * from t1; if('2002'='2002','Y','N') Y drop table if exists t1; -SET SESSION table_type="heap"; -SELECT @@table_type; -@@table_type +SET SESSION storage_engine="heap"; +SELECT @@storage_engine; +@@storage_engine HEAP CREATE TABLE t1 (a int not null); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=HEAP +) ENGINE=HEAP DEFAULT CHARSET=latin1 drop table t1; -SET SESSION table_type="gemini"; -SELECT @@table_type; -@@table_type -GEMINI +SET SESSION storage_engine="gemini"; +ERROR 42000: Unknown table engine 'gemini' +SELECT @@storage_engine; +@@storage_engine +HEAP CREATE TABLE t1 (a int not null); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM -SET SESSION table_type=default; +) ENGINE=HEAP DEFAULT CHARSET=latin1 +SET SESSION storage_engine=default; drop table t1; create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2)); insert into t1 values ("a", 1), ("b", 2); insert into t1 values ("c", NULL); -Column 'k2' cannot be null +ERROR 23000: Column 'k2' cannot be null insert into t1 values (NULL, 3); -Column 'k1' cannot be null +ERROR 23000: Column 'k1' cannot be null insert into t1 values (NULL, NULL); -Column 'k1' cannot be null +ERROR 23000: Column 'k1' cannot be null drop table t1; create table t1 select x'4132'; drop table t1; create table t1 select 1,2,3; create table if not exists t1 select 1,2; create table if not exists t1 select 1,2,3,4; -Column count doesn't match value count at row 1 +ERROR 21S01: Column count doesn't match value count at row 1 create table if not exists t1 select 1; select * from t1; 1 2 3 @@ -192,7 +244,7 @@ drop table t1; create table t1 select 1,2,3; create table if not exists t1 select 1,2; create table if not exists t1 select 1,2,3,4; -Column count doesn't match value count at row 1 +ERROR 21S01: Column count doesn't match value count at row 1 create table if not exists t1 select 1; select * from t1; 1 2 3 @@ -209,7 +261,7 @@ a b 0 2 create table if not exists t1 select 3 as 'a',4 as 'b'; create table if not exists t1 select 3 as 'a',3 as 'b'; -Duplicate entry '3' for key 1 +ERROR 23000: Duplicate entry '3' for key 1 select * from t1; a b 1 1 @@ -217,14 +269,286 @@ a b 3 4 drop table t1; create table `t1 `(a int); -Incorrect table name 't1 ' +ERROR 42000: Incorrect table name 't1 ' create database `db1 `; -Incorrect database name 'db1 ' +ERROR 42000: Incorrect database name 'db1 ' create table t1(`a ` int); -Incorrect column name 'a ' +ERROR 42000: Incorrect column name 'a ' create table t1 (a int,); -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 +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 create table t1 (a int,,b int); -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 'b int)' at line 1 +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 'b int)' at line 1 create table t1 (,b int); -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 'b int)' at line 1 +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 'b int)' at line 1 +create table t1 (a int, key(a)); +create table t2 (b int, foreign key(b) references t1(a), key(b)); +drop table if exists t1,t2; +create table t1(id int not null, name char(20)); +insert into t1 values(10,'mysql'),(20,'monty- the creator'); +create table t2(id int not null); +insert into t2 values(10),(20); +create table t3 like t1; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `id` int(11) NOT NULL default '0', + `name` char(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t3; +id name +create table if not exists t3 like t1; +Warnings: +Warning 1050 Table 't3' already exists +select @@warning_count; +@@warning_count +1 +create temporary table t3 like t2; +show create table t3; +Table Create Table +t3 CREATE TEMPORARY TABLE `t3` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t3; +id +drop table t3; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `id` int(11) NOT NULL default '0', + `name` char(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t3; +id name +drop table t2, t3; +create database mysqltest; +create table mysqltest.t3 like t1; +create temporary table t3 like mysqltest.t3; +show create table t3; +Table Create Table +t3 CREATE TEMPORARY TABLE `t3` ( + `id` int(11) NOT NULL default '0', + `name` char(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t2 like t3; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `name` char(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t2; +id name +create table t3 like t1; +create table t3 like mysqltest.t3; +ERROR 42S01: Table 't3' already exists +create table non_existing_database.t1 like t1; +Got one of the listed errors +create table t3 like non_existing_table; +ERROR 42S02: Unknown table 'non_existing_table' +create temporary table t3 like t1; +ERROR 42S01: Table 't3' already exists +create table t3 like `a/a`; +ERROR 42000: Incorrect table name 'a/a' +drop table t1, t2, t3; +drop table t3; +drop database mysqltest; +SET SESSION storage_engine="heap"; +SELECT @@storage_engine; +@@storage_engine +HEAP +CREATE TABLE t1 (a int not null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0' +) ENGINE=HEAP DEFAULT CHARSET=latin1 +drop table t1; +SET SESSION storage_engine="gemini"; +ERROR 42000: Unknown table engine 'gemini' +SELECT @@storage_engine; +@@storage_engine +HEAP +CREATE TABLE t1 (a int not null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0' +) ENGINE=HEAP DEFAULT CHARSET=latin1 +SET SESSION storage_engine=default; +drop table t1; +create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob); +insert into t1(a)values(1); +insert into t1(a,b,c,d,e,f,g,h) +values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data'); +select * from t1; +a b c d e f g h +1 NULL NULL NULL NULL NULL NULL NULL +2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data +select a, +ifnull(b,cast(-7 as signed)) as b, +ifnull(c,cast(7 as unsigned)) as c, +ifnull(d,cast('2000-01-01' as date)) as d, +ifnull(e,cast('b' as char)) as e, +ifnull(f,cast('2000-01-01' as datetime)) as f, +ifnull(g,cast('5:4:3' as time)) as g, +ifnull(h,cast('yet another binary data' as binary)) as h, +addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd +from t1; +a b c d e f g h dd +1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00 +2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00 +create table t2 +select +a, +ifnull(b,cast(-7 as signed)) as b, +ifnull(c,cast(7 as unsigned)) as c, +ifnull(d,cast('2000-01-01' as date)) as d, +ifnull(e,cast('b' as char)) as e, +ifnull(f,cast('2000-01-01' as datetime)) as f, +ifnull(g,cast('5:4:3' as time)) as g, +ifnull(h,cast('yet another binary data' as binary)) as h, +addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd +from t1; +explain t2; +Field Type Null Key Default Extra +a int(11) YES NULL +b bigint(11) 0 +c bigint(10) 0 +d date YES NULL +e char(1) +f datetime YES NULL +g time YES NULL +h longblob +dd time YES NULL +select * from t2; +a b c d e f g h dd +1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00 +2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00 +drop table t1, t2; +create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10)); +create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ifnull(a,a)` tinyint(4) default NULL, + `ifnull(b,b)` smallint(6) default NULL, + `ifnull(c,c)` mediumint(9) default NULL, + `ifnull(d,d)` int(11) default NULL, + `ifnull(e,e)` bigint(20) default NULL, + `ifnull(f,f)` float(3,2) default NULL, + `ifnull(g,g)` double(4,3) default NULL, + `ifnull(h,h)` decimal(5,4) default NULL, + `ifnull(i,i)` year(4) default NULL, + `ifnull(j,j)` date default NULL, + `ifnull(k,k)` datetime NOT NULL default '0000-00-00 00:00:00', + `ifnull(l,l)` datetime default NULL, + `ifnull(m,m)` char(1) default NULL, + `ifnull(n,n)` char(3) default NULL, + `ifnull(o,o)` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; +create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14'); +insert into t1 values ('','',0,0.0); +describe t1; +Field Type Null Key Default Extra +str varchar(10) YES def +strnull varchar(10) YES NULL +intg int(11) YES 10 +rel double YES 3.14 +create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1; +describe t2; +Field Type Null Key Default Extra +str varchar(10) YES NULL +strnull varchar(10) YES NULL +intg int(11) YES NULL +rel double YES NULL +drop table t1, t2; +create table t1(name varchar(10), age smallint default -1); +describe t1; +Field Type Null Key Default Extra +name varchar(10) YES NULL +age smallint(6) YES -1 +create table t2(name varchar(10), age smallint default - 1); +describe t2; +Field Type Null Key Default Extra +name varchar(10) YES NULL +age smallint(6) YES -1 +drop table t1, t2; +create table t1(cenum enum('a'), cset set('b')); +create table t2(cenum enum('a','a'), cset set('b','b')); +Warnings: +Note 1291 Column 'cenum' has duplicated value 'a' in ENUM +Note 1291 Column 'cset' has duplicated value 'b' in SET +create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d')); +Warnings: +Note 1291 Column 'cenum' has duplicated value 'a' in ENUM +Note 1291 Column 'cenum' has duplicated value 'A' in ENUM +Note 1291 Column 'cenum' has duplicated value 'c' in ENUM +Note 1291 Column 'cset' has duplicated value 'b' in SET +Note 1291 Column 'cset' has duplicated value 'B' in SET +Note 1291 Column 'cset' has duplicated value 'd' in SET +drop table t1, t2, t3; +create database mysqltest; +use mysqltest; +select database(); +database() +mysqltest +drop database mysqltest; +select database(); +database() +NULL +select database(); +database() +NULL +use test; +create table t1 (a int, index `primary` (a)); +ERROR 42000: Incorrect index name 'primary' +create table t1 (a int, index `PRIMARY` (a)); +ERROR 42000: Incorrect index name 'PRIMARY' +create table t1 (`primary` int, index(`primary`)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `primary` int(11) default NULL, + KEY `primary_2` (`primary`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t2 (`PRIMARY` int, index(`PRIMARY`)); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `PRIMARY` int(11) default NULL, + KEY `PRIMARY_2` (`PRIMARY`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t3 (a int); +alter table t3 add index `primary` (a); +ERROR 42000: Incorrect index name 'primary' +alter table t3 add index `PRIMARY` (a); +ERROR 42000: Incorrect index name 'PRIMARY' +create table t4 (`primary` int); +alter table t4 add index(`primary`); +show create table t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `primary` int(11) default NULL, + KEY `primary_2` (`primary`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t5 (`PRIMARY` int); +alter table t5 add index(`PRIMARY`); +show create table t5; +Table Create Table +t5 CREATE TABLE `t5` ( + `PRIMARY` int(11) default NULL, + KEY `PRIMARY_2` (`PRIMARY`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2, t3, t4, t5; +CREATE TABLE t1(id varchar(10) NOT NULL PRIMARY KEY, dsc longtext); +INSERT INTO t1 VALUES ('5000000001', NULL),('5000000003', 'Test'),('5000000004', NULL); +CREATE TABLE t2(id varchar(15) NOT NULL, proc varchar(100) NOT NULL, runID varchar(16) NOT NULL, start datetime NOT NULL, PRIMARY KEY (id,proc,runID,start)); +INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:38:40'),('5000000001', 'proc02', '20031029090650', '2003-10-29 13:38:51'),('5000000001', 'proc03', '20031029090650', '2003-10-29 13:38:11'),('5000000002', 'proc09', '20031024013310', '2003-10-24 01:33:11'),('5000000002', 'proc09', '20031024153537', '2003-10-24 15:36:04'),('5000000004', 'proc01', '20031024013641', '2003-10-24 01:37:29'),('5000000004', 'proc02', '20031024013641', '2003-10-24 01:37:39'); +CREATE TABLE t3 SELECT t1.dsc,COUNT(DISTINCT t2.id) AS countOfRuns FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) GROUP BY t1.id; +SELECT * FROM t3; +dsc countOfRuns +NULL 1 +Test 0 +NULL 1 +drop table t1, t2, t3; diff --git a/mysql-test/r/create_select_tmp.result b/mysql-test/r/create_select_tmp.result index 610ee70b3e3..b99bf3e3591 100644 --- a/mysql-test/r/create_select_tmp.result +++ b/mysql-test/r/create_select_tmp.result @@ -1,19 +1,19 @@ drop table if exists t1, t2; CREATE TABLE t1 ( a int ); INSERT INTO t1 VALUES (1),(2),(1); -CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1; -Duplicate entry '1' for key 1 +CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; +ERROR 23000: Duplicate entry '1' for key 1 select * from t2; -Table 'test.t2' doesn't exist -CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1; -Duplicate entry '1' for key 1 +ERROR 42S02: Table 'test.t2' doesn't exist +CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; +ERROR 23000: Duplicate entry '1' for key 1 select * from t2; -Table 'test.t2' doesn't exist -CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1; -Duplicate entry '1' for key 1 +ERROR 42S02: Table 'test.t2' doesn't exist +CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; +ERROR 23000: Duplicate entry '1' for key 1 select * from t2; -Table 'test.t2' doesn't exist -CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1; -Duplicate entry '1' for key 1 +ERROR 42S02: Table 'test.t2' doesn't exist +CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; +ERROR 23000: Duplicate entry '1' for key 1 select * from t2; -Table 'test.t2' doesn't exist +ERROR 42S02: Table 'test.t2' doesn't exist diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result new file mode 100644 index 00000000000..ea0d34271b5 --- /dev/null +++ b/mysql-test/r/csv.result @@ -0,0 +1,4931 @@ +drop table if exists t1,t2,t3,t4; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE = CSV; +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL +) ENGINE = CSV; +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +UPDATE t2 SET fld3="foo" WHERE fld3="b%"; +select fld3 from t2; +fld3 +Omaha +breaking +Romans +intercepted +bewilderingly +astound +admonishing +sumac +flanking +combed +subjective +scatterbrain +Eulerian +dubbed +Kane +overlay +perturb +goblins +annihilates +Wotan +snatching +concludes +laterally +yelped +grazing +Baird +celery +misunderstander +handgun +foldout +mystic +succumbed +Nabisco +fingerings +aging +afield +ammonium +boat +intelligibility +Augustine +teethe +dreaded +scholastics +audiology +wallet +parters +eschew +quitter +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +capably +impulsive +starlet +terminators +untying +announces +featherweight +pessimist +daughter +decliner +lawgiver +stated +readable +attrition +cascade +motors +interrogate +pests +stairway +dopers +testicle +Parsifal +leavings +postulation +squeaking +contrasted +leftover +whiteners +erases +Punjab +Merritt +Quixotism +sweetish +dogging +scornfully +bellow +bills +cupboard +sureties +puddings +tapestry +fetters +bivalves +incurring +Adolph +pithed +emergency +Miles +trimmings +tragedies +skulking +flint +flopping +relaxing +offload +suites +lists +animized +multilayer +standardizes +Judas +vacuuming +dentally +humanness +inch +Weissmuller +irresponsibly +luckily +culled +medical +bloodbath +subschema +animals +Micronesia +repetitions +Antares +ventilate +pityingly +interdependent +Graves +neonatal +scribbled +chafe +honoring +realtor +elite +funereal +abrogating +sorters +Conley +lectured +Abraham +Hawaii +cage +hushes +Simla +reporters +Dutchman +descendants +groupings +dissociate +coexist +Beebe +Taoism +Connally +fetched +checkpoints +rusting +galling +obliterates +traitor +resumes +analyzable +terminator +gritty +firearm +minima +Selfridge +disable +witchcraft +betroth +Manhattanize +imprint +peeked +swelling +interrelationships +riser +Gandhian +peacock +bee +kanji +dental +scarf +chasm +insolence +syndicate +alike +imperial +convulsion +railway +validate +normalizes +comprehensive +chewing +denizen +schemer +chronicle +Kline +Anatole +partridges +brunch +recruited +dimensions +Chicana +announced +praised +employing +linear +quagmire +western +relishing +serving +scheduling +lore +eventful +arteriole +disentangle +cured +Fenton +avoidable +drains +detectably +husky +impelling +undoes +evened +squeezes +destroyer +rudeness +beaner +boorish +Everhart +encompass +mushrooms +Alison +externally +pellagra +cult +creek +Huffman +Majorca +governing +gadfly +reassigned +intentness +craziness +psychic +squabbled +burlesque +capped +extracted +DiMaggio +exclamation +subdirectory +fangs +buyer +pithing +transistorizing +nonbiodegradable +dislocate +monochromatic +batting +postcondition +catalog +Remus +devices +bike +qualify +detained +commended +civilize +Elmhurst +anesthetizing +deaf +Brigham +title +coarse +combinations +grayness +innumerable +Caroline +fatty +eastbound +inexperienced +hoarder +scotch +passport +strategic +gated +flog +Pipestone +Dar +Corcoran +flyers +competitions +suppliers +skips +institutes +troop +connective +denies +polka +observations +askers +homeless +Anna +subdirectories +decaying +outwitting +Harpy +crazed +suffocate +provers +technically +Franklinizations +considered +tinnily +uninterruptedly +whistled +automate +gutting +surreptitious +Choctaw +cooks +millivolt +counterpoise +Gothicism +feminine +metaphysically +sanding +contributorily +receivers +adjourn +straggled +druggists +thanking +ostrich +hopelessness +Eurydice +excitation +presumes +imaginable +concoct +peering +Phelps +ferociousness +sentences +unlocks +engrossing +Ruth +tying +exclaimers +synergy +Huey +merging +judges +Shylock +Miltonism +hen +honeybee +towers +dilutes +numerals +democracy +Ibero- +invalids +behavior +accruing +relics +rackets +Fischbein +phony +cross +cleanup +conspirator +label +university +cleansed +ballgown +starlet +aqueous +portrayal +despising +distort +palmed +faced +silverware +assessor +spiders +artificially +reminiscence +Mexican +obnoxious +fragile +apprehensible +births +garages +panty +anteater +displacement +drovers +patenting +far +shrieks +aligning +pragmatism +fevers +reexamines +occupancies +sweats +modulators +demand +Madeira +Viennese +chillier +wildcats +gentle +Angles +accuracies +toggle +Mendelssohn +behaviorally +Rochford +mirror +Modula +clobbering +chronography +Eskimoizeds +British +pitfalls +verify +scatter +Aztecan +acuity +sinking +beasts +Witt +physicists +folksong +strokes +crowder +merry +cadenced +alimony +principled +golfing +undiscovered +irritates +patriots +rooms +towering +displease +photosensitive +inking +gainers +leaning +hydrant +preserve +blinded +interactions +Barry +whiteness +pastimes +Edenization +Muscat +assassinated +labeled +glacial +implied +bibliographies +Buchanan +forgivably +innuendo +den +submarines +mouthful +expiring +unfulfilled +precession +nullified +affects +Cynthia +Chablis +betterments +advertising +rubies +southwest +superstitious +tabernacle +silk +handsomest +Persian +analog +complex +Taoist +suspend +relegated +awesome +Bruxelles +imprecisely +televise +braking +true +disappointing +navally +circus +beetles +trumps +fourscore +Blackfoots +Grady +quiets +floundered +profundity +Garrisonian +Strauss +cemented +contrition +mutations +exhibits +tits +mate +arches +Moll +ropers +bombast +difficultly +adsorption +definiteness +cultivation +heals +Heusen +target +cited +congresswoman +Katherine +titter +aspire +Mardis +Nadia +estimating +stuck +fifteenth +Colombo +survey +staffing +obtain +loaded +slaughtered +lights +circumference +dull +weekly +wetness +visualized +Tannenbaum +moribund +demultiplex +lockings +thugs +unnerves +abut +Chippewa +stratifications +signaled +Italianizes +algorithmic +paranoid +camping +signifying +Patrice +search +Angeles +semblance +taxed +Beatrice +retrace +lockout +grammatic +helmsman +uniform +hamming +disobedience +captivated +transferals +cartographer +aims +Pakistani +burglarized +saucepans +lacerating +corny +megabytes +chancellor +bulk +commits +meson +deputies +northeaster +dipole +machining +therefore +Telefunken +salvaging +Corinthianizes +restlessly +bromides +generalized +mishaps +quelling +spiritual +beguiles +Trobriand +fleeing +Armour +chin +provers +aeronautic +voltage +sash +anaerobic +simultaneous +accumulating +Medusan +shouted +freakish +index +commercially +mistiness +endpoint +straight +flurried +denotative +coming +commencements +gentleman +gifted +Shanghais +sportswriting +sloping +navies +leaflet +shooter +Joplin +babies +subdivision +burstiness +belted +assails +admiring +swaying +Goldstine +fitting +Norwalk +weakening +analogy +deludes +cokes +Clayton +exhausts +causality +sating +icon +throttles +communicants +dehydrate +priceless +publicly +incidentals +commonplace +mumbles +furthermore +cautioned +parametrized +registration +sadly +positioning +babysitting +eternal +hoarder +congregates +rains +workers +sags +unplug +garage +boulder +hollowly +specifics +Teresa +Winsett +convenient +buckboards +amenities +resplendent +priding +configurations +untidiness +Brice +sews +participated +Simon +certificates +Fitzpatrick +Evanston +misted +textures +save +count +rightful +chaperone +Lizzy +clenched +effortlessly +accessed +beaters +Hornblower +vests +indulgences +infallibly +unwilling +excrete +spools +crunches +overestimating +ineffective +humiliation +sophomore +star +rifles +dialysis +arriving +indulge +clockers +languages +Antarctica +percentage +ceiling +specification +regimented +ciphers +pictures +serpents +allot +realized +mayoral +opaquely +hostess +fiftieth +incorrectly +decomposition +stranglings +mixture +electroencephalography +similarities +charges +freest +Greenberg +tinting +expelled +warm +smoothed +deductions +Romano +bitterroot +corset +securing +environing +cute +Crays +heiress +inform +avenge +universals +Kinsey +ravines +bestseller +equilibrium +extents +relatively +pressure +critiques +befouled +rightfully +mechanizing +Latinizes +timesharing +Aden +embassies +males +shapelessly +genres +mastering +Newtonian +finishers +abates +teem +kiting +stodgy +scalps +feed +guitars +airships +store +denounces +Pyle +Saxony +serializations +Peruvian +taxonomically +kingdom +stint +Sault +faithful +Ganymede +tidiness +gainful +contrary +Tipperary +tropics +theorizers +renew +already +terminal +Hegelian +hypothesizer +warningly +journalizing +nested +Lars +saplings +foothill +labeled +imperiously +reporters +furnishings +precipitable +discounts +excises +Stalin +despot +ripeness +Arabia +unruly +mournfulness +boom +slaughter +Sabine +handy +rural +organizer +shipyard +civics +inaccuracy +rules +juveniles +comprised +investigations +stabilizes +seminaries +Hunter +sporty +test +weasels +CERN +tempering +afore +Galatean +techniques +error +veranda +severely +Cassites +forthcoming +guides +vanish +lied +sawtooth +fated +gradually +widens +preclude +Jobrel +hooker +rainstorm +disconnects +cruelty +exponentials +affective +arteries +Crosby +acquaint +evenhandedly +percentage +disobedience +humility +gleaning +petted +bloater +minion +marginal +apiary +measures +precaution +repelled +primary +coverings +Artemia +navigate +spatial +Gurkha +meanwhile +Melinda +Butterfield +Aldrich +previewing +glut +unaffected +inmate +mineral +impending +meditation +ideas +miniaturizes +lewdly +title +youthfulness +creak +Chippewa +clamored +freezes +forgivably +reduce +McGovern +Nazis +epistle +socializes +conceptions +Kevin +uncovering +chews +appendixes +appendixes +appendixes +appendixes +appendixes +appendixes +raining +infest +compartment +minting +ducks +roped +waltz +Lillian +repressions +chillingly +noncritical +lithograph +spongers +parenthood +posed +instruments +filial +fixedly +relives +Pandora +watering +ungrateful +secures +chastisers +icon +reuniting +imagining +abiding +omnisciently +Britannic +scholastics +mechanics +humidly +masterpiece +however +Mendelian +jarred +scolds +infatuate +willed +joyfully +Microsoft +fibrosities +Baltimorean +equestrian +Goodrich +apish +Adlerian +Tropez +nouns +distracting +mutton +bridgeable +stickers +transcontinental +amateurish +Gandhian +stratified +chamberlains +creditably +philosophic +ores +Carleton +tape +afloat +goodness +welcoming +Pinsky +halting +bibliography +decoding +variance +allowed +dire +dub +poisoning +Iraqis +heaving +population +bomb +Majorca +Gershwins +explorers +libretto +occurred +Lagos +rats +bankruptcies +crying +unexpected +accessed +colorful +versatility +cosy +Darius +mastering +Asiaticizations +offerers +uncles +sleepwalk +Ernestine +checksumming +stopped +sicker +Italianization +alphabetic +pharmaceutic +creator +chess +charcoal +Epiphany +bulldozes +Pygmalion +caressing +Palestine +regimented +scars +realest +diffusing +clubroom +Blythe +ahead +reviver +retransmitting +landslide +Eiffel +absentee +aye +forked +Peruvianizes +clerked +tutor +boulevard +shuttered +quotes +Caltech +Mossberg +kept +roundly +features +imaginable +controller +racial +uprisings +narrowed +cannot +vest +famine +sugars +exterminated +belays +Hodges +translatable +duality +recording +rouses +poison +attitude +dusted +encompasses +presentation +Kantian +imprecision +saving +maternal +hewed +kerosene +Cubans +photographers +nymph +bedlam +north +Schoenberg +botany +curs +solidification +inheritresses +stiller +t1 +suite +ransomer +Willy +Rena +Seattle +relaxes +exclaim +exclaim +implicated +distinguish +assayed +homeowner +and +stealth +coinciding +founder +environing +jewelry +lemons +brokenness +bedpost +assurers +annoyers +affixed +warbling +seriously +boasted +Chantilly +Iranizes +violinist +extramarital +spates +cloakroom +gazer +hand +tucked +gems +clinker +refiner +callus +leopards +comfortingly +generically +getters +sexually +spear +serums +Italianization +attendants +spies +Anthony +planar +cupped +cleanser +commuters +honeysuckle +orphanage +skies +crushers +Puritan +squeezer +bruises +bonfire +Colombo +nondecreasing +UPDATE t2 SET fld3="bar" WHERE fld3="s%"; +select fld3 from t2; +fld3 +Omaha +breaking +Romans +intercepted +bewilderingly +astound +admonishing +sumac +flanking +combed +subjective +scatterbrain +Eulerian +dubbed +Kane +overlay +perturb +goblins +annihilates +Wotan +snatching +concludes +laterally +yelped +grazing +Baird +celery +misunderstander +handgun +foldout +mystic +succumbed +Nabisco +fingerings +aging +afield +ammonium +boat +intelligibility +Augustine +teethe +dreaded +scholastics +audiology +wallet +parters +eschew +quitter +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +capably +impulsive +starlet +terminators +untying +announces +featherweight +pessimist +daughter +decliner +lawgiver +stated +readable +attrition +cascade +motors +interrogate +pests +stairway +dopers +testicle +Parsifal +leavings +postulation +squeaking +contrasted +leftover +whiteners +erases +Punjab +Merritt +Quixotism +sweetish +dogging +scornfully +bellow +bills +cupboard +sureties +puddings +tapestry +fetters +bivalves +incurring +Adolph +pithed +emergency +Miles +trimmings +tragedies +skulking +flint +flopping +relaxing +offload +suites +lists +animized +multilayer +standardizes +Judas +vacuuming +dentally +humanness +inch +Weissmuller +irresponsibly +luckily +culled +medical +bloodbath +subschema +animals +Micronesia +repetitions +Antares +ventilate +pityingly +interdependent +Graves +neonatal +scribbled +chafe +honoring +realtor +elite +funereal +abrogating +sorters +Conley +lectured +Abraham +Hawaii +cage +hushes +Simla +reporters +Dutchman +descendants +groupings +dissociate +coexist +Beebe +Taoism +Connally +fetched +checkpoints +rusting +galling +obliterates +traitor +resumes +analyzable +terminator +gritty +firearm +minima +Selfridge +disable +witchcraft +betroth +Manhattanize +imprint +peeked +swelling +interrelationships +riser +Gandhian +peacock +bee +kanji +dental +scarf +chasm +insolence +syndicate +alike +imperial +convulsion +railway +validate +normalizes +comprehensive +chewing +denizen +schemer +chronicle +Kline +Anatole +partridges +brunch +recruited +dimensions +Chicana +announced +praised +employing +linear +quagmire +western +relishing +serving +scheduling +lore +eventful +arteriole +disentangle +cured +Fenton +avoidable +drains +detectably +husky +impelling +undoes +evened +squeezes +destroyer +rudeness +beaner +boorish +Everhart +encompass +mushrooms +Alison +externally +pellagra +cult +creek +Huffman +Majorca +governing +gadfly +reassigned +intentness +craziness +psychic +squabbled +burlesque +capped +extracted +DiMaggio +exclamation +subdirectory +fangs +buyer +pithing +transistorizing +nonbiodegradable +dislocate +monochromatic +batting +postcondition +catalog +Remus +devices +bike +qualify +detained +commended +civilize +Elmhurst +anesthetizing +deaf +Brigham +title +coarse +combinations +grayness +innumerable +Caroline +fatty +eastbound +inexperienced +hoarder +scotch +passport +strategic +gated +flog +Pipestone +Dar +Corcoran +flyers +competitions +suppliers +skips +institutes +troop +connective +denies +polka +observations +askers +homeless +Anna +subdirectories +decaying +outwitting +Harpy +crazed +suffocate +provers +technically +Franklinizations +considered +tinnily +uninterruptedly +whistled +automate +gutting +surreptitious +Choctaw +cooks +millivolt +counterpoise +Gothicism +feminine +metaphysically +sanding +contributorily +receivers +adjourn +straggled +druggists +thanking +ostrich +hopelessness +Eurydice +excitation +presumes +imaginable +concoct +peering +Phelps +ferociousness +sentences +unlocks +engrossing +Ruth +tying +exclaimers +synergy +Huey +merging +judges +Shylock +Miltonism +hen +honeybee +towers +dilutes +numerals +democracy +Ibero- +invalids +behavior +accruing +relics +rackets +Fischbein +phony +cross +cleanup +conspirator +label +university +cleansed +ballgown +starlet +aqueous +portrayal +despising +distort +palmed +faced +silverware +assessor +spiders +artificially +reminiscence +Mexican +obnoxious +fragile +apprehensible +births +garages +panty +anteater +displacement +drovers +patenting +far +shrieks +aligning +pragmatism +fevers +reexamines +occupancies +sweats +modulators +demand +Madeira +Viennese +chillier +wildcats +gentle +Angles +accuracies +toggle +Mendelssohn +behaviorally +Rochford +mirror +Modula +clobbering +chronography +Eskimoizeds +British +pitfalls +verify +scatter +Aztecan +acuity +sinking +beasts +Witt +physicists +folksong +strokes +crowder +merry +cadenced +alimony +principled +golfing +undiscovered +irritates +patriots +rooms +towering +displease +photosensitive +inking +gainers +leaning +hydrant +preserve +blinded +interactions +Barry +whiteness +pastimes +Edenization +Muscat +assassinated +labeled +glacial +implied +bibliographies +Buchanan +forgivably +innuendo +den +submarines +mouthful +expiring +unfulfilled +precession +nullified +affects +Cynthia +Chablis +betterments +advertising +rubies +southwest +superstitious +tabernacle +silk +handsomest +Persian +analog +complex +Taoist +suspend +relegated +awesome +Bruxelles +imprecisely +televise +braking +true +disappointing +navally +circus +beetles +trumps +fourscore +Blackfoots +Grady +quiets +floundered +profundity +Garrisonian +Strauss +cemented +contrition +mutations +exhibits +tits +mate +arches +Moll +ropers +bombast +difficultly +adsorption +definiteness +cultivation +heals +Heusen +target +cited +congresswoman +Katherine +titter +aspire +Mardis +Nadia +estimating +stuck +fifteenth +Colombo +survey +staffing +obtain +loaded +slaughtered +lights +circumference +dull +weekly +wetness +visualized +Tannenbaum +moribund +demultiplex +lockings +thugs +unnerves +abut +Chippewa +stratifications +signaled +Italianizes +algorithmic +paranoid +camping +signifying +Patrice +search +Angeles +semblance +taxed +Beatrice +retrace +lockout +grammatic +helmsman +uniform +hamming +disobedience +captivated +transferals +cartographer +aims +Pakistani +burglarized +saucepans +lacerating +corny +megabytes +chancellor +bulk +commits +meson +deputies +northeaster +dipole +machining +therefore +Telefunken +salvaging +Corinthianizes +restlessly +bromides +generalized +mishaps +quelling +spiritual +beguiles +Trobriand +fleeing +Armour +chin +provers +aeronautic +voltage +sash +anaerobic +simultaneous +accumulating +Medusan +shouted +freakish +index +commercially +mistiness +endpoint +straight +flurried +denotative +coming +commencements +gentleman +gifted +Shanghais +sportswriting +sloping +navies +leaflet +shooter +Joplin +babies +subdivision +burstiness +belted +assails +admiring +swaying +Goldstine +fitting +Norwalk +weakening +analogy +deludes +cokes +Clayton +exhausts +causality +sating +icon +throttles +communicants +dehydrate +priceless +publicly +incidentals +commonplace +mumbles +furthermore +cautioned +parametrized +registration +sadly +positioning +babysitting +eternal +hoarder +congregates +rains +workers +sags +unplug +garage +boulder +hollowly +specifics +Teresa +Winsett +convenient +buckboards +amenities +resplendent +priding +configurations +untidiness +Brice +sews +participated +Simon +certificates +Fitzpatrick +Evanston +misted +textures +save +count +rightful +chaperone +Lizzy +clenched +effortlessly +accessed +beaters +Hornblower +vests +indulgences +infallibly +unwilling +excrete +spools +crunches +overestimating +ineffective +humiliation +sophomore +star +rifles +dialysis +arriving +indulge +clockers +languages +Antarctica +percentage +ceiling +specification +regimented +ciphers +pictures +serpents +allot +realized +mayoral +opaquely +hostess +fiftieth +incorrectly +decomposition +stranglings +mixture +electroencephalography +similarities +charges +freest +Greenberg +tinting +expelled +warm +smoothed +deductions +Romano +bitterroot +corset +securing +environing +cute +Crays +heiress +inform +avenge +universals +Kinsey +ravines +bestseller +equilibrium +extents +relatively +pressure +critiques +befouled +rightfully +mechanizing +Latinizes +timesharing +Aden +embassies +males +shapelessly +genres +mastering +Newtonian +finishers +abates +teem +kiting +stodgy +scalps +feed +guitars +airships +store +denounces +Pyle +Saxony +serializations +Peruvian +taxonomically +kingdom +stint +Sault +faithful +Ganymede +tidiness +gainful +contrary +Tipperary +tropics +theorizers +renew +already +terminal +Hegelian +hypothesizer +warningly +journalizing +nested +Lars +saplings +foothill +labeled +imperiously +reporters +furnishings +precipitable +discounts +excises +Stalin +despot +ripeness +Arabia +unruly +mournfulness +boom +slaughter +Sabine +handy +rural +organizer +shipyard +civics +inaccuracy +rules +juveniles +comprised +investigations +stabilizes +seminaries +Hunter +sporty +test +weasels +CERN +tempering +afore +Galatean +techniques +error +veranda +severely +Cassites +forthcoming +guides +vanish +lied +sawtooth +fated +gradually +widens +preclude +Jobrel +hooker +rainstorm +disconnects +cruelty +exponentials +affective +arteries +Crosby +acquaint +evenhandedly +percentage +disobedience +humility +gleaning +petted +bloater +minion +marginal +apiary +measures +precaution +repelled +primary +coverings +Artemia +navigate +spatial +Gurkha +meanwhile +Melinda +Butterfield +Aldrich +previewing +glut +unaffected +inmate +mineral +impending +meditation +ideas +miniaturizes +lewdly +title +youthfulness +creak +Chippewa +clamored +freezes +forgivably +reduce +McGovern +Nazis +epistle +socializes +conceptions +Kevin +uncovering +chews +appendixes +appendixes +appendixes +appendixes +appendixes +appendixes +raining +infest +compartment +minting +ducks +roped +waltz +Lillian +repressions +chillingly +noncritical +lithograph +spongers +parenthood +posed +instruments +filial +fixedly +relives +Pandora +watering +ungrateful +secures +chastisers +icon +reuniting +imagining +abiding +omnisciently +Britannic +scholastics +mechanics +humidly +masterpiece +however +Mendelian +jarred +scolds +infatuate +willed +joyfully +Microsoft +fibrosities +Baltimorean +equestrian +Goodrich +apish +Adlerian +Tropez +nouns +distracting +mutton +bridgeable +stickers +transcontinental +amateurish +Gandhian +stratified +chamberlains +creditably +philosophic +ores +Carleton +tape +afloat +goodness +welcoming +Pinsky +halting +bibliography +decoding +variance +allowed +dire +dub +poisoning +Iraqis +heaving +population +bomb +Majorca +Gershwins +explorers +libretto +occurred +Lagos +rats +bankruptcies +crying +unexpected +accessed +colorful +versatility +cosy +Darius +mastering +Asiaticizations +offerers +uncles +sleepwalk +Ernestine +checksumming +stopped +sicker +Italianization +alphabetic +pharmaceutic +creator +chess +charcoal +Epiphany +bulldozes +Pygmalion +caressing +Palestine +regimented +scars +realest +diffusing +clubroom +Blythe +ahead +reviver +retransmitting +landslide +Eiffel +absentee +aye +forked +Peruvianizes +clerked +tutor +boulevard +shuttered +quotes +Caltech +Mossberg +kept +roundly +features +imaginable +controller +racial +uprisings +narrowed +cannot +vest +famine +sugars +exterminated +belays +Hodges +translatable +duality +recording +rouses +poison +attitude +dusted +encompasses +presentation +Kantian +imprecision +saving +maternal +hewed +kerosene +Cubans +photographers +nymph +bedlam +north +Schoenberg +botany +curs +solidification +inheritresses +stiller +t1 +suite +ransomer +Willy +Rena +Seattle +relaxes +exclaim +exclaim +implicated +distinguish +assayed +homeowner +and +stealth +coinciding +founder +environing +jewelry +lemons +brokenness +bedpost +assurers +annoyers +affixed +warbling +seriously +boasted +Chantilly +Iranizes +violinist +extramarital +spates +cloakroom +gazer +hand +tucked +gems +clinker +refiner +callus +leopards +comfortingly +generically +getters +sexually +spear +serums +Italianization +attendants +spies +Anthony +planar +cupped +cleanser +commuters +honeysuckle +orphanage +skies +crushers +Puritan +squeezer +bruises +bonfire +Colombo +nondecreasing +DELETE FROM t2 WHERE fld3="r%"; +SELECT fld3 FROM t2; +fld3 +Omaha +breaking +Romans +intercepted +bewilderingly +astound +admonishing +sumac +flanking +combed +subjective +scatterbrain +Eulerian +dubbed +Kane +overlay +perturb +goblins +annihilates +Wotan +snatching +concludes +laterally +yelped +grazing +Baird +celery +misunderstander +handgun +foldout +mystic +succumbed +Nabisco +fingerings +aging +afield +ammonium +boat +intelligibility +Augustine +teethe +dreaded +scholastics +audiology +wallet +parters +eschew +quitter +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +capably +impulsive +starlet +terminators +untying +announces +featherweight +pessimist +daughter +decliner +lawgiver +stated +readable +attrition +cascade +motors +interrogate +pests +stairway +dopers +testicle +Parsifal +leavings +postulation +squeaking +contrasted +leftover +whiteners +erases +Punjab +Merritt +Quixotism +sweetish +dogging +scornfully +bellow +bills +cupboard +sureties +puddings +tapestry +fetters +bivalves +incurring +Adolph +pithed +emergency +Miles +trimmings +tragedies +skulking +flint +flopping +relaxing +offload +suites +lists +animized +multilayer +standardizes +Judas +vacuuming +dentally +humanness +inch +Weissmuller +irresponsibly +luckily +culled +medical +bloodbath +subschema +animals +Micronesia +repetitions +Antares +ventilate +pityingly +interdependent +Graves +neonatal +scribbled +chafe +honoring +realtor +elite +funereal +abrogating +sorters +Conley +lectured +Abraham +Hawaii +cage +hushes +Simla +reporters +Dutchman +descendants +groupings +dissociate +coexist +Beebe +Taoism +Connally +fetched +checkpoints +rusting +galling +obliterates +traitor +resumes +analyzable +terminator +gritty +firearm +minima +Selfridge +disable +witchcraft +betroth +Manhattanize +imprint +peeked +swelling +interrelationships +riser +Gandhian +peacock +bee +kanji +dental +scarf +chasm +insolence +syndicate +alike +imperial +convulsion +railway +validate +normalizes +comprehensive +chewing +denizen +schemer +chronicle +Kline +Anatole +partridges +brunch +recruited +dimensions +Chicana +announced +praised +employing +linear +quagmire +western +relishing +serving +scheduling +lore +eventful +arteriole +disentangle +cured +Fenton +avoidable +drains +detectably +husky +impelling +undoes +evened +squeezes +destroyer +rudeness +beaner +boorish +Everhart +encompass +mushrooms +Alison +externally +pellagra +cult +creek +Huffman +Majorca +governing +gadfly +reassigned +intentness +craziness +psychic +squabbled +burlesque +capped +extracted +DiMaggio +exclamation +subdirectory +fangs +buyer +pithing +transistorizing +nonbiodegradable +dislocate +monochromatic +batting +postcondition +catalog +Remus +devices +bike +qualify +detained +commended +civilize +Elmhurst +anesthetizing +deaf +Brigham +title +coarse +combinations +grayness +innumerable +Caroline +fatty +eastbound +inexperienced +hoarder +scotch +passport +strategic +gated +flog +Pipestone +Dar +Corcoran +flyers +competitions +suppliers +skips +institutes +troop +connective +denies +polka +observations +askers +homeless +Anna +subdirectories +decaying +outwitting +Harpy +crazed +suffocate +provers +technically +Franklinizations +considered +tinnily +uninterruptedly +whistled +automate +gutting +surreptitious +Choctaw +cooks +millivolt +counterpoise +Gothicism +feminine +metaphysically +sanding +contributorily +receivers +adjourn +straggled +druggists +thanking +ostrich +hopelessness +Eurydice +excitation +presumes +imaginable +concoct +peering +Phelps +ferociousness +sentences +unlocks +engrossing +Ruth +tying +exclaimers +synergy +Huey +merging +judges +Shylock +Miltonism +hen +honeybee +towers +dilutes +numerals +democracy +Ibero- +invalids +behavior +accruing +relics +rackets +Fischbein +phony +cross +cleanup +conspirator +label +university +cleansed +ballgown +starlet +aqueous +portrayal +despising +distort +palmed +faced +silverware +assessor +spiders +artificially +reminiscence +Mexican +obnoxious +fragile +apprehensible +births +garages +panty +anteater +displacement +drovers +patenting +far +shrieks +aligning +pragmatism +fevers +reexamines +occupancies +sweats +modulators +demand +Madeira +Viennese +chillier +wildcats +gentle +Angles +accuracies +toggle +Mendelssohn +behaviorally +Rochford +mirror +Modula +clobbering +chronography +Eskimoizeds +British +pitfalls +verify +scatter +Aztecan +acuity +sinking +beasts +Witt +physicists +folksong +strokes +crowder +merry +cadenced +alimony +principled +golfing +undiscovered +irritates +patriots +rooms +towering +displease +photosensitive +inking +gainers +leaning +hydrant +preserve +blinded +interactions +Barry +whiteness +pastimes +Edenization +Muscat +assassinated +labeled +glacial +implied +bibliographies +Buchanan +forgivably +innuendo +den +submarines +mouthful +expiring +unfulfilled +precession +nullified +affects +Cynthia +Chablis +betterments +advertising +rubies +southwest +superstitious +tabernacle +silk +handsomest +Persian +analog +complex +Taoist +suspend +relegated +awesome +Bruxelles +imprecisely +televise +braking +true +disappointing +navally +circus +beetles +trumps +fourscore +Blackfoots +Grady +quiets +floundered +profundity +Garrisonian +Strauss +cemented +contrition +mutations +exhibits +tits +mate +arches +Moll +ropers +bombast +difficultly +adsorption +definiteness +cultivation +heals +Heusen +target +cited +congresswoman +Katherine +titter +aspire +Mardis +Nadia +estimating +stuck +fifteenth +Colombo +survey +staffing +obtain +loaded +slaughtered +lights +circumference +dull +weekly +wetness +visualized +Tannenbaum +moribund +demultiplex +lockings +thugs +unnerves +abut +Chippewa +stratifications +signaled +Italianizes +algorithmic +paranoid +camping +signifying +Patrice +search +Angeles +semblance +taxed +Beatrice +retrace +lockout +grammatic +helmsman +uniform +hamming +disobedience +captivated +transferals +cartographer +aims +Pakistani +burglarized +saucepans +lacerating +corny +megabytes +chancellor +bulk +commits +meson +deputies +northeaster +dipole +machining +therefore +Telefunken +salvaging +Corinthianizes +restlessly +bromides +generalized +mishaps +quelling +spiritual +beguiles +Trobriand +fleeing +Armour +chin +provers +aeronautic +voltage +sash +anaerobic +simultaneous +accumulating +Medusan +shouted +freakish +index +commercially +mistiness +endpoint +straight +flurried +denotative +coming +commencements +gentleman +gifted +Shanghais +sportswriting +sloping +navies +leaflet +shooter +Joplin +babies +subdivision +burstiness +belted +assails +admiring +swaying +Goldstine +fitting +Norwalk +weakening +analogy +deludes +cokes +Clayton +exhausts +causality +sating +icon +throttles +communicants +dehydrate +priceless +publicly +incidentals +commonplace +mumbles +furthermore +cautioned +parametrized +registration +sadly +positioning +babysitting +eternal +hoarder +congregates +rains +workers +sags +unplug +garage +boulder +hollowly +specifics +Teresa +Winsett +convenient +buckboards +amenities +resplendent +priding +configurations +untidiness +Brice +sews +participated +Simon +certificates +Fitzpatrick +Evanston +misted +textures +save +count +rightful +chaperone +Lizzy +clenched +effortlessly +accessed +beaters +Hornblower +vests +indulgences +infallibly +unwilling +excrete +spools +crunches +overestimating +ineffective +humiliation +sophomore +star +rifles +dialysis +arriving +indulge +clockers +languages +Antarctica +percentage +ceiling +specification +regimented +ciphers +pictures +serpents +allot +realized +mayoral +opaquely +hostess +fiftieth +incorrectly +decomposition +stranglings +mixture +electroencephalography +similarities +charges +freest +Greenberg +tinting +expelled +warm +smoothed +deductions +Romano +bitterroot +corset +securing +environing +cute +Crays +heiress +inform +avenge +universals +Kinsey +ravines +bestseller +equilibrium +extents +relatively +pressure +critiques +befouled +rightfully +mechanizing +Latinizes +timesharing +Aden +embassies +males +shapelessly +genres +mastering +Newtonian +finishers +abates +teem +kiting +stodgy +scalps +feed +guitars +airships +store +denounces +Pyle +Saxony +serializations +Peruvian +taxonomically +kingdom +stint +Sault +faithful +Ganymede +tidiness +gainful +contrary +Tipperary +tropics +theorizers +renew +already +terminal +Hegelian +hypothesizer +warningly +journalizing +nested +Lars +saplings +foothill +labeled +imperiously +reporters +furnishings +precipitable +discounts +excises +Stalin +despot +ripeness +Arabia +unruly +mournfulness +boom +slaughter +Sabine +handy +rural +organizer +shipyard +civics +inaccuracy +rules +juveniles +comprised +investigations +stabilizes +seminaries +Hunter +sporty +test +weasels +CERN +tempering +afore +Galatean +techniques +error +veranda +severely +Cassites +forthcoming +guides +vanish +lied +sawtooth +fated +gradually +widens +preclude +Jobrel +hooker +rainstorm +disconnects +cruelty +exponentials +affective +arteries +Crosby +acquaint +evenhandedly +percentage +disobedience +humility +gleaning +petted +bloater +minion +marginal +apiary +measures +precaution +repelled +primary +coverings +Artemia +navigate +spatial +Gurkha +meanwhile +Melinda +Butterfield +Aldrich +previewing +glut +unaffected +inmate +mineral +impending +meditation +ideas +miniaturizes +lewdly +title +youthfulness +creak +Chippewa +clamored +freezes +forgivably +reduce +McGovern +Nazis +epistle +socializes +conceptions +Kevin +uncovering +chews +appendixes +appendixes +appendixes +appendixes +appendixes +appendixes +raining +infest +compartment +minting +ducks +roped +waltz +Lillian +repressions +chillingly +noncritical +lithograph +spongers +parenthood +posed +instruments +filial +fixedly +relives +Pandora +watering +ungrateful +secures +chastisers +icon +reuniting +imagining +abiding +omnisciently +Britannic +scholastics +mechanics +humidly +masterpiece +however +Mendelian +jarred +scolds +infatuate +willed +joyfully +Microsoft +fibrosities +Baltimorean +equestrian +Goodrich +apish +Adlerian +Tropez +nouns +distracting +mutton +bridgeable +stickers +transcontinental +amateurish +Gandhian +stratified +chamberlains +creditably +philosophic +ores +Carleton +tape +afloat +goodness +welcoming +Pinsky +halting +bibliography +decoding +variance +allowed +dire +dub +poisoning +Iraqis +heaving +population +bomb +Majorca +Gershwins +explorers +libretto +occurred +Lagos +rats +bankruptcies +crying +unexpected +accessed +colorful +versatility +cosy +Darius +mastering +Asiaticizations +offerers +uncles +sleepwalk +Ernestine +checksumming +stopped +sicker +Italianization +alphabetic +pharmaceutic +creator +chess +charcoal +Epiphany +bulldozes +Pygmalion +caressing +Palestine +regimented +scars +realest +diffusing +clubroom +Blythe +ahead +reviver +retransmitting +landslide +Eiffel +absentee +aye +forked +Peruvianizes +clerked +tutor +boulevard +shuttered +quotes +Caltech +Mossberg +kept +roundly +features +imaginable +controller +racial +uprisings +narrowed +cannot +vest +famine +sugars +exterminated +belays +Hodges +translatable +duality +recording +rouses +poison +attitude +dusted +encompasses +presentation +Kantian +imprecision +saving +maternal +hewed +kerosene +Cubans +photographers +nymph +bedlam +north +Schoenberg +botany +curs +solidification +inheritresses +stiller +t1 +suite +ransomer +Willy +Rena +Seattle +relaxes +exclaim +exclaim +implicated +distinguish +assayed +homeowner +and +stealth +coinciding +founder +environing +jewelry +lemons +brokenness +bedpost +assurers +annoyers +affixed +warbling +seriously +boasted +Chantilly +Iranizes +violinist +extramarital +spates +cloakroom +gazer +hand +tucked +gems +clinker +refiner +callus +leopards +comfortingly +generically +getters +sexually +spear +serums +Italianization +attendants +spies +Anthony +planar +cupped +cleanser +commuters +honeysuckle +orphanage +skies +crushers +Puritan +squeezer +bruises +bonfire +Colombo +nondecreasing +DELETE FROM t2 WHERE fld3="d%" ORDER BY RAND(); +SELECT fld3 FROM t2; +fld3 +Omaha +breaking +Romans +intercepted +bewilderingly +astound +admonishing +sumac +flanking +combed +subjective +scatterbrain +Eulerian +dubbed +Kane +overlay +perturb +goblins +annihilates +Wotan +snatching +concludes +laterally +yelped +grazing +Baird +celery +misunderstander +handgun +foldout +mystic +succumbed +Nabisco +fingerings +aging +afield +ammonium +boat +intelligibility +Augustine +teethe +dreaded +scholastics +audiology +wallet +parters +eschew +quitter +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +capably +impulsive +starlet +terminators +untying +announces +featherweight +pessimist +daughter +decliner +lawgiver +stated +readable +attrition +cascade +motors +interrogate +pests +stairway +dopers +testicle +Parsifal +leavings +postulation +squeaking +contrasted +leftover +whiteners +erases +Punjab +Merritt +Quixotism +sweetish +dogging +scornfully +bellow +bills +cupboard +sureties +puddings +tapestry +fetters +bivalves +incurring +Adolph +pithed +emergency +Miles +trimmings +tragedies +skulking +flint +flopping +relaxing +offload +suites +lists +animized +multilayer +standardizes +Judas +vacuuming +dentally +humanness +inch +Weissmuller +irresponsibly +luckily +culled +medical +bloodbath +subschema +animals +Micronesia +repetitions +Antares +ventilate +pityingly +interdependent +Graves +neonatal +scribbled +chafe +honoring +realtor +elite +funereal +abrogating +sorters +Conley +lectured +Abraham +Hawaii +cage +hushes +Simla +reporters +Dutchman +descendants +groupings +dissociate +coexist +Beebe +Taoism +Connally +fetched +checkpoints +rusting +galling +obliterates +traitor +resumes +analyzable +terminator +gritty +firearm +minima +Selfridge +disable +witchcraft +betroth +Manhattanize +imprint +peeked +swelling +interrelationships +riser +Gandhian +peacock +bee +kanji +dental +scarf +chasm +insolence +syndicate +alike +imperial +convulsion +railway +validate +normalizes +comprehensive +chewing +denizen +schemer +chronicle +Kline +Anatole +partridges +brunch +recruited +dimensions +Chicana +announced +praised +employing +linear +quagmire +western +relishing +serving +scheduling +lore +eventful +arteriole +disentangle +cured +Fenton +avoidable +drains +detectably +husky +impelling +undoes +evened +squeezes +destroyer +rudeness +beaner +boorish +Everhart +encompass +mushrooms +Alison +externally +pellagra +cult +creek +Huffman +Majorca +governing +gadfly +reassigned +intentness +craziness +psychic +squabbled +burlesque +capped +extracted +DiMaggio +exclamation +subdirectory +fangs +buyer +pithing +transistorizing +nonbiodegradable +dislocate +monochromatic +batting +postcondition +catalog +Remus +devices +bike +qualify +detained +commended +civilize +Elmhurst +anesthetizing +deaf +Brigham +title +coarse +combinations +grayness +innumerable +Caroline +fatty +eastbound +inexperienced +hoarder +scotch +passport +strategic +gated +flog +Pipestone +Dar +Corcoran +flyers +competitions +suppliers +skips +institutes +troop +connective +denies +polka +observations +askers +homeless +Anna +subdirectories +decaying +outwitting +Harpy +crazed +suffocate +provers +technically +Franklinizations +considered +tinnily +uninterruptedly +whistled +automate +gutting +surreptitious +Choctaw +cooks +millivolt +counterpoise +Gothicism +feminine +metaphysically +sanding +contributorily +receivers +adjourn +straggled +druggists +thanking +ostrich +hopelessness +Eurydice +excitation +presumes +imaginable +concoct +peering +Phelps +ferociousness +sentences +unlocks +engrossing +Ruth +tying +exclaimers +synergy +Huey +merging +judges +Shylock +Miltonism +hen +honeybee +towers +dilutes +numerals +democracy +Ibero- +invalids +behavior +accruing +relics +rackets +Fischbein +phony +cross +cleanup +conspirator +label +university +cleansed +ballgown +starlet +aqueous +portrayal +despising +distort +palmed +faced +silverware +assessor +spiders +artificially +reminiscence +Mexican +obnoxious +fragile +apprehensible +births +garages +panty +anteater +displacement +drovers +patenting +far +shrieks +aligning +pragmatism +fevers +reexamines +occupancies +sweats +modulators +demand +Madeira +Viennese +chillier +wildcats +gentle +Angles +accuracies +toggle +Mendelssohn +behaviorally +Rochford +mirror +Modula +clobbering +chronography +Eskimoizeds +British +pitfalls +verify +scatter +Aztecan +acuity +sinking +beasts +Witt +physicists +folksong +strokes +crowder +merry +cadenced +alimony +principled +golfing +undiscovered +irritates +patriots +rooms +towering +displease +photosensitive +inking +gainers +leaning +hydrant +preserve +blinded +interactions +Barry +whiteness +pastimes +Edenization +Muscat +assassinated +labeled +glacial +implied +bibliographies +Buchanan +forgivably +innuendo +den +submarines +mouthful +expiring +unfulfilled +precession +nullified +affects +Cynthia +Chablis +betterments +advertising +rubies +southwest +superstitious +tabernacle +silk +handsomest +Persian +analog +complex +Taoist +suspend +relegated +awesome +Bruxelles +imprecisely +televise +braking +true +disappointing +navally +circus +beetles +trumps +fourscore +Blackfoots +Grady +quiets +floundered +profundity +Garrisonian +Strauss +cemented +contrition +mutations +exhibits +tits +mate +arches +Moll +ropers +bombast +difficultly +adsorption +definiteness +cultivation +heals +Heusen +target +cited +congresswoman +Katherine +titter +aspire +Mardis +Nadia +estimating +stuck +fifteenth +Colombo +survey +staffing +obtain +loaded +slaughtered +lights +circumference +dull +weekly +wetness +visualized +Tannenbaum +moribund +demultiplex +lockings +thugs +unnerves +abut +Chippewa +stratifications +signaled +Italianizes +algorithmic +paranoid +camping +signifying +Patrice +search +Angeles +semblance +taxed +Beatrice +retrace +lockout +grammatic +helmsman +uniform +hamming +disobedience +captivated +transferals +cartographer +aims +Pakistani +burglarized +saucepans +lacerating +corny +megabytes +chancellor +bulk +commits +meson +deputies +northeaster +dipole +machining +therefore +Telefunken +salvaging +Corinthianizes +restlessly +bromides +generalized +mishaps +quelling +spiritual +beguiles +Trobriand +fleeing +Armour +chin +provers +aeronautic +voltage +sash +anaerobic +simultaneous +accumulating +Medusan +shouted +freakish +index +commercially +mistiness +endpoint +straight +flurried +denotative +coming +commencements +gentleman +gifted +Shanghais +sportswriting +sloping +navies +leaflet +shooter +Joplin +babies +subdivision +burstiness +belted +assails +admiring +swaying +Goldstine +fitting +Norwalk +weakening +analogy +deludes +cokes +Clayton +exhausts +causality +sating +icon +throttles +communicants +dehydrate +priceless +publicly +incidentals +commonplace +mumbles +furthermore +cautioned +parametrized +registration +sadly +positioning +babysitting +eternal +hoarder +congregates +rains +workers +sags +unplug +garage +boulder +hollowly +specifics +Teresa +Winsett +convenient +buckboards +amenities +resplendent +priding +configurations +untidiness +Brice +sews +participated +Simon +certificates +Fitzpatrick +Evanston +misted +textures +save +count +rightful +chaperone +Lizzy +clenched +effortlessly +accessed +beaters +Hornblower +vests +indulgences +infallibly +unwilling +excrete +spools +crunches +overestimating +ineffective +humiliation +sophomore +star +rifles +dialysis +arriving +indulge +clockers +languages +Antarctica +percentage +ceiling +specification +regimented +ciphers +pictures +serpents +allot +realized +mayoral +opaquely +hostess +fiftieth +incorrectly +decomposition +stranglings +mixture +electroencephalography +similarities +charges +freest +Greenberg +tinting +expelled +warm +smoothed +deductions +Romano +bitterroot +corset +securing +environing +cute +Crays +heiress +inform +avenge +universals +Kinsey +ravines +bestseller +equilibrium +extents +relatively +pressure +critiques +befouled +rightfully +mechanizing +Latinizes +timesharing +Aden +embassies +males +shapelessly +genres +mastering +Newtonian +finishers +abates +teem +kiting +stodgy +scalps +feed +guitars +airships +store +denounces +Pyle +Saxony +serializations +Peruvian +taxonomically +kingdom +stint +Sault +faithful +Ganymede +tidiness +gainful +contrary +Tipperary +tropics +theorizers +renew +already +terminal +Hegelian +hypothesizer +warningly +journalizing +nested +Lars +saplings +foothill +labeled +imperiously +reporters +furnishings +precipitable +discounts +excises +Stalin +despot +ripeness +Arabia +unruly +mournfulness +boom +slaughter +Sabine +handy +rural +organizer +shipyard +civics +inaccuracy +rules +juveniles +comprised +investigations +stabilizes +seminaries +Hunter +sporty +test +weasels +CERN +tempering +afore +Galatean +techniques +error +veranda +severely +Cassites +forthcoming +guides +vanish +lied +sawtooth +fated +gradually +widens +preclude +Jobrel +hooker +rainstorm +disconnects +cruelty +exponentials +affective +arteries +Crosby +acquaint +evenhandedly +percentage +disobedience +humility +gleaning +petted +bloater +minion +marginal +apiary +measures +precaution +repelled +primary +coverings +Artemia +navigate +spatial +Gurkha +meanwhile +Melinda +Butterfield +Aldrich +previewing +glut +unaffected +inmate +mineral +impending +meditation +ideas +miniaturizes +lewdly +title +youthfulness +creak +Chippewa +clamored +freezes +forgivably +reduce +McGovern +Nazis +epistle +socializes +conceptions +Kevin +uncovering +chews +appendixes +appendixes +appendixes +appendixes +appendixes +appendixes +raining +infest +compartment +minting +ducks +roped +waltz +Lillian +repressions +chillingly +noncritical +lithograph +spongers +parenthood +posed +instruments +filial +fixedly +relives +Pandora +watering +ungrateful +secures +chastisers +icon +reuniting +imagining +abiding +omnisciently +Britannic +scholastics +mechanics +humidly +masterpiece +however +Mendelian +jarred +scolds +infatuate +willed +joyfully +Microsoft +fibrosities +Baltimorean +equestrian +Goodrich +apish +Adlerian +Tropez +nouns +distracting +mutton +bridgeable +stickers +transcontinental +amateurish +Gandhian +stratified +chamberlains +creditably +philosophic +ores +Carleton +tape +afloat +goodness +welcoming +Pinsky +halting +bibliography +decoding +variance +allowed +dire +dub +poisoning +Iraqis +heaving +population +bomb +Majorca +Gershwins +explorers +libretto +occurred +Lagos +rats +bankruptcies +crying +unexpected +accessed +colorful +versatility +cosy +Darius +mastering +Asiaticizations +offerers +uncles +sleepwalk +Ernestine +checksumming +stopped +sicker +Italianization +alphabetic +pharmaceutic +creator +chess +charcoal +Epiphany +bulldozes +Pygmalion +caressing +Palestine +regimented +scars +realest +diffusing +clubroom +Blythe +ahead +reviver +retransmitting +landslide +Eiffel +absentee +aye +forked +Peruvianizes +clerked +tutor +boulevard +shuttered +quotes +Caltech +Mossberg +kept +roundly +features +imaginable +controller +racial +uprisings +narrowed +cannot +vest +famine +sugars +exterminated +belays +Hodges +translatable +duality +recording +rouses +poison +attitude +dusted +encompasses +presentation +Kantian +imprecision +saving +maternal +hewed +kerosene +Cubans +photographers +nymph +bedlam +north +Schoenberg +botany +curs +solidification +inheritresses +stiller +t1 +suite +ransomer +Willy +Rena +Seattle +relaxes +exclaim +exclaim +implicated +distinguish +assayed +homeowner +and +stealth +coinciding +founder +environing +jewelry +lemons +brokenness +bedpost +assurers +annoyers +affixed +warbling +seriously +boasted +Chantilly +Iranizes +violinist +extramarital +spates +cloakroom +gazer +hand +tucked +gems +clinker +refiner +callus +leopards +comfortingly +generically +getters +sexually +spear +serums +Italianization +attendants +spies +Anthony +planar +cupped +cleanser +commuters +honeysuckle +orphanage +skies +crushers +Puritan +squeezer +bruises +bonfire +Colombo +nondecreasing +DROP TABLE t1; +ALTER TABLE t2 RENAME t1 +#; +DROP TABLE t1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE = CSV; +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +drop table if exists t1,t2,t3,t4; +Warnings: +Note 1051 Unknown table 't2' +Note 1051 Unknown table 't3' +Note 1051 Unknown table 't4' diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result new file mode 100644 index 00000000000..44fad0cd96a --- /dev/null +++ b/mysql-test/r/ctype_big5.result @@ -0,0 +1,10 @@ +drop table if exists t1; +SET NAMES big5; +CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c)); +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT * FROM t1 WHERE c LIKE 'aaa%'; +c +aaa +aaaa +aaaaa +DROP TABLE t1; diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result new file mode 100644 index 00000000000..d4a8beda185 --- /dev/null +++ b/mysql-test/r/ctype_collate.result @@ -0,0 +1,584 @@ +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +CREATE TABLE t1 ( +latin1_f CHAR(32) CHARACTER SET latin1 NOT NULL +); +CREATE TABLE t2 ( +latin1_f CHAR(32) CHARACTER SET latin1 COLLATE koi8r_general_ci NOT NULL +); +ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' +CREATE TABLE t2 ( +latin1_f CHAR(32) CHARACTER SET latin1 COLLATE some_non_existing_col NOT NULL +); +ERROR HY000: Unknown collation: 'some_non_existing_col' +INSERT INTO t1 (latin1_f) VALUES (_latin1'A'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'a'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'AD'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ad'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'AE'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ae'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'AF'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'af'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'Ä'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ä'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'Å'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'å'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'B'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'b'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'U'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'u'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'UE'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ue'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'Ü'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ü'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'SS'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ss'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'ß'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'Y'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'y'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'Z'); +INSERT INTO t1 (latin1_f) VALUES (_latin1'z'); +SELECT latin1_f FROM t1 ORDER BY latin1_f; +latin1_f +A +a +AD +ad +ae +AE +AF +af +b +B +SS +ss +u +U +UE +ue +Y +y +ü +Ü +Z +z +å +Å +Ä +ä +ß +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_swedish_ci; +latin1_f +A +a +AD +ad +ae +AE +AF +af +b +B +SS +ss +u +U +UE +ue +Y +y +ü +Ü +Z +z +å +Å +Ä +ä +ß +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci; +latin1_f +A +a +Å +å +AD +ad +Ä +ae +AE +ä +af +AF +b +B +ß +ss +SS +U +u +ue +UE +ü +Ü +Y +y +Z +z +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci; +latin1_f +A +a +AD +ad +AE +ae +af +AF +Ä +ä +Å +å +b +B +ss +SS +ß +U +u +UE +ue +ü +Ü +Y +y +Z +z +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin; +latin1_f +A +AD +AE +AF +B +SS +U +UE +Y +Z +a +ad +ae +af +b +ss +u +ue +y +z +Ä +Å +Ü +ß +ä +å +ü +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r_general_ci; +ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' +SELECT latin1_f COLLATE latin1_swedish_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +latin1_f_as +A +a +AD +ad +ae +AE +AF +af +b +B +SS +ss +u +U +UE +ue +Y +y +ü +Ü +Z +z +å +Å +Ä +ä +ß +SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +latin1_f_as +A +a +Å +å +AD +ad +Ä +ae +AE +ä +af +AF +b +B +ß +ss +SS +U +u +ue +UE +ü +Ü +Y +y +Z +z +SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +latin1_f_as +A +a +AD +ad +AE +ae +af +AF +Ä +ä +Å +å +b +B +ss +SS +ß +U +u +UE +ue +ü +Ü +Y +y +Z +z +SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +latin1_f_as +A +AD +AE +AF +B +SS +U +UE +Y +Z +a +ad +ae +af +b +ss +u +ue +y +z +Ä +Å +Ü +ß +ä +å +ü +SELECT latin1_f COLLATE koi8r_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; +latin1_f count(*) +A 2 +AD 2 +AE 2 +AF 2 +B 2 +SS 2 +U 2 +UE 2 +Ü 4 +Z 2 +Å 2 +Ä 2 +ß 1 +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_swedish_ci; +latin1_f count(*) +A 2 +AD 2 +AE 2 +AF 2 +B 2 +SS 2 +U 2 +UE 2 +Ü 4 +Z 2 +Å 2 +Ä 2 +ß 1 +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci; +latin1_f count(*) +A 4 +AD 2 +AE 4 +AF 2 +B 2 +SS 3 +U 2 +UE 4 +Y 2 +Z 2 +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci; +latin1_f count(*) +A 2 +AD 2 +AE 2 +AF 2 +Ä 2 +Å 2 +B 2 +SS 2 +ß 1 +U 2 +UE 2 +Ü 2 +Y 2 +Z 2 +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin; +latin1_f count(*) +A 1 +AD 1 +AE 1 +AF 1 +B 1 +SS 1 +U 1 +UE 1 +Y 1 +Z 1 +a 1 +ad 1 +ae 1 +af 1 +b 1 +ss 1 +u 1 +ue 1 +y 1 +z 1 +Ä 1 +Å 1 +Ü 1 +ß 1 +ä 1 +å 1 +ü 1 +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r_general_ci; +ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' +SELECT DISTINCT latin1_f FROM t1; +latin1_f +A +AD +AE +AF +Ä +Å +B +U +UE +Ü +SS +ß +Z +SELECT DISTINCT latin1_f COLLATE latin1_swedish_ci FROM t1; +latin1_f COLLATE latin1_swedish_ci +A +AD +AE +AF +Ä +Å +B +U +UE +Ü +SS +ß +Z +SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1; +latin1_f COLLATE latin1_german2_ci +A +AD +AE +AF +B +U +UE +SS +Y +Z +SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1; +latin1_f COLLATE latin1_general_ci +A +AD +AE +AF +Ä +Å +B +U +UE +Ü +SS +ß +Y +Z +SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; +latin1_f COLLATE latin1_bin +A +a +AD +ad +AE +ae +AF +af +Ä +ä +Å +å +B +b +U +u +UE +ue +Ü +ü +SS +ss +ß +Y +y +Z +z +SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; +ERROR HY000: Unknown collation: 'koi8r' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `latin1_f` char(32) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW FIELDS FROM t1; +Field Type Null Key Default Extra +latin1_f char(32) +ALTER TABLE t1 CHANGE latin1_f +latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `latin1_f` char(32) character set latin1 collate latin1_bin default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW FIELDS FROM t1; +Field Type Null Key Default Extra +latin1_f char(32) YES NULL +ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `latin1_f` char(32) collate latin1_bin default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin +SHOW FIELDS FROM t1; +Field Type Null Key Default Extra +latin1_f char(32) YES NULL +SET CHARACTER SET 'latin1'; +SHOW VARIABLES LIKE 'character_set_client'; +Variable_name Value +character_set_client latin1 +SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +charset('a') collation('a') coercibility('a') 'a'='A' +latin1 latin1_swedish_ci 3 1 +explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'` +SET CHARACTER SET koi8r; +SHOW VARIABLES LIKE 'collation_client'; +Variable_name Value +SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +charset('a') collation('a') coercibility('a') 'a'='A' +latin1 latin1_swedish_ci 3 1 +SET CHARACTER SET 'DEFAULT'; +ERROR 42000: Unknown character set: 'DEFAULT' +DROP TABLE t1; +CREATE TABLE t1 +(s1 CHAR(5) COLLATE latin1_german1_ci, +s2 CHAR(5) COLLATE latin1_swedish_ci); +SELECT * FROM t1 WHERE s1 = s2; +ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' +DROP TABLE t1; +SET NAMES latin1; +CREATE TABLE t1 +(s1 char(10) COLLATE latin1_german1_ci, +s2 char(10) COLLATE latin1_swedish_ci, +KEY(s1), +KEY(s2)); +INSERT INTO t1 VALUES ('a','a'); +INSERT INTO t1 VALUES ('b','b'); +INSERT INTO t1 VALUES ('c','c'); +INSERT INTO t1 VALUES ('d','d'); +INSERT INTO t1 VALUES ('e','e'); +INSERT INTO t1 VALUES ('f','f'); +INSERT INTO t1 VALUES ('g','g'); +INSERT INTO t1 VALUES ('h','h'); +INSERT INTO t1 VALUES ('i','i'); +INSERT INTO t1 VALUES ('j','j'); +EXPLAIN SELECT * FROM t1 WHERE s1='a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref s1 s1 11 const 1 Using where +EXPLAIN SELECT * FROM t1 WHERE s2='a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref s2 s2 11 const 1 Using where +EXPLAIN SELECT * FROM t1 WHERE s1='a' COLLATE latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref s1 s1 11 const 1 Using where +EXPLAIN SELECT * FROM t1 WHERE s2='a' COLLATE latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where +EXPLAIN SELECT * FROM t1 WHERE s1 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range s1 s1 11 NULL 2 Using where +EXPLAIN SELECT * FROM t1 WHERE s2 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where +EXPLAIN SELECT * FROM t1 WHERE s1 IN ('a','b' COLLATE latin1_german1_ci); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range s1 s1 11 NULL 2 Using where +EXPLAIN SELECT * FROM t1 WHERE s2 IN ('a','b' COLLATE latin1_german1_ci); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where +EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range s1 s1 11 NULL 1 Using where +EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where +DROP TABLE t1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index a1f860e1f83..3793e962d40 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1,4 +1,5 @@ drop table if exists t1; +SET NAMES cp1251; create table t1 (a varchar(10) not null); insert into t1 values ("a"),("ab"),("abc"); select * from t1; @@ -22,3 +23,34 @@ a b c drop table t1; +create table t1 (a char(15) binary, b binary(15)); +insert into t1 values ('aaa','bbb'),('AAA','BBB'); +select upper(a),upper(b) from t1; +upper(a) upper(b) +AAA bbb +AAA BBB +select lower(a),lower(b) from t1; +lower(a) lower(b) +aaa bbb +aaa BBB +select * from t1 where upper(a)='AAA'; +a b +aaa bbb +AAA BBB +select * from t1 where lower(a)='aaa'; +a b +aaa bbb +AAA BBB +select * from t1 where upper(b)='BBB'; +a b +AAA BBB +select * from t1 where lower(b)='bbb'; +a b +aaa bbb +select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1; +charset(a) charset(b) charset(binary 'ccc') +cp1251 binary binary +select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; +collation(a) collation(b) collation(binary 'ccc') +cp1251_bin binary binary +drop table t1; diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result new file mode 100644 index 00000000000..b35131f62a4 --- /dev/null +++ b/mysql-test/r/ctype_create.result @@ -0,0 +1,65 @@ +SET @@character_set_server=latin5; +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251; +USE mysqltest1; +CREATE DATABASE mysqltest2; +SHOW CREATE DATABASE mysqltest1; +Database Create Database +mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp1251 */ +SHOW CREATE DATABASE mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin5 */ +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin5 +DROP TABLE mysqltest2.t1; +ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin7 +DROP DATABASE mysqltest2; +CREATE DATABASE mysqltest2 CHARACTER SET latin2; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +DROP DATABASE mysqltest2; +USE mysqltest1; +CREATE TABLE t1 (a char(10)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 +DROP TABLE t1; +CREATE TABLE t1 (a char(10)) DEFAULT CHARACTER SET latin1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a char(10)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) collate latin1_german1_ci default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci +DROP TABLE t1; +create table t1 (a char) character set latin1 character set latin2; +ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2' +create table t1 (a char) character set latin1 collate latin2_bin; +ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1' +create database d1 default character set latin1 character set latin2; +ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2' +create database d1 default character set latin1 collate latin2_bin; +ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1' +DROP DATABASE mysqltest1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result new file mode 100644 index 00000000000..a8182438ac4 --- /dev/null +++ b/mysql-test/r/ctype_latin1.result @@ -0,0 +1,298 @@ +drop table if exists t1; +SET NAMES latin1; +CREATE TABLE t1 (a char(1) character set latin1); +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT +hex(a), +hex(@u:=convert(a using utf8)), +hex(@l:=convert(@u using latin1)), +a=@l FROM t1; +hex(a) hex(@u:=convert(a using utf8)) hex(@l:=convert(@u using latin1)) a=@l +00 00 00 1 +01 01 01 1 +02 02 02 1 +03 03 03 1 +04 04 04 1 +05 05 05 1 +06 06 06 1 +07 07 07 1 +08 08 08 1 +09 09 09 1 +0A 0A 0A 1 +0B 0B 0B 1 +0C 0C 0C 1 +0D 0D 0D 1 +0E 0E 0E 1 +0F 0F 0F 1 +10 10 10 1 +11 11 11 1 +12 12 12 1 +13 13 13 1 +14 14 14 1 +15 15 15 1 +16 16 16 1 +17 17 17 1 +18 18 18 1 +19 19 19 1 +1A 1A 1A 1 +1B 1B 1B 1 +1C 1C 1C 1 +1D 1D 1D 1 +1E 1E 1E 1 +1F 1F 1F 1 + 1 +21 21 21 1 +22 22 22 1 +23 23 23 1 +24 24 24 1 +25 25 25 1 +26 26 26 1 +27 27 27 1 +28 28 28 1 +29 29 29 1 +2A 2A 2A 1 +2B 2B 2B 1 +2C 2C 2C 1 +2D 2D 2D 1 +2E 2E 2E 1 +2F 2F 2F 1 +30 30 30 1 +31 31 31 1 +32 32 32 1 +33 33 33 1 +34 34 34 1 +35 35 35 1 +36 36 36 1 +37 37 37 1 +38 38 38 1 +39 39 39 1 +3A 3A 3A 1 +3B 3B 3B 1 +3C 3C 3C 1 +3D 3D 3D 1 +3E 3E 3E 1 +3F 3F 3F 1 +40 40 40 1 +41 41 41 1 +42 42 42 1 +43 43 43 1 +44 44 44 1 +45 45 45 1 +46 46 46 1 +47 47 47 1 +48 48 48 1 +49 49 49 1 +4A 4A 4A 1 +4B 4B 4B 1 +4C 4C 4C 1 +4D 4D 4D 1 +4E 4E 4E 1 +4F 4F 4F 1 +50 50 50 1 +51 51 51 1 +52 52 52 1 +53 53 53 1 +54 54 54 1 +55 55 55 1 +56 56 56 1 +57 57 57 1 +58 58 58 1 +59 59 59 1 +5A 5A 5A 1 +5B 5B 5B 1 +5C 5C 5C 1 +5D 5D 5D 1 +5E 5E 5E 1 +5F 5F 5F 1 +60 60 60 1 +61 61 61 1 +62 62 62 1 +63 63 63 1 +64 64 64 1 +65 65 65 1 +66 66 66 1 +67 67 67 1 +68 68 68 1 +69 69 69 1 +6A 6A 6A 1 +6B 6B 6B 1 +6C 6C 6C 1 +6D 6D 6D 1 +6E 6E 6E 1 +6F 6F 6F 1 +70 70 70 1 +71 71 71 1 +72 72 72 1 +73 73 73 1 +74 74 74 1 +75 75 75 1 +76 76 76 1 +77 77 77 1 +78 78 78 1 +79 79 79 1 +7A 7A 7A 1 +7B 7B 7B 1 +7C 7C 7C 1 +7D 7D 7D 1 +7E 7E 7E 1 +7F 7F 7F 1 +80 E282AC 80 1 +81 3F 3F 0 +82 E2809A 82 1 +83 C692 83 1 +84 E2809E 84 1 +85 E280A6 85 1 +86 E280A0 86 1 +87 E280A1 87 1 +88 CB86 88 1 +89 E280B0 89 1 +8A C5A0 8A 1 +8B E280B9 8B 1 +8C C592 8C 1 +8D 3F 3F 0 +8E C5BD 8E 1 +8F 3F 3F 0 +90 3F 3F 0 +91 E28098 91 1 +92 E28099 92 1 +93 E2809C 93 1 +94 E2809D 94 1 +95 E280A2 95 1 +96 E28093 96 1 +97 E28094 97 1 +98 CB9C 98 1 +99 E284A2 99 1 +9A C5A1 9A 1 +9B E280BA 9B 1 +9C C593 9C 1 +9D 3F 3F 0 +9E C5BE 9E 1 +9F C5B8 9F 1 +A0 C2A0 A0 1 +A1 C2A1 A1 1 +A2 C2A2 A2 1 +A3 C2A3 A3 1 +A4 C2A4 A4 1 +A5 C2A5 A5 1 +A6 C2A6 A6 1 +A7 C2A7 A7 1 +A8 C2A8 A8 1 +A9 C2A9 A9 1 +AA C2AA AA 1 +AB C2AB AB 1 +AC C2AC AC 1 +AD C2AD AD 1 +AE C2AE AE 1 +AF C2AF AF 1 +B0 C2B0 B0 1 +B1 C2B1 B1 1 +B2 C2B2 B2 1 +B3 C2B3 B3 1 +B4 C2B4 B4 1 +B5 C2B5 B5 1 +B6 C2B6 B6 1 +B7 C2B7 B7 1 +B8 C2B8 B8 1 +B9 C2B9 B9 1 +BA C2BA BA 1 +BB C2BB BB 1 +BC C2BC BC 1 +BD C2BD BD 1 +BE C2BE BE 1 +BF C2BF BF 1 +C0 C380 C0 1 +C1 C381 C1 1 +C2 C382 C2 1 +C3 C383 C3 1 +C4 C384 C4 1 +C5 C385 C5 1 +C6 C386 C6 1 +C7 C387 C7 1 +C8 C388 C8 1 +C9 C389 C9 1 +CA C38A CA 1 +CB C38B CB 1 +CC C38C CC 1 +CD C38D CD 1 +CE C38E CE 1 +CF C38F CF 1 +D0 C390 D0 1 +D1 C391 D1 1 +D2 C392 D2 1 +D3 C393 D3 1 +D4 C394 D4 1 +D5 C395 D5 1 +D6 C396 D6 1 +D7 C397 D7 1 +D8 C398 D8 1 +D9 C399 D9 1 +DA C39A DA 1 +DB C39B DB 1 +DC C39C DC 1 +DD C39D DD 1 +DE C39E DE 1 +DF C39F DF 1 +E0 C3A0 E0 1 +E1 C3A1 E1 1 +E2 C3A2 E2 1 +E3 C3A3 E3 1 +E4 C3A4 E4 1 +E5 C3A5 E5 1 +E6 C3A6 E6 1 +E7 C3A7 E7 1 +E8 C3A8 E8 1 +E9 C3A9 E9 1 +EA C3AA EA 1 +EB C3AB EB 1 +EC C3AC EC 1 +ED C3AD ED 1 +EE C3AE EE 1 +EF C3AF EF 1 +F0 C3B0 F0 1 +F1 C3B1 F1 1 +F2 C3B2 F2 1 +F3 C3B3 F3 1 +F4 C3B4 F4 1 +F5 C3B5 F5 1 +F6 C3B6 F6 1 +F7 C3B7 F7 1 +F8 C3B8 F8 1 +F9 C3B9 F9 1 +FA C3BA FA 1 +FB C3BB FB 1 +FC C3BC FC 1 +FD C3BD FD 1 +FE C3BE FE 1 +FF C3BF FF 1 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 28394d9533a..c500019042f 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -1,3 +1,8 @@ +set names latin1; +set @@collation_connection=latin1_german2_ci; +select @@collation_connection; +@@collation_connection +latin1_german2_ci drop table if exists t1; create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)); insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb'); @@ -216,23 +221,30 @@ a test drop table t1; create table t1 (word varchar(255) not null, word2 varchar(255) not null, index(word)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `word` varchar(255) collate latin1_german2_ci NOT NULL default '', + `word2` varchar(255) collate latin1_german2_ci NOT NULL default '', + KEY `word` (`word`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae'); update t1 set word2=word; -select word, word=0xdf as t from t1 having t > 0; +select word, word=binary 0xdf as t from t1 having t > 0; word t ß 1 select word, word=cast(0xdf AS CHAR) as t from t1 having t > 0; word t ss 1 ß 1 -select * from t1 where word=0xDF; +select * from t1 where word=binary 0xDF; word word2 ß ß select * from t1 where word=CAST(0xDF as CHAR); word word2 ss ss ß ß -select * from t1 where word2=0xDF; +select * from t1 where word2=binary 0xDF; word word2 ß ß select * from t1 where word2=CAST(0xDF as CHAR); @@ -247,7 +259,7 @@ select * from t1 where word= 0xe4 or word=CAST(0xe4 as CHAR); word word2 ä ä ae ae -select * from t1 where word between 0xDF and 0xDF; +select * from t1 where word between binary 0xDF and binary 0xDF; word word2 ß ß select * from t1 where word between CAST(0xDF AS CHAR) and CAST(0xDF AS CHAR); @@ -260,10 +272,34 @@ ae ae select * from t1 where word like 'AE'; word word2 ae ae -select * from t1 where word like 0xDF; +select * from t1 where word like binary 0xDF; word word2 ß ß select * from t1 where word like CAST(0xDF as CHAR); word word2 ß ß drop table t1; +CREATE TABLE t1 ( +s1 CHAR(5) CHARACTER SET latin1 COLLATE latin1_german2_ci +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` char(5) collate latin1_german2_ci default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci +INSERT INTO t1 VALUES ('Ü'); +INSERT INTO t1 VALUES ('ue'); +SELECT DISTINCT s1 FROM t1; +s1 +Ü +SELECT s1,COUNT(*) FROM t1 GROUP BY s1; +s1 COUNT(*) +Ü 2 +SELECT COUNT(DISTINCT s1) FROM t1; +COUNT(DISTINCT s1) +1 +SELECT FIELD('ue',s1), FIELD('Ü',s1), s1='ue', s1='Ü' FROM t1; +FIELD('ue',s1) FIELD('Ü',s1) s1='ue' s1='Ü' +1 1 1 1 +1 1 1 1 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result new file mode 100644 index 00000000000..8bfc6e98226 --- /dev/null +++ b/mysql-test/r/ctype_many.result @@ -0,0 +1,1685 @@ +DROP TABLE IF EXISTS t1; +SET CHARACTER SET latin1; +CREATE TABLE t1 ( +comment CHAR(32) ASCII NOT NULL, +koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL +) CHARSET=latin5; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `comment` char(32) character set latin1 NOT NULL default '', + `koi8_ru_f` char(32) character set koi8r NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin5 +ALTER TABLE t1 CHANGE comment comment CHAR(32) CHARACTER SET latin2 NOT NULL; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `comment` char(32) character set latin2 NOT NULL default '', + `koi8_ru_f` char(32) character set koi8r NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin5 +ALTER TABLE t1 ADD latin5_f CHAR(32) NOT NULL; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `comment` char(32) character set latin2 NOT NULL default '', + `koi8_ru_f` char(32) character set koi8r NOT NULL default '', + `latin5_f` char(32) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin5 +ALTER TABLE t1 DEFAULT CHARSET=latin2; +ALTER TABLE t1 ADD latin2_f CHAR(32) NOT NULL; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `comment` char(32) NOT NULL default '', + `koi8_ru_f` char(32) character set koi8r NOT NULL default '', + `latin5_f` char(32) character set latin5 NOT NULL default '', + `latin2_f` char(32) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +ALTER TABLE t1 DROP latin2_f, DROP latin5_f; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `comment` char(32) NOT NULL default '', + `koi8_ru_f` char(32) character set koi8r NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('a','LAT SMALL A'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('b','LAT SMALL B'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('c','LAT SMALL C'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('d','LAT SMALL D'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('e','LAT SMALL E'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('f','LAT SMALL F'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('g','LAT SMALL G'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('h','LAT SMALL H'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('i','LAT SMALL I'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('j','LAT SMALL J'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('k','LAT SMALL K'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('l','LAT SMALL L'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('m','LAT SMALL M'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('n','LAT SMALL N'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('o','LAT SMALL O'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('p','LAT SMALL P'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('q','LAT SMALL Q'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('r','LAT SMALL R'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('s','LAT SMALL S'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('t','LAT SMALL T'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('u','LAT SMALL U'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('v','LAT SMALL V'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('w','LAT SMALL W'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('x','LAT SMALL X'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('y','LAT SMALL Y'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('z','LAT SMALL Z'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('A','LAT CAPIT A'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('B','LAT CAPIT B'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('C','LAT CAPIT C'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('D','LAT CAPIT D'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('E','LAT CAPIT E'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('F','LAT CAPIT F'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('G','LAT CAPIT G'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('H','LAT CAPIT H'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('I','LAT CAPIT I'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('J','LAT CAPIT J'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('K','LAT CAPIT K'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('L','LAT CAPIT L'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('M','LAT CAPIT M'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('N','LAT CAPIT N'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('O','LAT CAPIT O'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('P','LAT CAPIT P'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('Q','LAT CAPIT Q'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('R','LAT CAPIT R'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('S','LAT CAPIT S'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('T','LAT CAPIT T'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('U','LAT CAPIT U'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('V','LAT CAPIT V'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('W','LAT CAPIT W'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('X','LAT CAPIT X'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('Y','LAT CAPIT Y'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES ('Z','LAT CAPIT Z'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Á','CYR SMALL A'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Â','CYR SMALL BE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'×','CYR SMALL VE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ç','CYR SMALL GE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ä','CYR SMALL DE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Å','CYR SMALL IE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'£','CYR SMALL IO'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ö','CYR SMALL ZHE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ú','CYR SMALL ZE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'É','CYR SMALL I'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ë','CYR SMALL KA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ì','CYR SMALL EL'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Í','CYR SMALL EM'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Î','CYR SMALL EN'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ï','CYR SMALL O'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ð','CYR SMALL PE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ò','CYR SMALL ER'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ó','CYR SMALL ES'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ô','CYR SMALL TE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Õ','CYR SMALL U'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Æ','CYR SMALL EF'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'È','CYR SMALL HA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ã','CYR SMALL TSE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Þ','CYR SMALL CHE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Û','CYR SMALL SHA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ý','CYR SMALL SCHA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ß','CYR SMALL HARD SIGN'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ù','CYR SMALL YERU'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ø','CYR SMALL SOFT SIGN'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ü','CYR SMALL E'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'À','CYR SMALL YU'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'Ñ','CYR SMALL YA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'á','CYR CAPIT A'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'â','CYR CAPIT BE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'÷','CYR CAPIT VE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ç','CYR CAPIT GE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ä','CYR CAPIT DE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'å','CYR CAPIT IE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'³','CYR CAPIT IO'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ö','CYR CAPIT ZHE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ú','CYR CAPIT ZE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'é','CYR CAPIT I'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ë','CYR CAPIT KA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ì','CYR CAPIT EL'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'í','CYR CAPIT EM'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'î','CYR CAPIT EN'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ï','CYR CAPIT O'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ð','CYR CAPIT PE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ò','CYR CAPIT ER'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ó','CYR CAPIT ES'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ô','CYR CAPIT TE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'õ','CYR CAPIT U'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'æ','CYR CAPIT EF'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'è','CYR CAPIT HA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ã','CYR CAPIT TSE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'þ','CYR CAPIT CHE'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'û','CYR CAPIT SHA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ý','CYR CAPIT SCHA'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ÿ','CYR CAPIT HARD SIGN'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ù','CYR CAPIT YERU'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ø','CYR CAPIT SOFT SIGN'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ü','CYR CAPIT E'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'à','CYR CAPIT YU'); +INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ñ','CYR CAPIT YA'); +SET CHARACTER SET utf8; +SELECT koi8_ru_f,MIN(comment),COUNT(*) FROM t1 GROUP BY 1; +koi8_ru_f MIN(comment) COUNT(*) +a LAT CAPIT A 2 +b LAT CAPIT B 2 +c LAT CAPIT C 2 +d LAT CAPIT D 2 +e LAT CAPIT E 2 +f LAT CAPIT F 2 +g LAT CAPIT G 2 +h LAT CAPIT H 2 +i LAT CAPIT I 2 +j LAT CAPIT J 2 +k LAT CAPIT K 2 +l LAT CAPIT L 2 +m LAT CAPIT M 2 +n LAT CAPIT N 2 +o LAT CAPIT O 2 +p LAT CAPIT P 2 +q LAT CAPIT Q 2 +r LAT CAPIT R 2 +s LAT CAPIT S 2 +t LAT CAPIT T 2 +u LAT CAPIT U 2 +v LAT CAPIT V 2 +w LAT CAPIT W 2 +x LAT CAPIT X 2 +y LAT CAPIT Y 2 +z LAT CAPIT Z 2 +а CYR CAPIT A 2 +б CYR CAPIT BE 2 +в CYR CAPIT VE 2 +г CYR CAPIT GE 2 +ÐŽ CYR CAPIT DE 2 +е CYR CAPIT IE 2 +Ñ CYR CAPIT IO 2 +ж CYR CAPIT ZHE 2 +з CYR CAPIT ZE 2 +О CYR CAPIT I 2 +к CYR CAPIT KA 2 +л CYR CAPIT EL 2 +ÐŒ CYR CAPIT EM 2 +М CYR CAPIT EN 2 +П CYR CAPIT O 2 +п CYR CAPIT PE 2 +Ñ CYR CAPIT ER 2 +Ñ CYR CAPIT ES 2 +Ñ CYR CAPIT TE 2 +Ñ CYR CAPIT U 2 +Ñ CYR CAPIT EF 2 +Ñ
CYR CAPIT HA 2 +Ñ CYR CAPIT TSE 2 +Ñ CYR CAPIT CHE 2 +Ñ CYR CAPIT SHA 2 +Ñ CYR CAPIT SCHA 2 +Ñ CYR CAPIT HARD SIGN 2 +Ñ CYR CAPIT YERU 2 +Ñ CYR CAPIT SOFT SIGN 2 +Ñ CYR CAPIT E 2 +Ñ CYR CAPIT YU 2 +Ñ CYR CAPIT YA 2 +ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL; +UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8); +SET CHARACTER SET koi8r; +SELECT * FROM t1; +comment koi8_ru_f utf8_f +LAT SMALL A a a +LAT SMALL B b b +LAT SMALL C c c +LAT SMALL D d d +LAT SMALL E e e +LAT SMALL F f f +LAT SMALL G g g +LAT SMALL H h h +LAT SMALL I i i +LAT SMALL J j j +LAT SMALL K k k +LAT SMALL L l l +LAT SMALL M m m +LAT SMALL N n n +LAT SMALL O o o +LAT SMALL P p p +LAT SMALL Q q q +LAT SMALL R r r +LAT SMALL S s s +LAT SMALL T t t +LAT SMALL U u u +LAT SMALL V v v +LAT SMALL W w w +LAT SMALL X x x +LAT SMALL Y y y +LAT SMALL Z z z +LAT CAPIT A A A +LAT CAPIT B B B +LAT CAPIT C C C +LAT CAPIT D D D +LAT CAPIT E E E +LAT CAPIT F F F +LAT CAPIT G G G +LAT CAPIT H H H +LAT CAPIT I I I +LAT CAPIT J J J +LAT CAPIT K K K +LAT CAPIT L L L +LAT CAPIT M M M +LAT CAPIT N N N +LAT CAPIT O O O +LAT CAPIT P P P +LAT CAPIT Q Q Q +LAT CAPIT R R R +LAT CAPIT S S S +LAT CAPIT T T T +LAT CAPIT U U U +LAT CAPIT V V V +LAT CAPIT W W W +LAT CAPIT X X X +LAT CAPIT Y Y Y +LAT CAPIT Z Z Z +CYR SMALL A Á Á +CYR SMALL BE   +CYR SMALL VE × × +CYR SMALL GE Ç Ç +CYR SMALL DE Ä Ä +CYR SMALL IE Å Å +CYR SMALL IO £ £ +CYR SMALL ZHE Ö Ö +CYR SMALL ZE Ú Ú +CYR SMALL I É É +CYR SMALL KA Ë Ë +CYR SMALL EL Ì Ì +CYR SMALL EM Í Í +CYR SMALL EN Î Î +CYR SMALL O Ï Ï +CYR SMALL PE Ð Ð +CYR SMALL ER Ò Ò +CYR SMALL ES Ó Ó +CYR SMALL TE Ô Ô +CYR SMALL U Õ Õ +CYR SMALL EF Æ Æ +CYR SMALL HA È È +CYR SMALL TSE à à +CYR SMALL CHE Þ Þ +CYR SMALL SHA Û Û +CYR SMALL SCHA Ý Ý +CYR SMALL HARD SIGN ß ß +CYR SMALL YERU Ù Ù +CYR SMALL SOFT SIGN Ø Ø +CYR SMALL E Ü Ü +CYR SMALL YU À À +CYR SMALL YA Ñ Ñ +CYR CAPIT A á á +CYR CAPIT BE â â +CYR CAPIT VE ÷ ÷ +CYR CAPIT GE ç ç +CYR CAPIT DE ä ä +CYR CAPIT IE å å +CYR CAPIT IO ³ ³ +CYR CAPIT ZHE ö ö +CYR CAPIT ZE ú ú +CYR CAPIT I é é +CYR CAPIT KA ë ë +CYR CAPIT EL ì ì +CYR CAPIT EM í í +CYR CAPIT EN î î +CYR CAPIT O ï ï +CYR CAPIT PE ð ð +CYR CAPIT ER ò ò +CYR CAPIT ES ó ó +CYR CAPIT TE ô ô +CYR CAPIT U õ õ +CYR CAPIT EF æ æ +CYR CAPIT HA è è +CYR CAPIT TSE ã ã +CYR CAPIT CHE þ þ +CYR CAPIT SHA û û +CYR CAPIT SCHA ý ý +CYR CAPIT HARD SIGN ÿ ÿ +CYR CAPIT YERU ù ù +CYR CAPIT SOFT SIGN ø ø +CYR CAPIT E ü ü +CYR CAPIT YU à à +CYR CAPIT YA ñ ñ +ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL; +UPDATE t1 SET bin_f=koi8_ru_f; +SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; +COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f) +116 58 57 +SELECT koi8_ru_f,MIN(comment) FROM t1 GROUP BY 1; +koi8_ru_f MIN(comment) +a LAT CAPIT A +b LAT CAPIT B +c LAT CAPIT C +d LAT CAPIT D +e LAT CAPIT E +f LAT CAPIT F +g LAT CAPIT G +h LAT CAPIT H +i LAT CAPIT I +j LAT CAPIT J +k LAT CAPIT K +l LAT CAPIT L +m LAT CAPIT M +n LAT CAPIT N +o LAT CAPIT O +p LAT CAPIT P +q LAT CAPIT Q +r LAT CAPIT R +s LAT CAPIT S +t LAT CAPIT T +u LAT CAPIT U +v LAT CAPIT V +w LAT CAPIT W +x LAT CAPIT X +y LAT CAPIT Y +z LAT CAPIT Z +Á CYR CAPIT A + CYR CAPIT BE +× CYR CAPIT VE +Ç CYR CAPIT GE +Ä CYR CAPIT DE +Å CYR CAPIT IE +£ CYR CAPIT IO +Ö CYR CAPIT ZHE +Ú CYR CAPIT ZE +É CYR CAPIT I +Ë CYR CAPIT KA +Ì CYR CAPIT EL +Í CYR CAPIT EM +Î CYR CAPIT EN +Ï CYR CAPIT O +Ð CYR CAPIT PE +Ò CYR CAPIT ER +Ó CYR CAPIT ES +Ô CYR CAPIT TE +Õ CYR CAPIT U +Æ CYR CAPIT EF +È CYR CAPIT HA +à CYR CAPIT TSE +Þ CYR CAPIT CHE +Û CYR CAPIT SHA +Ý CYR CAPIT SCHA +ß CYR CAPIT HARD SIGN +Ù CYR CAPIT YERU +Ø CYR CAPIT SOFT SIGN +Ü CYR CAPIT E +À CYR CAPIT YU +Ñ CYR CAPIT YA +SELECT utf8_f,MIN(comment) FROM t1 GROUP BY 1; +utf8_f MIN(comment) +a LAT CAPIT A +b LAT CAPIT B +c LAT CAPIT C +d LAT CAPIT D +e LAT CAPIT E +f LAT CAPIT F +g LAT CAPIT G +h LAT CAPIT H +i LAT CAPIT I +j LAT CAPIT J +k LAT CAPIT K +l LAT CAPIT L +m LAT CAPIT M +n LAT CAPIT N +o LAT CAPIT O +p LAT CAPIT P +q LAT CAPIT Q +r LAT CAPIT R +s LAT CAPIT S +t LAT CAPIT T +u LAT CAPIT U +v LAT CAPIT V +w LAT CAPIT W +x LAT CAPIT X +y LAT CAPIT Y +z LAT CAPIT Z +Á CYR CAPIT A + CYR CAPIT BE +× CYR CAPIT VE +Ç CYR CAPIT GE +Ä CYR CAPIT DE +Å CYR CAPIT IE +Ö CYR CAPIT ZHE +Ú CYR CAPIT ZE +É CYR CAPIT I +Ë CYR CAPIT KA +Ì CYR CAPIT EL +Í CYR CAPIT EM +Î CYR CAPIT EN +Ï CYR CAPIT O +Ð CYR CAPIT PE +Ò CYR CAPIT ER +Ó CYR CAPIT ES +Ô CYR CAPIT TE +Õ CYR CAPIT U +Æ CYR CAPIT EF +È CYR CAPIT HA +à CYR CAPIT TSE +Þ CYR CAPIT CHE +Û CYR CAPIT SHA +Ý CYR CAPIT SCHA +ß CYR CAPIT HARD SIGN +Ù CYR CAPIT YERU +Ø CYR CAPIT SOFT SIGN +Ü CYR CAPIT E +À CYR CAPIT YU +Ñ CYR CAPIT YA +SELECT DISTINCT koi8_ru_f FROM t1; +koi8_ru_f +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +Á + +× +Ç +Ä +Å +£ +Ö +Ú +É +Ë +Ì +Í +Î +Ï +Ð +Ò +Ó +Ô +Õ +Æ +È +à +Þ +Û +Ý +ß +Ù +Ø +Ü +À +Ñ +SELECT DISTINCT utf8_f FROM t1; +utf8_f +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +Á + +× +Ç +Ä +Å +Ö +Ú +É +Ë +Ì +Í +Î +Ï +Ð +Ò +Ó +Ô +Õ +Æ +È +à +Þ +Û +Ý +ß +Ù +Ø +Ü +À +Ñ +SELECT lower(koi8_ru_f) FROM t1 ORDER BY 1 DESC; +lower(koi8_ru_f) +Ñ +Ñ +À +À +Ü +Ü +Ø +Ø +Ù +Ù +ß +ß +Ý +Ý +Û +Û +Þ +Þ +à +à +È +È +Æ +Æ +Õ +Õ +Ô +Ô +Ó +Ó +Ò +Ò +Ð +Ð +Ï +Ï +Î +Î +Í +Í +Ì +Ì +Ë +Ë +É +É +Ú +Ú +Ö +Ö +£ +£ +Å +Å +Ä +Ä +Ç +Ç +× +× + + +Á +Á +z +z +y +y +x +x +w +w +v +v +u +u +t +t +s +s +r +r +q +q +p +p +o +o +n +n +m +m +l +l +k +k +j +j +i +i +h +h +g +g +f +f +e +e +d +d +c +c +b +b +a +a +SELECT lower(utf8_f) FROM t1 ORDER BY 1 DESC; +lower(utf8_f) +Ñ +Ñ +À +À +Ü +Ü +Ø +Ø +Ù +Ù +ß +ß +Ý +Ý +Û +Û +Þ +Þ +à +à +È +È +Æ +Æ +Õ +Õ +Ô +Ô +Ó +Ó +Ò +Ò +Ð +Ð +Ï +Ï +Î +Î +Í +Í +Ì +Ì +Ë +Ë +É +É +Ú +Ú +Ö +Ö +£ +Å +£ +Å +Ä +Ä +Ç +Ç +× +× + + +Á +Á +z +z +y +y +x +x +w +w +v +v +u +u +t +t +s +s +r +r +q +q +p +p +o +o +n +n +m +m +l +l +k +k +j +j +i +i +h +h +g +g +f +f +e +e +d +d +c +c +b +b +a +a +SELECT t11.comment,t12.comment +FROM t1 t11,t1 t12 WHERE CONVERT(t11.koi8_ru_f USING utf8)=t12.utf8_f +ORDER BY t11.koi8_ru_f,t11.comment,t12.comment; +comment comment +LAT CAPIT A LAT CAPIT A +LAT CAPIT A LAT SMALL A +LAT SMALL A LAT CAPIT A +LAT SMALL A LAT SMALL A +LAT CAPIT B LAT CAPIT B +LAT CAPIT B LAT SMALL B +LAT SMALL B LAT CAPIT B +LAT SMALL B LAT SMALL B +LAT CAPIT C LAT CAPIT C +LAT CAPIT C LAT SMALL C +LAT SMALL C LAT CAPIT C +LAT SMALL C LAT SMALL C +LAT CAPIT D LAT CAPIT D +LAT CAPIT D LAT SMALL D +LAT SMALL D LAT CAPIT D +LAT SMALL D LAT SMALL D +LAT CAPIT E LAT CAPIT E +LAT CAPIT E LAT SMALL E +LAT SMALL E LAT CAPIT E +LAT SMALL E LAT SMALL E +LAT CAPIT F LAT CAPIT F +LAT CAPIT F LAT SMALL F +LAT SMALL F LAT CAPIT F +LAT SMALL F LAT SMALL F +LAT CAPIT G LAT CAPIT G +LAT CAPIT G LAT SMALL G +LAT SMALL G LAT CAPIT G +LAT SMALL G LAT SMALL G +LAT CAPIT H LAT CAPIT H +LAT CAPIT H LAT SMALL H +LAT SMALL H LAT CAPIT H +LAT SMALL H LAT SMALL H +LAT CAPIT I LAT CAPIT I +LAT CAPIT I LAT SMALL I +LAT SMALL I LAT CAPIT I +LAT SMALL I LAT SMALL I +LAT CAPIT J LAT CAPIT J +LAT CAPIT J LAT SMALL J +LAT SMALL J LAT CAPIT J +LAT SMALL J LAT SMALL J +LAT CAPIT K LAT CAPIT K +LAT CAPIT K LAT SMALL K +LAT SMALL K LAT CAPIT K +LAT SMALL K LAT SMALL K +LAT CAPIT L LAT CAPIT L +LAT CAPIT L LAT SMALL L +LAT SMALL L LAT CAPIT L +LAT SMALL L LAT SMALL L +LAT CAPIT M LAT CAPIT M +LAT CAPIT M LAT SMALL M +LAT SMALL M LAT CAPIT M +LAT SMALL M LAT SMALL M +LAT CAPIT N LAT CAPIT N +LAT CAPIT N LAT SMALL N +LAT SMALL N LAT CAPIT N +LAT SMALL N LAT SMALL N +LAT CAPIT O LAT CAPIT O +LAT CAPIT O LAT SMALL O +LAT SMALL O LAT CAPIT O +LAT SMALL O LAT SMALL O +LAT CAPIT P LAT CAPIT P +LAT CAPIT P LAT SMALL P +LAT SMALL P LAT CAPIT P +LAT SMALL P LAT SMALL P +LAT CAPIT Q LAT CAPIT Q +LAT CAPIT Q LAT SMALL Q +LAT SMALL Q LAT CAPIT Q +LAT SMALL Q LAT SMALL Q +LAT CAPIT R LAT CAPIT R +LAT CAPIT R LAT SMALL R +LAT SMALL R LAT CAPIT R +LAT SMALL R LAT SMALL R +LAT CAPIT S LAT CAPIT S +LAT CAPIT S LAT SMALL S +LAT SMALL S LAT CAPIT S +LAT SMALL S LAT SMALL S +LAT CAPIT T LAT CAPIT T +LAT CAPIT T LAT SMALL T +LAT SMALL T LAT CAPIT T +LAT SMALL T LAT SMALL T +LAT CAPIT U LAT CAPIT U +LAT CAPIT U LAT SMALL U +LAT SMALL U LAT CAPIT U +LAT SMALL U LAT SMALL U +LAT CAPIT V LAT CAPIT V +LAT CAPIT V LAT SMALL V +LAT SMALL V LAT CAPIT V +LAT SMALL V LAT SMALL V +LAT CAPIT W LAT CAPIT W +LAT CAPIT W LAT SMALL W +LAT SMALL W LAT CAPIT W +LAT SMALL W LAT SMALL W +LAT CAPIT X LAT CAPIT X +LAT CAPIT X LAT SMALL X +LAT SMALL X LAT CAPIT X +LAT SMALL X LAT SMALL X +LAT CAPIT Y LAT CAPIT Y +LAT CAPIT Y LAT SMALL Y +LAT SMALL Y LAT CAPIT Y +LAT SMALL Y LAT SMALL Y +LAT CAPIT Z LAT CAPIT Z +LAT CAPIT Z LAT SMALL Z +LAT SMALL Z LAT CAPIT Z +LAT SMALL Z LAT SMALL Z +CYR CAPIT A CYR CAPIT A +CYR CAPIT A CYR SMALL A +CYR SMALL A CYR CAPIT A +CYR SMALL A CYR SMALL A +CYR CAPIT BE CYR CAPIT BE +CYR CAPIT BE CYR SMALL BE +CYR SMALL BE CYR CAPIT BE +CYR SMALL BE CYR SMALL BE +CYR CAPIT VE CYR CAPIT VE +CYR CAPIT VE CYR SMALL VE +CYR SMALL VE CYR CAPIT VE +CYR SMALL VE CYR SMALL VE +CYR CAPIT GE CYR CAPIT GE +CYR CAPIT GE CYR SMALL GE +CYR SMALL GE CYR CAPIT GE +CYR SMALL GE CYR SMALL GE +CYR CAPIT DE CYR CAPIT DE +CYR CAPIT DE CYR SMALL DE +CYR SMALL DE CYR CAPIT DE +CYR SMALL DE CYR SMALL DE +CYR CAPIT IE CYR CAPIT IE +CYR CAPIT IE CYR CAPIT IO +CYR CAPIT IE CYR SMALL IE +CYR CAPIT IE CYR SMALL IO +CYR SMALL IE CYR CAPIT IE +CYR SMALL IE CYR CAPIT IO +CYR SMALL IE CYR SMALL IE +CYR SMALL IE CYR SMALL IO +CYR CAPIT IO CYR CAPIT IE +CYR CAPIT IO CYR CAPIT IO +CYR CAPIT IO CYR SMALL IE +CYR CAPIT IO CYR SMALL IO +CYR SMALL IO CYR CAPIT IE +CYR SMALL IO CYR CAPIT IO +CYR SMALL IO CYR SMALL IE +CYR SMALL IO CYR SMALL IO +CYR CAPIT ZHE CYR CAPIT ZHE +CYR CAPIT ZHE CYR SMALL ZHE +CYR SMALL ZHE CYR CAPIT ZHE +CYR SMALL ZHE CYR SMALL ZHE +CYR CAPIT ZE CYR CAPIT ZE +CYR CAPIT ZE CYR SMALL ZE +CYR SMALL ZE CYR CAPIT ZE +CYR SMALL ZE CYR SMALL ZE +CYR CAPIT I CYR CAPIT I +CYR CAPIT I CYR SMALL I +CYR SMALL I CYR CAPIT I +CYR SMALL I CYR SMALL I +CYR CAPIT KA CYR CAPIT KA +CYR CAPIT KA CYR SMALL KA +CYR SMALL KA CYR CAPIT KA +CYR SMALL KA CYR SMALL KA +CYR CAPIT EL CYR CAPIT EL +CYR CAPIT EL CYR SMALL EL +CYR SMALL EL CYR CAPIT EL +CYR SMALL EL CYR SMALL EL +CYR CAPIT EM CYR CAPIT EM +CYR CAPIT EM CYR SMALL EM +CYR SMALL EM CYR CAPIT EM +CYR SMALL EM CYR SMALL EM +CYR CAPIT EN CYR CAPIT EN +CYR CAPIT EN CYR SMALL EN +CYR SMALL EN CYR CAPIT EN +CYR SMALL EN CYR SMALL EN +CYR CAPIT O CYR CAPIT O +CYR CAPIT O CYR SMALL O +CYR SMALL O CYR CAPIT O +CYR SMALL O CYR SMALL O +CYR CAPIT PE CYR CAPIT PE +CYR CAPIT PE CYR SMALL PE +CYR SMALL PE CYR CAPIT PE +CYR SMALL PE CYR SMALL PE +CYR CAPIT ER CYR CAPIT ER +CYR CAPIT ER CYR SMALL ER +CYR SMALL ER CYR CAPIT ER +CYR SMALL ER CYR SMALL ER +CYR CAPIT ES CYR CAPIT ES +CYR CAPIT ES CYR SMALL ES +CYR SMALL ES CYR CAPIT ES +CYR SMALL ES CYR SMALL ES +CYR CAPIT TE CYR CAPIT TE +CYR CAPIT TE CYR SMALL TE +CYR SMALL TE CYR CAPIT TE +CYR SMALL TE CYR SMALL TE +CYR CAPIT U CYR CAPIT U +CYR CAPIT U CYR SMALL U +CYR SMALL U CYR CAPIT U +CYR SMALL U CYR SMALL U +CYR CAPIT EF CYR CAPIT EF +CYR CAPIT EF CYR SMALL EF +CYR SMALL EF CYR CAPIT EF +CYR SMALL EF CYR SMALL EF +CYR CAPIT HA CYR CAPIT HA +CYR CAPIT HA CYR SMALL HA +CYR SMALL HA CYR CAPIT HA +CYR SMALL HA CYR SMALL HA +CYR CAPIT TSE CYR CAPIT TSE +CYR CAPIT TSE CYR SMALL TSE +CYR SMALL TSE CYR CAPIT TSE +CYR SMALL TSE CYR SMALL TSE +CYR CAPIT CHE CYR CAPIT CHE +CYR CAPIT CHE CYR SMALL CHE +CYR SMALL CHE CYR CAPIT CHE +CYR SMALL CHE CYR SMALL CHE +CYR CAPIT SHA CYR CAPIT SHA +CYR CAPIT SHA CYR SMALL SHA +CYR SMALL SHA CYR CAPIT SHA +CYR SMALL SHA CYR SMALL SHA +CYR CAPIT SCHA CYR CAPIT SCHA +CYR CAPIT SCHA CYR SMALL SCHA +CYR SMALL SCHA CYR CAPIT SCHA +CYR SMALL SCHA CYR SMALL SCHA +CYR CAPIT HARD SIGN CYR CAPIT HARD SIGN +CYR CAPIT HARD SIGN CYR SMALL HARD SIGN +CYR SMALL HARD SIGN CYR CAPIT HARD SIGN +CYR SMALL HARD SIGN CYR SMALL HARD SIGN +CYR CAPIT YERU CYR CAPIT YERU +CYR CAPIT YERU CYR SMALL YERU +CYR SMALL YERU CYR CAPIT YERU +CYR SMALL YERU CYR SMALL YERU +CYR CAPIT SOFT SIGN CYR CAPIT SOFT SIGN +CYR CAPIT SOFT SIGN CYR SMALL SOFT SIGN +CYR SMALL SOFT SIGN CYR CAPIT SOFT SIGN +CYR SMALL SOFT SIGN CYR SMALL SOFT SIGN +CYR CAPIT E CYR CAPIT E +CYR CAPIT E CYR SMALL E +CYR SMALL E CYR CAPIT E +CYR SMALL E CYR SMALL E +CYR CAPIT YU CYR CAPIT YU +CYR CAPIT YU CYR SMALL YU +CYR SMALL YU CYR CAPIT YU +CYR SMALL YU CYR SMALL YU +CYR CAPIT YA CYR CAPIT YA +CYR CAPIT YA CYR SMALL YA +CYR SMALL YA CYR CAPIT YA +CYR SMALL YA CYR SMALL YA +SELECT t11.comment,t12.comment +FROM t1 t11,t1 t12 +WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8r) +ORDER BY t12.utf8_f,t11.comment,t12.comment; +comment comment +LAT CAPIT A LAT CAPIT A +LAT CAPIT A LAT SMALL A +LAT SMALL A LAT CAPIT A +LAT SMALL A LAT SMALL A +LAT CAPIT B LAT CAPIT B +LAT CAPIT B LAT SMALL B +LAT SMALL B LAT CAPIT B +LAT SMALL B LAT SMALL B +LAT CAPIT C LAT CAPIT C +LAT CAPIT C LAT SMALL C +LAT SMALL C LAT CAPIT C +LAT SMALL C LAT SMALL C +LAT CAPIT D LAT CAPIT D +LAT CAPIT D LAT SMALL D +LAT SMALL D LAT CAPIT D +LAT SMALL D LAT SMALL D +LAT CAPIT E LAT CAPIT E +LAT CAPIT E LAT SMALL E +LAT SMALL E LAT CAPIT E +LAT SMALL E LAT SMALL E +LAT CAPIT F LAT CAPIT F +LAT CAPIT F LAT SMALL F +LAT SMALL F LAT CAPIT F +LAT SMALL F LAT SMALL F +LAT CAPIT G LAT CAPIT G +LAT CAPIT G LAT SMALL G +LAT SMALL G LAT CAPIT G +LAT SMALL G LAT SMALL G +LAT CAPIT H LAT CAPIT H +LAT CAPIT H LAT SMALL H +LAT SMALL H LAT CAPIT H +LAT SMALL H LAT SMALL H +LAT CAPIT I LAT CAPIT I +LAT CAPIT I LAT SMALL I +LAT SMALL I LAT CAPIT I +LAT SMALL I LAT SMALL I +LAT CAPIT J LAT CAPIT J +LAT CAPIT J LAT SMALL J +LAT SMALL J LAT CAPIT J +LAT SMALL J LAT SMALL J +LAT CAPIT K LAT CAPIT K +LAT CAPIT K LAT SMALL K +LAT SMALL K LAT CAPIT K +LAT SMALL K LAT SMALL K +LAT CAPIT L LAT CAPIT L +LAT CAPIT L LAT SMALL L +LAT SMALL L LAT CAPIT L +LAT SMALL L LAT SMALL L +LAT CAPIT M LAT CAPIT M +LAT CAPIT M LAT SMALL M +LAT SMALL M LAT CAPIT M +LAT SMALL M LAT SMALL M +LAT CAPIT N LAT CAPIT N +LAT CAPIT N LAT SMALL N +LAT SMALL N LAT CAPIT N +LAT SMALL N LAT SMALL N +LAT CAPIT O LAT CAPIT O +LAT CAPIT O LAT SMALL O +LAT SMALL O LAT CAPIT O +LAT SMALL O LAT SMALL O +LAT CAPIT P LAT CAPIT P +LAT CAPIT P LAT SMALL P +LAT SMALL P LAT CAPIT P +LAT SMALL P LAT SMALL P +LAT CAPIT Q LAT CAPIT Q +LAT CAPIT Q LAT SMALL Q +LAT SMALL Q LAT CAPIT Q +LAT SMALL Q LAT SMALL Q +LAT CAPIT R LAT CAPIT R +LAT CAPIT R LAT SMALL R +LAT SMALL R LAT CAPIT R +LAT SMALL R LAT SMALL R +LAT CAPIT S LAT CAPIT S +LAT CAPIT S LAT SMALL S +LAT SMALL S LAT CAPIT S +LAT SMALL S LAT SMALL S +LAT CAPIT T LAT CAPIT T +LAT CAPIT T LAT SMALL T +LAT SMALL T LAT CAPIT T +LAT SMALL T LAT SMALL T +LAT CAPIT U LAT CAPIT U +LAT CAPIT U LAT SMALL U +LAT SMALL U LAT CAPIT U +LAT SMALL U LAT SMALL U +LAT CAPIT V LAT CAPIT V +LAT CAPIT V LAT SMALL V +LAT SMALL V LAT CAPIT V +LAT SMALL V LAT SMALL V +LAT CAPIT W LAT CAPIT W +LAT CAPIT W LAT SMALL W +LAT SMALL W LAT CAPIT W +LAT SMALL W LAT SMALL W +LAT CAPIT X LAT CAPIT X +LAT CAPIT X LAT SMALL X +LAT SMALL X LAT CAPIT X +LAT SMALL X LAT SMALL X +LAT CAPIT Y LAT CAPIT Y +LAT CAPIT Y LAT SMALL Y +LAT SMALL Y LAT CAPIT Y +LAT SMALL Y LAT SMALL Y +LAT CAPIT Z LAT CAPIT Z +LAT CAPIT Z LAT SMALL Z +LAT SMALL Z LAT CAPIT Z +LAT SMALL Z LAT SMALL Z +CYR CAPIT A CYR CAPIT A +CYR CAPIT A CYR SMALL A +CYR SMALL A CYR CAPIT A +CYR SMALL A CYR SMALL A +CYR CAPIT BE CYR CAPIT BE +CYR CAPIT BE CYR SMALL BE +CYR SMALL BE CYR CAPIT BE +CYR SMALL BE CYR SMALL BE +CYR CAPIT VE CYR CAPIT VE +CYR CAPIT VE CYR SMALL VE +CYR SMALL VE CYR CAPIT VE +CYR SMALL VE CYR SMALL VE +CYR CAPIT GE CYR CAPIT GE +CYR CAPIT GE CYR SMALL GE +CYR SMALL GE CYR CAPIT GE +CYR SMALL GE CYR SMALL GE +CYR CAPIT DE CYR CAPIT DE +CYR CAPIT DE CYR SMALL DE +CYR SMALL DE CYR CAPIT DE +CYR SMALL DE CYR SMALL DE +CYR CAPIT IE CYR CAPIT IE +CYR CAPIT IE CYR SMALL IE +CYR CAPIT IO CYR CAPIT IO +CYR CAPIT IO CYR SMALL IO +CYR SMALL IE CYR CAPIT IE +CYR SMALL IE CYR SMALL IE +CYR SMALL IO CYR CAPIT IO +CYR SMALL IO CYR SMALL IO +CYR CAPIT ZHE CYR CAPIT ZHE +CYR CAPIT ZHE CYR SMALL ZHE +CYR SMALL ZHE CYR CAPIT ZHE +CYR SMALL ZHE CYR SMALL ZHE +CYR CAPIT ZE CYR CAPIT ZE +CYR CAPIT ZE CYR SMALL ZE +CYR SMALL ZE CYR CAPIT ZE +CYR SMALL ZE CYR SMALL ZE +CYR CAPIT I CYR CAPIT I +CYR CAPIT I CYR SMALL I +CYR SMALL I CYR CAPIT I +CYR SMALL I CYR SMALL I +CYR CAPIT KA CYR CAPIT KA +CYR CAPIT KA CYR SMALL KA +CYR SMALL KA CYR CAPIT KA +CYR SMALL KA CYR SMALL KA +CYR CAPIT EL CYR CAPIT EL +CYR CAPIT EL CYR SMALL EL +CYR SMALL EL CYR CAPIT EL +CYR SMALL EL CYR SMALL EL +CYR CAPIT EM CYR CAPIT EM +CYR CAPIT EM CYR SMALL EM +CYR SMALL EM CYR CAPIT EM +CYR SMALL EM CYR SMALL EM +CYR CAPIT EN CYR CAPIT EN +CYR CAPIT EN CYR SMALL EN +CYR SMALL EN CYR CAPIT EN +CYR SMALL EN CYR SMALL EN +CYR CAPIT O CYR CAPIT O +CYR CAPIT O CYR SMALL O +CYR SMALL O CYR CAPIT O +CYR SMALL O CYR SMALL O +CYR CAPIT PE CYR CAPIT PE +CYR CAPIT PE CYR SMALL PE +CYR SMALL PE CYR CAPIT PE +CYR SMALL PE CYR SMALL PE +CYR CAPIT ER CYR CAPIT ER +CYR CAPIT ER CYR SMALL ER +CYR SMALL ER CYR CAPIT ER +CYR SMALL ER CYR SMALL ER +CYR CAPIT ES CYR CAPIT ES +CYR CAPIT ES CYR SMALL ES +CYR SMALL ES CYR CAPIT ES +CYR SMALL ES CYR SMALL ES +CYR CAPIT TE CYR CAPIT TE +CYR CAPIT TE CYR SMALL TE +CYR SMALL TE CYR CAPIT TE +CYR SMALL TE CYR SMALL TE +CYR CAPIT U CYR CAPIT U +CYR CAPIT U CYR SMALL U +CYR SMALL U CYR CAPIT U +CYR SMALL U CYR SMALL U +CYR CAPIT EF CYR CAPIT EF +CYR CAPIT EF CYR SMALL EF +CYR SMALL EF CYR CAPIT EF +CYR SMALL EF CYR SMALL EF +CYR CAPIT HA CYR CAPIT HA +CYR CAPIT HA CYR SMALL HA +CYR SMALL HA CYR CAPIT HA +CYR SMALL HA CYR SMALL HA +CYR CAPIT TSE CYR CAPIT TSE +CYR CAPIT TSE CYR SMALL TSE +CYR SMALL TSE CYR CAPIT TSE +CYR SMALL TSE CYR SMALL TSE +CYR CAPIT CHE CYR CAPIT CHE +CYR CAPIT CHE CYR SMALL CHE +CYR SMALL CHE CYR CAPIT CHE +CYR SMALL CHE CYR SMALL CHE +CYR CAPIT SHA CYR CAPIT SHA +CYR CAPIT SHA CYR SMALL SHA +CYR SMALL SHA CYR CAPIT SHA +CYR SMALL SHA CYR SMALL SHA +CYR CAPIT SCHA CYR CAPIT SCHA +CYR CAPIT SCHA CYR SMALL SCHA +CYR SMALL SCHA CYR CAPIT SCHA +CYR SMALL SCHA CYR SMALL SCHA +CYR CAPIT HARD SIGN CYR CAPIT HARD SIGN +CYR CAPIT HARD SIGN CYR SMALL HARD SIGN +CYR SMALL HARD SIGN CYR CAPIT HARD SIGN +CYR SMALL HARD SIGN CYR SMALL HARD SIGN +CYR CAPIT YERU CYR CAPIT YERU +CYR CAPIT YERU CYR SMALL YERU +CYR SMALL YERU CYR CAPIT YERU +CYR SMALL YERU CYR SMALL YERU +CYR CAPIT SOFT SIGN CYR CAPIT SOFT SIGN +CYR CAPIT SOFT SIGN CYR SMALL SOFT SIGN +CYR SMALL SOFT SIGN CYR CAPIT SOFT SIGN +CYR SMALL SOFT SIGN CYR SMALL SOFT SIGN +CYR CAPIT E CYR CAPIT E +CYR CAPIT E CYR SMALL E +CYR SMALL E CYR CAPIT E +CYR SMALL E CYR SMALL E +CYR CAPIT YU CYR CAPIT YU +CYR CAPIT YU CYR SMALL YU +CYR SMALL YU CYR CAPIT YU +CYR SMALL YU CYR SMALL YU +CYR CAPIT YA CYR CAPIT YA +CYR CAPIT YA CYR SMALL YA +CYR SMALL YA CYR CAPIT YA +CYR SMALL YA CYR SMALL YA +SET CHARACTER SET utf8; +ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2; +ALTER TABLE t1 CHANGE ucs2_f ucs2_f CHAR(32) UNICODE NOT NULL; +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0391,'GREEK CAPIT ALPHA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0393,'GREEK CAPIT GAMMA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0394,'GREEK CAPIT DELTA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0395,'GREEK CAPIT EPSILON'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x03B1,'GREEK SMALL ALPHA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x03B2,'GREEK SMALL BETA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x03B3,'GREEK SMALL GAMMA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x03B4,'GREEK SMALL DELTA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x03B5,'GREEK SMALL EPSILON'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0531,'ARMENIAN CAPIT AYB'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0532,'ARMENIAN CAPIT BEN'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0533,'ARMENIAN CAPIT GIM'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0534,'ARMENIAN CAPIT DA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0535,'ARMENIAN CAPIT ECH'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0536,'ARMENIAN CAPIT ZA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0561,'ARMENIAN SMALL YAB'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0562,'ARMENIAN SMALL BEN'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0563,'ARMENIAN SMALL GIM'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0564,'ARMENIAN SMALL DA'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0565,'ARMENIAN SMALL ECH'); +INSERT INTO t1 (ucs2_f,comment) VALUES (0x0566,'ARMENIAN SMALL ZA'); +ALTER TABLE t1 ADD armscii8_f CHAR(32) CHARACTER SET armscii8 NOT NULL; +ALTER TABLE t1 ADD greek_f CHAR(32) CHARACTER SET greek NOT NULL; +UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE%'; +UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; +UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; +UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; +SELECT * FROM t1; +comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f +LAT SMALL A a a a a +LAT SMALL B b b b b +LAT SMALL C c c c c +LAT SMALL D d d d d +LAT SMALL E e e e e +LAT SMALL F f f f f +LAT SMALL G g g g g +LAT SMALL H h h h h +LAT SMALL I i i i i +LAT SMALL J j j j j +LAT SMALL K k k k k +LAT SMALL L l l l l +LAT SMALL M m m m m +LAT SMALL N n n n n +LAT SMALL O o o o o +LAT SMALL P p p p p +LAT SMALL Q q q q q +LAT SMALL R r r r r +LAT SMALL S s s s s +LAT SMALL T t t t t +LAT SMALL U u u u u +LAT SMALL V v v v v +LAT SMALL W w w w w +LAT SMALL X x x x x +LAT SMALL Y y y y y +LAT SMALL Z z z z z +LAT CAPIT A A A A A +LAT CAPIT B B B B B +LAT CAPIT C C C C C +LAT CAPIT D D D D D +LAT CAPIT E E E E E +LAT CAPIT F F F F F +LAT CAPIT G G G G G +LAT CAPIT H H H H H +LAT CAPIT I I I I I +LAT CAPIT J J J J J +LAT CAPIT K K K K K +LAT CAPIT L L L L L +LAT CAPIT M M M M M +LAT CAPIT N N N N N +LAT CAPIT O O O O O +LAT CAPIT P P P P P +LAT CAPIT Q Q Q Q Q +LAT CAPIT R R R R R +LAT CAPIT S S S S S +LAT CAPIT T T T T T +LAT CAPIT U U U U U +LAT CAPIT V V V V V +LAT CAPIT W W W W W +LAT CAPIT X X X X X +LAT CAPIT Y Y Y Y Y +LAT CAPIT Z Z Z Z Z +CYR SMALL A а а Á а +CYR SMALL BE б б  б +CYR SMALL VE в в × Ð² +CYR SMALL GE г г Ç Ð³ +CYR SMALL DE ÐŽ ÐŽ Ä ÐŽ +CYR SMALL IE е е Šе +CYR SMALL IO Ñ Ñ £ Ñ +CYR SMALL ZHE ж ж Ö Ð¶ +CYR SMALL ZE з з Ú Ð· +CYR SMALL I О О É Ðž +CYR SMALL KA к к Ë Ðº +CYR SMALL EL л л Ì Ð» +CYR SMALL EM ÐŒ ÐŒ Í ÐŒ +CYR SMALL EN М М ΠМ +CYR SMALL O П П Ï ÐŸ +CYR SMALL PE п п Рп +CYR SMALL ER Ñ Ñ Ò Ñ +CYR SMALL ES Ñ Ñ Ó Ñ +CYR SMALL TE Ñ Ñ Ô Ñ +CYR SMALL U Ñ Ñ Õ Ñ +CYR SMALL EF Ñ Ñ Æ Ñ +CYR SMALL HA Ñ
Ñ
È Ñ
+CYR SMALL TSE Ñ Ñ Ã Ñ +CYR SMALL CHE Ñ Ñ Þ Ñ +CYR SMALL SHA Ñ Ñ Û Ñ +CYR SMALL SCHA Ñ Ñ Ý Ñ +CYR SMALL HARD SIGN Ñ Ñ ß Ñ +CYR SMALL YERU Ñ Ñ Ù Ñ +CYR SMALL SOFT SIGN Ñ Ñ Ø Ñ +CYR SMALL E Ñ Ñ Ü Ñ +CYR SMALL YU Ñ Ñ À Ñ +CYR SMALL YA Ñ Ñ Ñ Ñ +CYR CAPIT A Ð Ð á Ð +CYR CAPIT BE Ð Ð â Ð +CYR CAPIT VE Ð Ð ÷ Ð +CYR CAPIT GE Ð Ð ç Ð +CYR CAPIT DE Ð Ð ä Ð +CYR CAPIT IE Ð Ð å Ð +CYR CAPIT IO Ð Ð ³ Ð +CYR CAPIT ZHE Ð Ð ö Ð +CYR CAPIT ZE Ð Ð ú Ð +CYR CAPIT I Ð Ð é Ð +CYR CAPIT KA Ð Ð ë Ð +CYR CAPIT EL Ð Ð ì Ð +CYR CAPIT EM Ð Ð í Ð +CYR CAPIT EN Ð Ð î Ð +CYR CAPIT O Ð Ð ï Ð +CYR CAPIT PE Ð Ð ð Ð +CYR CAPIT ER Ð Ð ò Ð +CYR CAPIT ES С С ó С +CYR CAPIT TE Т Т ô Т +CYR CAPIT U У У õ У +CYR CAPIT EF Ѐ Ѐ æ Ѐ +CYR CAPIT HA Ð¥ Ð¥ è Ð¥ +CYR CAPIT TSE Њ Њ ã Њ +CYR CAPIT CHE Ч Ч þ Ч +CYR CAPIT SHA К К û К +CYR CAPIT SCHA Щ Щ ý Щ +CYR CAPIT HARD SIGN Ъ Ъ ÿ Ъ +CYR CAPIT YERU Ы Ы ù Ы +CYR CAPIT SOFT SIGN Ь Ь ø Ь +CYR CAPIT E Ð Ð ü Ð +CYR CAPIT YU Ю Ю à Ю +CYR CAPIT YA Я Я ñ Я +GREEK CAPIT ALPHA Î Î Î +GREEK CAPIT BETA Î Î Î +GREEK CAPIT GAMMA Î Î Î +GREEK CAPIT DELTA Î Î Î +GREEK CAPIT EPSILON Î Î Î +GREEK SMALL ALPHA α α α +GREEK SMALL BETA β β β +GREEK SMALL GAMMA γ γ γ +GREEK SMALL DELTA ÎŽ ÎŽ ÎŽ +GREEK SMALL EPSILON ε ε ε +ARMENIAN CAPIT AYB Ô± Ô± Ô± +ARMENIAN CAPIT BEN Ô² Ô² Ô² +ARMENIAN CAPIT GIM Ô³ Ô³ Ô³ +ARMENIAN CAPIT DA ÔŽ ÔŽ ÔŽ +ARMENIAN CAPIT ECH Ôµ Ôµ Ôµ +ARMENIAN CAPIT ZA Ô¶ Ô¶ Ô¶ +ARMENIAN SMALL YAB Õ¡ Õ¡ Õ¡ +ARMENIAN SMALL BEN Õ¢ Õ¢ Õ¢ +ARMENIAN SMALL GIM Õ£ Õ£ Õ£ +ARMENIAN SMALL DA Õ€ Õ€ Õ€ +ARMENIAN SMALL ECH Õ¥ Õ¥ Õ¥ +ARMENIAN SMALL ZA ÕŠ ÕŠ ÕŠ +SET CHARACTER SET 'binary'; +SELECT * FROM t1; +comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f +LAT SMALL A a a a +LAT SMALL B b b b +LAT SMALL C c c c +LAT SMALL D d d d +LAT SMALL E e e e +LAT SMALL F f f f +LAT SMALL G g g g +LAT SMALL H h h h +LAT SMALL I i i i +LAT SMALL J j j j +LAT SMALL K k k k +LAT SMALL L l l l +LAT SMALL M m m m +LAT SMALL N n n n +LAT SMALL O o o o +LAT SMALL P p p p +LAT SMALL Q q q q +LAT SMALL R r r r +LAT SMALL S s s s +LAT SMALL T t t t +LAT SMALL U u u u +LAT SMALL V v v v +LAT SMALL W w w w +LAT SMALL X x x x +LAT SMALL Y y y y +LAT SMALL Z z z z +LAT CAPIT A A A A +LAT CAPIT B B B B +LAT CAPIT C C C C +LAT CAPIT D D D D +LAT CAPIT E E E E +LAT CAPIT F F F F +LAT CAPIT G G G G +LAT CAPIT H H H H +LAT CAPIT I I I I +LAT CAPIT J J J J +LAT CAPIT K K K K +LAT CAPIT L L L L +LAT CAPIT M M M M +LAT CAPIT N N N N +LAT CAPIT O O O O +LAT CAPIT P P P P +LAT CAPIT Q Q Q Q +LAT CAPIT R R R R +LAT CAPIT S S S S +LAT CAPIT T T T T +LAT CAPIT U U U U +LAT CAPIT V V V V +LAT CAPIT W W W W +LAT CAPIT X X X X +LAT CAPIT Y Y Y Y +LAT CAPIT Z Z Z Z +CYR SMALL A Á а Á 0 +CYR SMALL BE  б  1 +CYR SMALL VE × Ð² × 2 +CYR SMALL GE Ç Ð³ Ç 3 +CYR SMALL DE Ä ÐŽ Ä 4 +CYR SMALL IE Šе Å 5 +CYR SMALL IO £ Ñ £ Q +CYR SMALL ZHE Ö Ð¶ Ö 6 +CYR SMALL ZE Ú Ð· Ú 7 +CYR SMALL I É Ðž É 8 +CYR SMALL KA Ë Ðº Ë : +CYR SMALL EL Ì Ð» Ì ; +CYR SMALL EM Í ÐŒ Í < +CYR SMALL EN ΠМ Î = +CYR SMALL O Ï ÐŸ Ï > +CYR SMALL PE Рп Ð ? +CYR SMALL ER Ò Ñ Ò @ +CYR SMALL ES Ó Ñ Ó A +CYR SMALL TE Ô Ñ Ô B +CYR SMALL U Õ Ñ Õ C +CYR SMALL EF Æ Ñ Æ D +CYR SMALL HA È Ñ
È E +CYR SMALL TSE Ã Ñ Ã F +CYR SMALL CHE Þ Ñ Þ G +CYR SMALL SHA Û Ñ Û H +CYR SMALL SCHA Ý Ñ Ý I +CYR SMALL HARD SIGN ß Ñ ß J +CYR SMALL YERU Ù Ñ Ù K +CYR SMALL SOFT SIGN Ø Ñ Ø L +CYR SMALL E Ü Ñ Ü M +CYR SMALL YU À Ñ À N +CYR SMALL YA Ñ Ñ Ñ O +CYR CAPIT A á Ð á +CYR CAPIT BE â Ð â +CYR CAPIT VE ÷ Ð ÷ +CYR CAPIT GE ç Ð ç +CYR CAPIT DE ä Ð ä +CYR CAPIT IE å Ð å +CYR CAPIT IO ³ Ð ³ +CYR CAPIT ZHE ö Ð ö +CYR CAPIT ZE ú Ð ú +CYR CAPIT I é Ð é +CYR CAPIT KA ë Ð ë +CYR CAPIT EL ì Ð ì +CYR CAPIT EM í Ð í +CYR CAPIT EN î Ð î +CYR CAPIT O ï Ð ï +CYR CAPIT PE ð Ð ð +CYR CAPIT ER ò Ð ò +CYR CAPIT ES ó С ó ! +CYR CAPIT TE ô Т ô " +CYR CAPIT U õ У õ # +CYR CAPIT EF æ Ѐ æ $ +CYR CAPIT HA è Ð¥ è % +CYR CAPIT TSE ã Њ ã & +CYR CAPIT CHE þ Ч þ ' +CYR CAPIT SHA û К û ( +CYR CAPIT SCHA ý Щ ý ) +CYR CAPIT HARD SIGN ÿ Ъ ÿ * +CYR CAPIT YERU ù Ы ù + +CYR CAPIT SOFT SIGN ø Ь ø , +CYR CAPIT E ü Ð ü - +CYR CAPIT YU à Ю à . +CYR CAPIT YA ñ Я ñ / +GREEK CAPIT ALPHA Î Á +GREEK CAPIT BETA Î Â +GREEK CAPIT GAMMA Î Ã +GREEK CAPIT DELTA Î Ä +GREEK CAPIT EPSILON Î Å +GREEK SMALL ALPHA α ± á +GREEK SMALL BETA β ² â +GREEK SMALL GAMMA γ ³ ã +GREEK SMALL DELTA ÎŽ Ž ä +GREEK SMALL EPSILON ε µ å +ARMENIAN CAPIT AYB Ô± 1 ² +ARMENIAN CAPIT BEN Ô² 2 Ž +ARMENIAN CAPIT GIM Ô³ 3 ¶ +ARMENIAN CAPIT DA ÔŽ 4 ž +ARMENIAN CAPIT ECH Ôµ 5 º +ARMENIAN CAPIT ZA Ô¶ 6 Œ +ARMENIAN SMALL YAB Õ¡ a ³ +ARMENIAN SMALL BEN Õ¢ b µ +ARMENIAN SMALL GIM Õ£ c · +ARMENIAN SMALL DA Õ€ d ¹ +ARMENIAN SMALL ECH Õ¥ e » +ARMENIAN SMALL ZA ÕŠ f œ +SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; +min(comment) count(*) +LAT CAPIT A 2 +LAT CAPIT B 2 +LAT CAPIT C 2 +LAT CAPIT D 2 +LAT CAPIT E 2 +LAT CAPIT F 2 +LAT CAPIT G 2 +LAT CAPIT H 2 +LAT CAPIT I 2 +LAT CAPIT J 2 +LAT CAPIT K 2 +LAT CAPIT L 2 +LAT CAPIT M 2 +LAT CAPIT N 2 +LAT CAPIT O 2 +LAT CAPIT P 2 +LAT CAPIT Q 2 +LAT CAPIT R 2 +LAT CAPIT S 2 +LAT CAPIT T 2 +LAT CAPIT U 2 +LAT CAPIT V 2 +LAT CAPIT W 2 +LAT CAPIT X 2 +LAT CAPIT Y 2 +LAT CAPIT Z 2 +GREEK CAPIT ALPHA 2 +GREEK CAPIT BETA 2 +GREEK CAPIT GAMMA 2 +GREEK CAPIT DELTA 2 +GREEK CAPIT EPSILON 2 +CYR CAPIT A 2 +CYR CAPIT BE 2 +CYR CAPIT VE 2 +CYR CAPIT GE 2 +CYR CAPIT DE 2 +CYR CAPIT IE 4 +CYR CAPIT ZHE 2 +CYR CAPIT ZE 2 +CYR CAPIT I 2 +CYR CAPIT KA 2 +CYR CAPIT EL 2 +CYR CAPIT EM 2 +CYR CAPIT EN 2 +CYR CAPIT O 2 +CYR CAPIT PE 2 +CYR CAPIT ER 2 +CYR CAPIT ES 2 +CYR CAPIT TE 2 +CYR CAPIT U 2 +CYR CAPIT EF 2 +CYR CAPIT HA 2 +CYR CAPIT TSE 2 +CYR CAPIT CHE 2 +CYR CAPIT SHA 2 +CYR CAPIT SCHA 2 +CYR CAPIT HARD SIGN 2 +CYR CAPIT YERU 2 +CYR CAPIT SOFT SIGN 2 +CYR CAPIT E 2 +CYR CAPIT YU 2 +CYR CAPIT YA 2 +ARMENIAN CAPIT AYB 2 +ARMENIAN CAPIT BEN 2 +ARMENIAN CAPIT GIM 2 +ARMENIAN CAPIT DA 2 +ARMENIAN CAPIT ECH 2 +ARMENIAN CAPIT ZA 2 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result new file mode 100644 index 00000000000..5e273b3c800 --- /dev/null +++ b/mysql-test/r/ctype_mb.result @@ -0,0 +1,57 @@ +drop table if exists t1; +CREATE TABLE t1 SELECT _utf8'test' as c1, _utf8'ÑеÑÑ' as c2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(4) character set utf8 NOT NULL default '', + `c2` char(4) character set utf8 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DELETE FROM t1; +ALTER TABLE t1 ADD c3 CHAR(4) CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(4) character set utf8 NOT NULL default '', + `c2` char(4) character set utf8 NOT NULL default '', + `c3` char(4) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd'); +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +SELECT * FROM t1; +c1 c2 c3 +aaaa aaaa aaaa +DROP TABLE t1; +CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8, KEY key_a(a(3))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(4) character set utf8 default NULL, + KEY `key_a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW KEYS FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 key_a 1 a A NULL 9 NULL YES BTREE +ALTER TABLE t1 CHANGE a a CHAR(4); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(4) default NULL, + KEY `key_a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW KEYS FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 key_a 1 a A NULL 3 NULL YES BTREE +ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(4) character set utf8 default NULL, + KEY `key_a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW KEYS FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 key_a 1 a A NULL 9 NULL YES BTREE +DROP TABLE t1; diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result new file mode 100644 index 00000000000..be792c007fc --- /dev/null +++ b/mysql-test/r/ctype_recoding.result @@ -0,0 +1,168 @@ +SET CHARACTER SET koi8r; +DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ, t1, t2; +SET CHARACTER SET koi8r; +CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; +CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set cp1251 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a FROM t1; +a +ÐÒÏÂÁ +SELECT HEX(a) FROM t1; +HEX(a) +EFF0EEE1E0 +INSERT t2 SELECT * FROM t1; +SELECT HEX(a) FROM t2; +HEX(a) +D0BFD180D0BED0B1D0B0 +DROP TABLE t1, t2; +CREATE TABLE t1 (description text character set cp1250 NOT NULL); +INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde'); +SELECT description FROM t1; +description +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde +DROP TABLE t1; +CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; +CREATE TABLE t2 (a TEXT CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text character set cp1251 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT HEX(a) FROM t1; +HEX(a) +EFF0EEE1E0 +INSERT t2 SELECT * FROM t1; +SELECT HEX(a) FROM t2; +HEX(a) +D0BFD180D0BED0B1D0B0 +DROP TABLE t1, t2; +CREATE TABLE `ÔÁÂÌÉÃÁ` +( +ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ" +) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ"; +SHOW TABLES; +Tables_in_test +ÔÁÂÌÉÃÁ +SHOW CREATE TABLE ÔÁÂÌÉÃÁ; +Table Create Table +ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` ( + `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ' +SHOW FIELDS FROM ÔÁÂÌÉÃÁ; +Field Type Null Key Default Extra +ÐÏÌÅ char(32) +SET CHARACTER SET cp1251; +SHOW TABLES; +Tables_in_test +òàáëèöà +SHOW CREATE TABLE òàáëèöà; +Table Create Table +òàáëèöà CREATE TABLE `òàáëèöà` ( + `ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû' +SHOW FIELDS FROM òàáëèöà; +Field Type Null Key Default Extra +ïîëå char(32) +SET CHARACTER SET utf8; +SHOW TABLES; +Tables_in_test +ÑаблОÑа +SHOW CREATE TABLE ÑаблОÑа; +Table Create Table +ÑаблОÑа CREATE TABLE `ÑаблОÑа` ( + `пПле` char(32) character set koi8r NOT NULL default '' COMMENT 'кПЌЌеМÑаÑОй пПлÑ' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='кПЌЌеМÑаÑОй ÑаблОÑÑ' +SHOW FIELDS FROM ÑаблОÑа; +Field Type Null Key Default Extra +пПле char(32) +SET CHARACTER SET koi8r; +DROP TABLE ÔÁÂÌÉÃÁ; +SET CHARACTER SET default; +SET NAMES UTF8; +CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; +INSERT INTO t1 (t) VALUES ('x'); +SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; +1 +1 +DROP TABLE t1; +SET CHARACTER SET koi8r; +CREATE DATABASE ÔÅÓÔ; +USE ÔÅÓÔ; +SHOW TABLES; +Tables_in_ÔÅÓÔ +SHOW TABLES IN ÔÅÓÔ; +Tables_in_ÔÅÓÔ +SET CHARACTER SET cp1251; +SHOW TABLES; +Tables_in_òåñò +SHOW TABLES IN òåñò; +Tables_in_òåñò +SET CHARACTER SET koi8r; +DROP DATABASE ÔÅÓÔ; +SET NAMES koi8r; +SELECT hex('ÔÅÓÔ'); +hex('ÔÅÓÔ') +D4C5D3D4 +SET character_set_connection=cp1251; +SELECT hex('ÔÅÓÔ'); +hex('ÔÅÓÔ') +F2E5F1F2 +USE test; +SET NAMES binary; +CREATE TABLE `ÑеÑÑ` (`ÑеÑÑ` int); +SHOW CREATE TABLE `ÑеÑÑ`; +Table Create Table +ÑеÑÑ CREATE TABLE `ÑеÑÑ` ( + `ÑеÑÑ` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SET NAMES utf8; +SHOW CREATE TABLE `ÑеÑÑ`; +Table Create Table +ÑеÑÑ CREATE TABLE `ÑеÑÑ` ( + `ÑеÑÑ` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE `ÑеÑÑ`; +SET NAMES binary; +SET character_set_connection=utf8; +SELECT 'ÑеÑÑ' as s; +s +ÑеÑÑ +SET NAMES utf8; +SET character_set_connection=binary; +SELECT 'ÑеÑÑ' as s; +s +ÑеÑÑ +SET NAMES latin1; +CREATE TABLE t1 (`ä` CHAR(128) DEFAULT 'ä', `ä1` ENUM('ä1','ä2') DEFAULT 'ä2'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ä` char(128) default 'ä', + `ä1` enum('ä1','ä2') default 'ä2' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +ä char(128) YES ä +ä1 enum('ä1','ä2') YES ä2 +SET NAMES binary; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `À` char(128) default 'À', + `À1` enum('À1','À2') default 'À2' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +À char(128) YES À +À1 enum('À1','À2') YES À2 +DROP TABLE t1; +SET NAMES binary; +CREATE TABLE `goodÐÌÏÈÏ` (a int); +ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ' +SET NAMES utf8; +CREATE TABLE `goodÐÌÏÈÏ` (a int); +ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)' diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result new file mode 100644 index 00000000000..1e3e28784a5 --- /dev/null +++ b/mysql-test/r/ctype_sjis.result @@ -0,0 +1,43 @@ +drop table if exists t1; +set names sjis; +select 'a' like 'a'; +'a' like 'a' +1 +select 'A' like 'a'; +'A' like 'a' +1 +select 'A' like 'a' collate sjis_bin; +'A' like 'a' collate sjis_bin +0 +set @sjis1= _sjis 0xa1a2a3a4a5a6a7a8a9aaabacadaeaf; +set @sjis2= _sjis 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebf; +set @sjis3= _sjis 0xc0c1c2c3c4c5c6c7c8c9cacbcccdcecf; +set @sjis4= _sjis 0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf; +set @utf81= CONVERT(@sjis1 USING utf8); +set @utf82= CONVERT(@sjis2 USING utf8); +set @utf83= CONVERT(@sjis3 USING utf8); +set @utf84= CONVERT(@sjis4 USING utf8); +select hex(@utf81); +hex(@utf81) +EFBDA1EFBDA2EFBDA3EFBDA4EFBDA5EFBDA6EFBDA7EFBDA8EFBDA9EFBDAAEFBDABEFBDACEFBDADEFBDAEEFBDAF +select hex(@utf82); +hex(@utf82) +EFBDB0EFBDB1EFBDB2EFBDB3EFBDB4EFBDB5EFBDB6EFBDB7EFBDB8EFBDB9EFBDBAEFBDBBEFBDBCEFBDBDEFBDBEEFBDBF +select hex(@utf83); +hex(@utf83) +EFBE80EFBE81EFBE82EFBE83EFBE84EFBE85EFBE86EFBE87EFBE88EFBE89EFBE8AEFBE8BEFBE8CEFBE8DEFBE8EEFBE8F +select hex(@utf84); +hex(@utf84) +EFBE90EFBE91EFBE92EFBE93EFBE94EFBE95EFBE96EFBE97EFBE98EFBE99EFBE9AEFBE9BEFBE9CEFBE9DEFBE9EEFBE9F +select hex(CONVERT(@utf81 USING sjis)); +hex(CONVERT(@utf81 USING sjis)) +A1A2A3A4A5A6A7A8A9AAABACADAEAF +select hex(CONVERT(@utf82 USING sjis)); +hex(CONVERT(@utf82 USING sjis)) +B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF +select hex(CONVERT(@utf83 USING sjis)); +hex(CONVERT(@utf83 USING sjis)) +C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF +select hex(CONVERT(@utf84 USING sjis)); +hex(CONVERT(@utf84 USING sjis)) +D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index 811609d4ba9..94c4b295713 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -1,9 +1,129 @@ drop table if exists t1; +SET @pl0= _tis620 0x000102030405060708090A0B0C0D0E0F; +SET @pl1= _tis620 0x101112131415161718191A1B1C1D1E1F; +SET @pl2= _tis620 0x202122232425262728292A2B2C2D2E2F; +SET @pl3= _tis620 0x303132333435363738393A3B3C3D3E3F; +SET @pl4= _tis620 0x404142434445464748494A4B4C4D4E4F; +SET @pl5= _tis620 0x505152535455565758595A5B5C5D5E5F; +SET @pl6= _tis620 0x606162636465666768696A6B6C6D6E6F; +SET @pl7= _tis620 0x707172737475767778797A7B7C7D7E7F; +SET @pl8= _tis620 0x808182838485868788898A8B8C8D8E8F; +SET @pl9= _tis620 0x909192939495969798999A9B9C9D9E9F; +SET @plA= _tis620 0xA0A1A2A3A4A5A6A7A8A9AAABACADAEAF; +SET @plB= _tis620 0xB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF; +SET @plC= _tis620 0xC0C1C2C3C4C5C6C7C8C9CACBCCCDCECF; +SET @plD= _tis620 0xD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF; +SET @plE= _tis620 0xE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF; +SET @plF= _tis620 0xF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF; +SELECT hex(@u0:=convert(@pl0 using utf8)); +hex(@u0:=convert(@pl0 using utf8)) +000102030405060708090A0B0C0D0E0F +SELECT hex(@u1:=convert(@pl1 using utf8)); +hex(@u1:=convert(@pl1 using utf8)) +101112131415161718191A1B1C1D1E1F +SELECT hex(@u2:=convert(@pl2 using utf8)); +hex(@u2:=convert(@pl2 using utf8)) +202122232425262728292A2B2C2D2E2F +SELECT hex(@u3:=convert(@pl3 using utf8)); +hex(@u3:=convert(@pl3 using utf8)) +303132333435363738393A3B3C3D3E3F +SELECT hex(@u4:=convert(@pl4 using utf8)); +hex(@u4:=convert(@pl4 using utf8)) +404142434445464748494A4B4C4D4E4F +SELECT hex(@u5:=convert(@pl5 using utf8)); +hex(@u5:=convert(@pl5 using utf8)) +505152535455565758595A5B5C5D5E5F +SELECT hex(@u6:=convert(@pl6 using utf8)); +hex(@u6:=convert(@pl6 using utf8)) +606162636465666768696A6B6C6D6E6F +SELECT hex(@u7:=convert(@pl7 using utf8)); +hex(@u7:=convert(@pl7 using utf8)) +707172737475767778797A7B7C7D7E7F +SELECT hex(@u8:=convert(@pl8 using utf8)); +hex(@u8:=convert(@pl8 using utf8)) +C280C281C282C283C284C285C286C287C288C289C28AC28BC28CC28DC28EC28F +SELECT hex(@u9:=convert(@pl9 using utf8)); +hex(@u9:=convert(@pl9 using utf8)) +C290C291C292C293C294C295C296C297C298C299C29AC29BC29CC29DC29EC29F +SELECT hex(@uA:=convert(@plA using utf8)); +hex(@uA:=convert(@plA using utf8)) +EFBFBDE0B881E0B882E0B883E0B884E0B885E0B886E0B887E0B888E0B889E0B88AE0B88BE0B88CE0B88DE0B88EE0B88F +SELECT hex(@uB:=convert(@plB using utf8)); +hex(@uB:=convert(@plB using utf8)) +E0B890E0B891E0B892E0B893E0B894E0B895E0B896E0B897E0B898E0B899E0B89AE0B89BE0B89CE0B89DE0B89EE0B89F +SELECT hex(@uC:=convert(@plC using utf8)); +hex(@uC:=convert(@plC using utf8)) +E0B8A0E0B8A1E0B8A2E0B8A3E0B8A4E0B8A5E0B8A6E0B8A7E0B8A8E0B8A9E0B8AAE0B8ABE0B8ACE0B8ADE0B8AEE0B8AF +SELECT hex(@uD:=convert(@plD using utf8)); +hex(@uD:=convert(@plD using utf8)) +E0B8B0E0B8B1E0B8B2E0B8B3E0B8B4E0B8B5E0B8B6E0B8B7E0B8B8E0B8B9E0B8BAEFBFBDEFBFBDEFBFBDEFBFBDE0B8BF +SELECT hex(@uE:=convert(@plE using utf8)); +hex(@uE:=convert(@plE using utf8)) +E0B980E0B981E0B982E0B983E0B984E0B985E0B986E0B987E0B988E0B989E0B98AE0B98BE0B98CE0B98DE0B98EE0B98F +SELECT hex(@uF:=convert(@plF using utf8)); +hex(@uF:=convert(@plF using utf8)) +E0B990E0B991E0B992E0B993E0B994E0B995E0B996E0B997E0B998E0B999E0B99AE0B99BEFBFBDEFBFBDEFBFBDEFBFBD +SELECT hex(convert(@u0 USING tis620)); +hex(convert(@u0 USING tis620)) +000102030405060708090A0B0C0D0E0F +SELECT hex(convert(@u1 USING tis620)); +hex(convert(@u1 USING tis620)) +101112131415161718191A1B1C1D1E1F +SELECT hex(convert(@u2 USING tis620)); +hex(convert(@u2 USING tis620)) +202122232425262728292A2B2C2D2E2F +SELECT hex(convert(@u3 USING tis620)); +hex(convert(@u3 USING tis620)) +303132333435363738393A3B3C3D3E3F +SELECT hex(convert(@u4 USING tis620)); +hex(convert(@u4 USING tis620)) +404142434445464748494A4B4C4D4E4F +SELECT hex(convert(@u5 USING tis620)); +hex(convert(@u5 USING tis620)) +505152535455565758595A5B5C5D5E5F +SELECT hex(convert(@u6 USING tis620)); +hex(convert(@u6 USING tis620)) +606162636465666768696A6B6C6D6E6F +SELECT hex(convert(@u7 USING tis620)); +hex(convert(@u7 USING tis620)) +707172737475767778797A7B7C7D7E7F +SELECT hex(convert(@u8 USING tis620)); +hex(convert(@u8 USING tis620)) +808182838485868788898A8B8C8D8E8F +SELECT hex(convert(@u9 USING tis620)); +hex(convert(@u9 USING tis620)) +909192939495969798999A9B9C9D9E9F +SELECT hex(convert(@uA USING tis620)); +hex(convert(@uA USING tis620)) +FFA1A2A3A4A5A6A7A8A9AAABACADAEAF +SELECT hex(convert(@uB USING tis620)); +hex(convert(@uB USING tis620)) +B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF +SELECT hex(convert(@uC USING tis620)); +hex(convert(@uC USING tis620)) +C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF +SELECT hex(convert(@uD USING tis620)); +hex(convert(@uD USING tis620)) +D0D1D2D3D4D5D6D7D8D9DAFFFFFFFFDF +SELECT hex(convert(@uE USING tis620)); +hex(convert(@uE USING tis620)) +E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF +SELECT hex(convert(@uF USING tis620)); +hex(convert(@uF USING tis620)) +F0F1F2F3F4F5F6F7F8F9FAFBFFFFFFFF +SET NAMES tis620; CREATE TABLE t1 ( recid int(11) NOT NULL auto_increment, dyninfo text, PRIMARY KEY (recid) ) ENGINE=MyISAM; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `recid` int(11) NOT NULL auto_increment, + `dyninfo` text, + PRIMARY KEY (`recid`) +) ENGINE=MyISAM DEFAULT CHARSET=tis620 INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n'); INSERT INTO t1 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n'); SELECT DISTINCT @@ -16,3 +136,2766 @@ FROM t1 HAVING year != '' ORDER BY year; year DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 +( +name varchar(50) NOT NULL default '', +excelorder int(11) NOT NULL default '0', +neworder int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=tis620; +INSERT INTO `t1` VALUES ('+45 BRETT',4,1),('+55 BRETT',5,2),('+56 BRETT',6,3),('-.55 BRETT',2,4),('-45 BRETT',8,5),('-55 BRETT',13,6),('.-55 BRETT',3,7),('.55 BRETT',1,8),('45 BRETT',7,9),('5 5 BRETT3',9,10),('5 5 BRETT2',10,11),('5 5 BRETT1',11,12),('5-5 BRETT',14,13),('55 BRETT',12,14),('55+ BRETT',17,15),('55- BRETT',15,16),('55. BRETT',16,17),('Ã.µËÔ§ ŸÍãš',1630,1630),('ÂÃç€ì',1599,1599),('ÃÁÂìšÃÃÂì',1638,1638),('àÁàšÍÃìÍØµÊÒË¡ÃÃÁä·Â (1989)',1583,1583),('àÁâ·ÃʻԹ¹Ôè§',1586,1586),('àÃÇѵ',1706,1706),('àÂ繚ԵÃ',1623,1623),('àÂ繚Եµì',1622,1622),('àÁÉÂÒ',1591,1591),('àÁÉÔ³Õ',1592,1592),('áÁé¹ÁÒµÃ',1595,1595),('àÂÒÇàÃÈ',1627,1627),('àÂÒÇÀÒ',1626,1626),('àÂÒÇÅѡɳì',1628,1628),('àÂÒÇŽÕ',1624,1624),('àÂÒÇŸÒ',1625,1625),('àÃÔ§ÃÐÇÕ',1708,1708),('àÃÔ§Ä·žÔì',1709,1709),('àÃÔ§·ÔÇÒ',1707,1707),('ÀÃÒŽÃ',1496,1496),('àâÒ',1702,1702),('âç§Ò¹àËÅç¡¡ÃØ§à·ŸÏ',1712,1712),('âÚ¹ì»ÃÐàÊÃÔ°',1713,1713),('àóÙ',1703,1703),('àÁŽÔ€ÃÒ¿·ì',1584,1584),('àÁµµÒ',1585,1585),('áÁ··ÕàÃÕÂÅ¡ÃØê» šÓ¡ÑŽ',1594,1594),('àÁžÒ',1587,1587),('àÁžÕ',1590,1590),('àÁžÒÇÕ',1588,1588),('âžԹ',1629,1629),('àÁžÔ¹Õ',1589,1589),('Áâ¹',1553,1553),('Á⹪',1554,1554),('àßៀ à·ÃŽŽÔé§',1704,1704),('áßៀ €Í¹ÊµÃÑ€ªÑè¹',1711,1711),('àßៀ€Í¹ÊµÃÑ€ªÑè¹',1705,1705),('àÃ×ͧÂÈ',1710,1710),('àÁ×ͧ·Í§',1593,1593),('ÁÂØÃÕ',1555,1555),('áÇÇÇÔÀÒ',1952,1952),('áÇÇÇŽÕ',1951,1951),('àÇèÂà©Ô¹ÍÔ¹ŽÑÊàµÃÕ¹',1949,1949),('àÇÍÃìâ¡é ·ÃҹʻÍÃìµ',1950,1950),('ÀÇÔ¹',1497,1497),('Ãǧ·Í§',1639,1639),('ÁÐÅÔÇÑÅÂì',1560,1560),('ÃеÃÕ',1643,1643),('ÃПԹ·Ãì',1644,1644),('ÃП՟Ã',1645,1645),('ÃП՟Ãó',1646,1646),('ÃП՟Å',1647,1647),('àËÁÇŽÕ',2452,2452),('âÊÃÊ',2438,2438),('àÈÃɰžÃ',2050,2050),('àÈÃɰŸ§Éì',2051,2051),('âÊÃÑš',2439,2439),('ÁËÀÑ®',1558,1558),('àÊÁÒ',2410,2410),('àÊÃÕ',2413,2413),('âÊÀÒ',2432,2432),('âÊÀÕ',2435,2435),('àÊÃÔÁÈÑ¡ŽÔì',2412,2412),('àÊÃÔÁäªÂ€éÒ¡ÃÐŽÒÉ',2411,2411),('àËÃÕÂ',2455,2455),('âÊÀÒŸÃó',2434,2434),('âÊÀÒŸš¹Õ',2433,2433),('âÊÚԵ',2436,2436),('âÊÀ³',2431,2431),('âÈÃŽÒ',2052,2052),('âÊÃŽÒ',2437,2437),('àËÁ×͹¢ÇÑ',2453,2453),('àËÁ×͹Ÿ¹Í',2454,2454),('àÊÇÂ',2414,2414),('áÊǧ',2430,2430),('Áéǹáµé',1557,1557),('ÃÊÊØ€¹žì',1641,1641),('âÊÌÊ',2440,2440),('ÃÈÑ¡ŽÔì',1640,1640),('ÁËÒÃÒª',1559,1559),('àÊÒÇÅѡɳì',2420,2420),('àÊÒÇ€¹žì',2415,2415),('àÊÒdzÕ',2416,2416),('àÊÒdzÕÂì',2417,2417),('àÊÒǹÕÂì',2419,2419),('àÊÒǹԵÂì',2418,2418),('áËÅÁ·Í§ÊË¡ÒÃ',2456,2456),('àÊ¡ÊÃÃ',2405,2405),('àÊ¡ÊÃÀì',2406,2406),('áʧÃÐÇÕ',2424,2424),('Âè§àΧÇѲ¹Ò¡ÒßÔÁŸì',1598,1598),('áʧàŽ×͹',2422,2422),('áʧªÑÂ',2421,2421),('áʧ·Í§',2423,2423),('àʶÕÂÃ',2407,2407),('áʹÃÑ¡',2428,2428),('áʹÂÒ¡Ã',2427,2427),('áʹÀŸ',2426,2426),('àʹËì',2408,2408),('áÊ¹ÊØ¢',2429,2429),('àʹÕÂì',2409,2409),('áʹ·ÇÕà·ç¡«ìä·Åì',2425,2425),('àÍ.àš.ŸÅÒÊ·ì',2676,2676),('âÍàÃÕÂÅ·ÍÅ ¿ØéŽ',2716,2716),('áÍÃì«Õ à¿Ã· ¿ÍÃìàÇÔŽàµÍÃì',2712,2712),('áÍÃìŸÕàŸÔÅÍÔ¹àµÍÃì๪Ñè¹á¹Å',2713,2713),('ÃÍÂÑÅàÍ繚Ôà¹ÕÂÃÔè§',1642,1642),('àÍàªÕÂàÊÃÔÁ¡ÔšÅÔÊ«Ôè§',2687,2687),('àÍçÁ .«Õ.ŸÕÅÔÊ«Ôè§',2690,2690),('àÍçÁ «Õ ÍÐâ¡Ãà€ÁÕ€ÍÅ',2691,2691),('àÍçÁ.àÍçÁ.«Õ.â»ÅÔàÁÍÃì',2693,2693),('àÍçÁ.«Õ.ŸÕ. ÅÔÊ«Ôè§',2692,2692),('àÍçÁ«ÕÊÂÒÁ âÅšÕʵԀÊì',2694,2694),('âÍÇÍÐËÅÑèŸÒÃì·à«ç¹àµÍÃì',2717,2717),('àÍç¡«Õà«ÅàŹ¿ÍÃìÁ',2678,2678),('àÍçª àÍçÁ «Õ â»ÅÕàÁÍÃì',2684,2684),('àÍçª.àÍçÁ.«Õ.â»ÅÔàÁÍÃì',2685,2685),('àÍçª.àÍçÁ.«Õ.â»ÅÕàÁÍÃì (ºš¡.)',2686,2686),('àÍç¹ ŽÕ à€ (»ÃÐà·Èä·Â)',2688,2688),('àÍÊ àÍÊ à€ ¡Å¡ÒÃ',2697,2697),('àÍÊ àš ŸÅÒÊ·ì á͹Žì ៀ',2695,2695),('àÍÊ ŸÕ Ê᡹',2696,2696),('àÍÊ.àÍçÁ.ÇÕ ÊË¡ÒÃ',2701,2701),('àÍÊ.àÍÊ.à€ ¡Å¡ÒÃ',2702,2702),('àÍÊ.àÍÊ.à€.¡Å¡ÒÃ',2703,2703),('àÍÊ.àÍÊ.ÍÔ¹¡Íµ ÍÅÙÁÔà¹ÕÂÁ1999',2704,2704),('àÍÊ.à€.ÍÕ.',2698,2698),('àÍÊ.«Õ.ŸÕ.ៀ',2699,2699),('àÍÊ.ŸÕ.¹ÔµµÔé§',2700,2700),('áÍÊષŸÅÑÊ',2715,2715),('àÍÊÇÕ¹Ô··Ñ¹ŸÃÔ«ÔªÑè¹',2705,2705),('áÍÅ¿èÒ â»Ãà«Ê«Ôè§',2714,2714),('àÍ¡ÃÒª',2679,2679),('àÍ¡ÃÔ¹·Ãì',2680,2680),('àÍ¡ÊÔ·žÔì',2681,2681),('àÍ¡ÍÃö',2683,2683),('à͡͹ѹµì',2682,2682),('àÍ¡ªÑÂ',2677,2677),('àΧàšÃԪѠ¡ÃØê» ÍÔ¹ŽÑÊàµÃÕÂÅ',2725,2725),('ÂÍŽàŸªÃ',1600,1600),('á͹¹Ò',2709,2709),('á͹¹ÒÃÕ',2710,2710),('áͺºÕà€ÃÊ·ì(»ÃÐà·Èä·Â)',2711,2711),('àÍ¿ ÍÕ «Ô€ÅÔ€ (¡Ãاෟ)',2689,2689),('àÍ×éÍÁŸÃ',2707,2707),('àÍ×éÍÍÒÃÕ',2708,2708),('àÍ×é͟ѹžØì',2706,2706),('ÃÑÈÁÕ',1674,1674),('ÃÑÈÁÕÀÑÊÊÃ',1675,1675),('ÀÑÊÇÃó',1511,1511),('ÀÑÊÅÔ¹',1510,1510),('ÁÑÅÅÔ¡Ò',1564,1564),('ÃÑ¡ÈÑ¡ŽÔì',1649,1649),('ÃÑ¡ÉÔµÀÑ·Ã',1650,1650),('ÀÑ¡ŽÕ',1498,1498),('ÃÑ¡ŽÕ',1648,1648),('ÀÑ€šÔÃÒ',1499,1499),('ÃѧÊÃÀì',1651,1651),('ÃѧÊѹµì',1652,1652),('ÃѧÊÔÁÒ',1653,1653),('Áѧ¡Ãä·ÂʵÕźÒÃì',1561,1561),('ÃѪà¡ÅéÒ',1654,1654),('ÃѪ®Ò',1655,1655),('ÃѪ®ÒŸÃ',1656,1656),('ÃѪŽÒ',1657,1657),('ÃѪ¹Õ',1658,1658),('ÃѪ¹Õ¡Ã',1659,1659),('ÃѪ¹ÕŸÃ',1660,1660),('ÃÑ°ÊØŽÒ',1662,1662),('ÃѰŸ§Éì',1661,1661),('Àѳ±ÔÃÒ',1500,1500),('Áѳ±¹Ò',1562,1562),('ÃѵÔÂÒ',1672,1672),('ÃѵÔÂÒÀóì',1673,1673),('Ãѵ³Ò',1663,1663),('ÃѵµÔÂÒ',1665,1665),('ÃѵµªÑÂ',1664,1664),('Ãѵ¹Àóì',1667,1667),('Ãѵ¹Á³Õ',1668,1668),('Ãѵ¹Ò',1669,1669),('Ãѵ¹ÒÀóì',1671,1671),('Ãѵ¹ÒŸÃ',1670,1670),('Ãѵ¹ªÑÂ',1666,1666),('ÀÑ·ÃÀÃ',1505,1505),('ÀÑ·ÃÃѧÊÕ',1506,1506),('ÀÑ·ÃÒÀóì',1508,1508),('ÀÑ·ÃÔ¹·Ãì',1509,1509),('ÀÑ·ÃÄŽÕ',1507,1507),('Àѷ÷ÔÃÒ',1501,1501),('ÀѷßÃ',1503,1503),('ÀѷßÅ',1504,1504),('Àѷß§Èì',1502,1502),('ÁÑ·¹Ò',1563,1563),('Âѹ áÍÅ à€âÂÊ',1601,1601),('ÃÒàÁÈÃì',1681,1681),('ÁÒÃÔÉÒ',1572,1572),('ÃÒÂÕ¹',1682,1682),('ÃÒહ',1678,1678),('ÀÒÃŽÕ',1521,1521),('ÀÔÃŽÕ',1531,1531),('ÁÒ⹪³ì',1570,1570),('ÁÒâ¹·',1571,1571),('ÀÒÇÔ³Õ',1524,1524),('ÀÒÇÔ¹',1525,1525),('ÀÒÇÔ¹Õ',1526,1526),('ÀÒǹÒ',1522,1522),('ÀÒǟѹž¹ì',1523,1523),('ÀÒÉÔµÒ',1527,1527),('ÂÔè§ÇÃó',1602,1602),('ÁÔÅàŹà¹ÕèÂÁ âÍ.àÍ 2000',1578,1578),('ÁÒÅÑÂ',1573,1573),('ÁÒÅÕ',1575,1575),('ÁÒÅÕÇÃó',1576,1576),('ÁÒÅÔ¹Õ',1574,1574),('ÀÒ¡Ã',1512,1512),('ÀÒ€ÀÙÁÔ',1513,1513),('ÀÔšÔµÃÒ',1528,1528),('ÁÒªÍÃì¡ÇÒ¹',1565,1565),('ÃҪѹÂì',1676,1676),('ÃÒªÒÍÙªÔâ¹',1677,1677),('ÀÔâ',1530,1530),('ÀÔŸÑ¡µÃì',1529,1529),('ÀÒ³Õ',1514,1514),('ÁÒ³Õ',1566,1566),('ÃÒ³Õ',1679,1679),('ÀÒ³Ø',1515,1515),('ÀÒ³ØÇÃó',1517,1517),('Àҳ؟Å',1516,1516),('ÃÒµÃÕ',1680,1680),('ÁÔµ·ÔÃÒ',1577,1577),('ÁÒ¹Ð',1568,1568),('ÁÒ¹ÔµÂì',1569,1569),('ÁÒ¹Ÿ',1567,1567),('ÀÒ¹ØÇѲ¹ì',1518,1518),('ÀÒ¹ØÇѵÃ',1519,1519),('ÀÒŸÃ',1520,1520),('ÁÕŸÅ',1579,1579),('ÀÙÃÔÇÃò¡ì',1535,1535),('ÀÙÁÔ°Ò¹',1533,1533),('ÀÙÃÔŸ§Èì',1534,1534),('ÂÙà¹Õè¹á¡êÊá͹ŽìàÅÁÔ€ÑÅÊì',1621,1621),('ÀÙàºÈ',1532,1532),('ÃÙàºÕÂÍØµÊÒË¡ÃÃÁ',1701,1701),('ÁÙËÐÁÐŽ×ÍàÃÐ',1582,1582),('ÀÙÉÔµ',1536,1536),('ÂÙ¹ÔÅÕàÇÍÃì ä·Â âÎÅŽÔé§Êì',1618,1618),('ÂÙ¹ÔÅÕàÇÍÃìä·Â âÎÅŽÔé§Êì',1619,1619),('ÂÙ¹Õ€ ÍÍÃì€ÔŽ',1620,1620),('âÅËСԚʵÕÅ',1744,1744),('àÅÍÊÃÀì',1739,1739),('àÅÍÈÑ¡ŽÔì',1738,1738),('àÅÍÊØ¢',1740,1740),('àÅͪÑÂ',1737,1737),('àÅÔÈÈÑ¡ŽÔì',1742,1742),('àÅÔÈÊÒÁÒö âžÒ',1743,1743),('àÅÔȪÑÂ',1741,1741),('ÁÅÄŽÕ',1556,1556),('â¡àÁÈ',206,206),('â¡àÇȹì',211,211),('à¡ÃÕ§§ÍÔ¹àµÍÃì๪Ñè¹á¹Å',179,179),('à¡ÃÕ§ÈÑ¡ŽÔì',180,180),('à¡ÃÕ§ä¡Ã',177,177),('à¡ÃÕ§ªÑÂ',178,178),('à¡ÃÔ¡',174,174),('à¡ÃÔ¡ä¡Ã',175,175),('à¡ÃÔ¡Ÿ§Éì',176,176),('Á¡Ãҹѹ·ì',1537,1537),('â¡Áşѹžì',205,205),('â¡ÇÔ·',208,208),('â¡ÇÔ·Âì',209,209),('â¡ÇÔ¹',210,210),('à¡çšŸÔÃØ³',170,170),('à¡ÉÁ',190,190),('à¡ÊÃ',196,195),('à¡ÉÁÊѹµì',191,191),('à¡ÊÃì',195,196),('à¡ÈÃÒ',182,182),('à¡ÉÃÒ',192,192),('à¡ÉÃÕ',193,193),('à¡ÈÃÔ¹·Ãì',183,183),('á¡éÇ',203,203),('á¡éÇãš',204,204),('à¡ÈÇÅÕ',184,184),('à¡ÈÈÔÃÔ',185,185),('à¡ÈÊØŽÒ',186,186),('à¡ÉÕÂÃ',194,194),('à¡ÈÔ¹Õ',187,187),('â¡ÊÔ¹·Ãì',213,213),('â¡ÈÅ',212,212),('à¡È¡ØÅÀÒ',181,181),('à¡É³Õ',188,188),('à¡ÉŽÒ',189,189),('à¡ÕÂõÔ',197,197),('à¡ÕÂõÔÊÇÑÊŽÔì',201,201),('à¡ÕÂõÔÈÑ¡ŽÔì',200,200),('à¡ÕÂõԻÀÒ',198,198),('à¡ÕÂõԟ§Éì',199,199),('â¡ÅºÍÅ €Í¹à¹ç€ªÑè¹Êì',207,207),('ࡪÒ',171,171),('ࡳԡÒ',172,172),('ࡵØÁ³Õ',173,173),('à¡×éÍ¡ÙÅ',202,202),('á¢ä¢',235,235),('à€ ÊËÒÂÍÔÁà»ê¡«ì',262,262),('à€.«Õ.ŸÕ. áÁªªÕ¹à¹ÍÃÕè',263,263),('â€Ãà¹Ê (ä·ÂᏎì)',270,270),('à€Ã×ÍÇÑÅÂì',267,267),('á€ÐšéÍÂ',269,269),('à€·Õ·ÕÅÔÊ«Ôè§',264,264),('à€¹ áÁç¡«ì (»ÃÐà·Èä·Â)',266,266),('à€¹ áÁ¡«ì (»ÃÐà·Èä·Â)',265,265),('္¹Ù ÍÔ¹àµÍÃìà·ÃŽ',268,268),('âŠÉÔµ',271,271),('Â§ÂØ·ž',1597,1597),('à§Ô¹·Ø¹à¡ÕÂõԹҀԹ',274,274),('Á§¡Ø®Ãѵ¹ì',1538,1538),('Á§€Å',1539,1539),('Á§€Å¡Òûѡ',1540,1540),('àšÃÕ§',409,409),('àšÃÔ',407,407),('àšÃÔªÑÂËÁéÍá»Å§ä¿¿éÒ',408,408),('ášèÁ',414,414),('ãšÊÇÇÀì',415,415),('àšéÒŸÃÐÂÒÁÒÃì€',411,411),('àšÉ®Ò',410,410),('àšÕÂÁšÔµ',413,413),('àšÔÁªÑÂ',412,412),('àšµ¹ì',401,401),('àš¹',402,402),('àš¹à¹ÍÃÑÅ乫ì (»ÃÐà·Èä·Â)',405,405),('àš¹ÇÔ·Âì',406,406),('Ú¹Ò',1631,1631),('àš¹šÔÃÒ',403,403),('àš¹µì³Ã§€ì',404,404),('â©ÁÊØŽÒ',436,436),('â©ÁÅŽÒ',435,435),('à©Ô¹',434,434),('à©ÅÔÁ',428,428),('à©ÅÕÂÇ',433,433),('à©ÅÔÁ¢ÇÑ',429,429),('à©ÅÔÁªÑÂ',430,430),('à©ÅÔÁªÒµÔ',431,431),('à©ÅÔÁŸÑ¹žØì',432,432),('àªÉ°Ò',555,555),('àªÍÃÔè§-ŸÅÒÇ á͹ÔÁÑÅ àÎéŪ',556,556),('àªÍÃÔè§-ŸÅÒÇá͹ÔÁÑÅàÎçÅž',557,557),('àªÕ§àΧ¡ÒêèÒ§',563,563),('àªÒÇÅÔµ',559,559),('àªÒǹÒ',558,558),('àªÕèÂÇªÒ ÍÔ¹ŽÑÊ·ÃÕè (1989)',564,564),('àªÕèÂǪÒÍÔ¹ŽÑÊ·ÃÕ (1989)',565,565),('àªÕèÂǪÒÍÔ¹ŽÑÊ·ÃÕè (1989)',566,566),('àªÕèÂǪÒÍÔ¹ŽÑÊ·ÃÕè(1989)',567,567),('àªÔŽÈÑ¡ŽÔì',562,562),('àªÔŽšÔµµì',560,560),('àªÔŽªÑÂ',561,561),('⪀',568,568),('⪀ªÑÂ',569,569),('ય°¡Ã',554,554),('⪵Ô',570,570),('⪵ÔÃÊ',571,571),('⪵ÔÇØž',572,572),('à«ÕÂÁà¡ÕÂÇ',589,589),('à«ÒÐ',588,588),('óç€ì',1632,1632),('Á³à±ÕÂÃ',1546,1546),('Á³ÕÃѵ¹ì',1547,1547),('Á³°ÔŽÒ',1541,1541),('Á³±Ò',1545,1545),('Á³±ÅÕ',1544,1544),('Á³±¹ì¡Òš¹ì',1542,1542),('Á³±¹Ôš',1543,1543),('âŽÁ',708,708),('àŽÍЀÇÍÅÔµäÇÃì',705,705),('ÃŽÒ',1633,1633),('àŽª',703,703),('àŽªÒ',704,704),('àŽ×͹àŸç',707,707),('àŽ×͹¹ÀÒ',706,706),('àµçÁàŽª',720,720),('ãµé à«é§ «Ñ¹',723,723),('àµ×͹ãš',721,721),('àµ×͹µÒ',722,722),('à¶ÅÔ§ÈÑ¡ŽÔì',734,734),('à·ÇÒ',802,802),('à·ÇÕ',803,803),('à·ÔŽä·',804,804),('à·Ÿ',799,799),('à·ŸÄ·žÔì',801,801),('à·ŸŸÔºÙÅ',800,800),('Á¹ÑÊ',1550,1550),('Á¹ÑÊÇÕ',1551,1551),('à¹ÒÇÃѵ¹ì',1043,1043),('ùԮ°Ò',1634,1634),('Á¹Ù',1552,1552),('Á¹µÃÕ',1549,1549),('๵ÎÒÇ',1042,1042),('Á¹µìªÑÂ',1548,1548),('àºçÇÃó',1117,1117),('àºç·à·ÍÃì äÅ¿ì',1118,1118),('ບÁÒ',1114,1114),('ບÇÃó',1116,1116),('ບÅÑ¡É³ì ŸÃÔé¹µÔé§',1115,1115),('ບŸÃ',1113,1113),('à»ÃÁ',1265,1265),('à»ÃÁÈÃÕ',1268,1268),('à»ÃÁÊÔ·žÔì',1269,1269),('à»ÃÁÄŽÕ',1267,1267),('à»ÃÁ»ÃÐÀÒ',1266,1266),('à»à»ÍÃìÅÔ¿',1264,1264),('à»ÕèÂÁÊØ¢',1270,1270),('á»Å¹âÁ·Ô¿',1271,1271),('àŒÔ§',1291,1291),('àŒŽçš',1290,1290),('áŸÃÇ',1475,1475),('áŸÃÇÒ',1476,1476),('àŸÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ŸÕ·ÕÍÕ ÅÔÁÔàµçŽ',1468,1468),('àŸç§ ¿Ù ËÅÔ¹',1456,1456),('àŸçªÃì',1457,1457),('àŸçÈÃÕ',1467,1467),('àŸçšÑ¹·Ãì',1461,1461),('àŸç·ÔŸÂì',1462,1462),('àŸç¹ÀÒ',1463,1463),('àŸç»ÃÐÀÒ',1464,1464),('àŸçŒ¡Ò',1465,1465),('àŸçŸÔäÅ',1466,1466),('ßÕÀÑ·Ã',1637,1637),('àŸÕ§ŸÃ',1471,1471),('ß՟Ã',1635,1635),('ß՟Ѳ¹ì',1636,1636),('àŸÅԹĎÕ',1470,1470),('àŸÅÔ¹šÔµµì',1469,1469),('àŸªÃÃѵ¹ì',1458,1458),('àŸªÃÔ¹·Ãì',1460,1460),('àŸªÃÅŽÒ',1459,1459),('៎ŽÔé§ (ä·ÂᏎì)',1472,1472),('៎ŽÔé§(ä·ÂᏎì)',1473,1473),('៹ŽéÒ à»à»ÍÃì €ÒÃìµÑ¹Ê',1474,1474),('á¿ÃìàÇÂì ÍÔ¹àµÍÃì๪Ñè¹á¹Å',1495,1495),('á¿Ã§€ì',1494,1494),('Ã×è¹ÇÃÒËì',1683,1683),('ÂØÀÒÀóì',1615,1615),('ÂØÀÒŸÃ',1614,1614),('ÂØÇÃÕ',1617,1617),('ÂØÇŽÕ',1616,1616),('ÃØËйÒ',1700,1700),('ÃØé§',1684,1684),('ÃØè§âÚ¹ì',1693,1693),('ÃØè§âڹ좹Êè§',1694,1694),('ÃØè§àÃ×ͧ',1692,1692),('ÃØè§ÃÑÈÁÕ',1691,1691),('ÃØè§ÃѪ¹Õ',1689,1689),('ÃØè§Ãѵ¹ì',1690,1690),('ÃØè§àŸªÃ',1688,1688),('ÃØè§ÇÔ·Âì',1696,1696),('ÃØè§ÍÃØ³',1697,1697),('ÃØé§ÅÒÇÃó',1695,1695),('ÃØè§·ÔÇÒ',1686,1686),('ÃØè§·ÔŸÂì',1685,1685),('ÃØè§¹ÀÒ',1687,1687),('ÁØ¢',1580,1580),('ÂØ€ÅŸÃ',1603,1603),('ÃØšÒ',1698,1698),('ÃØšÒÀÒ',1699,1699),('ÂØŽÒ',1604,1604),('ÁØ·ÔµÒ',1581,1581),('ÂØ·žÂ§',1607,1607),('ÂØ·ž¹Ò',1605,1605),('ÂØ·ž¹ÒÇÕ',1606,1606),('ÂØžÒÁÒµÂì',1608,1608),('ÂØ¹â¡Ð',1609,1609),('ÂØŸÒ',1610,1610),('ÂØŸÒÇŽÕ',1612,1612),('ÂØŸÔ¹',1613,1613),('ÂØŸÒŸÃ',1611,1611),('ÇÃÃѪ',1792,1792),('ÇÃÁÅ',1768,1768),('ÇÃóÀóì',1785,1785),('ÇÃóÀÒ',1786,1786),('ÇÃóÀŸ',1784,1784),('ÇÃóàŸç',1783,1783),('ÇÃóǎÕ',1787,1787),('ÇÃóÈÔÃÔ',1788,1788),('ÇÃóìŽÕ',1773,1774),('ÇÃóÒ',1789,1789),('ÇÃóÕ',1790,1790),('ÇÃóšÔµ',1770,1770),('ÇÃóªÑÂ',1771,1771),('ÇÃó±¹Ò',1772,1772),('ÇÃóŽÕ',1774,1773),('ÇÃó·¹Ò',1775,1775),('ÇÃó·¹Õ',1776,1776),('ÇÃóžÁÅ',1778,1778),('ÇÃóž³Õ',1777,1777),('ÇÃó¹ÀÒ',1779,1779),('ÇÃó¹ÒÃÕ',1780,1780),('ÇÃóŸÃ',1781,1781),('ÇÃóŸÒ',1782,1782),('ÇÃà·Ÿ',1762,1762),('ÇÃÞ¹Ò',1791,1791),('ÇÃÂØ·žì',1769,1769),('ÇÃÇÃó',1794,1794),('ÇÃÇÃÞ¹ì',1795,1795),('ÇÃÇѲ¹ì',1796,1796),('ÇÃÇÔÀÒ',1797,1797),('ÇÃÑžÃ',1798,1798),('ÇÃÒ',1799,1799),('ÇÃÒÀóì',1803,1803),('ÇÃÒÃѵ¹ì',1804,1804),('ÇÃÔÁÒ',1810,1810),('ÇÃÕÇÃó',1812,1812),('ÇÃÒÇØ²Ô',1806,1806),('ÇÃÒÇØž',1807,1807),('ÇÃÔÈÃÒ',1811,1811),('ÇÃÒÅѡɳì',1805,1805),('ÇÃÒ§Ãѵ¹ì',1801,1801),('ÇÃÒ§€³Ò',1800,1800),('ÇÃÔ¹·Ãì',1808,1808),('ÇÃÔ¹žÃ',1809,1809),('ÇÃÒŸÃ',1802,1802),('ÇÃÅѡɳì',1793,1793),('ÇáÒÃ',1758,1758),('ÇêÑÂ',1759,1759),('ÇêҵÔ',1760,1760),('ÇÃŽÔɰì',1761,1761),('ÇÞѹÂì',1763,1763),('Çùت',1764,1764),('ÇßÅ',1767,1767),('Çß§Éì',1765,1765),('Çßš¹ì',1766,1766),('ÇÃØ³',1813,1813),('Çèͧ',1819,1819),('ÇÊѹµì',1817,1817),('ÇÈÔ³Ò',1815,1815),('ÇÈÔ¹',1816,1816),('ÇÊØ',1818,1818),('CHEE KUNG FOOK',18,18),('CHEN CHIA YI',19,19),('CHI WAI DAVIT',20,20),('ÇÑʹÑÂ',1843,1843),('ÇÑÈŸÅ',1842,1842),('ÇÑÅÅÀ',1839,1839),('ÇÑÅÅÀÒ',1840,1840),('ÇÑÅÅÒÀÒ',1841,1841),('ÇѪÃÐ',1822,1822),('ÇѪÃÑÒ',1823,1823),('ÇѪÃÕ',1825,1825),('ÇѪÃÔ¹·Ãì',1824,1824),('ÇѪáÃ',1820,1820),('ÇѪßÅ',1821,1821),('ÇѲ¹Ð',1826,1826),('ÇѲ¹Ò',1827,1827),('ÇѹÃѪŽÒ',1836,1836),('Çѹà©ÅÔÁ',1828,1828),('ÇѹàŸç',1835,1835),('ÇѹÇÔÊÒ¢ì',1837,1837),('ÇѹʶÒ',1838,1838),('ÇѹªÑÂ',1829,1829),('ÇѹªÒµÔ',1830,1830),('ÇѹŽÕ',1831,1831),('Çѹ·¹Ò',1832,1832),('Çѹ·¹Õ',1833,1833),('Çѹ·¹ÕÂì',1834,1834),('ÇÕ àÍÊ à¹à¹ÍÃÑÅ à€Á',1916,1916),('ÇÔÃÁÅ',1886,1886),('ÇÔâÚ¹ì',1889,1889),('ÇÕÃ⪵Ô',1921,1921),('ÇÕÃàŽª',1922,1922),('ÇÕÃÂØ·Âì',1925,1925),('ÇÕÃÇÃó',1926,1926),('ÇÕÃÐ',1929,1929),('ÇÕÃÐàŽª',1933,1933),('ÇÕÃÐÂØ·žì',1936,1936),('ÇÕÃÐÇÃó',1937,1937),('ÇÕÃÐÇѲ¹ì',1938,1938),('ÇÕÃÐÈÑ¡ŽÔì',1939,1939),('ÇÕÃЪÑÂ',1930,1930),('ÇÕÃЪÒÂ',1932,1932),('ÇÕÃЪҵÔ',1931,1931),('ÇÕÃПÅ',1935,1935),('ÇÕÃП§Éì',1934,1934),('ÇÕÃÈÑ¡ŽÔì',1927,1927),('ÇÕÃÊÔ·žÔì',1928,1928),('ÇÔÃѪ',1887,1887),('ÇÔÃѵ¹ì',1888,1888),('ÇÒÃÕ',1849,1849),('ÇÔÀÒ',1875,1875),('ÇÕÃÒÀóì',1940,1940),('ÇÔÀÒÃѵ¹ì',1879,1879),('ÇÔÀÒÊ',1881,1881),('ÇÔÀÒɳÕÂì',1880,1880),('ÇÔÀҡóì',1876,1876),('ÇÔÀÒ€',1877,1877),('ÇÒÃÔª',1848,1848),('ÇÔÀÒŸÃó',1878,1878),('ÇÔÀÙÉÔµ',1882,1882),('ÇÔÁÅ',1883,1883),('ÇÔÁÅÇÃó',1885,1885),('ÇÔÁÅŸÃ',1884,1884),('ÇÔàªÉ°',1863,1863),('ÇÕêÑÂ',1920,1920),('ÇÔàªÕÂÃ',1864,1864),('ÇÕßÅ',1924,1924),('ÇÕß§Èì',1923,1923),('ÇÒÃØ³Õ',1850,1850),('ÇÔÇ',1901,1901),('ÇÔÇÃÞ¹ì',1902,1902),('ÇÔÇѲ¹ì',1903,1903),('ÇÔÇѲ¹ìªÑÂ',1904,1904),('ÇÔÉÃØš¹ì',1910,1910),('ÇÔÈÃØµ',1906,1906),('ÇÔÈÔÉ®ì',1908,1908),('ÇÔÈÔɰì',1909,1909),('ÇÔÈÒÅ',1907,1907),('ÇÔÊÔ°ÈÑ¡ŽÔì',1911,1911),('ÇÔÊÔ·žÔì',1912,1912),('ÇÔÊÙµ',1915,1915),('ÇÒʹÒ',1851,1851),('ÇÔȹÕ',1905,1905),('ÇÔÊØ·žÔ',1914,1913),('ÇÔÊØ·žÔì',1913,1914),('ÇÔÅÇѳÂì',1890,1890),('ÇÔÅÒÇÃó',1891,1891),('ÇÔÅÒÇÑÅÂì',1893,1893),('ÇÔÅÒÇѳÂì',1892,1892),('ÇÔÅÒÊÔ¹Õ',1894,1894),('ÇÔÅÔµ',1895,1895),('ÇÔäÅ',1896,1896),('ÇÔäÅÃѵ¹ì',1898,1898),('ÇÔäÅÇÃó',1900,1900),('ÇÔäÅÅѡɳì',1899,1899),('ÇÔäÅŸÃ',1897,1897),('ÇÔ€Á',1853,1853),('ÇÔ€µÍÃÕè âŸÃà¡Ã·',1852,1852),('ÇÔšÔÃÒ',1856,1856),('ÇÔšÒóì',1854,1854),('ÇÔšÔµÃ',1855,1855),('ÇÔªÑÂ',1859,1859),('ÇÔªÒ',1860,1860),('ÇÔªÔµ',1861,1861),('ÇÔªªÒ',1857,1857),('ÇÔªÐÃØš',1858,1858),('ÇԪ؎Ò',1862,1862),('ÇÕ«èÒ (2000)',1917,1917),('ÇÔØŽÒ',1865,1865),('ÇÔ±ÙÅÂì',1866,1866),('ÇÒ³Õ',1844,1844),('ÇÕ³Ò',1918,1918),('ÇÔ·ÂÒ',1868,1868),('ÇÔ·ÇÑÊ',1869,1869),('ÇÒ·Ôµ',1845,1845),('ÇÒ·Ô¹',1846,1846),('ÇÒ·Ô¹ÕÂì',1847,1847),('ÇÔ·ÙÃ',1870,1870),('ÇÔ·žÇѪ',1867,1867),('ÇÔ¹ÊÃÀì',1871,1871),('ÇÔ¹ÑÂ',1872,1872),('ÇÕ¹ÑÊ',1919,1919),('ÇÔ¹Ôš',1873,1873),('ÇÔºÙÅÂì',1874,1874),('ÇÅÑŸÃ',1814,1814),('ǧàŽ×͹',1745,1745),('ǧÈìÇÒµ',1749,1749),('ǧÈìÊØÀÒ',1750,1750),('ǧÈì䟱ÙÃÂì¡Ãç» º',1746,1746),('ǧÈì䟱ÙÃÂì¡ÃÙê»',1748,1748),('ǧÈì䟱ÙÃÂì¡ÃØê»',1747,1747),('ÇšÕÃѵ¹ì',1751,1751),('ǪÔÃÒÀÒ',1752,1752),('ǹÑʹѹ·ì',1754,1754),('ǹѪŸÃ',1753,1753),('ǹÒ',1755,1755),('ǹԪ',1756,1756),('ǹԎÒ',1757,1757),('ÇØ²ÔÃѵ¹ì',1948,1948),('ÇØ²Ô¡Ã',1941,1941),('ÇØ²ÔªÑÂ',1942,1942),('ÇØ²Ô¹ÑÂ',1944,1944),('ÇØ²Ô¹Ñ¹·ì',1943,1943),('ÇØ²ÔŸÅ',1947,1947),('ÇØ²ÔŸ§Èì',1945,1945),('ÇØ²ÔŸš¹ì',1946,1946),('Ê ÍÒŽ',2054,2054),('Ê.͹ѹµìàÍ繚Ôà¹ÕÂÃÔè§ á͹€Í¹ÊµÃÑ€ªÑè¹',2055,2055),('ÊÁ',2078,2078),('ÊÁÃ',2113,2113),('ÊÃÃàÊÃÔ°',2142,2142),('ÊÁâÀª¹ì',2108,2108),('ÊÁâÁ·',2111,2111),('ÊÁÂÈ',2112,2112),('ÊÁÃÑ¡Éì',2114,2114),('ÊÁÁÒö',2109,2109),('ÊÁÁÒȹì',2110,2110),('ÊÁà¡ÕÂõÔ',2080,2080),('ÊÁãš',2088,2088),('ÊÁ⪀',2093,2093),('ÊÁàŽª',2095,2095),('ÊÁÀŸ',2107,2107),('ÈÃÇÑÅÂì',1959,1959),('ÊÁǧÉì',2119,2119),('ÊÁÈÃÕ',2120,2120),('ÊÁËÁÒÂ',2126,2126),('ÊÁËÇѧ',2127,2127),('ÊÁÈÑ¡ŽÔì',2121,2121),('ÊÁÈÔÃÔ',2122,2122),('ÊÁËÔ§',2125,2125),('ÊÁÊØ¢',2123,2123),('ÊÁÊØ¹ÕÂì',2124,2124),('ÊÁÑÂ',2128,2128),('ÈÃÑÒ',1960,1960),('ÊÃÑÒ',2143,2143),('ÈÃѳÂì',1962,1962),('ÈÃѳŸÃ',1961,1961),('ÊÂÒÁ',2133,2133),('ÊÂÒÁàÁŠÕâŸÅÕàÁÍÃì',2139,2139),('ÊÂÒÁÂÙ¹Ôâ«Å',2140,2140),('ÈÃÕÃѵ¹ì',1977,1977),('ÈÃÕÀÒ',1976,1976),('ÈÃÒÁÒÈ',1963,1963),('ÈÂÒÁÅ',1957,1957),('ÊÂÒÁäŽà€ÕÂÇ',2136,2136),('ÊÂÒÁ€Í¹àÇàÂÍÃì',2134,2134),('ÊÂÒÁªÑÂâŸÅÕàÁÍÃì',2135,2135),('ÊÂÒÁ¹ÔÊÊѹ ÍÍâµéâÁºÔÅ',2137,2137),('ÊÂÒÁŸÃà·ÃŽà«ç¹àµÍÃì',2138,2138),('ÈÃÕàŸç',1975,1975),('ÊÃÒÂØž',2146,2146),('ÈÃÕÇÑš¹Ò',1978,1978),('ÈÃÕÇѲ¹Ò',1979,1979),('ÈÃÕÇÔ¡Ò',1980,1980),('ÈÃÒÇØ²Ô',1964,1964),('ÊÃÒÇØ²Ô',2147,2147),('ÈÃÒÇØž',1965,1965),('ÊÃÒÇØž',2148,2148),('ÈÃÕÊÁÃ\nÈÃÕÊÁÃ',1984,1983),('ÈÃÕÊÁÃ',1983,1984),('ÈÃÕÈÑ¡ŽÔì',1981,1981),('ÈÃÕÊ¡ØÅ',1982,1982),('ÈÃÕÊØÇÃó€Í¹àÇàÂÍÃìàºÅ·ì á͹Žì ÃѺàºÍÃì',1985,1985),('ÈÃÕÍÓŸÅÍØµÊÒË¡ÃÃÁ',1987,1987),('ÈÃÕ͹§€ì',1986,1986),('ÊÃÒ¡Ã',2144,2144),('ÈÃ՚ѹ·Ãì',1967,1967),('ÈÃ՚ѹ·ÃÒ',1968,1968),('ÊÃÒšÔµ',2145,2145),('ÈÃշͧà¹ÁàŸÅ·',1969,1969),('ÈÃÕ·Í§ÍØµÊÒË¡ÃÃÁ«ÑŸŸÅÒÂ',1970,1970),('ÊÁÔ·žÔ',2131,2130),('ÊÁÔ·žÔì',2130,2131),('ÊÁÒ¹',2129,2129),('ËÃÔ¹',2446,2446),('ÊÃÔ¹ÃÒ',2149,2149),('ÈÃÕ¹ÇÅ',1971,1971),('ÈÃÔ¹·Ãì',1966,1966),('ÈÃÕ»ÃÐÀÒ',1973,1973),('ÈÃÕ»ÃÐäŸ',1972,1972),('ÈÃÕŸ§Éì',1974,1974),('ÈÁÅÇÃó',1956,1956),('ÊÁÅѡɳì',2118,2118),('ÊàÅ€·ì¿ÍÃìÁà¿ÍÃì¹ÔàšÍÃìáÅкصÃ',2152,2152),('ÊÁÄŽÕ',2115,2115),('ÊÁÄ·ÑÂ',2117,2117),('ÊÁÄ·žÔì',2116,2116),('ÊÁ¡ÁÅ',2079,2079),('ÊÁ€ÇÃ',2081,2081),('ÊÁ€ÔŽ',2082,2082),('ÊÁšÔµ',2083,2083),('ÊÁšÔµÃ',2086,2085),('ÊÁšÔµÃì',2085,2086),('ÊÁšÔµµì',2084,2084),('ÊÁšÔ¹µ¹Ò',2087,2087),('ÈêÑÂ',1958,1958),('ÊÁªÑÂ',2089,2089),('ÊÁªÒÂ',2092,2092),('ÊÁªÒ',2090,2090),('ÊÁªÒµÔ',2091,2091),('ÊÁŽÕ',2094,2094),('Êáµ¹ŽÒÃìŽ ªÒÃìàµÍÃì (»ÃÐà·Èä·Â)',2066,2066),('ÊÁ·Ã§',2096,2096),('ÊÁ¹Ö¡',2097,2097),('ÊÁºÑµÔ',2098,2098),('ÊÁºÙóì',2100,2100),('ÊÁºØ',2099,2099),('Êà»ç€ àŽç¹ µÑÅ áź',2076,2076),('ÊÁ»Í§',2101,2101),('Ê໫€ÍÁ',2077,2077),('ÊÁŸÃ',2104,2104),('ÊÁŸÔÈ',2106,2106),('ÊÁŸÅ',2105,2105),('ÊÁŸ§Éì',2102,2102),('ÊÁŸš¹ì',2103,2103),('ÊÂØÁŸÃ',2141,2141),('ÊÃØš',2150,2150),('ÊÁتªÅ',2132,2132),('ÊÇÑÊŽÔì',2154,2154),('ÊÇÕâÚ¹ì',2155,2155),('ÊÇÕÇÃó',2156,2156),('ËÇÒ¹',2448,2448),('ÊÇÅѡɳì',2153,2153),('Êзé͹',2161,2161),('ÈÈÁÅ',1989,1989),('ÊËà¡ÕÂõÔâÅËÐà¡ÕÂõÔ',2158,2158),('ÈÈÔ',1990,1990),('ÈÈÔÀÒ',1993,1993),('ÈÈÔÁÒ',1994,1994),('ÈÈÔÇÔÁÅ',1995,1995),('ÈÈÔÉÒ',1996,1996),('ÈÈÔžÃ',1991,1991),('ÈÈÔŸÃ',1992,1992),('ÊÊԟѹžØì',2157,2157),('Êè§àÊÃÔÁ',2062,2062),('Êè§ÈÃÕ',2061,2061),('ÊËŸÅ',2159,2159),('ËÍÁšÑ¹·Ãì',2449,2449),('ÊÍÒŽ',2160,2160),('ÊÑÁÄ·žÔì',2170,2170),('ÊÑÁŸÑ¹žì',2169,2169),('ËÑÊÂÒ',2451,2451),('ËÑʹÕ',2450,2450),('ÈÑ¡ÃÔ¹·Ãì',2003,2003),('ÈÑ¡ŽÒ',1997,1997),('ÈÑ¡ŽÔì',1998,1998),('ÈÑ¡ŽÔìàªÇ§',2000,2000),('ÈÑ¡ŽÔìÇÔºÙÅÂì',2002,2002),('ÈÑ¡ŽÔìªÑÂ',1999,1999),('ÈÑ¡ŽÔìŽÒ',2001,2001),('ÊѧÇÒÅÂì',2162,2162),('ÊÑšŸ§Éì',2163,2163),('ÊѪÑÂ',2165,2165),('ÊѪ¹Ò',2164,2164),('ÊÑÒ',2166,2166),('ÈѹʹÕÂì',2004,2004),('ÊѹµÔ',2167,2167),('ÊѹµÔªÑÂ',2168,2168),('ÊÒÂãš',2176,2176),('ÈÔâÚ¹ì',2030,2030),('ÊÒâÚ¹ì',2188,2188),('ÊÔâÚ¹ì',2228,2228),('ÊÒâê',2189,2189),('ÊÒ¹µì',2181,2181),('ÊÒÁÀŸ',2174,2174),('ÊÓÃÇÁ',2195,2195),('ÊÓÃÇÂ',2196,2196),('ÊÒÂÊÁÃ',2183,2183),('ÈÔÃÉÒ',2007,2007),('ÊÒÂÊØ³Õ',2184,2184),('ÊÒÂÊØ¹ÕÂì',2185,2185),('ÊÒÂѳ',2186,2186),('ÊÒÂѳËì',2187,2187),('ÈÔÃÔ',2009,2009),('ÈÔÃÔÃÑš¹ì',2024,2024),('ÈÔÃÔÃѵ¹ì',2025,2025),('ÊÔÃÔÃѵ¹ì',2223,2223),('ÈÔÁÒÃÕ',2006,2006),('ÈÔÃÔÁÒ',2023,2023),('ÊÔÃÔÁÒ',2222,2222),('ÈÔÃÔâ©Á',2012,2012),('ÊÔÃÔàŽª',2214,2214),('ÊÒÁÒö',2175,2175),('ÈÔÃÔàŸç',2022,2022),('ÈÔÃÔÇÃó',2027,2027),('ÊÔÃÔÇÃó',2225,2225),('ÊÔÃÔÇѲ¡ì',2226,2226),('ÈÔÃÔÇѲ¹ì',2028,2028),('ÊÔÃÔÇѲ¹Ò',2227,2227),('ÈÔÃÔÈÑ¡ŽÔì',2029,2029),('ÈÔÃÔÅѡɳì',2026,2026),('ÊÔÃÔÅѡɳì',2224,2224),('ÈÔÃÔ¡ØÅ',2010,2010),('ÈÔÃԚѹ·Ãì',2011,2011),('ÈÔÃÔªÑÂ',2013,2013),('ÊÔÃÔªÑÂ',2213,2213),('ÊÓÃÒ',2197,2197),('ÈÔÃÔ·Ñȹì',2014,2014),('ÈÔÃÔžÃ',2015,2015),('ÊÔÃÔ¹Ãѵ¹ì',2216,2216),('ÈÔÃÔ¹Òö',2017,2017),('ÈÔÃÔ¹Ò',2016,2016),('ÊÔÃÔ¹ŸÃ',2215,2215),('ÈÔÃԹت',2018,2018),('ÊÔÃÔ»ÃÐÀÒ',2217,2217),('ÈÔÃÒŸÃ',2008,2008),('ÈÔÃÔŸÃ',2020,2020),('ÊÔÃÔŸÃ',2219,2219),('ÈÔÃÔŸÃó',2021,2021),('ÊÔÃÔŸÃó',2220,2220),('ÊÔÃԟѹžì',2221,2221),('ÈÔÃÔŸ§Éì',2019,2019),('ÊÔÃÔŸ§Éì',2218,2218),('ÊÒÂÅÁ',2182,2182),('ÊÒÂä¿¿éÒä·Â-ÂÒ«Ò¡Ô',2180,2180),('ÊÒªÅ',2177,2177),('ÊÓà¹Õ§',2194,2194),('ÊÒ¹·Õ',2178,2178),('ÊÒœ¹',2179,2179),('ÈÔÇÒÀóì',2036,2036),('ÊÕÇÔ¡Ò',2231,2231),('ÊÒÇÔµÃÕ',2192,2192),('ÈÔÇÒŸÃ',2035,2035),('ÊÔÇÅÕ',2229,2229),('ÈÔÇŸÃ',2033,2033),('ÈÔÇŸÅ',2034,2034),('ÈÔÅÒ',2032,2032),('ÊÒÅÕ',2190,2190),('ÊÓÅÕ',2199,2199),('ÊÒÅÕè',2191,2191),('ÈÔÅ»ªÑÂ',2031,2031),('ÊÓÄ·žÔì',2198,2198),('ÊÒ€Ã',2171,2171),('ÊÔ§Ëì',2200,2200),('ÊÔ§ËìŸÅ',2201,2201),('ÊÔ§ËÒ',2202,2202),('ÊԵҹѹ',2203,2203),('ÊÔµÒŸÃ',2204,2204),('ÊÔ·žÒ',2205,2205),('ÊÔ·žÔàŽª',2208,2208),('ÊÔ·žÔì',2206,2206),('ÊÔ·žÔªÑÂ',2207,2207),('ÊÔ·žÔŸÃ',2209,2209),('ÊÔ·žÔŸÃó',2210,2210),('ÊÔ·žÔŸÅ',2211,2211),('ÊÒžÔµ',2172,2172),('ÊÕ¹ÇÅ',2230,2230),('Êӹѡ¹âºÒÂáÅÐጹ¡ÃاෟÁËÒ¹€Ã',2193,2193),('ÊÒ¹ÔµÂì',2173,2173),('ÈÒ¹µÔᏎì',2005,2005),('ÊÔ¹·ÇÕ',2212,2212),('ÊÅÑ¡šÔµÃ',2151,2151),('ÈÅÔÉÒ',1988,1988),('ËÄ·Â',2447,2447),('Ê¡ÒÇÃѵ¹ì',2057,2057),('Ê¡ÅÃѵ¹ì',2056,2056),('È¡ÅÇÃó',1954,1954),('˧',2441,2441),('ʧǹ',2060,2060),('ʧèÒ',2064,2064),('ʧю',2063,2063),('ʧ¡ÃÒ¹µì',2059,2059),('ʧ¡Ã³ì',2058,2058),('ÈšÕ',1955,1955),('ʎѺŸÔ³',2065,2065),('ʶÔÃÂÒ',2068,2068),('ʶҟÃ',2067,2067),('Ë·ÑÂ',2442,2442),('Ë·ÑÂÃѵ¹ì',2444,2444),('Ë·Ñ·ԟÂì',2443,2443),('ʹãš',2069,2069),('ʹͧ',2073,2073),('ʹÑè¹',2074,2074),('ʹԎÒ',2075,2075),('˹Öè§Ä·ÑÂ',2445,2445),('ʹ·ÂÒ',2070,2070),('ʹžÂÒ',2072,2072),('ʹžŸ',2071,2071),('ÈØÀÃ',2042,2042),('ÈØÀÃѵ¹ì',2043,2043),('ÈØÀÃÒÀóì',2044,2044),('ÊØÀÁÒÊ',2329,2329),('ÈØÀÁÔµÃ',2041,2041),('ÊØÃàªÉ°ì',2353,2353),('ÊØÀ⪀',2328,2328),('ÊØÃàŽª',2354,2354),('ÊØàÁž',2348,2348),('ÊØàÁžÕ¡ì',2349,2349),('ÉØÀÁ¹',2053,2053),('ÈØÀÇѲ¹ì',2046,2046),('ÈØÀÇÔ·Âì',2047,2047),('ÈØÀÈÑ¡ŽÔì',2048,2048),('ÊØÃÈÑ¡ŽÔì',2360,2360),('ÊØÃÊÔ·žÔì',2361,2361),('ÊØÀÑ€',2330,2330),('ÊØÃѪ¹Õ¡Ã',2362,2362),('ÊØÀѵÃÒ',2331,2331),('ÊØÃѵÂÒ',2367,2367),('ÊØÃѵ¹ÇŽÕ',2365,2364),('ÊØÃѵ¹ì',2363,2363),('ÊØÃѵ¹ìÇŽÕ',2364,2365),('ÊØÃѵ¹Ò',2366,2366),('ÊØÀÑ·ÃÒ',2332,2332),('ÊØÀÒ',2333,2333),('ÊØÀÒÀóì',2338,2338),('ÊØÃÕÂì',2381,2381),('ÊØÃÕÂìŸÃ',2382,2382),('ÊØÃÕÃѵ¹ì',2383,2383),('ÊØÃÔÂѹ',2375,2375),('ÊØÃÔÂѹµì',2376,2376),('ÊØÃÔÂÒ',2377,2377),('ÊØÃÕÁÒÈ',2380,2380),('ÊØÃÔ§Èì',2371,2371),('ÊØÀÒÃŽÕ',2339,2339),('ÊØÃÔ¹',2372,2372),('ÊØÃÔ¹µì',2373,2373),('ÊØÃÔŸ§Èì',2374,2374),('ÊØÀÒÇŽÕ',2340,2340),('ÈØÀÔÊÃÒ',2049,2049),('ÊØÁÒÊÕ',2345,2345),('ÊØÁÒÅÕ',2344,2344),('ÊØÃÒ§€¹Ò',2368,2368),('ÊØÃÔªÑÂ',2369,2369),('ÊØÀÔÒ',2341,2341),('ÊØÀÒ³Õ',2334,2334),('ÊØÁÔµÃ',2346,2346),('ÊØÁÔµÃÒ',2347,2347),('ÊØÃÕžÒŸÃ',2378,2378),('ÊØÃÔ¹·Ãì',2370,2370),('ÊØÀÒŸ',2335,2335),('ÊØÀÒŸÃ',2336,2336),('ÊØÃÕŸÃ',2379,2379),('ÊØÀÒŸÃó',2337,2337),('ÈØÀÅѡɳì',2045,2045),('ÈØÀ¡Ã',2037,2037),('ÈØÀ¡Ôš',2038,2038),('ÊØÀ¡Ôš',2326,2326),('ÊØÃ¡Ôš',2350,2350),('ÈØÀªÑÂ',2039,2039),('ÊØÃªÑÂ',2351,2351),('ÊØÀªÒ',2327,2327),('ÊØÃªÒµÔ',2352,2352),('ÊØÃ·Ô¹',2355,2355),('ÊØà·Ÿ',2289,2289),('ÊØÁ¹Ò',2343,2343),('ÊØà¹µÃ',2307,2307),('ÊØÁ¹µì',2342,2342),('ÈØÀŸÃ',2040,2040),('ÊØÃŸÑ¹žì',2358,2358),('ÊØÃŸÑ¹žØì',2359,2359),('ÊØÃŸÅ',2357,2357),('ÊØÃŸ§Éì',2356,2356),('ÊØÇÃó',2386,2386),('ÊØÇÃóÒ',2388,2388),('ÊØÇÃóÕ',2389,2389),('ÊØÇÃóÕÂì',2390,2390),('ÊØÇÃóªÑÂ',2387,2387),('ÊØÇÃѵ¹ì',2391,2391),('ÊØÇÀÑ·Ãì',2385,2385),('ÊØÇѲ¹ì',2392,2392),('ÊØÇѲ¹ìªÑÂ',2393,2393),('ÊØÇѲ¹Ò',2394,2394),('ÊØÇѵªÑÂ',2395,2395),('ÊØÇÔÃѪ',2402,2402),('ÊØÇÒÃÕ',2396,2396),('ÊØÇÔÁÅ',2401,2401),('ÊØÇÔªÑÂ',2397,2397),('ÊØÇÔªÒ',2398,2398),('ÊØÇÔŽÒ',2399,2399),('ÊØÇÔ·Âì',2400,2400),('ÊØËÑʪÒ',2404,2404),('ÊØÊÔÃÔ',2403,2403),('ÊØÅÑŽŽÒ',2384,2384),('ÊØ¡ÃÕ',2232,2232),('ÊØ¡ÑÒ',2233,2233),('ÊØ¡Ôš',2235,2235),('ÊØ¡ÔµÔì',2236,2236),('ÊØ¡ÕµÔì',2237,2237),('ÊØ¡Ò¹ŽÒ',2234,2234),('ÊØ¡ØÁÒ',2238,2238),('ÊØ¢',2239,2239),('ÊØ¢ÊÇÑÊŽÔì¡Å¡ÒÃ',2242,2242),('ÊØ¢Êѹµì',2243,2243),('ÊØ¢ÄŽÕ',2241,2241),('ÊØ¢ªÒÂ',2240,2240),('ÊØ¢ØÁ',2244,2244),('ÊØ€¹žì',2245,2245),('ÊØ€¹žÒ',2246,2246),('ÊØšÒÃÕ',2247,2247),('ÊØšÔµ',2248,2248),('ÊØšÔµÃÒ',2250,2250),('ÊØšÔµµÒ',2249,2249),('ÊØšÔ¹ŽÒ',2251,2251),('ÊØšÔ¹µì',2252,2252),('ÊØšÔ¹µ¹ì',2253,2253),('ÊØªÑÂ',2255,2255),('ÊØªÒÂ',2258,2258),('ÊØªÒÊÔ¹Õ',2259,2259),('ÊØªÒŽÒ',2256,2256),('ÊØªÔµ',2260,2260),('ÊØªÒµÔ',2257,2257),('ÊØªÔ¹',2261,2261),('ÊØªÅ',2254,2254),('ÊØ±ÒÁÒÈ',2262,2262),('ÊØ³Õ',2263,2263),('ÊØŽÊÇÒ·',2265,2265),('ÊØŽÊ§Ç¹',2264,2264),('ÊØŽÒ',2266,2266),('ÊØŽÒÃѵ¹ì',2270,2270),('ÊØŽÒÀÒ',2269,2269),('ÊØŽÒÃÒ',2271,2271),('ÊØŽÕàŸé¹·ìà«ç¹àµÍÃì',2272,2272),('ÊØŽÒªÅÕ',2267,2267),('ÊØŽÒŸÃ',2268,2268),('ÊØ·ÃÕ',2282,2282),('ÊØ·ÑÈ',2283,2283),('ÊØ·Ñȹì',2284,2284),('ÊØ·ÔÈÒ',2288,2288),('ÊØ·ÔµÂì',2285,2285),('ÊØ·Ô¹',2286,2286),('ÊØ·ÔŸÒ',2287,2287),('ÊØ·žÔÇѲ¹ì',2280,2280),('ÊØ·žÔÈÑ¡ŽÔì',2281,2281),('ÊØ·žÔ쟧Éì',2278,2278),('ÊØ·žÔ¡Òš',2274,2274),('ÊØ·žÔªÑÂ',2275,2275),('ÊØ·žÒ·ÔŸÂì',2273,2273),('ÊØ·žÔ¹Ñ¹·ì',2276,2276),('ÊØ·žÔ¹Õ',2277,2277),('ÊØ·žÔŸÃó',2279,2279),('ÊØžÕ',2294,2294),('ÊØžÕÃì',2295,2295),('ÊØžÕÃÒ',2296,2296),('ÊØžÔÈÑ¡ŽÔì',2293,2293),('ÊØžÔŽÒ',2292,2292),('ÊØžÒ·ÔŸÂì',2290,2290),('ÊØžÒ¹ÔžÔ',2291,2291),('ÊØ¹Ñ··Õ',2299,2299),('ÊØ¹Ñ¹·ì',2300,2300),('ÊØ¹Ñ¹·Ò',2301,2301),('ÊØ¹ÕÂì',2306,2306),('ÊØ¹ÔÈÒ',2303,2303),('ÊØ¹ÔÉÒ',2304,2304),('ÊØ¹ÔÊÒ',2305,2305),('ÊØ¹ÔµÒ',2302,2302),('ÊØ¹·Ã',2297,2297),('ÊØ¹·ÃÕ',2298,2298),('ÊØ»ÃÐÇÕ³ì',2309,2309),('ÊØ»ÃÐŽÔɰì',2308,2308),('ÊØ»ÃÕÃÐŽÒ',2312,2312),('ÊØ»ÃÕÂÒ',2311,2311),('ÊØ»ÃÒ³Õ',2310,2310),('ÊØ»ÑÒ',2313,2313),('ÊØŸÃ',2316,2316),('ÊØŸÃÃÉÒ',2318,2318),('ÊØŸÃóÕ',2317,2317),('ÊØŸÑ²¹ì',2320,2320),('ÊØŸÑµÃÒ',2321,2321),('ÊØŸÕÃìªÑÂ',2325,2325),('ÊØŸÔÈ',2324,2324),('ÊØŸÔªìªÒ',2322,2322),('ÊØŸÔ¹',2323,2323),('ÊØŸÅ',2319,2319),('ÊØŸšÁÒÅÂì',2315,2315),('ÊØŸš¹ì',2314,2314),('GEORGE',21,21),('Í.àšÃÔÎÒÃìŽáÇÃì',2457,2457),('ÍÁÃÃѵ¹ì',2515,2515),('ÍÁÃà·Ÿ',2514,2514),('ÍÁÃÈÑ¡ŽÔì',2516,2516),('ÍÁÃÊÔÃÔ',2517,2517),('ÍÃÀÑ·Ãì',2534,2534),('ÍÁÃÒÅѡɳì',2518,2518),('ÍÃÊÂì',2535,2535),('ÍÁêÑÂ',2513,2513),('ÍÃóŸ',2536,2536),('ÍÃöÊÔ·žÔì',2540,2540),('ÍÃöŸÃ',2538,2538),('ÍÃöŸÅ',2539,2539),('ÍÃöŸ¹žì',2537,2537),('ÍÃ๵Ã',2530,2530),('ÍÃÇÃó',2542,2542),('ÍÃÇÔ· ÍÔ¹àµÍÃì๪Ñè¹á¹Å',2543,2543),('ÍÃÈÁ',2544,2544),('ÍÃÈÃÕ',2545,2545),('ÍÃÊÒ',2546,2546),('ÍÃèÒÁÈÃÕ',2551,2551),('ÍÃ͹§€ì',2547,2547),('ÍÃÍØÁÒ',2548,2548),('ÍÃÑ',2549,2549),('ÍÃÑÒ',2550,2550),('ÍÀѹµÃÕÊì',2496,2496),('ÍÀÔÃÑ¡Éì',2507,2507),('ÍÃÔÂÒ',2555,2555),('ÍÃÔÂÒÀóì',2556,2556),('ÍÀÔÀÒŽÒ',2505,2505),('ÍÀÔવ',2501,2501),('ÍÀÔÃŽÕ',2506,2506),('ÍÀÔàŽª',2503,2503),('ÍÀÔÇѲ¹ì',2508,2508),('ÍÀÔÇѹ·ì',2509,2509),('ÍÀÔÊÃ',2511,2511),('ÍÃÔÈÃÒ',2557,2557),('ÍÃÔÊÃÒ',2558,2558),('ÍÀÔÈÑ¡ŽÔì',2510,2510),('ÍÃÔÊÒ',2559,2559),('ÍÀÔÊÔ·žÔì',2512,2512),('ÍÀÔªÑÂ',2497,2497),('ÍÃÔªÑÂ',2552,2552),('ÍÀÔªÒ µÔ',2498,2498),('ÍÀÔªÒµ',2499,2499),('ÍÀÔªÒµÔ',2500,2500),('ÍÀÔÒ',2502,2502),('ÍÁÔµÒ',2519,2519),('ÍÀԹѹ·ì',2504,2504),('ÍÃÔ¹ª¹Ò',2553,2553),('ÍÁÔ¹µÒ',2520,2520),('ÍÃÔ¹·ÁÒ',2554,2554),('ÍÃÄŽÕ',2541,2541),('ÍÚÔÃÒ',2522,2522),('ÍêÃ',2523,2523),('ÍêسËì',2524,2524),('ÍóѪì',2525,2525),('Íâ³·ÂÒ',2459,2459),('Í÷ÑÂ',2526,2526),('Í÷ԪÒ',2527,2527),('ÍùԵÂì',2528,2528),('Í⹪Ò',2495,2495),('Íùت',2529,2529),('ÍßÃó',2531,2531),('ÍßԹ',2532,2532),('ÍßԹ·Ãì',2533,2533),('ÍÃØ³',2560,2560),('ÍÃØ³Ãѵ¹ì',2561,2561),('ÍÃØ³ÃØè§',2562,2562),('ÍÃØ³ÈÃÕ',2563,2563),('ÍÃØ³Õ',2564,2564),('ÍÂØžÂѹ',2521,2521),('ÍǪÑÂ',2567,2567),('ÍÐÅÒ¹',2574,2574),('ÍЀÙà·ç€·ì',2573,2573),('ÍéÍ·ԟÂì',2571,2571),('ÍéÒÂÍÔé§',2612,2612),('ÍÍâµàÁªÑè¹à«ÍÃìÇÔÊ',2570,2570),('ÍÍÊ·ì ÍÍÂÊì',2572,2572),('ÎÍÊ·ì ÍÍÂÅì',2723,2723),('ÍÍ€µéÒ àÁÁâÁàÃÕÂÅ',2568,2568),('ÍÍ€µéÒàÁÁâÁàÃÕÂÅ',2569,2569),('ÍÑÁäŸÇÃó',2594,2594),('ÍÑÁŸÃ',2592,2592),('ÍÑÁŸÃó',2593,2593),('ÍÑ€ÃàŽª',2575,2575),('ÍÑ€ÃÇÔ·Âì',2578,2578),('ÍÑ€ÃÇÔ¹·ì',2579,2579),('ÍÑ€ÃÒ',2580,2580),('Íрßњ¹ì',2577,2577),('Íрß¹žì',2576,2576),('ÍѧʹÒ',2581,2581),('ÍÑš©ÃÒ',2582,2582),('ÍѪÂÒ',2583,2583),('ÍѪÅÕ',2587,2587),('ÍѪ³ÒŸÃ',2584,2584),('ÍѪŽÒ',2585,2585),('ÍѪ¹Ò',2586,2586),('ÍѪØÅÕ',2588,2588),('ÍÑ®ÉÁÒ',2589,2589),('ÍѹÊÃÕÂì',2590,2590),('ÍÑ»ÊÃ',2591,2591),('ÍÒÃÂѹ',2616,2616),('ÍÒÃÂÒ',2617,2617),('ÍÔÁâ¡éáŸç€ €ÍÃì»ÍÃìàêÑè¹',2641,2641),('ÍÒÀóì',2606,2606),('ÍÒÃÁ³ì',2615,2615),('ÍÒÃì«Õ ¹ÔµáÇÃì',2613,2613),('ÍÒÃì«Ø»à»ÍÃì⫹ԀŸÔ€ÍÑŸÊì',2614,2614),('ÍÒÃÑ¡Éì',2618,2618),('ÍÒÀÒ',2607,2607),('ÍÒÃÕ',2621,2621),('ÍÓÀÒ',2633,2633),('ÍÒÀÒÀóì',2611,2611),('ÍÒÃÕÂì',2622,2622),('ÍÒÃÕÂì àÊÁÒ©ÔÁ (ä·Âູ¡Ñ¹',2623,2623),('ÍÒÃÕÃѵ¹ì',2624,2624),('ÍÒÃÔÂÒ',2620,2620),('ÍÒÃÕÇÃó',2625,2625),('ÍÒÀÒ¡Ã',2608,2608),('ÍÒÀÒ³Õ',2609,2609),('ÍÒÀÒŸÃ',2610,2610),('ÍÒÃÒŸÃ',2619,2619),('ÍÔÈÃÒ',2642,2642),('ÍÔê¡«èÒ ÍÔ¹àµÍÃì๪Ñè¹á¹Åàš¹à¹ÃÑÅ à«ÅÅì',2634,2634),('ÍÓäŸ',2632,2632),('ÍÒ€Á',2595,2595),('ÍÔ§Ë·ÑÂ',2635,2635),('ÍÒš³Ã§€ì',2596,2596),('ÍÒ«ÒÎÕ-ä·Â ÍÑÅÅÍÂ',2597,2597),('ÍҳѹÂì',2598,2598),('ÍÒ·Ô¡Ã',2599,2599),('ÍÕ·Õ«Õ',2643,2643),('ÍÒ·Ôµ',2600,2600),('ÍÔ·žÔŸÅ',2636,2636),('ÍÔ¹àµÍÃìàÇç·(»ÃÐà·Èä·Â)',2638,2638),('ÍÓ¹ÇÂ',2626,2626),('Íҹю',2603,2603),('ÍҹѹµÂÒ',2604,2604),('ÍÓ¹Òš',2627,2627),('ÍԹ䫷ìà€Á',2637,2637),('ÍÔ¹·ÔÃÒ',2639,2639),('ÍÒ¹¹·ì',2601,2601),('ÍÒ¹Ÿ',2602,2602),('ÍÒ¹ØÀÒŸ',2605,2605),('ÍÔŸ',2640,2640),('ÍÓŸÃ',2628,2628),('ÍÓŸÃó',2629,2629),('Íӟѹžì',2631,2631),('ÍÓŸÅ',2630,2630),('ÎÙàÇÍÃìÍØµÊÒË¡ÃÃÁ(»ÃÐà·Èä·Â)',2724,2724),('Íŧ¡Ã³ì',2566,2566),('Íŧ¡µ',2565,2565),('ͧÍÒš',2458,2458),('ÍŽÔàá',2460,2460),('ÍŽÔÈÃ',2461,2461),('ÍŽÔÈÑ¡ŽÔì',2462,2462),('ÍŽØÅ',2463,2463),('ÍŽØÅÂìàŽª',2465,2465),('ÍŽØÅŸÑ²¹ì',2464,2464),('͵Թت',2466,2466),('͵ԟÃ',2467,2467),('ͶԪÒ',2468,2468),('ÍžÔ»ŸÅ',2469,2469),('͹ÇѪ',2473,2473),('͹ÑÒ',2474,2474),('͹ѹµÈÑ¡ŽÔì',2476,2476),('͹ѹµì',2475,2475),('͹§€ìÇÃó',2471,2471),('͹§€ì¹Ò®',2470,2470),('͹¹·ì',2472,2472),('͹ØÃÑÉì',2491,2491),('͹ØÃÑ¡Éì',2489,2489),('͹ØÃѵ¹ì',2490,2490),('͹ØÇѲ¹ì',2492,2492),('͹ØÊóì',2494,2494),('͹ØÈÑ¡ŽÔì',2493,2493),('͹ءԵÔ',2477,2477),('͹ءÙÅ',2478,2478),('͹تÒ',2479,2479),('͹تԵ',2480,2480),('͹؎Ò',2481,2481),('͹صÃ',2483,2483),('͹صµÃÒ',2482,2482),('͹طԵÒ',2484,2484),('͹؟Ã',2487,2487),('͹؟ѹžì',2488,2488),('͹؟§Èì',2485,2485),('͹؟§Éì',2486,2486),('ÍØÁÒ',2665,2665),('ÍØÃÕÂì',2667,2667),('ÍØÁÒŸÃ',2666,2666),('ÍØà·¹·Ãì',2660,2660),('ÍØÉÒ',2673,2673),('ÍØÊÒËì',2674,2674),('ÍØè§á€Ð',2644,2644),('ÍØÉ³Õ',2672,2672),('ÍØè¹ãš',2661,2661),('ÍØÌÒÃ',2675,2675),('ÍØäÃ',2668,2668),('ÍØäÃÃѵ¹ì',2670,2670),('ÍØäÃÇÃó',2671,2671),('ÍØäßÃ',2669,2669),('ÍØ³ÒÇŽÕ',2645,2645),('ÍØŽÁ',2646,2646),('ÍØŽÃ',2654,2654),('ÍØŽÁàÁŽÔ€ÍÅ ÍÔ€ÇÔ»àÁé¹',2650,2650),('ÍØŽÁÇßѹžì',2652,2652),('ÍØŽÁÈÑ¡ŽÔì',2653,2653),('ÍØŽÁÅѡɳì',2651,2651),('ÍØŽÁŸÃ',2648,2648),('ÍØŽÁŸÑ¹žì',2649,2649),('ÍØŽÁŸ§Èì',2647,2647),('ÍØµâÁ·Âì',2655,2655),('ÍØµÊÒË¡ÃÃÁŒéÒà€Å×ͺŸÅÒʵԡä·Â',2656,2656),('ÍØ·ÑÂ',2657,2657),('ÍØ·ÑÂÇÃó',2658,2658),('ÍØ·ØÁŸÃ',2659,2659),('ÍØºÅ',2662,2662),('ÍØºÅÇÃó',2664,2664),('ÍØºÅŸÃó',2663,2663),('KAWAIJIT',22,22),('KAWALJIT',23,23),('KOJI',24,24),('LOUIS',25,25),('PETER',26,26),('SHERMAN',27,27),('TAN',28,28),('Willem Arnold',29,29),('WONG',30,30),('WU',31,31),('ÅÐÁèÍÁ',1718,1718),('ÅÐàÍÕÂŽ',1721,1721),('ÅÐÁÑÂ',1719,1719),('ÅÐÍͧŽÒÇ',1720,1720),('ÅÑ¡ÉÁÕ',1724,1724),('ÅѡɳÒ',1723,1723),('ÅÑ¡¢³Ò',1722,1722),('ÅѪ¹Ò',1725,1725),('ÅÑŽŽÒ',1726,1726),('ÅÑŽŽÒÇÃó',1727,1727),('ÅÑŽŽÒÇÑÅÂì',1728,1728),('ÅÑ·žÈÑ¡ŽÔì',1729,1729),('ÅÔÁ',1734,1734),('ÅÒÇѳÂì',1730,1730),('ÅÔÅÒÀóì',1735,1735),('ÅÓäÂ',1732,1732),('ÅÓäŸ',1731,1731),('ÅÔ¹ŽÒÇÃó',1733,1733),('ÅÅÔŽÒ',1716,1716),('ÅÅÔµÒ',1717,1717),('Å×ͪÑÂ',1736,1736),('äÁµÃÕ',1596,1596),('äÇ·Ô¹',1953,1953),('äÍ.àÍÊ.äÍ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å',2721,2721),('äÍ.«Õ.«Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å (ÁËÒª¹)',2718,2718),('äÍ.·Õ.áÍŽìÇÒ¹« à·€ šÓ¡ÑŽ',2719,2719),('äÍ.·Õ.á͹ŽìÇÒ¹« à·€ šÓ¡ÑŽ',2720,2720),('äÍÂàÃÈ',2722,2722),('ä¡Ãà·Ÿ',215,215),('ä¡Ã€Ó',214,214),('ä¡ÃžÇѪ',216,216),('äªÂÃѵ¹ì',575,575),('äªÂÁ§€Å',574,574),('äªÂÒ',576,576),('äªÂ¹Ñ¹·¹ì',573,573),('äŽÍСÅêÒÊ',709,709),('äµÃç€ì',726,726),('äµÃà·Ÿ',725,725),('äµÃ·È',724,724),('ä·Â',805,805),('ä·Â €Í¹Êì á͹Žì ºÔÅŽÔé§',806,806),('ä·Â ŽÕ à͹ ·Õ àŸ¹·ì',807,807),('ä·Â-àÍà«Õ ŸÕ.ÍÕ.äŸéŸì',824,808),('ä·ÂàÇÅ€Í¹ÍØµÊÒ¡ÃÃÁ',821,822),('ä·ÂÂÙà¹Õ¹€ÇÍÅÅÔµÕé',820,821),('ä·Âà¡ÃÕ§ÊÔè§·Í',808,809),('ä·Âà€ÁÕÀѳ±ì',810,811),('ä·Âà«çÅ·ÃÑÅà€ÁÕ ª¹)',813,814),('ä·Âà«ç¹·ÃÑÅ à€ÁÕ ª¹)',811,812),('ä·Âà«ç¹·ÃÑÅà€ÁÕ',812,813),('ä·ÂàŸÔèÁŸÅÒʵԡ',819,820),('ä·ÂÍÔ¹àµÍÃì ÍÐâÃàÁµÔ¡Êì',823,824),('ä·ÂÍÔ¹àµÍÃì €ÍµµÍ¹¡Ò÷Í',822,823),('ä·Â€Òà«ÎÔ¹',809,810),('ä·ÂŽÕà͹·ÕàŸ¹·ì',814,815),('ä·Âµ§¹ÔµµÔé§',815,816),('ä·ÂžÒ¹Õà€ÁÕ',817,818),('ä·Âž¹ÒŸÒ³ÔªÂì',816,817),('ä·ÂŸÃçÍ¡«ì',818,819),('Ä·žÔì',1714,1714),('Ä·žÔªÑÂ',1715,1715),('䌷',1292,1292),('äŸàÃÒÐ',1485,1485),('äŸâÚ¹ì',1486,1486),('äŸÃÊÔ·žÔì',1481,1481),('äŸÃʳ±ì',1480,1480),('äŸÃѪ',1482,1482),('äŸÃѵ¹ì',1483,1483),('äŸÃÔ¹·Ãì',1484,1484),('äŸÃÄ·žÔì',1479,1479),('äŸÇÑÅÂì',1488,1488),('äŸÈÔÃÔ',1490,1490),('äŸÈÒÅ',1489,1489),('äŸÊÔ°',1491,1491),('äŸÅÔ¹',1487,1487),('䟱ÙÃÂì',1477,1477),('䟺ÙÅÂì',1478,1478),('¡.µÃÕ·ÔŸÂì €Í¹«ÑÅáµ¹·ì',32,32),('¡ÃÃÔ¡ÒÃì',65,65),('¡ÃóԡÒ',66,66),('¡ÃóԡÒÃì',67,67),('¡ÃÇÔ·Âì',69,69),('¡ÃÇÅÑÂ',68,68),('¡ÃК¡ä·ÂÍÒ«ÒÎÕ',72,72),('¡Ãͧá¡éÇ',70,70),('¡Ãͧ·ÔŸÂì',71,71),('¡ÃÕ±Ò',73,73),('¡ÁÅ',49,49),('¡ÁÅÃѪµì',55,55),('¡ÁÅÃѵ¹ì',56,56),('¡ÁÅÁÒÅÂì',54,54),('¡ÁÅÇÃó',57,57),('¡ÁũѵÃ',50,50),('¡ÁÅ·ÔŸÂì',51,51),('¡ÁÅŸÃ',52,52),('¡ÁÅŸÃó',53,53),('¡Ã¡ÁÅ',60,60),('¡Ã¡¹¡',58,58),('¡Ã¡ŸÃ',59,59),('¡ÃªÑÂ',61,61),('¡Ã³ì',62,62),('¡Ã¹Ñ¹·ì',63,63),('¡Ã»ÃÕÂÒ',64,64),('¡ÃاෟŒÅÔµàËÅç¡',74,74),('¡Ãاä·ÂÍØ»¡Ã³ì',76,76),('¡Ãاä·Â€ÒÃìàÃé¹·ì ÍÔ¹àµÍÃì๪Ñè¹á¹Å',75,75),('¡ÃسÒ',77,77),('¡ÇÕ',93,93),('¡ÉÁÒ',94,94),('¡èÍà¡ÕÂõÔ',98,98),('¡ÊÔÇѹ',97,97),('¡ÉÔªì',95,95),('¡ÉÔŽÔÈ',96,96),('¡Íºá¡éÇ',100,100),('¡ÍºÅÒÀ',102,102),('¡Íº¡ØÅ',99,99),('¡ÍººØ',101,101),('¡Ñ ÅÂÒ',103,103),('¡ÑÁ»¹Ò¶',117,117),('¡ÑÁ»¹Ò·',118,118),('¡ÑÅÂÒ',119,119),('¡ÑÅÂÒÃѵ¹ì',121,121),('¡ÑÅÂÒ³Õ',120,120),('¡ÑªŸÃ',104,104),('¡ÑÀÑ€',105,105),('¡ÑìÇÃÒ',106,106),('¡ÑÒÁÒÈ',107,107),('¡ÑÒÇÕÃì',108,108),('¡Ñ³°Ô¡Ò',110,110),('¡Ñ³°ªÒ',109,109),('¡Ñ³·ÔÁÒ',111,111),('¡Ñ¹ÂÒÃѵ¹ì',116,116),('¡Ñ¹µì',112,112),('¡Ñ¹µÔ¡Ã',113,113),('¡Ñ¹žÔÁÒ',115,115),('¡Ñ¹žÔªÒ',114,114),('¡ÒÃÇÔÍÃ',128,128),('¡ÒÂÊÔ·žÔì',127,127),('¡Óá˧',134,134),('¡ÔÁÅÑé§',157,157),('¡ÕõÔ',158,158),('¡ÒÃØ³Õ',129,129),('¡ÒÈÔ',130,130),('¡Ôè§¡Òš¹ì',135,135),('¡ÓäÃ',133,133),('¡ÔšÇÃó',137,137),('¡ÔšµÔÂÒ',136,136),('¡Òš¹ÇÃó',122,122),('¡Òš¹Ò',123,123),('¡ÔµÔ¡Ã',153,153),('¡ÔµÔ¡Ã³ì',154,154),('¡ÔµÔ¡ÑÒ',155,155),('¡ÔµÔªÒ',156,156),('¡ÔµµÔ',138,138),('¡ÔµµÔÃѵ¹ì',150,150),('¡ÔµµÔÁÒ',148,148),('¡ÔµµÔÂÒ',149,149),('¡ÔµµÔÇѲ¹ì',151,151),('¡ÔµµÔÈÑ¡ŽÔì',152,152),('¡ÔµµÔ¡Ñ¹µì',139,139),('¡ÔµµÔªÑÂ',140,140),('¡ÔµµÔÒ',141,141),('¡ÔµµÔ¹Ñ¹·ì',142,142),('¡ÔµµÔŸÑ²¹ì',146,146),('¡ÔµµÔŸÑ¹žì',147,147),('¡ÔµµÔŸÅ',145,145),('¡ÔµµÔŸ§Èì',143,143),('¡ÔµµÔŸ§Éì',144,144),('¡ÓžÃ',131,131),('¡Ò¹ŽÒ',124,124),('¡Ò¹µì',125,125),('¡Ò¹µìÃÇÕ',126,126),('¡ÓŸÅ',132,132),('¡ÙêŽÇÔÅ ÍÔ¹ŽÑʵÃÕé',169,169),('¡ÄÉ®Ò',84,84),('¡ÄÉ®Õ',85,85),('¡Äɮ՟Ã',86,86),('¡ÄɳÐ',89,89),('¡ÄɳÒ',90,90),('¡ÄɳÕ',91,91),('¡ÄɳŸÅ',88,88),('¡ÄɳŸš¹ì',87,87),('¡ÄÉŽÒ',92,92),('¡ÄÈŸÃó',83,83),('¡ÄªÇÃó',78,78),('¡ÄµÂÒ',80,80),('¡ÄµÔÂÒ',82,82),('¡ÄµÔ¡Ò¹·ì',81,81),('¡ÄµºŸÔž',79,79),('¡ªÁÅ',35,35),('¡ª¡Ã',33,33),('¡ªŸÃ',34,34),('¡µÑÙ',36,36),('¡¹ÔɰÒ',48,48),('¡¹¡',37,37),('¡¹¡Ãѵ¹ì',43,43),('¡¹¡ÇÃó',45,45),('¡¹¡ÈÃÕ',46,46),('¡¹¡Òš¹ì',47,47),('¡¹¡Ä·žÔì',44,44),('¡¹¡¡Òš¹ì',38,38),('¡¹¡ªÑÂ',39,39),('¡¹¡¹ÔÀÒ',40,40),('¡¹¡¹Øª',41,41),('¡¹¡ŸÃ',42,42),('¡ØÁØ·ŸÑ¹žì',159,159),('¡ØéÂà«é§ ÍÔÁ»ÍÃìµ á͹Žì àÍç¡«ì»ÍÃìµ',160,160),('¡ØËÅÒº',168,168),('¡ØÊØÁÒ',167,167),('¡ØÅÂÒ',163,163),('¡ØÅÇŽÕ',165,165),('¡ØÅÈÔÃÔ',166,166),('¡ØÅÅŽÒ',164,164),('¡ØÅ¹Ñ¹·ì',161,161),('¡ØÅ¹ÒÃÕ',162,162),('¢ÇÑàÁ×èͧ',228,228),('¢ÇÑàÃ×͹',231,231),('¢ÇÑãš',223,223),('¢ÇÑàŽ×͹',225,225),('¢ÇÑàŸçªÃ',227,227),('¢ÇÑÃØé§',230,230),('¢ÇÑÂØŸÒ',229,229),('¢ÇѪÑÂ',224,224),('¢ÇѵÒ',226,226),('¢éÒÇÍÔèÁ·ÔŸÂì',233,233),('¢ÑµµÔÂÒ³Õ',232,232),('¢šÃ',217,217),('¢šÃà¡ÕÂõÔ',218,218),('¢šÃÈÃÕ',219,219),('¢šÃÈÑ¡ŽÔì',220,220),('¢¹Ôɰì',221,221),('¢¹ÔɰÒ',222,222),('¢Ø¹·Í§',234,234),('€ÁàŸçªÃ',249,249),('€ÃÒ¿·ìàŽÍÐàºÊ·ì',250,250),('€Á¡ÃÔª',247,247),('€ÁšÑ¡Ã',248,248),('€àª¹·Ãì',238,238),('€à³È',244,244),('€à¹Âì',246,246),('€ÍÊÁÔ€ €Í¹€ÍÃìŽ €ÍÃì»ÍàêÑè¹',251,251),('€ÔÁ§€ì',257,257),('€Óá˧',256,256),('€ÒÃìâ»Ãà¿ÊªÑè¹á¹Å',253,253),('€Óó',255,255),('€ÒÇÒ€Ô¹',254,254),('€Ò«ÙâÍÐ',252,252),('€ÙèºØ',260,260),('€Ù»Ò¹Ò',261,261),('€§àŽª',237,237),('€§¡ÄÈ',236,236),('€³ÒÇØ²Ô',240,240),('€³ÔÈÃ',241,241),('€³ÔÊÃ',242,242),('€³Ò¡Ã',239,239),('€³ØµÁì',243,243),('€žÒ',245,245),('€Ø³Ò¡Ã',258,258),('€Ø³Õ·Ã',259,259),('§ÒÁàŸç',273,273),('§ÒÁ¹Ôš',272,272),('šàÃ',298,298),('šÃÃÂÒ',285,285),('šàÃÈÑ¡ŽÔì',299,299),('šÃÇÃÞ¹ì',287,287),('šÃÇŸÃ',286,286),('šÃÑʪÑÂ',290,290),('šÃÑÊŸÅ',291,291),('šÃÑÅ',289,289),('šÃÑ',288,288),('šÃÔÂÒ',294,294),('šÃÔÂÒÀóì',295,295),('šÃÔ¹·Ãì',292,292),('šÃÔ¹žÃ',293,293),('šÃÙ',297,297),('šÃØžÔŽÒ',296,296),('šÍÁ¢ÇÑãš',300,300),('šÑ¡ÃÇÒÅ',304,304),('šÑ¡Ãѵ¹ì',305,305),('šÑ¡ÃÕ',307,307),('šÑ¡ÃÔ¹·Ãì',306,306),('šÑ¡Ã¡Äɳì',302,302),('šÑ¡Ã¡Äª',301,301),('šÑ¡ÃŸÑ¹žì',303,303),('šÑ¡ÉÇѯ',308,308),('šÑŽËÒ§Ò¹ÎÔÇáÁ¹àÍ繚Ôà¹ÕÂÃÔè§',309,309),('šÑµÃŽÒÇ',310,310),('šÑ¹šÔÃÒ',311,311),('šÑ¹·Ã',314,314),('šÑ¹·ÃìÃѵ¹ì',321,321),('šÑ¹·ÃìàšéÒ',315,315),('šÑ¹·ÃìàŸç',320,320),('šÑ¹·ÃìÇÔÁÅ',322,322),('šÑ¹·ÃìÇÔäÅ',323,323),('šÑ¹·ÃìÊØŽÒ',324,324),('šÑ¹·Ãì·ÔŸÂì',316,316),('šÑ¹·ÃìžÔÀÒ',317,317),('šÑ¹·Ãì¹ÀÒ',318,318),('šÑ¹·ÃìŸÃ',319,319),('šÑ¹·ÔÀÒ',326,326),('šÑ¹·ÔÁÒ',327,327),('šÑ¹·ÔÃÒ',329,329),('šÑ¹·ÔÁÒÀóì',328,328),('šÑ¹·Ô¡Ò',325,325),('šÑ¹··Õ',312,312),('šÑ¹·¹Ò',313,313),('šÔÃÀÑ·Ã',361,361),('šÔÃÀÒ',362,362),('šÓàÃÔ',344,344),('šÔÃÇÃó',363,363),('šÔÃÇѲ¹ì',364,364),('šÔÃÐÀÒ',369,369),('šÕÃÐÇѲ¹ì',386,386),('šÔÃÐÈÑ¡ŽÔì',370,370),('šÕÃйѹ·ì',385,385),('šÔÃПÃ',367,367),('šÔÃПÃó',368,368),('šÔÃÈÑ¡ŽÔì',365,365),('šÕÃÈÑ¡ŽÔì',384,384),('šÔÃÊØŽÒ',366,366),('šÕâÍà·€¹Ô€ (ä·ÂᏎì)',388,388),('šÓÃÑÊ',343,343),('šÔÃѪŽÒ',371,371),('šÔÃѰµÔì',372,372),('šÔÃÒÀóì',376,376),('šÒÃÕÃѵ¹ì',333,333),('šÔÃÒÀÒ',377,377),('šÔÃÒÂØ',378,378),('šÔÃÒÇÃó',379,379),('šÔÃÒÇÑÅÂì',380,380),('šÔÃÒÇØ²Ô',381,381),('šÔÃÒ€Á',373,373),('šÔÃҹت',374,374),('šÔÃÒŸÃ',375,375),('šÔßÃ',359,359),('šÕßÃó',383,383),('šÔßѹžì',360,360),('šÒÃØÃѵ¹ì',338,338),('šÒÃØÇÃó',339,339),('šÒÃØ³Õ',334,334),('šÒÃØ³ÕÂì',335,335),('šÒÃØ¹Ñ¹',336,336),('šÒÃØºØµÃ',337,337),('šÕÍÕ á€»»ÔµÍÅ (»ÃÐà·Èä·Â)',387,387),('šÓÅͧ',345,345),('šÔ³³ì',346,346),('šÔµÃÒ',354,354),('šÔµÃÒÀóì',355,355),('šÔµÃÅŽÒ',353,353),('šÔµµÁÒÊ',349,349),('šÔµµì',347,347),('šÔµµì¹ÔÉÒ',348,348),('šÔµµÒ',350,350),('šÔµµÔ',351,351),('šÔµµÔ¹¹Ñ¹·ì',352,352),('šÒµØÃ§€ì',331,331),('šÒµØÃ¹µì',332,332),('šÒµØŸÃ',330,330),('šÕ·Õ«Õ ·Ã§ŸÑ¹žì)',382,382),('šÓ¹§',340,340),('šÓ¹§€ì',341,341),('šÔ¹ŽÒ',356,356),('šÔ¹µìšØ±Ò',357,357),('šÔ¹µ¹Ò',358,358),('šÓ»Õ',342,342),('š§ÃÑ¡',277,277),('š§ÃÑ¡Éì',278,278),('š§Åѡɳì',279,279),('š§¡Å',275,275),('š§¡Å³Õ',276,276),('šµØÃ§€ì',283,283),('šµØÄ·žÔì',284,284),('šµØŸÃ',280,280),('šµØŸÑ¹žì',282,282),('šµØŸÅ',281,281),('šØÃÕÃѵ¹ì',395,395),('šØÌÒ',397,397),('šØÌÒÀóì',398,398),('šØÌÒÀÒ',399,399),('šØÌÒÅѡɳì',400,400),('šØÅÅŽÒ',396,396),('šØ±ÒÃѵ¹ì',393,393),('šØ±ÒÁÒÈ',391,391),('šØ±ÒÁÒÊ',392,392),('šØ±ÒÇÃó',394,394),('šØ±Ò·ÔŸÂì',389,389),('šØ±ÒŸÑ¹žì',390,390),('©ÇÕÇÃó',419,419),('©Íé͹',420,420),('©ÑµÃÀóì',422,422),('©ÑµÃÈÔÃÔ',423,423),('©ÑµÃªÑÂ',421,421),('©Ñ¹·Ãѵ¹ì',425,425),('©Ñ¹·¹Ò',424,424),('©ÅÇÂ',416,416),('©Åͧ',417,417),('©ÅÒŽ',418,418),('©×èÍ šÔé¹ ÎÑéÇ',426,426),('©×èÍšÔé¹ÎÑéÇ',427,427),('ª.ÊÂÒÁšÑ¡ÃÂÒ¹àŽç¡àÅè¹',437,437),('ªÁ',450,450),('ªÁÀÑÊÊÃ',454,454),('ªÁÀٹت',455,455),('ªÁÑŸÃ',456,456),('ªÃÑÊÃÒ',463,463),('ªÃѪÊÃÒ',461,461),('ªÃѶšÑ¹·Ãì',462,462),('ªÂÒÀóì',460,460),('ªÃÔ¹Ãѵ¹ì',465,465),('ªÃÔ¹·Ãì',464,464),('ªÂÒŸÅ',459,459),('ªÂ¹',458,458),('ªÁŸÙ¹Øª',452,452),('ªÁŸÙ¹Ø·',453,453),('ªÁŸÅ',451,451),('ªÇÔÈÒ',479,479),('ªÇÅÔµ',478,478),('ªÇ¹',475,475),('ªÇ¹ªÁ',476,476),('ªÇ¹ŸÔÈ',477,477),('ªÐÍé͹',485,485),('ªÐ¹ÔÅ',484,484),('ªèÍ',480,480),('ªèÍÍѪÑ',483,483),('ªèͩѵÃ',481,481),('ªèÍ·ÔŸÂì',482,482),('ªÑÂÂÐ',509,509),('ªÑÂÂÈ',508,508),('ªÑÂÃѵ¹ì',511,511),('ªÑÂÀÑ·Ã',505,505),('ªÑÂÁ§€Å',506,506),('ªÑ§³ì',507,507),('ªÑÂàšÃÔãªèËÅÕʵÕÅ',496,496),('ªÑÂÂØ·ž',510,510),('ªÑÂÇѲ¹ì',512,512),('ªÑÂÊÔ·žÔì',513,513),('ªÑÂÊÔ¹žØì',514,514),('ªÑªÒ',498,498),('ªÑª¹Ð',497,497),('ªÑ³ç€ì',499,499),('ªÑžÇѲ¹ì',500,500),('ªÑ¹ѹ·ì',502,502),('ªÑ¹€Ã',501,501),('ªÑŸÃ',503,503),('ªÑŸÅ',504,504),('ªÑªÀÑÊÊÃ',489,489),('ªÑªÀ³',488,488),('ªÑªÁ³±ì',490,490),('ªÑªÁ¹±ì',491,491),('ªÑªÇÒÅÂì',493,492),('ªÑªÇÒÅìÂ',492,493),('ªÑªªÑÂ',486,486),('ªÑª®Ò',487,487),('ªÑÉÒ',495,495),('ªÑÒ',494,494),('ªÒÂ',524,524),('ªÒÇѳÂì',526,526),('ªÕÇÒŸÃ',534,534),('ªÒÅÕ',525,525),('ªÒ',515,515),('ªÒÂØ·ž',518,518),('ªÒÈÑ¡ŽÔì',519,519),('ªÒªÑÂ',516,516),('ªÒ³Ã§€ì',517,517),('ªÔŽª¹¡',529,529),('ªÒµÃÕ',520,520),('ªÒµÔªÒÂ',521,521),('ªÒ¹',522,522),('ªÔ¹',530,530),('ªÔ¹Ãѵ¹ì',532,532),('ªÔ¹ÇѲ¹ì',533,533),('ªÓ¹Ô',528,528),('ªÓ¹Ò',527,527),('ªÒ¹¹·ì',523,523),('ªÔ¹ŸÑ¹žì',531,531),('ªÙà¡ÉÁ',544,544),('ªÙà¡ÕÂõÔ',545,545),('ªÙÈÑ¡ŽÔì',553,553),('ªÙšÔµ',546,546),('ªÙšÔµµì',547,547),('ªÙªÑÂ',548,548),('ªÙªÒµÔ',549,549),('ªÙªÕŸ',550,550),('ªÙŸ§Èì',551,551),('ªÙŸ§Éì',552,552),('ªÅÍ',468,468),('ªÅÍÁ',469,469),('ªÅÒ¡Ã',470,470),('ªÅÔ¡Ò',471,471),('ªÅÔŽÒ',472,472),('ªÅÔµ',473,473),('ªÅÔµÒ',474,474),('ªÅžÕ',467,467),('ªÅžÔªÒ',466,466),('ªäÁŸÃ',457,457),('ª®ÒÃѪ',438,438),('ªŽÒ¡Ã',439,439),('ª¹ÁìÊØÇÃó',442,442),('ª¹Ð',443,443),('ª¹Ð⪵Ô',444,444),('ª¹ÑÒ',445,445),('ª¹Ñ°',446,446),('ª¹Ñ¹Àóì',447,447),('ª¹ÒÀÒ',448,448),('ª¹ÔŽÒ',449,449),('ª¹¹Ñ¹·ì',440,440),('ª¹¹ÔÈÒ',441,441),('ª×蹚Եµì',535,535),('ªØÁÊÒÂ',542,542),('ªØÁÈÔÃÔ',541,541),('ªØÁŸÃ',539,539),('ªØÁŸÅ',540,540),('ªØÅÕŸÃ',543,543),('ªØŽÒŸÃ',536,536),('ªØµÔÁÒ',538,538),('ªØµÔ¡Òš¹ì',537,537),('«è͹¡ÅÔè¹',577,577),('«Õ àÍç¹ äÍ',580,580),('«Õ ŽÕ àÍçÁ àÍç¹àµÍÃìäŸÃÊì',581,581),('«Õ.ÇÕ.àÍÊ.ÍÔ¹ŽÑʵÃÕé',584,584),('«Õ.ŽÕ.ÍØµÊÒË¡ÃÃÁ',582,582),('«Õ.·Õ.à·àÅ€ÍÁ',583,583),('«ÕàÍç¹äÍàÍ繚Ôà¹ÕÂÃÔè§«ÑŸŸÅÒÂ',586,586),('«Òâµéâ€à¡ÕÂÇ ¡Ãاෟ',578,578),('«Ô¡»éÒ (»ÃÐà·Èä·Â)',579,579),('«ÕŽÕ ÍØµÊÒË¡ÃÃÁ',585,585),('«Ù',587,587),('Ò³ÀÑ€',590,590),('Õ¹ÀÒ',591,591),('¯Ç§¡ÁÅ',592,592),('°ÔµÔÃѪµì',605,605),('°ÔµÔÃѵ¹ì',606,606),('°ÔµÔÁÒ',604,604),('°ÔµÔàžÕÂÃ',600,600),('°ÔµÔ¡Ò¹µì',598,598),('°ÔµÔ³Ñ°',599,599),('°ÔµÔ¹Ñ¹·ì',601,601),('°ÔµÔŸÃ',603,603),('°ÔµÔŸ§Èì',602,602),('°Ôµ¡Ò¹µì',597,597),('°Ò¹Ñ¹·ì',593,593),('°Ò¹ÔÊÃ',595,595),('°Ò¹ÔµÂì',594,594),('°Ò»¹ÇÔ·Âì',596,596),('±ÔÁÀì¹Øª',607,607),('³ÀÑ·Ã',609,609),('³Àѷáóì',610,610),('³Ã§ÃÑ¡Éì',617,617),('³Ã§ÈÑ¡ŽÔì',619,619),('³Ã§Ä·žÔì',618,618),('³Ã§€ì',611,611),('³Ã§€ìÇÔ·Âì',615,615),('³Ã§€ìÈÑ¡ŽÔì',616,616),('³Ã§€ìÄ·žÔì',614,614),('³Ã§€ìªÑÂ',612,612),('³Ã§€ìŸÑªÃì',613,613),('³Ë·ÑÂ',620,620),('³ÑªªÒ',621,621),('³ÑÒ',622,622),('³Ñ®°ÁÑÂ',623,623),('³Ñ®°ÇÃó',624,624),('³Ñ¯ŸÅ',625,625),('³Ñ°',626,626),('³Ñ°ÁÒ',645,645),('³Ñ°ÂÒ',646,646),('³Ñ°ÀÙÁÔ',643,643),('³Ñ°Á¹',644,644),('³Ñ°ÇÃÕÂì',647,647),('³Ñ°ÇѪÃì',648,648),('³Ñ°ÇѲ¹ì',649,649),('³Ñ°ÇѵÔ',650,650),('³Ñ°ÇزÔ',651,651),('³Ñ°ÊÃÑ',653,653),('³Ñ°ÈÑ¡Âì',652,652),('³Ñ°Ë·ÑÂ',654,654),('³Ñ°Ô¡Ò',655,655),('³Ñ°¡Ã³ÔÈÒ',627,627),('³Ñ°¡Ò¹µì',629,629),('³Ñ°¡ÄµÒ',628,628),('³Ñ°¢šÃ',630,630),('³Ñ°ªÒ',632,632),('³Ñ°ª¹Ñ',631,631),('³Ñ°°Ò',633,633),('³Ñ°µÂÒ',634,634),('³Ñ°¹Ñ¹·ì',636,636),('³Ñ°¹¹·ì',635,635),('³Ñ°»¡Ã³ì',637,637),('³Ñ°ŸÃ',641,641),('³Ñ°ŸÅ',642,642),('³Ñ°Ÿ§Èì',638,638),('³Ñ°Ÿ§Éì',639,639),('³Ñ°Ÿš¹ì',640,640),('³Õç€ì',657,657),('³ÔªÒ¡Ã',656,656),('³žÔµÒ',608,608),('³Øªª¹Ò',658,658),('ŽÃÃ쪹Õ',661,661),('ŽÃسÕ',662,662),('ŽÇ§Ãѵ¹ì',674,674),('ŽÇ§ãš',667,667),('ŽÇ§àŽ×͹',669,669),('ŽÇ§Á¹·Ãì',673,673),('ŽÇ§Ë·ÑÂ',675,675),('ŽÇ§¡ÁÅ',665,665),('ŽÇ§šÑ¹·Ãì',666,666),('ŽÇ§ŽÒÇ',668,668),('ŽÇ§¹ÀÒ',670,670),('ŽÇ§ºÅ',671,671),('ŽÇ§ŸÃ',672,672),('ŽÍ¡äÁé',676,676),('ŽÕ.ºÕ.äŽÁ͹Žì (»ÃÐà·Èä·Â)',695,695),('ŽÔàá',692,692),('ŽÒÃÒÃѵ¹ì',680,680),('ŽÒÃÒÇÃó',681,681),('ŽÒÃÔ¡Ò',682,682),('ŽÒÃÔ³Õ',683,683),('ŽÒÃÔ¹',684,684),('ŽÒÃÒ¹ÕÅì',679,679),('ŽÓç',689,689),('ŽÓç€ì',690,690),('ŽÒóÕ',677,677),('ŽÒùÕÂì',678,678),('ŽÓà¹Ô¹',688,688),('ŽÒÃØ³Õ',685,685),('ŽÒÇÃÕ',687,687),('ŽÒÇ»ÃСÒÂ',686,686),('ŽÓËÃÔ',691,691),('ŽÔÈ¡ØÅ',693,693),('ŽÔʷѵ',694,694),('ŽÅÄŽÕ',663,663),('ŽÅÄ·ÑÂ',664,664),('޹ÑÂ',659,659),('Ž¹ØŸÅ',660,660),('ŽØÊÔµ',701,701),('ŽØÊÔµà€ÁÕÀѳ±ì',702,702),('ŽØÉ®Õ',698,698),('ިɳÕ',699,699),('ŽØÉŽÕ',700,700),('ŽØÅÂìŸÑ²¹ì',697,697),('ŽØÅŸÅ',696,696),('µÐÇѹ',712,712),('µÐÅèÍÁÊÔ¹ŸÅÒʵԡ',711,711),('µè͚ѡÃ',710,710),('µÑè§šÑè§ËÅÍŽä¿',713,713),('µÒà¿çŽ',714,714),('µØê',715,715),('µØéÁ',717,717),('µØëÂ',718,718),('µØê¡µÒ',716,716),('µØÅÒÅѡɳì',719,719),('¶ÇÑÅ',729,729),('¶ÇÑÅÂì',730,730),('¶ÇÔÅ',731,731),('¶ÒÇÃ',733,733),('¶Ò³ØŸ§Èì',732,732),('¶¹ÍÁÈÑ¡ŽÔì',727,727),('¶¹ÔµŸÅ',728,728),('·ÃÃȹÕÂì',745,745),('·ÃÑŸÂì¶ÒÇÀéÒÇÑÊŽØ',746,746),('·Ã§',737,737),('·Ã§ÇزÔ',741,741),('·Ã§ÈÃÕ',742,742),('·Ã§ÈÑ¡ŽÔì',743,743),('·Ã§ÈÔÃÔ',744,744),('·Ã§ªÑ»Ñè¹·Í',738,738),('·Ã§žÃÃÁ',739,739),('·Ã§ŸÅ',740,740),('·ÇÕ',748,748),('·ÇÕÇѲ¹ì',752,752),('·ÇÕÈÃÕ',753,753),('·ÇÕÈÑ¡ŽÔì',754,754),('·ÇÔª',747,747),('·ÇÕªÑÂ',749,749),('·ÇÕ»',750,750),('·ÇÕŸÃ',751,751),('·èÒ·ÃÒÂášé§ÇѲ¹Ò',773,773),('·ÈŸÃ',755,755),('·ÈŸÅ',756,756),('·Í§ãº',759,759),('·Í§ÊØ¢',763,763),('·Í§ÍÔ¹·Ãì',764,764),('·Í§¢ÒÇ',757,757),('·Í§€Ó',758,758),('·Í§»Ò¹',760,760),('·Í§ŸÑ¹žì',761,761),('·Í§ŸÑ¹žØì',762,762),('·ÑÈÇÃó',772,772),('·ÑȹÇÃó',768,768),('·ÑȹÕÂì',770,770),('·ÑȹÕÂÒ',771,771),('·Ñȹ՟Ã',769,769),('·Ñ¡ÉÁ³¹ì',765,765),('·ÑŽŽÒÇ',766,766),('·Ñº·ÔÁ',767,767),('·Õ «Õ ŸÕ ÍÔ¹ŽÑÊ·ÃÕé',791,791),('·Õ.àÍÊ.äÇÃì€Ñ· á͹Žì áÁªªÕ¹ŸÒÃì·',794,794),('·Õ.äÍ.·Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å',795,795),('·Õ.«Õ.«Õ.ŸÃçÍŸàŸÍÃìµÕé',792,792),('·Õ.«Õ.ŸÕ.ÍÔ¹ŽÑÊ·ÃÕé',793,793),('·ÕâÍàÍ âŽ¿à€Á ÍÔ¹ŽÃÑʵÕé',796,796),('·ÔÇÒ',789,789),('·ÔÈŸÅ',790,790),('·ÔŠÑÁŸÃ',774,774),('·Ô¹á€¹ ÍÔ¹ŽÑÊ·ÃÕ',775,775),('·ÔŸÂìÇÃó',778,778),('·ÔŸÂìÇÃØ³',779,779),('·ÔŸÂìÇÑÅÂì',780,780),('·ÔŸÂìÇÒÃÕ',781,781),('·ÔŸÂìÇÔÁÅ',782,782),('·ÔŸÂìÇŽÕ',777,777),('·ÔŸÂìŸÒŸÃ',776,776),('·ÔŸÇÃó',783,783),('·ÔŸÇÑÅÂì',784,784),('·ÔŸÇÔÁÅ',785,785),('·ÔŸÊØŽÒ',786,786),('·ÔŸÒÇÃó',788,788),('·ÔŸÒ¡Ã',787,787),('·ÙÃ',798,798),('·ÙÁÔ¹Ô·Êì ºÔ«Ôà¹Ê',797,797),('·¹§ÈÑ¡ŽÔì',735,735),('·¹Ø',736,736),('žÃÃÁÈÒʵÃì',861,861),('žÃÃÁ¹Ù',860,860),('žà¹È',857,857),('žà¹ÈÃì',858,858),('žÁ¹Ñ¹·ì',859,859),('žÇÑÅÃѵ¹ì',865,865),('žÇѪ',863,863),('žÇѪªÑÂ',864,864),('žÑªÇѲ¹ì',869,869),('žÑªÇŽÕ',868,868),('žÑª¡Ã',866,866),('žÑªŸÅ',867,867),('žÑÃŽÒ',877,877),('žÑª¹¡',870,870),('žÑžÃ',871,871),('žÑŸÑ²¹ì',872,872),('žÑ³ÔªÒ',873,873),('žÑ¹Ñ¹·ì',874,874),('žÑŸÃ',875,875),('žÑŸÔÊÔ·žÔì',876,876),('žÕÃÀÑ·Ãì',896,896),('žÕÃÀÒŸ',897,897),('žÕÃÇѲ¹ì',898,898),('žÕÃÐ',901,901),('žÕÃÐÇѲ¹ì',904,904),('žÕÃЪÑÂ',902,902),('žÕÃПÅ',903,903),('žÕÃÈÑ¡ŽÔì',899,899),('žÕÃÈÒ¹µÔŸÑ¹žì',900,900),('žÒÃÒ',883,883),('žÒÃÔ¹Õ',884,884),('žÓçÃѵ¹ì',886,886),('žÓç€ì',885,885),('žÕêÑÂ',890,890),('žÒ÷ԟÂì',882,882),('žÕùت',891,891),('žÕßѲ¹ì',895,895),('žÕßÅ',894,894),('žÕß§Èì',892,892),('žÕß§Éì',893,893),('žÒ¡Ã',878,878),('žÒŽÒ',879,879),('žÔŽÒÃѵ¹ì',887,887),('žÔµÔ¹Ñ¹·ì',888,888),('žÒ¹Õ',881,881),('žÔ¹Õ¡Òš¹ì',889,889),('žÒ¹Ô¹·Ãì',880,880),('žÄµ',862,862),('ž§äªÂ',826,826),('ž§ªÑÂ',825,825),('ž³Ñ°',827,827),('ž¹âÚ¹ì',834,834),('ž¹ÃѪ',832,832),('ž¹Ãѵ¹ì',833,833),('ž¹ÇѲ¹ì',836,836),('ž¹Çѹ',837,837),('ž¹ÇÔµµ',838,838),('ž¹ÇÔ·Âì',839,839),('ž¹ÇŽÕ',835,835),('ž¹ÐÃѪµì',841,841),('ž¹ÊÔ·žÔì',840,840),('ž¹ÑÊ',846,846),('ž¹ÑªžÔŽÒ',842,842),('ž¹ÑÒ',843,843),('ž¹Ñ¹µì',844,844),('ž¹Ñ¹·ì',845,845),('ž¹Ò',847,847),('ž¹ÒÀóì',850,850),('ž¹ÒÃÑ¡Éì',852,852),('ž¹ÒÀÒ',851,851),('ž¹ÒÇѪÃì',853,853),('ž¹ÔɰÒ',855,855),('ž¹Ò€ÒÃÂÙâÍºÕ Ãѵ¹ÊÔ¹ ÊÒ¢ÒËÑÇËÁÒ¡',849,849),('ž¹Ò€ÒÃ¡ÃØ§ÈÃÕÍÂØžÂÒ º',848,848),('ž¹ÔŽÒ',854,854),('ž¹Ù',856,856),('ž¹¡Ã',828,828),('ž¹¡Äµ',829,829),('ž¹ŸÃ',830,830),('ž¹ŸÅ',831,831),('¹ à¿ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ŸÕ·ÕÍÕ ÅÔÁÔàµç',906,906),('¹ ŸŽÅ',905,905),('¹àÃÈ',946,946),('¹ÃÀÑ·Ãì',939,939),('¹âõÁì',947,947),('¹ÀÇÃó',929,929),('¹ÀÑÊÊÃ',930,930),('¹ÀÑÊÊØÇÃó',931,931),('¹ÀÒ',932,932),('¹ÃÒ',940,940),('¹ÃÕ',945,945),('¹ÀÒÂØ·žì',934,934),('¹ÀÒÇÃó',935,935),('¹ÃÔÈ',943,943),('¹ÃÔɰ',944,944),('¹ÀÔ¹·Ã',936,936),('¹ÃÔ¹·Ãì',941,941),('¹ÃÔ¹·ÃìàŽª',942,942),('¹ÀÒŸÃ',933,933),('¹ÃªÑÂ',937,937),('¹ÀŽÅ',928,928),('¹ÃŸÅ',938,938),('¹ÇÃѵ¹ì',956,956),('¹ÇÅÅÐÍÍ',960,960),('¹ÇŚѹ·Ãì',957,957),('¹ÇÅ©ÇÕ',958,958),('¹ÇÅŸÃ',959,959),('¹Ç¡Ã³ì',954,954),('¹ÇŸÅ',955,955),('¹éÓÁѹ€ÒÅà·ê¡«ì',992,992),('¹éÓàŸªÃ',991,991),('¹éÓÍéÍÂ',994,994),('¹éÓ·ÔŸÂì',988,988),('¹éÓœ¹',989,989),('¹Ñ¹Ò',980,980),('¹ÑªÅÒ',961,961),('¹Ñ¯ŸÃ',962,962),('¹Ñ±ŸÃ',963,963),('¹Ñ·ª¹¡',964,964),('¹Ñ·žÁ¹',965,965),('¹Ñ¹ªÑÂ',966,966),('¹Ñ¹·Ãѵ¹ì',973,973),('¹Ñ¹·ÁÒÊ',972,972),('¹Ñ¹·ÇÃó',975,975),('¹Ñ¹·Ç§Éì',974,974),('¹Ñ¹·ÈÑ¡ŽÔì',976,976),('¹Ñ¹·Ò',977,977),('¹Ñ¹·ÔÂÒ',979,979),('¹Ñ¹·Ô¡Ò¹µì',978,978),('¹Ñ¹·ªÑÂ',967,967),('¹Ñ¹·¹ì',968,968),('¹Ñ¹·¹Ò',969,969),('¹Ñ¹·ŸÃ',970,970),('¹Ñ¹·ŸÅ',971,971),('¹ÒÁ',983,983),('¹ÔÂÁ',1016,1016),('¹ÔÃÁÅ',1017,1017),('¹ÔÃѹŽÃ',1018,1018),('¹ÒÃÕ',985,985),('¹ÔÀÒ',1015,1015),('¹ÒÃÕÃѵ¹ì',986,986),('¹ÔÃÒÇÃóì',1019,1019),('¹ÒÃÔ¹·Ãì',984,984),('¹ÔâźÅ',1024,1024),('¹Ôà«Ð',998,998),('¹ÓÃØè§ä·Â ¡ÒÃìàÁ¹·ì',993,993),('¹ÔÃØš¹ì',1020,1020),('¹ÔÃØµµì',1021,1021),('¹ÔÇૹšÙÃÕèŸÃÔé¹µÔé§á͹Žì ៀ࡚šÔé§',1025,1025),('¹ÔÇѲ¹ì',1026,1026),('¹ÔÇѵÃì',1027,1027),('¹ÔÇѵÔ',1028,1028),('¹ÔÇÒµ',1029,1029),('¹ÒÇÔ¹Õ',987,987),('¹ÔÈÃÒ',1030,1030),('¹ÔÊÒ',1033,1033),('¹ÔÈÒªÅ',1031,1031),('¹ÔÈÒŸÃ',1032,1032),('¹ÔÅÀÒ',1022,1022),('¹ÔÅØºÅ',1023,1023),('¹Ô¡Éì',995,995),('¹Ô€Á',996,996),('¹ÔªÃªÕŸ',997,997),('¹Ò¯Êǧ',981,981),('¹ÔŽ',999,999),('¹ÔŽÒ',1000,1000),('¹ÔµÂì',1001,1001),('¹ÒµÂÒ',982,982),('¹ÔµÂÒ',1002,1002),('¹ÔµÔ',1003,1003),('¹ÕµÔ',1034,1034),('¹ÔµÔÁÒ',1005,1005),('¹ÔµÔŸ§Éì',1004,1004),('¹Ô·ÃÒ',1006,1006),('¹Ô·Ñȹì',1007,1007),('¹Ô·ÑȹÕÂì',1008,1008),('¹ÔžÔÇŽÕ',1009,1009),('¹Ô»»Í¹àŸ¹µì(»ÃÐà·Èä·Â)',1010,1010),('¹ÔŸÑ·žÒ',1013,1013),('¹ÔŸÑ¹',1014,1014),('¹ÓŸÅ',990,990),('¹ÔŸÅ',1012,1012),('¹ÔŸ¹žì',1011,1011),('¹ÅŸÃó',953,953),('¹ÄÁÒ³',952,952),('¹ÄÁÅ',951,951),('¹Ä³Õ',948,948),('¹ÄŽÕ',949,949),('¹Ä·žÔì',950,950),('¹€Ã',907,907),('¹€Ã»°Á Î͹ŽéÒ€ÒÃìÊì (1994)',908,908),('¹§Åѡɳì',911,911),('¹§ª¹¡',909,909),('¹§¹Øª',910,910),('¹·',912,912),('¹·Õ',914,914),('¹·Ô¹',913,913),('¹¹·ÈÑ¡ŽÔì',915,915),('¹ŸÃѵ¹ì',924,924),('¹ŸÁÒÈ',923,923),('¹Ÿà¡éÒ',916,916),('¹ŸÇÃó',926,926),('¹ŸÒŸÃ',927,927),('¹ŸÄÔ·žÔì',925,925),('¹ŸŽÅ',917,917),('¹ŸŽÅÂì',918,918),('¹Ÿ·Ñµ',919,919),('¹ŸŸÃ',921,921),('¹ŸŸÅ',922,922),('¹ŸŸ§€ì',920,920),('¹ØÈÃÒ',1039,1039),('¹ØÊÃÒ',1041,1041),('¹ØÊºÒ',1040,1040),('¹ØªÂÒ',1037,1037),('¹ØªÃÕ',1038,1038),('¹ØªšÃÔ¹·Ãì',1035,1035),('¹Øª¹Ò¶',1036,1036),('ºÃç',1050,1050),('ºÃÃàšÔŽ',1049,1049),('ºÃÃÊÒÃ',1051,1051),('ºÃÚ§',1047,1047),('ºÃÚº',1048,1048),('ºÃÔÇÃõ',1052,1052),('ºÇêÑÂ',1053,1053),('ºÑ§ÍÃ',1054,1054),('ºÑªÒ',1055,1055),('ºÑѵÔ',1056,1056),('ºÑ³±Ôµ',1057,1057),('ºÑ³±ÔµÂì',1058,1058),('ºÑµÃ¡ÃاÈÃÕÍÂØžÂÒ',1060,1060),('ºÑµÃ¡Ãاä·Â',1059,1059),('ºÑ¹Å×ÍÈÑ¡ŽÔì',1061,1061),('ºÕ á͹Žì «Õ ŸÙÅÒÊ¡Õé',1067,1067),('ºÕ ÇÒ €ÍÃìâŸàêÑè¹ šÓ¡ÑŽ',1066,1066),('ºÕ.àÍç¹.ºÃÒàŽÍÃì',1068,1068),('ºÕ.àÍÊ.äÍ.àËÅç¡¡èÍÊÃéÒ§',1069,1069),('ºÓÃØ§ä·Â',1064,1064),('ºÔǵÕéៀ',1065,1065),('ºÒ§¡Í¡ªÕ·àÁç··ÑÅ',1062,1062),('ºÒ¹ªéÍÂ',1063,1063),('ºÙê·Êì (»ÃÐà·Èä·Â)',1111,1111),('ºÙê·ÊìáÁ¹Ùá¿€àšÍÃìÃÔè§ (»ÃÐà·Èä·Â)',1112,1112),('º§¡ª',1044,1044),('º§¡µÃѵ¹ì',1045,1045),('º«ì ÍÔ¹â¿Ãì à«ÍÃìÇÔÊ',1046,1046),('ºØÃѪÅÕ',1101,1101),('ºØÃÔ¹·Ãì',1102,1102),('ºØÈÃÒ',1103,1103),('ºØÉÂÒ',1108,1108),('ºØÉÃÒÀóì',1109,1109),('ºØÈÃÔ¹·Ãì',1105,1105),('ºØÈÃÒŸÃ',1104,1104),('ºØËÅÑè¹',1110,1110),('ºØÉ¡Ã',1106,1106),('ºØÉºÒ',1107,1107),('ºØàÂÕèÂÁ',1085,1085),('ºØÃèÇÁ',1086,1086),('ºØáʧ',1098,1098),('ºØÃÑ¡',1087,1087),('ºØÂѧ',1084,1084),('ºØÁÕ',1083,1083),('ºØàÅÔÈ',1090,1090),('ºØà¡ÕÂõÔ',1070,1070),('ºØàªÔŽ',1075,1075),('ºØÈÃÕ',1091,1091),('ºØÊè§',1093,1093),('ºØÈÔÃÔ ŽÕÇÔÅÍ»àÁ¹·ì',1092,1092),('ºØÊÔ¹',1095,1095),('ºØÊ¹Í§',1094,1094),('ºØÊ׺',1096,1096),('ºØÊØ¢',1097,1097),('ºØÅѺ',1088,1088),('ºØÅ×Í',1089,1089),('ºØ€§',1071,1071),('ºØªèÇÂ',1072,1072),('ºØªÑÂ',1073,1073),('ºØªØº',1074,1074),('ºØ«é͹',1076,1076),('ºØ·ÃÑŸÂì',1077,1077),('ºØ·ÇÕ',1078,1078),('ºØ·Í§',1079,1079),('ºØžÃÃÁ',1080,1080),('ºØ»ÃÐÊÔ·žÔì',1081,1081),('ºØŸ§Éì',1082,1082),('ºØ³±Ôµ',1099,1099),('ºØ»ŒÒ',1100,1100),('»ÃÐ⪹ì',1179,1179),('»ÃÐàÇÈ',1186,1186),('»ÃÐÁÇÅ',1171,1171),('»ÃÐàÊÃÔ°',1193,1193),('»ÃÐÁÑŸÃ',1172,1172),('»ÃÐÀÑÊ',1163,1163),('»ÃÐÀÑÊÃì',1164,1164),('»ÃÐÀÑÊÃÒŸÃ',1165,1165),('»ÃÐÀÑÊÊÃ',1166,1166),('»ÃÐÀÒÀóì',1169,1169),('»ÃÐÀÒÊ',1170,1170),('»ÃÐÂÔ¹',1175,1175),('»ÃÐÀÒŸÃ',1167,1167),('»ÃÐÀÒŸÃó',1168,1168),('»ÃÐÂÙÃ',1177,1177),('»ÃÐÂÙÃÈÃÕ',1178,1178),('»ÃÐÁÙÅ',1173,1173),('»ÃЧ€ì',1174,1174),('»ÃÐà·×ͧ',1156,1156),('»ÃÐÂØ·ž',1176,1176),('»ÃÐÇѵÃ',1180,1180),('»ÃÐÇѵÔ',1181,1181),('»ÃÐÇÕ³Ò',1185,1185),('»ÃÐÇÔµÃ',1182,1182),('»ÃÐÇÔ·',1183,1183),('»ÃÐÇÔ·Âì',1184,1184),('»ÃÐÊÒÃ',1190,1190),('»ÃÐÊÒ·',1188,1188),('»ÃÐÊÔ·žÔì',1191,1191),('»ÃÐÊÒ¹',1189,1189),('»ÃÐʧ€ì',1187,1187),('»ÃÐÊ׺',1192,1192),('»ÃÐäŸ',1162,1162),('»ÃСͺ',1138,1138),('»ÃСÒÈ',1139,1139),('»ÃСÒÈÔµ',1140,1140),('»ÃСԚ',1141,1141),('»ÃСԵ',1142,1142),('»ÃЀͧ',1143,1143),('»ÃКǺ',1145,1145),('»ÃКѡÉì',1146,1146),('»ÃКԵÃ',1147,1147),('»ÃК§šÔµ',1144,1144),('»ÃЪÒ',1148,1148),('»ÃЪԵ',1149,1149),('»ÃЪØÁŸÃ',1150,1150),('»Ãгµ',1151,1151),('»ÃÐŽÔɰì',1152,1152),('»ÃзѺãš',1153,1153),('»Ãзջ',1154,1154),('»ÃзØÁ·ÔŸÂì',1155,1155),('»ÃПѲ¹ì',1160,1160),('»ÃПѹžì',1161,1161),('»ÃПķžÔì',1159,1159),('»ÃПš¹ì',1157,1157),('»ÃП¹žì',1158,1158),('»ÀÑÊÊÃ',1132,1132),('»ÃѪÒ',1194,1194),('»ÃÒâÁ·Âì',1200,1200),('»ÃÕÂÒÀóì',1213,1213),('»ÃÔÂÒÇÃó',1208,1208),('»ÃÒö¹Ò',1201,1201),('»ÀÒÇÃÔ¹·ì',1135,1135),('»ÀÒÇÕ',1136,1136),('»ÀÒÇŽÕ',1134,1134),('»ÃÔȹÒ',1209,1209),('»ÃÔȹÕ',1210,1210),('»ÃÒ¡ÒÃ',1195,1195),('»ÃÒ§³Õ',1196,1196),('»ÃÕªÒ',1211,1211),('»ÃÒªì',1197,1197),('»ÃÕÒ',1212,1212),('»ÃÔì',1202,1202),('»ÃÔÒ',1203,1203),('»ÃÔŽÒ',1204,1204),('»ÃÒ³Õ',1198,1198),('»ÃÒ³ÕÂì',1199,1199),('»ÃÔ³ŽÒ',1205,1205),('»ÀÒ³Ø',1133,1133),('»ÃÔ·ÑÈ',1206,1206),('»ÃÔ¹ŽÒ',1207,1207),('»ÂصÒ',1137,1137),('»ÇÕ³ÃѪ',1214,1214),('»ÇÕ³Ò',1215,1215),('»Êѹµì',1216,1216),('»Êѹ¹ì',1217,1217),('»Í§ÀŸ',1218,1218),('»ÑšÃÑÈÁÔì',1219,1219),('»ÑÒ',1220,1220),('»ÑÒŸÃ',1221,1221),('»ÑÒŸÅ',1222,1222),('»Ñ³ÃÊÕ',1223,1223),('»Ñ·Á',1224,1224),('»Ñ·ÁÒ',1225,1225),('»Ñ·ÁÒÇŽÕ',1226,1226),('»ÔÂÃѵ¹ì',1246,1246),('»ÔÂÁÒÀóì',1245,1245),('»ÔÂÇÃó',1247,1247),('»ÔÂÇѲ¹ì',1248,1248),('»ÔÂÐ',1250,1250),('»ÔÂÐÁÒÈ',1259,1259),('»ÔÂÐÈÑ¡ŽÔì',1260,1260),('»ÔÂЪÑÂ',1251,1251),('»ÔÂйѹ·ì',1253,1253),('»ÔÂй¹·ì',1252,1252),('»ÔÂйت',1254,1254),('»ÔÂПÃ',1256,1256),('»ÔÂПѹžì',1257,1257),('»ÔÂПѹžØì',1258,1258),('»ÔÂП§Èì',1255,1255),('»ÔÂÈÑ¡ŽÔì',1249,1249),('»ÒÃÔªÒµ',1230,1230),('»ÒÃÔªÒµÔ',1231,1231),('»ÒÃÕ³Ò',1233,1233),('»ÔÂÒŸÃ',1261,1261),('»ÒÃԟѹžì',1232,1232),('»Ô¡Қ¹ì',1239,1239),('»Ô¹ѹ·ì',1240,1240),('»Ô¹ү',1241,1241),('»ÔŸÃ',1244,1244),('»ÔŸ§Èì',1242,1242),('»ÔŸ§Éì',1243,1243),('»Ôè¹ÁÒ⹪',1238,1238),('»Ôè¹Á³Õ',1237,1237),('»Ò˹ѹ',1234,1234),('»ÔÅѹÒ',1262,1262),('»Ò³ÔÊÃÒ',1227,1227),('»ÔµÔ',1235,1235),('»ÔµÔÇѪÃì',1236,1236),('»Ò¹',1228,1228),('»Ò¹àŸªÃ',1229,1229),('»¡Ã³ì',1119,1119),('»®ÔÁÒ',1120,1120),('»¯ÔÁÒ',1123,1123),('»¯ÔÒ',1121,1121),('»¯ÔŸÅ',1122,1122),('»°ÁÇѲ¹ì',1124,1124),('»³ÔŽÒ',1126,1126),('»³ÔµÒ',1127,1127),('»³ªÑÂ',1125,1125),('»·ØÁ',1128,1128),('»·ØÁÒ',1130,1130),('»·ØÁŸÃ',1129,1129),('»¹ÑŽŽÒ',1131,1131),('»Ø³³ÂÒ',1263,1263),('ŒàŽÔÁ',1277,1277),('ŒèͧÈÃÕ',1279,1279),('ŒèͧŸÃó',1278,1278),('Œè͹»ÃÐÀÒ',1280,1280),('ŒèÒ¡ÒÀÅѧ¡Í§¡ÅÒ§Êӹѡ»ÅÑŽ¡ÃاෟÁËÒ¹€Ã',1285,1285),('ŒéÒ¢¹Ë¹ÙªÔ¹àΧ',1281,1281),('ŒéÒ¢¹Ë¹Ù«Ô¹àΧ',1282,1282),('ŒéҢع˹٫ԹàΧ',1283,1283),('ŒèÒ¹¿éÒ àÍ繚Ôà¹ÕÂÃÔè§',1284,1284),('ŒÒÊØ¢',1286,1286),('ŒÙéãËèàÅç¡',1289,1289),('ŒÙéàŒŽçš',1288,1288),('Œ¡Ò¡Ãͧ',1272,1272),('Œ¡ÒŸÃó',1273,1273),('Œ§',1274,1274),('Œš§šÔµµì',1275,1275),('ŒŽØ§ÈÑ¡ŽÔì',1276,1276),('ŒØÊŽÕ',1287,1287),('œèÒ¡ÒÀÅѧ¡Í§¡ÅÒ§ Êӹѡ»ÅÑŽ¡ÃاෟÁËÒ¹€Ã',1293,1293),('ŸÃ',1319,1319),('ŸÃÁ§€Åà¿ÍÃì¹ÔàšÍÃì',1338,1338),('ŸÃóÃÒ³ì',1344,1344),('ŸÃóÊóì',1345,1345),('ŸÃóÕ',1347,1347),('ŸÃóԡÒ',1346,1346),('ŸÃó·ÔÀÒ',1339,1339),('ŸÃó¹ÔÀÒ',1340,1340),('ŸÃó»ÃÐäŸÇŽÕ',1341,1341),('ŸÃóŸÃÃÉ',1342,1342),('ŸÃóŸÔÁÅ',1343,1343),('ŸÃà·Ÿ',1326,1326),('ŸÃÞԎÒ',1348,1348),('ŸÃàŸç',1337,1337),('ŸÃÇÔÁÅ',1349,1349),('ŸÃÇÔäÅ',1350,1350),('ŸÃÐÃÒÁ 3 Î͹ŽéÒ€ÒÃìÊì',1360,1360),('ŸÃÐÃÒÁ 3 €ÒÃìà«ç¹àµÍÃì',1359,1359),('ŸÃлÃÐᎧ Î͹ŽéÒ€ÒÃìÊì',1357,1357),('ŸÃлÃÐᎧ Î͹ŽéÒ€ÒÃìÊì šÓ¡ÑŽ',1358,1358),('ŸÃÊÃǧ',1353,1353),('ŸÃËÁŸÑ²¹ì',1355,1355),('ŸÃÊÇÃÀì',1354,1354),('ŸÃéÍÁªÑÂ',1356,1356),('ŸÃÈÑ¡ŽÔì',1351,1351),('ŸÃÈÔÃÔ',1352,1352),('ŸÃÕàÁÕÂÃìà€ÁÔ€ÑÅ á͹ŽìŸÅÒʵԡ',1362,1362),('ŸÃÕàÁÕÂÃìÍÔ¹àµÍÃìÅÔ««Ôè§',1363,1363),('ŸÃÔéÁàŸÃÒ',1361,1361),('ŸÃ¡ÇÕ',1320,1320),('ŸÃšÔµµì',1321,1321),('ŸÃªÑÂ',1322,1322),('ŸÃ·ÔÀÒ',1325,1325),('ŸÃ·ÔŸÂì',1323,1323),('ŸÃ·ÔŸÒ',1324,1324),('ŸÃ¹ÀÒ',1328,1328),('ŸÃ¹ÔµÔ¿ÔÅìÁá͹ŽìÇÕŽÕâÍ',1329,1329),('ŸÂ¹µì',1317,1317),('ŸÃ¹·Õ',1327,1327),('ŸÃŸÃó',1332,1332),('ŸÃŸÔÁÅ',1335,1335),('ŸÃŸÔäÅ',1336,1336),('ŸÃŸÅ',1333,1333),('ŸÃŸÅÒ§ÒÁ',1334,1334),('ŸÃŸ§Éì',1330,1330),('ŸÃŸ¹Ò',1331,1331),('ŸÂا',1318,1318),('ŸÇ§Ãѵ¹ì',1372,1372),('ŸÇ§àŸç',1371,1371),('ŸÇ§·Í§',1370,1370),('ŸÈÔ¹',1373,1373),('ŸÊØà¡µÔì',1374,1374),('ŸÑÊŸÃ',1391,1391),('ŸÑÅÅÀ',1390,1390),('ŸÑªÃ',1376,1376),('ŸÑªÃÇäÅ',1377,1377),('ŸÑªÃÒ',1378,1378),('ŸÑªÃÕ',1382,1382),('ŸÑªÃÒÀóì',1379,1379),('ŸÑªÃÕÀóì',1384,1384),('ŸÑªÃÒÀÒ',1380,1380),('ŸÑªÃÔ¹·Ãì',1381,1381),('ŸÑªÃÕŸÃ',1383,1383),('ŸÑª¹Õ',1375,1375),('ŸÑ²·ÇÕ',1385,1385),('ŸÑ²¹Ð',1387,1387),('ŸÑ²¹ªÑÂ',1386,1386),('ŸÑ²Ÿ§Éì',1388,1388),('ŸÑ·žìžÕÃÒ',1389,1389),('ŸÔ ÈÁÑÂ',1397,1397),('ŸÕ.àÍÊ.šÕ ÅÔÊ«Ôè§',1439,1439),('ŸÕ.àÍÊ.ŸÅÒʵԡºÃÒàŽÍÃì á͹Žì«Ñ¹',1440,1440),('ŸÕ.àÍÊ.ŸÅÒʵԡºÃÒàŽÍÃìá͹Žì«Ñ¹',1441,1441),('ŸÕ.«Õ.àºÊ·ì €ÃÕàÍ·',1438,1438),('ŸÔÃÁÂì',1430,1430),('ŸÔÁÀÒ',1428,1428),('ŸÕÃÇØ²Ô',1446,1446),('ŸÕÃÐ',1448,1448),('ŸÕÃÐÈÑ¡ŽÔì',1451,1451),('ŸÕÃПÅ',1450,1450),('ŸÕÃП§Èì',1449,1449),('ŸÕÃÈÔÅ»ì',1447,1447),('ŸÒÃҡ͹ÍÔ¹â¿à·€',1396,1396),('ŸÔÁÅ',1429,1429),('ŸÔàªÉ°',1409,1408),('ŸÔàªÉ°ì',1408,1409),('ŸÔય',1406,1406),('ŸÔય°ì',1407,1407),('ŸÒâµà€ÁÕÍØµÊÒË¡ÃÃÁ',1394,1394),('ŸÕ÷ѵ',1444,1444),('ŸÔà·Ÿ',1415,1415),('ŸÔÀŸ',1420,1420),('ŸÔÁŸìÀóì',1425,1425),('ŸÔÁŸìÀÑ€',1426,1426),('ŸÔÁŸìãš',1421,1421),('ŸÔÁŸìÇÔÁÅ',1427,1427),('ŸÔÁŸìª¹¡',1422,1422),('ŸÔÁŸì»ÃПÃó',1423,1423),('ŸÔÁŸìŸÃ',1424,1424),('ŸÕßѲ¹ì',1445,1445),('ŸÔÃØ³',1431,1431),('ŸÔÊÁÑÂ',1434,1434),('ŸÔÈÔɰì',1432,1432),('ŸÔÊÔɰì',1437,1437),('ŸÔÊÔ°',1435,1435),('ŸÔÊÔ·žÔì',1436,1436),('ŸÔɳØ',1433,1433),('ŸÔšÔµÃÒ',1398,1398),('ŸÔªÂÒ',1401,1401),('ŸÔªÑÂ',1402,1402),('ŸÔªÑÂÇѲ¹ì',1403,1403),('ŸÔªÔµ',1404,1404),('ŸÔªÔµŸÅ',1405,1405),('ŸÔªì',1399,1399),('ŸÔªŽÒ',1400,1400),('ŸÔ±ÙÃÂì',1410,1410),('ŸÒ³Õ',1393,1393),('ŸÒ³ÔªÂì',1392,1392),('ŸÔ³ªØŽÒ',1411,1411),('ŸÔ³¹ÀÒ',1412,1412),('ŸÔ·ÂÒ',1413,1413),('ŸÔ·Ñ¡Éì',1414,1414),('ŸÔžÒ¹¡Ã',1416,1416),('ŸÕ¹Ô¡«ì àÍç¡«ìàŸÃÊ',1442,1442),('ŸÕ¹Ô¡«ìàÍç¡«ìàŸÃÊ',1443,1443),('ŸÒ¹·Í§',1395,1395),('ŸÔ¹¹ÔÀÒ',1417,1417),('ŸÔºÙÅÂì',1418,1418),('ŸÔŸÑ²¹ì',1419,1419),('ŸÙŷͧŸÃçÍŸàŸÍÃìµÕé_',1454,1454),('ŸÙÅŒÅ',1455,1455),('ŸÙ¹ÈÑ¡ŽÔì',1453,1453),('ŸÙ¹ŸÑ¹žì',1452,1452),('ŸÅà·Ÿ',1366,1366),('ŸÅÊÔ·žÔì',1369,1369),('ŸÅ¡Äɳì',1364,1364),('ŸÅªÑÂ',1365,1365),('ŸÅŸÑªÃì',1367,1367),('ŸÅŸÑ²¹ì',1368,1368),('Ÿ§ÈìÀÑ€',1300,1300),('Ÿ§Èìà¡ÕÂõÔ',1294,1294),('Ÿ§Èìà·Ÿ',1296,1296),('Ÿ§Éìà·Ÿ',1302,1302),('Ÿ§ÉìÈÑ¡ŽÔì',1304,1304),('Ÿ§ÉìÊѹµì',1305,1305),('Ÿ§ÈìÊØà¡ÉÁ',1301,1301),('Ÿ§Éì͹ѹµì',1306,1306),('Ÿ§ÈìªÒÂ',1295,1295),('Ÿ§ÉìŸÃ',1303,1303),('Ÿ§ÈìŸÑ¹žì',1298,1298),('Ÿ§ÈìŸÔŸÑ²¹ì',1299,1299),('Ÿ§ÈžÃ',1297,1297),('ŸšÁÒÅÂì',1312,1312),('ŸšÁÒ¹',1311,1311),('Ÿš¹ì',1307,1307),('Ÿš¹Ò',1308,1308),('Ÿš¹ÕÂì',1310,1310),('Ÿš¹Òö',1309,1309),('Ÿ¹Á',1313,1313),('Ÿ¹ÁªÑÂ',1314,1314),('Ÿ¹ÒÊѹ±ì',1315,1315),('Ÿ¹ÔŽÒ',1316,1316),('¿Õ¹Ô¡«ì àÍç¡«ìàŸÃÊ',1493,1493),('¿ÅØÊÊÔ¡à€Á',1492,1492); +SELECT name FROM t1 ORDER BY name; +name ++45 BRETT ++55 BRETT ++56 BRETT +-.55 BRETT +-45 BRETT +-55 BRETT +.-55 BRETT +.55 BRETT +45 BRETT +5 5 BRETT3 +5 5 BRETT2 +5 5 BRETT1 +5-5 BRETT +55 BRETT +55+ BRETT +55- BRETT +55. BRETT +CHEE KUNG FOOK +CHEN CHIA YI +CHI WAI DAVIT +GEORGE +KAWAIJIT +KAWALJIT +KOJI +LOUIS +PETER +SHERMAN +TAN +Willem Arnold +WONG +WU +¡.µÃÕ·ÔŸÂì €Í¹«ÑÅáµ¹·ì +¡ª¡Ã +¡ªŸÃ +¡ªÁÅ +¡µÑÙ +¡¹¡ +¡¹¡¡Òš¹ì +¡¹¡ªÑ +¡¹¡¹ÔÀÒ +¡¹¡¹Øª +¡¹¡ŸÃ +¡¹¡Ãѵ¹ì +¡¹¡Ä·žÔì +¡¹¡ÇÃó +¡¹¡ÈÃÕ +¡¹¡Òš¹ì +¡¹ÔÉ°Ò +¡ÁÅ +¡Áũѵà +¡ÁÅ·ÔŸÂì +¡ÁÅŸÃ +¡ÁÅŸÃó +¡ÁÅÁÒÅÂì +¡ÁÅÃѪµì +¡ÁÅÃѵ¹ì +¡ÁÅÇÃó +¡Ã¡¹¡ +¡Ã¡ŸÃ +¡Ã¡ÁÅ +¡ÃªÑ +¡Ã³ì +¡Ã¹Ñ¹·ì +¡Ã»ÃÕÂÒ +¡ÃÃÔ¡ÒÃì +¡ÃÃ³Ô¡Ò +¡ÃóԡÒÃì +¡ÃÇÅÑ +¡ÃÇÔ·Âì +¡Ãͧá¡éÇ +¡Ãͧ·ÔŸÂì +¡ÃК¡ä·ÂÍÒ«ÒÎÕ +¡ÃÕ±Ò +¡ÃاෟŒÅÔµàËÅç¡ +¡Ãاä·Â€ÒÃìàÃé¹·ì ÍÔ¹àµÍÃì๪Ñè¹á¹Å +¡Ãاä·ÂÍØ»¡Ã³ì +¡ÃØ³Ò +¡ÄªÇÃó +¡ÄµºŸÔž +¡ÄµÂÒ +¡ÄµÔ¡Ò¹·ì +¡ÄµÔÂÒ +¡ÄÈŸÃó +¡ÄÉ®Ò +¡ÄÉ®Õ +¡Äɮ՟à +¡ÄɳŸš¹ì +¡ÄɳŸÅ +¡ÄɳР+¡ÄÉ³Ò +¡ÄÉ³Õ +¡ÄÉŽÒ +¡ÇÕ +¡ÉÁÒ +¡ÉÔªì +¡ÉÔŽÔÈ +¡ÊÔÇѹ +¡èÍà¡ÕÂÃµÔ +¡Íº¡ØÅ +¡Íºá¡éÇ +¡ÍººØ +¡ÍºÅÒÀ +¡Ñ ÅÂÒ +¡ÑªŸÃ +¡ÑÀÑ€ +¡ÑìÇÃÒ +¡ÑÒÁÒÈ +¡ÑÒÇÕÃì +¡Ñ³°ªÒ +¡Ñ³°Ô¡Ò +¡Ñ³·ÔÁÒ +¡Ñ¹µì +¡Ñ¹µÔ¡Ã +¡Ñ¹žÔªÒ +¡Ñ¹žÔÁÒ +¡Ñ¹ÂÒÃѵ¹ì +¡ÑÁ»¹Ò¶ +¡ÑÁ»¹Ò· +¡ÑÅÂÒ +¡ÑÅÂÒ³Õ +¡ÑÅÂÒÃѵ¹ì +¡Òš¹ÇÃó +¡Òš¹Ò +¡Ò¹ŽÒ +¡Ò¹µì +¡Ò¹µìÃÇÕ +¡ÒÂÊÔ·žÔì +¡ÒÃÇÔÍà +¡ÒÃØ³Õ +¡ÒÈÔ +¡ÓžÃ +¡ÓŸÅ +¡Óäà +¡Óá˧ +¡Ôè§¡Òš¹ì +¡ÔšµÔÂÒ +¡ÔšÇÃó +¡ÔµµÔ +¡ÔµµÔ¡Ñ¹µì +¡ÔµµÔªÑ +¡ÔµµÔÒ +¡ÔµµÔ¹Ñ¹·ì +¡ÔµµÔŸ§Èì +¡ÔµµÔŸ§Éì +¡ÔµµÔŸÅ +¡ÔµµÔŸÑ²¹ì +¡ÔµµÔŸÑ¹žì +¡ÔµµÔÁÒ +¡ÔµµÔÂÒ +¡ÔµµÔÃѵ¹ì +¡ÔµµÔÇѲ¹ì +¡ÔµµÔÈÑ¡ŽÔì +¡ÔµÔ¡Ã +¡ÔµÔ¡Ã³ì +¡ÔµÔ¡ÑÒ +¡ÔµÔªÒ +¡ÔÁÅÑé§ +¡ÕÃµÔ +¡ØÁØ·ŸÑ¹žì +¡ØéÂà«é§ ÍÔÁ»ÍÃìµ á͹Žì àÍç¡«ì»ÍÃìµ +¡ØÅ¹Ñ¹·ì +¡ØÅ¹ÒÃÕ +¡ØÅÂÒ +¡ØÅÅŽÒ +¡ØÅÇŽÕ +¡ØÅÈÔÃÔ +¡ØÊØÁÒ +¡ØËÅÒº +¡ÙêŽÇÔÅ ÍÔ¹ŽÑʵÃÕé +à¡çšŸÔÃØ³ +à¡ªÒ +à¡³Ô¡Ò +ࡵØÁ³Õ +à¡ÃÔ¡ +à¡ÃÔ¡ä¡Ã +à¡ÃÔ¡Ÿ§Éì +à¡ÃÕ§ä¡Ã +à¡ÃÕ§ªÑ +à¡ÃÕ§§ÍÔ¹àµÍÃì๪Ñè¹á¹Å +à¡ÃÕ§ÈÑ¡ŽÔì +à¡È¡ØÅÀÒ +à¡ÈÃÒ +à¡ÈÃÔ¹·Ãì +à¡ÈÇÅÕ +à¡ÈÈÔÃÔ +à¡ÈÊØŽÒ +à¡ÈÔ¹Õ +à¡É³Õ +à¡ÉŽÒ +à¡ÉÁ +à¡ÉÁÊѹµì +à¡ÉÃÒ +à¡ÉÃÕ +à¡ÉÕÂà +à¡Êà +à¡ÊÃì +à¡ÕÂÃµÔ +à¡ÕÂõԻÀÒ +à¡ÕÂõԟ§Éì +à¡ÕÂõÔÈÑ¡ŽÔì +à¡ÕÂõÔÊÇÑÊŽÔì +à¡×éÍ¡ÙÅ +á¡éÇ +á¡éÇãš +â¡Áşѹžì +â¡àÁÈ +â¡ÅºÍÅ €Í¹à¹ç€ªÑè¹Êì +â¡ÇÔ· +â¡ÇÔ·Âì +â¡ÇÔ¹ +â¡àÇȹì +â¡ÈÅ +â¡ÊÔ¹·Ãì +ä¡Ã€Ó +ä¡Ãà·Ÿ +ä¡ÃžÇѪ +¢šÃ +¢šÃà¡ÕÂÃµÔ +¢šÃÈÃÕ +¢šÃÈÑ¡ŽÔì +¢¹Ôɰì +¢¹ÔÉ°Ò +¢ÇÑãš +¢ÇѪÑ +¢ÇÑàŽ×͹ +¢ÇÑµÒ +¢ÇÑàŸçªÃ +¢ÇÑàÁ×èͧ +¢ÇÑÂØŸÒ +¢ÇÑÃØé§ +¢ÇÑàÃ×͹ +¢ÑµµÔÂÒ³Õ +¢éÒÇÍÔèÁ·ÔŸÂì +¢Ø¹·Í§ +á¢ä¢ +€§¡ÄÈ +€§àŽª +€àª¹·Ãì +€³Ò¡Ã +€³ÒÇØ²Ô +€³ÔÈà +€³ÔÊà +€³ØµÁì +€à³È +€žÒ +€à¹Âì +€Á¡ÃÔª +€ÁšÑ¡Ã +€ÁàŸçªÃ +€ÃÒ¿·ìàŽÍÐàºÊ·ì +€ÍÊÁÔ€ €Í¹€ÍÃìŽ €ÍÃì»ÍàêÑè¹ +€Ò«ÙâÍÐ +€ÒÃìâ»Ãà¿ÊªÑè¹á¹Å +€ÒÇÒ€Ô¹ +€Óó +€Óá˧ +€ÔÁ§€ì +€Ø³Ò¡Ã +€Ø³Õ·Ã +€ÙèºØ +€Ù»Ò¹Ò +à€ ÊËÒÂÍÔÁà»ê¡«ì +à€.«Õ.ŸÕ. áÁªªÕ¹à¹ÍÃÕè +à€·Õ·ÕÅÔÊ«Ôè§ +à€¹ áÁ¡«ì (»ÃÐà·Èä·Â) +à€¹ áÁç¡«ì (»ÃÐà·Èä·Â) +à€Ã×ÍÇÑÅÂì +္¹Ù ÍÔ¹àµÍÃìà·ÃŽ +á€ÐšéÍ +â€Ãà¹Ê (ä·ÂᏎì) +âŠÉÔµ +§ÒÁ¹Ôš +§ÒÁàŸç +à§Ô¹·Ø¹à¡ÕÂõԹҀԹ +š§¡Å +š§¡Å³Õ +š§ÃÑ¡ +š§ÃÑ¡Éì +š§Åѡɳì +šµØŸÃ +šµØŸÅ +šµØŸÑ¹žì +šµØÃ§€ì +šµØÄ·žÔì +šÃÃÂÒ +šÃÇŸà +šÃÇÃÞ¹ì +šÃÑ +šÃÑÅ +šÃÑʪÑ +šÃÑÊŸÅ +šÃÔ¹·Ãì +šÃÔ¹žÃ +šÃÔÂÒ +šÃÔÂÒÀóì +šÃØžÔŽÒ +šÃÙ +šàà +šàÃÈÑ¡ŽÔì +šÍÁ¢ÇÑãš +šÑ¡Ã¡Äª +šÑ¡Ã¡Äɳì +šÑ¡ÃŸÑ¹žì +šÑ¡ÃÇÒÅ +šÑ¡Ãѵ¹ì +šÑ¡ÃÔ¹·Ãì +šÑ¡ÃÕ +šÑ¡ÉÇѯ +šÑŽËÒ§Ò¹ÎÔÇáÁ¹àÍ繚Ôà¹ÕÂÃÔè§ +šÑµÃŽÒÇ +šÑ¹šÔÃÒ +šÑ¹··Õ +šÑ¹·¹Ò +šÑ¹·Ã +šÑ¹·ÃìàšéÒ +šÑ¹·Ãì·ÔŸÂì +šÑ¹·ÃìžÔÀÒ +šÑ¹·Ãì¹ÀÒ +šÑ¹·ÃìŸÃ +šÑ¹·ÃìàŸç +šÑ¹·ÃìÃѵ¹ì +šÑ¹·ÃìÇÔÁÅ +šÑ¹·ÃìÇÔäÅ +šÑ¹·ÃìÊØŽÒ +šÑ¹·Ô¡Ò +šÑ¹·ÔÀÒ +šÑ¹·ÔÁÒ +šÑ¹·ÔÁÒÀóì +šÑ¹·ÔÃÒ +šÒµØŸÃ +šÒµØÃ§€ì +šÒµØÃ¹µì +šÒÃÕÃѵ¹ì +šÒÃØ³Õ +šÒÃØ³ÕÂì +šÒÃØ¹Ñ¹ +šÒÃØºØµÃ +šÒÃØÃѵ¹ì +šÒÃØÇÃó +šÓ¹§ +šÓ¹§€ì +šÓ»Õ +šÓÃÑÊ +šÓàÃÔ +šÓÅͧ +šÔ³³ì +šÔµµì +šÔµµì¹ÔÉÒ +šÔµµÁÒÊ +šÔµµÒ +šÔµµÔ +šÔµµÔ¹¹Ñ¹·ì +šÔµÃÅŽÒ +šÔµÃÒ +šÔµÃÒÀóì +šÔ¹ŽÒ +šÔ¹µìšØ±Ò +šÔ¹µ¹Ò +šÔßà +šÔßѹžì +šÔÃÀÑ·Ã +šÔÃÀÒ +šÔÃÇÃó +šÔÃÇѲ¹ì +šÔÃÈÑ¡ŽÔì +šÔÃÊØŽÒ +šÔÃПà +šÔÃПÃó +šÔÃÐÀÒ +šÔÃÐÈÑ¡ŽÔì +šÔÃѪŽÒ +šÔÃѰµÔì +šÔÃÒ€Á +šÔÃҹت +šÔÃÒŸÃ +šÔÃÒÀóì +šÔÃÒÀÒ +šÔÃÒÂØ +šÔÃÒÇÃó +šÔÃÒÇÑÅÂì +šÔÃÒÇØ²Ô +šÕ·Õ«Õ ·Ã§ŸÑ¹žì) +šÕßÃó +šÕÃÈÑ¡ŽÔì +šÕÃйѹ·ì +šÕÃÐÇѲ¹ì +šÕÍÕ á€»»ÔµÍÅ (»ÃÐà·Èä·Â) +šÕâÍà·€¹Ô€ (ä·ÂᏎì) +šØ±Ò·ÔŸÂì +šØ±ÒŸÑ¹žì +šØ±ÒÁÒÈ +šØ±ÒÁÒÊ +šØ±ÒÃѵ¹ì +šØ±ÒÇÃó +šØÃÕÃѵ¹ì +šØÅÅŽÒ +šØÌÒ +šØÌÒÀóì +šØÌÒÀÒ +šØÌÒÅѡɳì +àšµ¹ì +àš¹ +àš¹šÔÃÒ +àš¹µì³Ã§€ì +àš¹à¹ÍÃÑÅ乫ì (»ÃÐà·Èä·Â) +àš¹ÇÔ·Âì +àšÃÔ +àšÃÔªÑÂËÁéÍá»Å§ä¿¿éÒ +àšÃÕ§ +àšÉ®Ò +àšéÒŸÃÐÂÒÁÒÃì€ +àšÔÁªÑ +àšÕÂÁšÔµ +ášèÁ +ãšÊÇÇÀì +©ÅÇ +©Åͧ +©ÅÒŽ +©ÇÕÇÃó +©Íé͹ +©ÑµÃªÑ +©ÑµÃÀóì +©ÑµÃÈÔÃÔ +©Ñ¹·¹Ò +©Ñ¹·Ãѵ¹ì +©×èÍ šÔé¹ ÎÑéÇ +©×èÍšÔé¹ÎÑéÇ +à©ÅÔÁ +à©ÅÔÁ¢ÇÑ +à©ÅÔÁªÑ +à©ÅÔÁªÒµÔ +à©ÅÔÁŸÑ¹žØì +à©ÅÕÂÇ +à©Ô¹ +â©ÁÅŽÒ +â©ÁÊØŽÒ +ª.ÊÂÒÁšÑ¡ÃÂÒ¹àŽç¡àÅè¹ +ª®ÒÃѪ +ªŽÒ¡Ã +ª¹¹Ñ¹·ì +ª¹¹ÔÈÒ +ª¹ÁìÊØÇÃó +ª¹Ð +ª¹ÐâªµÔ +ª¹ÑÒ +ª¹Ñ° +ª¹Ñ¹Àóì +ª¹ÒÀÒ +ª¹ÔŽÒ +ªÁ +ªÁŸÅ +ªÁŸÙ¹Øª +ªÁŸÙ¹Ø· +ªÁÀÑÊÊà +ªÁÀٹت +ªÁÑŸà +ªäÁŸÃ +ªÂ¹ +ªÂÒŸÅ +ªÂÒÀóì +ªÃѪÊÃÒ +ªÃѶšÑ¹·Ãì +ªÃÑÊÃÒ +ªÃÔ¹·Ãì +ªÃÔ¹Ãѵ¹ì +ªÅžÔªÒ +ªÅžÕ +ªÅÍ +ªÅÍÁ +ªÅÒ¡Ã +ªÅÔ¡Ò +ªÅÔŽÒ +ªÅÔµ +ªÅÔµÒ +ªÇ¹ +ªÇ¹ªÁ +ªÇ¹ŸÔÈ +ªÇÅÔµ +ªÇÔÈÒ +ªèÍ +ªèͩѵà +ªèÍ·ÔŸÂì +ªèÍÍÑªÑ +ªÐ¹ÔÅ +ªÐÍé͹ +ªÑªªÑ +ªÑª®Ò +ªÑªÀ³ +ªÑªÀÑÊÊà +ªÑªÁ³±ì +ªÑªÁ¹±ì +ªÑªÇÒÅÂì +ªÑªÇÒÅì +ªÑÒ +ªÑÉÒ +ªÑÂàšÃÔãªèËÅÕʵÕÅ +ªÑª¹Ð +ªÑÂªÒ +ªÑ³ç€ì +ªÑžÇѲ¹ì +ªÑ¹€Ã +ªÑ¹ѹ·ì +ªÑŸà +ªÑŸŠ+ªÑÂÀÑ·Ã +ªÑÂÁ§€Å +ªÑ§³ì +ªÑÂÂÈ +ªÑÂÂÐ +ªÑÂÂØ·ž +ªÑÂÃѵ¹ì +ªÑÂÇѲ¹ì +ªÑÂÊÔ·žÔì +ªÑÂÊÔ¹žØì +ªÒ +ªÒªÑ +ªÒ³Ã§€ì +ªÒÂØ·ž +ªÒÈÑ¡ŽÔì +ªÒµÃÕ +ªÒµÔªÒ +ªÒ¹ +ªÒ¹¹·ì +ªÒ +ªÒÅÕ +ªÒÇѳÂì +ªÓ¹Ò +ªÓ¹Ô +ªÔŽª¹¡ +ªÔ¹ +ªÔ¹ŸÑ¹žì +ªÔ¹Ãѵ¹ì +ªÔ¹ÇѲ¹ì +ªÕÇÒŸÃ +ª×蹚Եµì +ªØŽÒŸÃ +ªØµÔ¡Òš¹ì +ªØµÔÁÒ +ªØÁŸÃ +ªØÁŸÅ +ªØÁÈÔÃÔ +ªØÁÊÒ +ªØÅÕŸÃ +ªÙà¡ÉÁ +ªÙà¡ÕÂÃµÔ +ªÙšÔµ +ªÙšÔµµì +ªÙªÑ +ªÙªÒµÔ +ªÙªÕŸ +ªÙŸ§Èì +ªÙŸ§Éì +ªÙÈÑ¡ŽÔì +ય°¡Ã +àªÉ°Ò +àªÍÃÔè§-ŸÅÒÇ á͹ÔÁÑÅ àÎéŪ +àªÍÃÔè§-ŸÅÒÇá͹ÔÁÑÅàÎçÅž +àªÒÇ¹Ò +àªÒÇÅÔµ +àªÔŽšÔµµì +àªÔŽªÑ +àªÔŽÈÑ¡ŽÔì +àªÕ§àΧ¡ÒêèÒ§ +àªÕèÂÇªÒ ÍÔ¹ŽÑÊ·ÃÕè (1989) +àªÕèÂǪÒÍÔ¹ŽÑÊ·ÃÕè (1989) +àªÕèÂǪÒÍÔ¹ŽÑÊ·ÃÕ (1989) +àªÕèÂǪÒÍÔ¹ŽÑÊ·ÃÕè(1989) +⪀ +⪀ªÑ +âªµÔ +⪵ÔÃÊ +⪵ÔÇØž +äªÂ¹Ñ¹·¹ì +äªÂÁ§€Å +äªÂÃѵ¹ì +äªÂÒ +«è͹¡ÅÔè¹ +«Òâµéâ€à¡ÕÂÇ ¡Ãاෟ +«Ô¡»éÒ (»ÃÐà·Èä·Â) +«Õ àÍç¹ äÍ +«Õ ŽÕ àÍçÁ àÍç¹àµÍÃìäŸÃÊì +«Õ.ŽÕ.ÍØµÊÒË¡ÃÃÁ +«Õ.·Õ.à·àÅ€ÍÁ +«Õ.ÇÕ.àÍÊ.ÍÔ¹ŽÑʵÃÕé +«ÕŽÕ ÍØµÊÒË¡ÃÃÁ +«ÕàÍç¹äÍàÍ繚Ôà¹ÕÂÃÔè§«ÑŸŸÅÒ +«Ù +à«ÒÐ +à«ÕÂÁà¡ÕÂÇ +Ò³ÀÑ€ +Õ¹ÀÒ +¯Ç§¡ÁÅ +°Ò¹Ñ¹·ì +°Ò¹ÔµÂì +°Ò¹ÔÊà +°Ò»¹ÇÔ·Âì +°Ôµ¡Ò¹µì +°ÔµÔ¡Ò¹µì +°ÔµÔ³Ñ° +°ÔµÔàžÕÂà +°ÔµÔ¹Ñ¹·ì +°ÔµÔŸ§Èì +°ÔµÔŸÃ +°ÔµÔÁÒ +°ÔµÔÃѪµì +°ÔµÔÃѵ¹ì +±ÔÁÀì¹Øª +³žÔµÒ +³ÀÑ·Ã +³Àѷáóì +³Ã§€ì +³Ã§€ìªÑ +³Ã§€ìŸÑªÃì +³Ã§€ìÄ·žÔì +³Ã§€ìÇÔ·Âì +³Ã§€ìÈÑ¡ŽÔì +³Ã§ÃÑ¡Éì +³Ã§Ä·žÔì +³Ã§ÈÑ¡ŽÔì +³Ë·Ñ +³ÑªªÒ +³ÑÒ +³Ñ®°ÁÑ +³Ñ®°ÇÃó +³Ñ¯ŸÅ +³Ñ° +³Ñ°¡Ã³ÔÈÒ +³Ñ°¡ÄµÒ +³Ñ°¡Ò¹µì +³Ñ°¢šÃ +³Ñ°ª¹Ñ +³Ñ°ªÒ +³Ñ°°Ò +³Ñ°µÂÒ +³Ñ°¹¹·ì +³Ñ°¹Ñ¹·ì +³Ñ°»¡Ã³ì +³Ñ°Ÿ§Èì +³Ñ°Ÿ§Éì +³Ñ°Ÿš¹ì +³Ñ°ŸÃ +³Ñ°ŸÅ +³Ñ°ÀÙÁÔ +³Ñ°Á¹ +³Ñ°ÁÒ +³Ñ°ÂÒ +³Ñ°ÇÃÕÂì +³Ñ°ÇѪÃì +³Ñ°ÇѲ¹ì +³Ñ°ÇÑµÔ +³Ñ°ÇØ²Ô +³Ñ°ÈÑ¡Âì +³Ñ°ÊÃÑ +³Ñ°Ë·Ñ +³Ñ°Ô¡Ò +³ÔªÒ¡Ã +³Õç€ì +³Øªª¹Ò +޹Ñ +Ž¹ØŸÅ +ŽÃÃìª¹Õ +ŽÃØ³Õ +ŽÅÄŽÕ +ŽÅÄ·Ñ +ŽÇ§¡ÁÅ +ŽÇ§šÑ¹·Ãì +ŽÇ§ãš +ŽÇ§ŽÒÇ +ŽÇ§àŽ×͹ +ŽÇ§¹ÀÒ +ŽÇ§ºÅ +ŽÇ§ŸÃ +ŽÇ§Á¹·Ãì +ŽÇ§Ãѵ¹ì +ŽÇ§Ë·Ñ +ŽÍ¡äÁé +ŽÒÃ³Õ +ŽÒùÕÂì +ŽÒÃÒ¹ÕÅì +ŽÒÃÒÃѵ¹ì +ŽÒÃÒÇÃó +ŽÒÃÔ¡Ò +ŽÒÃÔ³Õ +ŽÒÃÔ¹ +ŽÒÃØ³Õ +ŽÒÇ»ÃСÒ +ŽÒÇÃÕ +ŽÓà¹Ô¹ +ŽÓç +ŽÓç€ì +ŽÓËÃÔ +ŽÔàá +ŽÔÈ¡ØÅ +ŽÔʷѵ +ŽÕ.ºÕ.äŽÁ͹Žì (»ÃÐà·Èä·Â) +ŽØÅŸŠ+ŽØÅÂìŸÑ²¹ì +ŽØÉ®Õ +ŽØÉ³Õ +ŽØÉŽÕ +ŽØÊÔµ +ŽØÊÔµà€ÁÕÀѳ±ì +àŽª +àŽªÒ +àŽÍЀÇÍÅÔµäÇÃì +àŽ×͹¹ÀÒ +àŽ×͹àŸç +âŽÁ +äŽÍСÅêÒÊ +µè͚ѡà +µÐÅèÍÁÊÔ¹ŸÅÒʵԡ +µÐÇѹ +µÑè§šÑè§ËÅÍŽä¿ +µÒà¿çŽ +µØê +µØê¡µÒ +µØéÁ +µØë +µØÅÒÅѡɳì +àµçÁàŽª +àµ×͹㚠+àµ×͹µÒ +ãµé à«é§ «Ñ¹ +äµÃ·È +äµÃà·Ÿ +äµÃç€ì +¶¹ÍÁÈÑ¡ŽÔì +¶¹ÔµŸÅ +¶ÇÑÅ +¶ÇÑÅÂì +¶ÇÔÅ +¶Ò³ØŸ§Èì +¶ÒÇà +à¶ÅÔ§ÈÑ¡ŽÔì +·¹§ÈÑ¡ŽÔì +·¹Ø +·Ã§ +·Ã§ªÑ»Ñè¹·Í +·Ã§žÃÃÁ +·Ã§ŸÅ +·Ã§ÇØ²Ô +·Ã§ÈÃÕ +·Ã§ÈÑ¡ŽÔì +·Ã§ÈÔÃÔ +·ÃÃȹÕÂì +·ÃÑŸÂì¶ÒÇÀéÒÇÑÊŽØ +·ÇÔª +·ÇÕ +·ÇժѠ+·ÇÕ» +·ÇÕŸÃ +·ÇÕÇѲ¹ì +·ÇÕÈÃÕ +·ÇÕÈÑ¡ŽÔì +·ÈŸÃ +·ÈŸÅ +·Í§¢ÒÇ +·Í§€Ó +·Í§ãº +·Í§»Ò¹ +·Í§ŸÑ¹žì +·Í§ŸÑ¹žØì +·Í§ÊØ¢ +·Í§ÍÔ¹·Ãì +·Ñ¡ÉÁ³¹ì +·ÑŽŽÒÇ +·Ñº·ÔÁ +·ÑȹÇÃó +·Ñȹ՟à +·ÑȹÕÂì +·ÑȹÕÂÒ +·ÑÈÇÃó +·èÒ·ÃÒÂášé§ÇѲ¹Ò +·ÔŠÑÁŸÃ +·Ô¹á€¹ ÍÔ¹ŽÑÊ·ÃÕ +·ÔŸÂìŸÒŸÃ +·ÔŸÂìÇŽÕ +·ÔŸÂìÇÃó +·ÔŸÂìÇÃØ³ +·ÔŸÂìÇÑÅÂì +·ÔŸÂìÇÒÃÕ +·ÔŸÂìÇÔÁÅ +·ÔŸÇÃó +·ÔŸÇÑÅÂì +·ÔŸÇÔÁÅ +·ÔŸÊØŽÒ +·ÔŸÒ¡Ã +·ÔŸÒÇÃó +·ÔÇÒ +·ÔÈŸÅ +·Õ «Õ ŸÕ ÍÔ¹ŽÑÊ·ÃÕé +·Õ.«Õ.«Õ.ŸÃçÍŸàŸÍÃìµÕé +·Õ.«Õ.ŸÕ.ÍÔ¹ŽÑÊ·ÃÕé +·Õ.àÍÊ.äÇÃì€Ñ· á͹Žì áÁªªÕ¹ŸÒÃì· +·Õ.äÍ.·Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å +·ÕâÍàÍ âŽ¿à€Á ÍÔ¹ŽÃÑʵÕé +·ÙÁÔ¹Ô·Êì ºÔ«Ôà¹Ê +·Ùà +à·Ÿ +à·ŸŸÔºÙÅ +à·ŸÄ·žÔì +à·ÇÒ +à·ÇÕ +à·ÔŽä· +ä·Â +ä·Â €Í¹Êì á͹Žì ºÔÅŽÔé§ +ä·Â ŽÕ à͹ ·Õ àŸ¹·ì +ä·Â-àÍà«Õ ŸÕ.ÍÕ.äŸéŸì +ä·Âà¡ÃÕ§ÊÔè§·Í +ä·Â€Òà«ÎÔ¹ +ä·Âà€ÁÕÀѳ±ì +ä·Âà«ç¹·ÃÑÅ à€ÁÕ ª¹) +ä·Âà«ç¹·ÃÑÅà€ÁÕ +ä·Âà«çÅ·ÃÑÅà€ÁÕ ª¹) +ä·ÂŽÕà͹·ÕàŸ¹·ì +ä·Âµ§¹ÔµµÔé§ +ä·Âž¹ÒŸÒ³ÔªÂì +ä·ÂžÒ¹Õà€ÁÕ +ä·ÂŸÃçÍ¡«ì +ä·ÂàŸÔèÁŸÅÒʵԡ +ä·ÂÂÙà¹Õ¹€ÇÍÅÅÔµÕé +ä·ÂàÇÅ€Í¹ÍØµÊÒ¡ÃÃÁ +ä·ÂÍÔ¹àµÍÃì €ÍµµÍ¹¡ÒÃ·Í +ä·ÂÍÔ¹àµÍÃì ÍÐâÃàÁµÔ¡Êì +ž§ªÑ +ž§äªÂ +ž³Ñ° +ž¹¡Ã +ž¹¡Äµ +ž¹ŸÃ +ž¹ŸÅ +ž¹ÃѪ +ž¹Ãѵ¹ì +ž¹âÚ¹ì +ž¹ÇŽÕ +ž¹ÇѲ¹ì +ž¹Çѹ +ž¹ÇÔµµ +ž¹ÇÔ·Âì +ž¹ÊÔ·žÔì +ž¹ÐÃѪµì +ž¹ÑªžÔŽÒ +ž¹ÑÒ +ž¹Ñ¹µì +ž¹Ñ¹·ì +ž¹ÑÊ +ž¹Ò +ž¹Ò€ÒÃ¡ÃØ§ÈÃÕÍÂØžÂÒ º +ž¹Ò€ÒÃÂÙâÍºÕ Ãѵ¹ÊÔ¹ ÊÒ¢ÒËÑÇËÁÒ¡ +ž¹ÒÀóì +ž¹ÒÀÒ +ž¹ÒÃÑ¡Éì +ž¹ÒÇѪÃì +ž¹ÔŽÒ +ž¹ÔÉ°Ò +ž¹Ù +žà¹È +žà¹ÈÃì +žÁ¹Ñ¹·ì +žÃÃÁ¹Ù +žÃÃÁÈÒʵÃì +žÄµ +žÇѪ +žÇѪªÑ +žÇÑÅÃѵ¹ì +žÑª¡Ã +žÑªŸÅ +žÑªÇŽÕ +žÑªÇѲ¹ì +žÑª¹¡ +žÑžÃ +žÑŸÑ²¹ì +žÑ³ÔªÒ +žÑ¹Ñ¹·ì +žÑŸÃ +žÑŸÔÊÔ·žÔì +žÑÃŽÒ +žÒ¡Ã +žÒŽÒ +žÒ¹Ô¹·Ãì +žÒ¹Õ +žÒ÷ԟÂì +žÒÃÒ +žÒÃÔ¹Õ +žÓç€ì +žÓçÃѵ¹ì +žÔŽÒÃѵ¹ì +žÔµÔ¹Ñ¹·ì +žÔ¹Õ¡Òš¹ì +žÕêÑ +žÕùت +žÕß§Èì +žÕß§Éì +žÕߊ+žÕßѲ¹ì +žÕÃÀÑ·Ãì +žÕÃÀÒŸ +žÕÃÇѲ¹ì +žÕÃÈÑ¡ŽÔì +žÕÃÈÒ¹µÔŸÑ¹žì +žÕÃÐ +žÕÃЪÑ +žÕÃПŠ+žÕÃÐÇѲ¹ì +¹ ŸŽÅ +¹ à¿ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ŸÕ·ÕÍÕ ÅÔÁÔàµç +¹€Ã +¹€Ã»°Á Î͹ŽéÒ€ÒÃìÊì (1994) +¹§ª¹¡ +¹§¹Øª +¹§Åѡɳì +¹· +¹·Ô¹ +¹·Õ +¹¹·ÈÑ¡ŽÔì +¹Ÿà¡éÒ +¹ŸŽÅ +¹ŸŽÅÂì +¹Ÿ·Ñµ +¹ŸŸ§€ì +¹ŸŸÃ +¹ŸŸÅ +¹ŸÁÒÈ +¹ŸÃѵ¹ì +¹ŸÄÔ·žÔì +¹ŸÇÃó +¹ŸÒŸÃ +¹ÀŽÅ +¹ÀÇÃó +¹ÀÑÊÊà +¹ÀÑÊÊØÇÃó +¹ÀÒ +¹ÀÒŸÃ +¹ÀÒÂØ·žì +¹ÀÒÇÃó +¹ÀÔ¹·Ã +¹ÃªÑ +¹ÃŸÅ +¹ÃÀÑ·Ãì +¹ÃÒ +¹ÃÔ¹·Ãì +¹ÃÔ¹·ÃìàŽª +¹ÃÔÈ +¹ÃÔɰ +¹ÃÕ +¹àÃÈ +¹âõÁì +¹Ä³Õ +¹ÄŽÕ +¹Ä·žÔì +¹ÄÁÅ +¹ÄÁÒ³ +¹ÅŸÃó +¹Ç¡Ã³ì +¹ÇŸÅ +¹ÇÃѵ¹ì +¹ÇŚѹ·Ãì +¹ÇÅ©ÇÕ +¹ÇÅŸÃ +¹ÇÅÅÐÍÍ +¹ÑªÅÒ +¹Ñ¯ŸÃ +¹Ñ±ŸÃ +¹Ñ·ª¹¡ +¹Ñ·žÁ¹ +¹Ñ¹ªÑ +¹Ñ¹·ªÑ +¹Ñ¹·¹ì +¹Ñ¹·¹Ò +¹Ñ¹·ŸÃ +¹Ñ¹·ŸÅ +¹Ñ¹·ÁÒÊ +¹Ñ¹·Ãѵ¹ì +¹Ñ¹·Ç§Éì +¹Ñ¹·ÇÃó +¹Ñ¹·ÈÑ¡ŽÔì +¹Ñ¹·Ò +¹Ñ¹·Ô¡Ò¹µì +¹Ñ¹·ÔÂÒ +¹ÑÂ¹Ò +¹Ò¯Êǧ +¹ÒµÂÒ +¹ÒÁ +¹ÒÃÔ¹·Ãì +¹ÒÃÕ +¹ÒÃÕÃѵ¹ì +¹ÒÇÔ¹Õ +¹éÓ·ÔŸÂì +¹éÓœ¹ +¹ÓŸÅ +¹éÓàŸªÃ +¹éÓÁѹ€ÒÅà·ê¡«ì +¹ÓÃØè§ä·Â ¡ÒÃìàÁ¹·ì +¹éÓÍéÍ +¹Ô¡Éì +¹Ô€Á +¹ÔªÃªÕŸ +¹Ôà«Ð +¹ÔŽ +¹ÔŽÒ +¹ÔµÂì +¹ÔµÂÒ +¹ÔµÔ +¹ÔµÔŸ§Éì +¹ÔµÔÁÒ +¹Ô·ÃÒ +¹Ô·Ñȹì +¹Ô·ÑȹÕÂì +¹ÔžÔÇŽÕ +¹Ô»»Í¹àŸ¹µì(»ÃÐà·Èä·Â) +¹ÔŸ¹žì +¹ÔŸÅ +¹ÔŸÑ·žÒ +¹ÔŸÑ¹ +¹ÔÀÒ +¹ÔÂÁ +¹ÔÃÁÅ +¹ÔÃѹŽÃ +¹ÔÃÒÇÃóì +¹ÔÃØš¹ì +¹ÔÃØµµì +¹ÔÅÀÒ +¹ÔÅØºÅ +¹Ô⟊+¹ÔÇૹšÙÃÕèŸÃÔé¹µÔé§á͹Žì ៀ࡚šÔé§ +¹ÔÇѲ¹ì +¹ÔÇѵÃì +¹ÔÇÑµÔ +¹ÔÇÒµ +¹ÔÈÃÒ +¹ÔÈҪŠ+¹ÔÈÒŸÃ +¹ÔÊÒ +¹ÕµÔ +¹ØªšÃÔ¹·Ãì +¹Øª¹Ò¶ +¹ØªÂÒ +¹ØªÃÕ +¹ØÈÃÒ +¹ØÊºÒ +¹ØÊÃÒ +๵ÎÒÇ +à¹ÒÇÃѵ¹ì +º§¡ª +º§¡µÃѵ¹ì +º«ì ÍÔ¹â¿Ãì à«ÍÃìÇÔÊ +ºÃÚ§ +ºÃÚº +ºÃÃàšÔŽ +ºÃç +ºÃÃÊÒà +ºÃÔÇÃõ +ºÇêÑ +ºÑ§Íà +ºÑªÒ +ºÑÑµÔ +ºÑ³±Ôµ +ºÑ³±ÔµÂì +ºÑµÃ¡Ãاä·Â +ºÑµÃ¡ÃاÈÃÕÍÂØžÂÒ +ºÑ¹Å×ÍÈÑ¡ŽÔì +ºÒ§¡Í¡ªÕ·àÁç··ÑÅ +ºÒ¹ªéÍ +ºÓÃØ§ä·Â +ºÔǵÕéៀ +ºÕ ÇÒ €ÍÃìâŸàêÑè¹ šÓ¡ÑŽ +ºÕ á͹Žì «Õ ŸÙÅÒÊ¡Õé +ºÕ.àÍç¹.ºÃÒàŽÍÃì +ºÕ.àÍÊ.äÍ.àËÅç¡¡èÍÊÃéÒ§ +ºØà¡ÕÂÃµÔ +ºØ€§ +ºØªèÇ +ºØªÑ +ºØªØº +ºØàªÔŽ +ºØ«é͹ +ºØ·ÃÑŸÂì +ºØ·ÇÕ +ºØ·Í§ +ºØžÃÃÁ +ºØ»ÃÐÊÔ·žÔì +ºØŸ§Éì +ºØÁÕ +ºØÂѧ +ºØàÂÕèÂÁ +ºØÃèÇÁ +ºØÃÑ¡ +ºØÅѺ +ºØÅ×Í +ºØàÅÔÈ +ºØÈÃÕ +ºØÈÔÃÔ ŽÕÇÔÅÍ»àÁ¹·ì +ºØÊè§ +ºØÊ¹Í§ +ºØÊÔ¹ +ºØÊ׺ +ºØÊØ¢ +ºØáʧ +ºØ³±Ôµ +ºØ»ŒÒ +ºØÃѪÅÕ +ºØÃÔ¹·Ãì +ºØÈÃÒ +ºØÈÃÒŸÃ +ºØÈÃÔ¹·Ãì +ºØÉ¡Ã +ºØÉºÒ +ºØÉÂÒ +ºØÉÃÒÀóì +ºØËÅÑè¹ +ºÙê·Êì (»ÃÐà·Èä·Â) +ºÙê·ÊìáÁ¹Ùá¿€àšÍÃìÃÔè§ (»ÃÐà·Èä·Â) +ບŸÃ +ບÁÒ +ບÅÑ¡É³ì ŸÃÔé¹µÔé§ +ບÇÃó +àºçÇÃó +àºç·à·ÍÃì äÅ¿ì +»¡Ã³ì +»®ÔÁÒ +»¯ÔÒ +»¯ÔŸÅ +»¯ÔÁÒ +»°ÁÇѲ¹ì +»³ªÑ +»³ÔŽÒ +»³ÔµÒ +»·ØÁ +»·ØÁŸÃ +»·ØÁÒ +»¹ÑŽŽÒ +»ÀÑÊÊà +»ÀÒ³Ø +»ÀÒÇŽÕ +»ÀÒÇÃÔ¹·ì +»ÀÒÇÕ +»ÂØµÒ +»ÃСͺ +»ÃСÒÈ +»ÃСÒÈÔµ +»ÃСԚ +»ÃСԵ +»ÃЀͧ +»ÃК§šÔµ +»ÃКǺ +»ÃКѡÉì +»ÃКԵà +»ÃÐªÒ +»ÃЪԵ +»ÃЪØÁŸÃ +»Ãгµ +»ÃÐŽÔɰì +»ÃзѺ㚠+»Ãзջ +»ÃзØÁ·ÔŸÂì +»ÃÐà·×ͧ +»ÃПš¹ì +»ÃП¹žì +»ÃПķžÔì +»ÃПѲ¹ì +»ÃПѹžì +»ÃÐäŸ +»ÃÐÀÑÊ +»ÃÐÀÑÊÃì +»ÃÐÀÑÊÃÒŸÃ +»ÃÐÀÑÊÊà +»ÃÐÀÒŸÃ +»ÃÐÀÒŸÃó +»ÃÐÀÒÀóì +»ÃÐÀÒÊ +»ÃÐÁÇÅ +»ÃÐÁÑŸà +»ÃÐÁÙÅ +»ÃЧ€ì +»ÃÐÂÔ¹ +»ÃÐÂØ·ž +»ÃÐÂÙà +»ÃÐÂÙÃÈÃÕ +»ÃÐ⪹ì +»ÃÐÇѵà +»ÃÐÇÑµÔ +»ÃÐÇԵà +»ÃÐÇÔ· +»ÃÐÇÔ·Âì +»ÃÐÇÕ³Ò +»ÃÐàÇÈ +»ÃÐʧ€ì +»ÃÐÊÒ· +»ÃÐÊÒ¹ +»ÃÐÊÒà +»ÃÐÊÔ·žÔì +»ÃÐÊ׺ +»ÃÐàÊÃÔ° +»ÃÑªÒ +»ÃÒ¡Òà +»ÃÒ§³Õ +»ÃÒªì +»ÃÒ³Õ +»ÃÒ³ÕÂì +»ÃÒâÁ·Âì +»ÃÒö¹Ò +»ÃÔì +»ÃÔÒ +»ÃÔŽÒ +»ÃÔ³ŽÒ +»ÃÔ·ÑÈ +»ÃÔ¹ŽÒ +»ÃÔÂÒÇÃó +»ÃÔÈ¹Ò +»ÃÔÈ¹Õ +»ÃÕªÒ +»ÃÕÒ +»ÃÕÂÒÀóì +»ÇÕ³ÃѪ +»ÇÕ³Ò +»Êѹµì +»Êѹ¹ì +»Í§ÀŸ +»ÑšÃÑÈÁÔì +»ÑÒ +»ÑÒŸÃ +»ÑÒŸÅ +»Ñ³ÃÊÕ +»Ñ·Á +»Ñ·ÁÒ +»Ñ·ÁÒÇŽÕ +»Ò³ÔÊÃÒ +»Ò¹ +»Ò¹àŸªÃ +»ÒÃÔªÒµ +»ÒÃÔªÒµÔ +»ÒÃԟѹžì +»ÒÃÕ³Ò +»Ò˹ѹ +»ÔµÔ +»ÔµÔÇѪÃì +»Ôè¹Á³Õ +»Ôè¹ÁÒ⹪ +»Ô¡Қ¹ì +»Ô¹ѹ·ì +»Ô¹ү +»ÔŸ§Èì +»ÔŸ§Éì +»ÔŸà +»ÔÂÁÒÀóì +»ÔÂÃѵ¹ì +»ÔÂÇÃó +»ÔÂÇѲ¹ì +»ÔÂÈÑ¡ŽÔì +»ÔÂÐ +»ÔÂЪÑ +»ÔÂй¹·ì +»ÔÂйѹ·ì +»ÔÂйت +»ÔÂП§Èì +»ÔÂПà +»ÔÂПѹžì +»ÔÂПѹžØì +»ÔÂÐÁÒÈ +»ÔÂÐÈÑ¡ŽÔì +»ÔÂÒŸÃ +»ÔÅÑ¹Ò +»Ø³³ÂÒ +à»à»ÍÃìÅÔ¿ +à»ÃÁ +à»ÃÁ»ÃÐÀÒ +à»ÃÁÄŽÕ +à»ÃÁÈÃÕ +à»ÃÁÊÔ·žÔì +à»ÕèÂÁÊØ¢ +á»Å¹âÁ·Ô¿ +Œ¡Ò¡Ãͧ +Œ¡ÒŸÃó +Œ§ +Œš§šÔµµì +ŒŽØ§ÈÑ¡ŽÔì +ŒàŽÔÁ +ŒèͧŸÃó +ŒèͧÈÃÕ +Œè͹»ÃÐÀÒ +ŒéÒ¢¹Ë¹ÙªÔ¹àΧ +ŒéÒ¢¹Ë¹Ù«Ô¹àΧ +ŒéҢع˹٫ԹàΧ +ŒèÒ¹¿éÒ àÍ繚Ôà¹ÕÂÃÔè§ +ŒèÒ¡ÒÀÅѧ¡Í§¡ÅÒ§Êӹѡ»ÅÑŽ¡ÃاෟÁËÒ¹€Ã +ŒÒÊØ¢ +ŒØÊŽÕ +ŒÙéàŒŽçš +ŒÙéãËèàÅç¡ +àŒŽçš +àŒÔ§ +䌷 +œèÒ¡ÒÀÅѧ¡Í§¡ÅÒ§ Êӹѡ»ÅÑŽ¡ÃاෟÁËÒ¹€Ã +Ÿ§Èìà¡ÕÂÃµÔ +Ÿ§ÈìªÒ +Ÿ§Èìà·Ÿ +Ÿ§ÈžÃ +Ÿ§ÈìŸÑ¹žì +Ÿ§ÈìŸÔŸÑ²¹ì +Ÿ§ÈìÀÑ€ +Ÿ§ÈìÊØà¡ÉÁ +Ÿ§Éìà·Ÿ +Ÿ§ÉìŸÃ +Ÿ§ÉìÈÑ¡ŽÔì +Ÿ§ÉìÊѹµì +Ÿ§Éì͹ѹµì +Ÿš¹ì +Ÿš¹Ò +Ÿš¹Òö +Ÿš¹ÕÂì +ŸšÁÒ¹ +ŸšÁÒÅÂì +Ÿ¹Á +Ÿ¹ÁªÑ +Ÿ¹ÒÊѹ±ì +Ÿ¹ÔŽÒ +ŸÂ¹µì +ŸÂا +ŸÃ +ŸÃ¡ÇÕ +ŸÃšÔµµì +ŸÃªÑ +ŸÃ·ÔŸÂì +ŸÃ·ÔŸÒ +ŸÃ·ÔÀÒ +ŸÃà·Ÿ +ŸÃ¹·Õ +ŸÃ¹ÀÒ +ŸÃ¹ÔµÔ¿ÔÅìÁá͹ŽìÇÕŽÕâÍ +ŸÃŸ§Éì +ŸÃŸ¹Ò +ŸÃŸÃó +ŸÃŸÅ +ŸÃŸÅÒ§ÒÁ +ŸÃŸÔÁÅ +ŸÃŸÔäÅ +ŸÃàŸç +ŸÃÁ§€Åà¿ÍÃì¹ÔàšÍÃì +ŸÃó·ÔÀÒ +ŸÃó¹ÔÀÒ +ŸÃó»ÃÐäŸÇŽÕ +ŸÃóŸÃÃÉ +ŸÃóŸÔÁÅ +ŸÃóÃÒ³ì +ŸÃóÊóì +ŸÃÃ³Ô¡Ò +ŸÃÃ³Õ +ŸÃÃžÔŽÒ +ŸÃÇÔÁÅ +ŸÃÇÔäÅ +ŸÃÈÑ¡ŽÔì +ŸÃÈÔÃÔ +ŸÃÊÃǧ +ŸÃÊÇÃÀì +ŸÃËÁŸÑ²¹ì +ŸÃéÍÁªÑ +ŸÃлÃÐᎧ Î͹ŽéÒ€ÒÃìÊì +ŸÃлÃÐᎧ Î͹ŽéÒ€ÒÃìÊì šÓ¡ÑŽ +ŸÃÐÃÒÁ 3 €ÒÃìà«ç¹àµÍÃì +ŸÃÐÃÒÁ 3 Î͹ŽéÒ€ÒÃìÊì +ŸÃÔéÁàŸÃÒ +ŸÃÕàÁÕÂÃìà€ÁÔ€ÑÅ á͹ŽìŸÅÒʵԡ +ŸÃÕàÁÕÂÃìÍÔ¹àµÍÃìÅÔ««Ôè§ +ŸÅ¡Äɳì +ŸÅªÑ +ŸÅà·Ÿ +ŸÅŸÑªÃì +ŸÅŸÑ²¹ì +ŸÅÊÔ·žÔì +ŸÇ§·Í§ +ŸÇ§àŸç +ŸÇ§Ãѵ¹ì +ŸÈÔ¹ +ŸÊØà¡µÔì +ŸÑª¹Õ +ŸÑªÃ +ŸÑªÃÇäÅ +ŸÑªÃÒ +ŸÑªÃÒÀóì +ŸÑªÃÒÀÒ +ŸÑªÃÔ¹·Ãì +ŸÑªÃÕ +ŸÑªÃÕŸÃ +ŸÑªÃÕÀóì +ŸÑ²·ÇÕ +ŸÑ²¹ªÑ +ŸÑ²¹Ð +ŸÑ²Ÿ§Éì +ŸÑ·žìžÕÃÒ +ŸÑÅÅÀ +ŸÑÊŸÃ +ŸÒ³ÔªÂì +ŸÒ³Õ +ŸÒâµà€ÁÕÍØµÊÒË¡ÃÃÁ +ŸÒ¹·Í§ +ŸÒÃҡ͹ÍÔ¹â¿à·€ +ŸÔ ÈÁÑ +ŸÔšÔµÃÒ +ŸÔªì +ŸÔªŽÒ +ŸÔªÂÒ +ŸÔªÑ +ŸÔªÑÂÇѲ¹ì +ŸÔªÔµ +ŸÔªÔµŸÅ +ŸÔય +ŸÔય°ì +ŸÔàªÉ° +ŸÔàªÉ°ì +ŸÔ±ÙÃÂì +ŸÔ³ªØŽÒ +ŸÔ³¹ÀÒ +ŸÔ·ÂÒ +ŸÔ·Ñ¡Éì +ŸÔà·Ÿ +ŸÔžÒ¹¡Ã +ŸÔ¹¹ÔÀÒ +ŸÔºÙÅÂì +ŸÔŸÑ²¹ì +ŸÔÀŸ +ŸÔÁŸìãš +ŸÔÁŸìª¹¡ +ŸÔÁŸì»ÃПÃó +ŸÔÁŸìŸÃ +ŸÔÁŸìÀóì +ŸÔÁŸìÀÑ€ +ŸÔÁŸìÇÔÁÅ +ŸÔÁÀÒ +ŸÔÁÅ +ŸÔÃÁÂì +ŸÔÃØ³ +ŸÔÈÔɰì +ŸÔÉ³Ø +ŸÔÊÁÑ +ŸÔÊÔ° +ŸÔÊÔ·žÔì +ŸÔÊÔɰì +ŸÕ.«Õ.àºÊ·ì €ÃÕàÍ· +ŸÕ.àÍÊ.šÕ ÅÔÊ«Ôè§ +ŸÕ.àÍÊ.ŸÅÒʵԡºÃÒàŽÍÃì á͹Žì«Ñ¹ +ŸÕ.àÍÊ.ŸÅÒʵԡºÃÒàŽÍÃìá͹Žì«Ñ¹ +ŸÕ¹Ô¡«ì àÍç¡«ìàŸÃÊ +ŸÕ¹Ô¡«ìàÍç¡«ìàŸÃÊ +ŸÕ÷ѵ +ŸÕßѲ¹ì +ŸÕÃÇØ²Ô +ŸÕÃÈÔÅ»ì +ŸÕÃÐ +ŸÕÃП§Èì +ŸÕÃПŠ+ŸÕÃÐÈÑ¡ŽÔì +ŸÙ¹ŸÑ¹žì +ŸÙ¹ÈÑ¡ŽÔì +ŸÙŷͧŸÃçÍŸàŸÍÃìµÕé_ +ŸÙŌŠ+àŸç§ ¿Ù ËÅÔ¹ +àŸçªÃì +àŸªÃÃѵ¹ì +àŸªÃÅŽÒ +àŸªÃÔ¹·Ãì +àŸçšÑ¹·Ãì +àŸç·ÔŸÂì +àŸç¹ÀÒ +àŸç»ÃÐÀÒ +àŸçŒ¡Ò +àŸçŸÔäÅ +àŸçÈÃÕ +àŸÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ŸÕ·ÕÍÕ ÅÔÁÔàµçŽ +àŸÅÔ¹šÔµµì +àŸÅÔ¹ÄŽÕ +àŸÕ§ŸÃ +៎ŽÔé§ (ä·ÂᏎì) +៎ŽÔé§(ä·ÂᏎì) +៹ŽéÒ à»à»ÍÃì €ÒÃìµÑ¹Ê +áŸÃÇ +áŸÃÇÒ +䟱ÙÃÂì +䟺ÙÅÂì +äŸÃÄ·žÔì +äŸÃʳ±ì +äŸÃÊÔ·žÔì +äŸÃѪ +äŸÃѵ¹ì +äŸÃÔ¹·Ãì +äŸàÃÒÐ +äŸâÚ¹ì +äŸÅÔ¹ +äŸÇÑÅÂì +äŸÈÒÅ +äŸÈÔÃÔ +äŸÊÔ° +¿ÅØÊÊÔ¡à€Á +¿Õ¹Ô¡«ì àÍç¡«ìàŸÃÊ +á¿Ã§€ì +á¿ÃìàÇÂì ÍÔ¹àµÍÃì๪Ñè¹á¹Å +ÀÃÒŽÃ +ÀÇÔ¹ +ÀÑ¡ŽÕ +ÀÑ€šÔÃÒ +Àѳ±ÔÃÒ +Àѷ÷ÔÃÒ +Àѷß§Èì +Àѷßà +Àѷߊ+ÀÑ·ÃÀà +ÀÑ·ÃÃѧÊÕ +ÀÑ·ÃÄŽÕ +ÀÑ·ÃÒÀóì +ÀÑ·ÃÔ¹·Ãì +ÀÑÊÅÔ¹ +ÀÑÊÇÃó +ÀÒ¡Ã +ÀÒ€ÀÙÁÔ +ÀÒ³Õ +ÀÒ³Ø +Àҳ؟Š+ÀÒ³ØÇÃó +ÀÒ¹ØÇѲ¹ì +ÀÒ¹ØÇѵà +ÀÒŸÃ +ÀÒÃŽÕ +ÀÒÇ¹Ò +ÀÒǟѹž¹ì +ÀÒÇÔ³Õ +ÀÒÇÔ¹ +ÀÒÇÔ¹Õ +ÀÒÉÔµÒ +ÀÔšÔµÃÒ +ÀÔŸÑ¡µÃì +ÀÔâ +ÀÔÃŽÕ +ÀÙàºÈ +ÀÙÁÔ°Ò¹ +ÀÙÃÔŸ§Èì +ÀÙÃÔÇÃò¡ì +ÀÙÉÔµ +Á¡Ãҹѹ·ì +Á§¡Ø®Ãѵ¹ì +Á§€Å +Á§€Å¡Òûѡ +Á³°ÔŽÒ +Á³±¹ì¡Òš¹ì +Á³±¹Ôš +Á³±ÅÕ +Á³±Ò +Á³à±ÕÂà +Á³ÕÃѵ¹ì +Á¹µìªÑ +Á¹µÃÕ +Á¹ÑÊ +Á¹ÑÊÇÕ +Á¹Ù +Áâ¹ +Á⹪ +ÁÂØÃÕ +ÁÅÄŽÕ +Áéǹáµé +ÁËÀÑ® +ÁËÒÃÒª +ÁÐÅÔÇÑÅÂì +Áѧ¡Ãä·ÂʵÕźÒÃì +Áѳ±¹Ò +ÁÑ·¹Ò +ÁÑÅÅÔ¡Ò +ÁÒªÍÃì¡ÇÒ¹ +ÁÒ³Õ +ÁÒ¹Ÿ +ÁҹР+ÁÒ¹ÔµÂì +ÁÒ⹪³ì +ÁÒâ¹· +ÁÒÃÔÉÒ +ÁÒÅÑ +ÁÒÅÔ¹Õ +ÁÒÅÕ +ÁÒÅÕÇÃó +ÁÔµ·ÔÃÒ +ÁÔÅàŹà¹ÕèÂÁ âÍ.àÍ 2000 +ÁÕŸÅ +ÁØ¢ +ÁØ·ÔµÒ +ÁÙËÐÁÐŽ×ÍàÃÐ +àÁàšÍÃìÍØµÊÒË¡ÃÃÁä·Â (1989) +àÁŽÔ€ÃÒ¿·ì +àÁµµÒ +àÁâ·ÃʻԹ¹Ôè§ +àÁžÒ +àÁžÒÇÕ +àÁžÔ¹Õ +àÁžÕ +àÁÉÂÒ +àÁÉÔ³Õ +àÁ×ͧ·Í§ +áÁ··ÕàÃÕÂÅ¡ÃØê» šÓ¡ÑŽ +áÁé¹Áҵà +äÁµÃÕ +Â§ÂØ·ž +Âè§àΧÇѲ¹Ò¡ÒßÔÁŸì +ÂÃç€ì +ÂÍŽàŸªÃ +Âѹ áÍÅ à€âÂÊ +ÂÔè§ÇÃó +ÂØ€ÅŸÃ +ÂØŽÒ +ÂØ·ž¹Ò +ÂØ·ž¹ÒÇÕ +ÂØ·žÂ§ +ÂØžÒÁÒµÂì +ÂØ¹â¡Ð +ÂØŸÒ +ÂØŸÒŸÃ +ÂØŸÒÇŽÕ +ÂØŸÔ¹ +ÂØÀÒŸÃ +ÂØÀÒÀóì +ÂØÇŽÕ +ÂØÇÃÕ +ÂÙ¹ÔÅÕàÇÍÃì ä·Â âÎÅŽÔé§Êì +ÂÙ¹ÔÅÕàÇÍÃìä·Â âÎÅŽÔé§Êì +ÂÙ¹Õ€ ÍÍÃì€ÔŽ +ÂÙà¹Õè¹á¡êÊá͹ŽìàÅÁÔ€ÑÅÊì +àÂ繚Եµì +àÂ繚Եà +àÂÒÇŽÕ +àÂÒÇŸÒ +àÂÒÇÀÒ +àÂÒÇàÃÈ +àÂÒÇÅѡɳì +âžԹ +Ã.µËÔ§ ŸÍãš +Ú¹Ò +óç€ì +ÃŽÒ +ùԮ°Ò +ß՟à +ß՟Ѳ¹ì +ßÕÀÑ·Ã +ÃÁÂìšÃÃÂì +Ãǧ·Í§ +ÃÈÑ¡ŽÔì +ÃÊÊØ€¹žì +ÃÍÂÑÅàÍ繚Ôà¹ÕÂÃÔè§ +ÃеÃÕ +ÃПԹ·Ãì +ÃП՟à +ÃП՟Ãó +ÃП՟Š+ÃÑ¡ŽÕ +ÃÑ¡ÈÑ¡ŽÔì +ÃÑ¡ÉÔµÀÑ·Ã +ÃѧÊÃÀì +ÃѧÊѹµì +ÃѧÊÔÁÒ +ÃѪà¡ÅéÒ +ÃѪ®Ò +ÃѪ®ÒŸÃ +ÃѪŽÒ +ÃѪ¹Õ +ÃѪ¹Õ¡Ã +ÃѪ¹ÕŸÃ +ÃѰŸ§Éì +ÃÑ°ÊØŽÒ +Ãѵ³Ò +ÃѵµªÑ +ÃѵµÔÂÒ +Ãѵ¹ªÑ +Ãѵ¹Àóì +Ãѵ¹Á³Õ +Ãѵ¹Ò +Ãѵ¹ÒŸÃ +Ãѵ¹ÒÀóì +ÃѵÔÂÒ +ÃѵÔÂÒÀóì +ÃÑÈÁÕ +ÃÑÈÁÕÀÑÊÊà +ÃҪѹÂì +ÃÒªÒÍÙªÔâ¹ +ÃÒહ +ÃÒ³Õ +ÃÒµÃÕ +ÃÒàÁÈÃì +ÃÒÂÕ¹ +Ã×è¹ÇÃÒËì +ÃØé§ +ÃØè§·ÔŸÂì +ÃØè§·ÔÇÒ +ÃØè§¹ÀÒ +ÃØè§àŸªÃ +ÃØè§ÃѪ¹Õ +ÃØè§Ãѵ¹ì +ÃØè§ÃÑÈÁÕ +ÃØè§àÃ×ͧ +ÃØè§âÚ¹ì +ÃØè§âڹ좹Êè§ +ÃØé§ÅÒÇÃó +ÃØè§ÇÔ·Âì +ÃØè§ÍÃØ³ +ÃØšÒ +ÃØšÒÀÒ +ÃØËÐ¹Ò +ÃÙàºÕÂÍØµÊÒË¡ÃÃÁ +àÃ¢Ò +àó٠+àßៀ à·ÃŽŽÔé§ +àßៀ€Í¹ÊµÃÑ€ªÑè¹ +àÃÇѵ +àÃÔ§·ÔÇÒ +àÃÔ§ÃÐÇÕ +àÃÔ§Ä·žÔì +àÃ×ͧÂÈ +áßៀ €Í¹ÊµÃÑ€ªÑè¹ +âç§Ò¹àËÅç¡¡ÃØ§à·ŸÏ +âÚ¹ì»ÃÐàÊÃÔ° +Ä·žÔì +Ä·žÔªÑ +ÅÅÔŽÒ +ÅÅÔµÒ +ÅÐÁèÍÁ +ÅÐÁÑ +ÅÐÍͧŽÒÇ +ÅÐàÍÕÂŽ +ÅÑ¡¢³Ò +ÅÑ¡É³Ò +ÅÑ¡ÉÁÕ +ÅѪ¹Ò +ÅÑŽŽÒ +ÅÑŽŽÒÇÃó +ÅÑŽŽÒÇÑÅÂì +ÅÑ·žÈÑ¡ŽÔì +ÅÒÇѳÂì +ÅÓäŸ +ÅÓä +ÅÔ¹ŽÒÇÃó +ÅÔÁ +ÅÔÅÒÀóì +Å×ͪÑ +àÅͪÑ +àÅÍÈÑ¡ŽÔì +àÅÍÊÃÀì +àÅÍÊØ¢ +àÅÔȪÑ +àÅÔÈÈÑ¡ŽÔì +àÅÔÈÊÒÁÒö âÂžÒ +âÅËСԚʵÕÅ +ǧàŽ×͹ +ǧÈì䟱ÙÃÂì¡Ãç» º +ǧÈì䟱ÙÃÂì¡ÃØê» +ǧÈì䟱ÙÃÂì¡ÃÙê» +ǧÈìÇÒµ +ǧÈìÊØÀÒ +ÇšÕÃѵ¹ì +ǪÔÃÒÀÒ +ǹѪŸÃ +ǹÑʹѹ·ì +Ç¹Ò +ǹԪ +Ç¹ÔŽÒ +ÇáÒà +ÇêÑ +ÇÃªÒµÔ +ÇÃŽÔɰì +ÇÃà·Ÿ +ÇÞѹÂì +Çùت +Çß§Éì +Çßš¹ì +Çߊ+ÇÃÁÅ +ÇÃÂØ·žì +ÇÃóšÔµ +ÇÃóªÑ +ÇÃó±¹Ò +ÇÃóŽÕ +ÇÃóìŽÕ +ÇÃó·¹Ò +ÇÃó·¹Õ +ÇÃóž³Õ +ÇÃóžÁÅ +ÇÃó¹ÀÒ +ÇÃó¹ÒÃÕ +ÇÃóŸÃ +ÇÃóŸÒ +ÇÃóàŸç +ÇÃóÀŸ +ÇÃóÀóì +ÇÃóÀÒ +ÇÃÃ³ÇŽÕ +ÇÃóÈÔÃÔ +ÇÃÃ³Ò +ÇÃÃ³Õ +ÇÃÞ¹Ò +ÇÃÃѪ +ÇÃÅѡɳì +ÇÃÇÃó +ÇÃÇÃÞ¹ì +ÇÃÇѲ¹ì +ÇÃÇÔÀÒ +ÇÃўà +ÇÃÒ +ÇÃÒ§€³Ò +ÇÃÒ§Ãѵ¹ì +ÇÃÒŸÃ +ÇÃÒÀóì +ÇÃÒÃѵ¹ì +ÇÃÒÅѡɳì +ÇÃÒÇØ²Ô +ÇÃÒÇØž +ÇÃÔ¹·Ãì +ÇÃÔ¹žÃ +ÇÃÔÁÒ +ÇÃÔÈÃÒ +ÇÃÕÇÃó +ÇÃØ³ +ÇÅÑŸà +ÇÈÔ³Ò +ÇÈÔ¹ +ÇÊѹµì +ÇÊØ +Çèͧ +ÇѪáà +ÇѪߊ+ÇѪÃÐ +ÇѪÃÑÒ +ÇѪÃÔ¹·Ãì +ÇѪÃÕ +ÇѲ¹Ð +ÇѲ¹Ò +Çѹà©ÅÔÁ +ÇѹªÑ +ÇѹªÒµÔ +ÇѹŽÕ +Çѹ·¹Ò +Çѹ·¹Õ +Çѹ·¹ÕÂì +ÇѹàŸç +ÇѹÃѪŽÒ +ÇѹÇÔÊÒ¢ì +ÇÑ¹Ê¶Ò +ÇÑÅÅÀ +ÇÑÅÅÀÒ +ÇÑÅÅÒÀÒ +ÇÑÈŸÅ +ÇÑʹÑ +ÇÒ³Õ +ÇÒ·Ôµ +ÇÒ·Ô¹ +ÇÒ·Ô¹ÕÂì +ÇÒÃÔª +ÇÒÃÕ +ÇÒÃØ³Õ +ÇÒÊ¹Ò +ÇÔ€µÍÃÕè âŸÃà¡Ã· +ÇÔ€Á +ÇÔšÒóì +ÇԚԵà +ÇÔšÔÃÒ +ÇÔªªÒ +ÇÔªÐÃØš +ÇԪѠ+ÇÔªÒ +ÇÔªÔµ +ÇÔªØŽÒ +ÇÔàªÉ° +ÇÔàªÕÂà +ÇÔØŽÒ +ÇÔ±ÙÅÂì +ÇÔ·žÇѪ +ÇÔ·ÂÒ +ÇÔ·ÇÑÊ +ÇÔ·Ùà +ÇÔ¹ÊÃÀì +ÇԹѠ+ÇÔ¹Ôš +ÇÔºÙÅÂì +ÇÔÀÒ +ÇÔÀҡóì +ÇÔÀÒ€ +ÇÔÀÒŸÃó +ÇÔÀÒÃѵ¹ì +ÇÔÀÒɳÕÂì +ÇÔÀÒÊ +ÇÔÀÙÉÔµ +ÇÔÁÅ +ÇÔÁÅŸÃ +ÇÔÁÅÇÃó +ÇÔÃÁÅ +ÇÔÃѪ +ÇÔÃѵ¹ì +ÇÔâÚ¹ì +ÇÔÅÇѳÂì +ÇÔÅÒÇÃó +ÇÔÅÒÇѳÂì +ÇÔÅÒÇÑÅÂì +ÇÔÅÒÊÔ¹Õ +ÇÔÅÔµ +ÇÔäÅ +ÇÔäÅŸÃ +ÇÔäÅÃѵ¹ì +ÇÔäÅÅѡɳì +ÇÔäÅÇÃó +ÇÔÇ +ÇÔÇÃÞ¹ì +ÇÔÇѲ¹ì +ÇÔÇѲ¹ìªÑ +ÇÔÈ¹Õ +ÇÔÈÃØµ +ÇÔÈÒÅ +ÇÔÈÔÉ®ì +ÇÔÈÔɰì +ÇÔÉÃØš¹ì +ÇÔÊÔ°ÈÑ¡ŽÔì +ÇÔÊÔ·žÔì +ÇÔÊØ·žÔ +ÇÔÊØ·žÔì +ÇÔÊÙµ +ÇÕ àÍÊ à¹à¹ÍÃÑÅ à€Á +ÇÕ«èÒ (2000) +ÇÕ³Ò +ÇÕ¹ÑÊ +ÇÕêÑ +ÇÕÃâªµÔ +ÇÕÃàŽª +ÇÕß§Èì +ÇÕߊ+ÇÕÃÂØ·Âì +ÇÕÃÇÃó +ÇÕÃÈÑ¡ŽÔì +ÇÕÃÊÔ·žÔì +ÇÕÃÐ +ÇÕÃЪÑ +ÇÕÃÐªÒµÔ +ÇÕÃЪÒ +ÇÕÃÐàŽª +ÇÕÃП§Éì +ÇÕÃПŠ+ÇÕÃÐÂØ·žì +ÇÕÃÐÇÃó +ÇÕÃÐÇѲ¹ì +ÇÕÃÐÈÑ¡ŽÔì +ÇÕÃÒÀóì +ÇØ²Ô¡Ã +ÇØ²ÔªÑ +ÇØ²Ô¹Ñ¹·ì +ÇØ²Ô¹Ñ +ÇØ²ÔŸ§Èì +ÇØ²ÔŸš¹ì +ÇØ²ÔŸÅ +ÇØ²ÔÃѵ¹ì +àÇèÂà©Ô¹ÍÔ¹ŽÑÊàµÃÕ¹ +àÇÍÃìâ¡é ·ÃҹʻÍÃìµ +áÇÇÇŽÕ +áÇÇÇÔÀÒ +äÇ·Ô¹ +È¡ÅÇÃó +ÈšÕ +ÈÁÅÇÃó +ÈÂÒÁÅ +ÈêÑ +ÈÃÇÑÅÂì +ÈÃÑÒ +ÈÃѳŸÃ +ÈÃѳÂì +ÈÃÒÁÒÈ +ÈÃÒÇØ²Ô +ÈÃÒÇØž +ÈÃÔ¹·Ãì +ÈÃ՚ѹ·Ãì +ÈÃ՚ѹ·ÃÒ +ÈÃշͧà¹ÁàŸÅ· +ÈÃÕ·Í§ÍØµÊÒË¡ÃÃÁ«ÑŸŸÅÒ +ÈÃÕ¹ÇÅ +ÈÃÕ»ÃÐäŸ +ÈÃÕ»ÃÐÀÒ +ÈÃÕŸ§Éì +ÈÃÕàŸç +ÈÃÕÀÒ +ÈÃÕÃѵ¹ì +ÈÃÕÇÑš¹Ò +ÈÃÕÇѲ¹Ò +ÈÃÕÇÔ¡Ò +ÈÃÕÈÑ¡ŽÔì +ÈÃÕÊ¡ØÅ +ÈÃÕÊÁà +ÈÃÕÊÁà +ÈÃÕÊÁà +ÈÃÕÊØÇÃó€Í¹àÇàÂÍÃìàºÅ·ì á͹Žì ÃѺàºÍÃì +ÈÃÕ͹§€ì +ÈÃÕÍÓŸÅÍØµÊÒË¡ÃÃÁ +ÈÅÔÉÒ +ÈÈÁÅ +ÈÈÔ +ÈÈԞà +ÈÈÔŸÃ +ÈÈÔÀÒ +ÈÈÔÁÒ +ÈÈÔÇÔÁÅ +ÈÈÔÉÒ +ÈÑ¡ŽÒ +ÈÑ¡ŽÔì +ÈÑ¡ŽÔìªÑ +ÈÑ¡ŽÔìàªÇ§ +ÈÑ¡ŽÔìŽÒ +ÈÑ¡ŽÔìÇÔºÙÅÂì +ÈÑ¡ÃÔ¹·Ãì +ÈѹʹÕÂì +ÈÒ¹µÔᏎì +ÈÔÁÒÃÕ +ÈÔÃÉÒ +ÈÔÃÒŸÃ +ÈÔÃÔ +ÈÔÃÔ¡ØÅ +ÈÔÃԚѹ·Ãì +ÈÔÃÔâ©Á +ÈÔÃԪѠ+ÈÔÃÔ·Ñȹì +ÈÔÃԞà +ÈÔÃÔ¹Ò +ÈÔÃÔ¹Òö +ÈÔÃԹت +ÈÔÃÔŸ§Éì +ÈÔÃÔŸÃ +ÈÔÃÔŸÃó +ÈÔÃÔàŸç +ÈÔÃÔÁÒ +ÈÔÃÔÃÑš¹ì +ÈÔÃÔÃѵ¹ì +ÈÔÃÔÅѡɳì +ÈÔÃÔÇÃó +ÈÔÃÔÇѲ¹ì +ÈÔÃÔÈÑ¡ŽÔì +ÈÔâÚ¹ì +ÈÔÅ»ªÑ +ÈÔÅÒ +ÈÔÇŸÃ +ÈÔÇŸÅ +ÈÔÇÒŸÃ +ÈÔÇÒÀóì +ÈØÀ¡Ã +ÈØÀ¡Ôš +ÈØÀªÑ +ÈØÀŸÃ +ÈØÀÁԵà +ÈØÀà +ÈØÀÃѵ¹ì +ÈØÀÃÒÀóì +ÈØÀÅѡɳì +ÈØÀÇѲ¹ì +ÈØÀÇÔ·Âì +ÈØÀÈÑ¡ŽÔì +ÈØÀÔÊÃÒ +àÈÃɰžÃ +àÈÃɰŸ§Éì +âÈÃŽÒ +ÉØÀÁ¹ +Ê ÍÒŽ +Ê.͹ѹµìàÍ繚Ôà¹ÕÂÃÔè§ á͹€Í¹ÊµÃÑ€ªÑè¹ +Ê¡ÅÃѵ¹ì +Ê¡ÒÇÃѵ¹ì +ʧ¡Ã³ì +ʧ¡ÃÒ¹µì +ʧǹ +Êè§ÈÃÕ +Êè§àÊÃÔÁ +ʧю +ʧèÒ +ʎѺŸÔ³ +Êáµ¹ŽÒÃìŽ ªÒÃìàµÍÃì (»ÃÐà·Èä·Â) +ʶҟà +ʶÔÃÂÒ +ʹ㚠+ʹ·ÂÒ +ʹžŸ +ʹžÂÒ +ʹͧ +ʹÑè¹ +Ê¹ÔŽÒ +Êà»ç€ àŽç¹ µÑÅ áź +Ê໫€ÍÁ +ÊÁ +ÊÁ¡ÁÅ +ÊÁà¡ÕÂÃµÔ +ÊÁ€Çà +ÊÁ€ÔŽ +ÊÁšÔµ +ÊÁšÔµµì +ÊÁšÔµÃ +ÊÁšÔµÃì +ÊÁšÔ¹µ¹Ò +ÊÁãš +ÊÁªÑ +ÊÁªÒ +ÊÁªÒµÔ +ÊÁªÒ +ÊÁ⪀ +ÊÁŽÕ +ÊÁàŽª +ÊÁ·Ã§ +ÊÁ¹Ö¡ +ÊÁºÑµÔ +ÊÁºØ +ÊÁºÙóì +ÊÁ»Í§ +ÊÁŸ§Éì +ÊÁŸš¹ì +ÊÁŸÃ +ÊÁŸÅ +ÊÁŸÔÈ +ÊÁÀŸ +ÊÁâÀª¹ì +ÊÁÁÒö +ÊÁÁÒȹì +ÊÁâÁ· +ÊÁÂÈ +ÊÁà +ÊÁÃÑ¡Éì +ÊÁÄŽÕ +ÊÁÄ·žÔì +ÊÁÄ·Ñ +ÊÁÅѡɳì +ÊÁǧÉì +ÊÁÈÃÕ +ÊÁÈÑ¡ŽÔì +ÊÁÈÔÃÔ +ÊÁÊØ¢ +ÊÁÊØ¹ÕÂì +ÊÁËÔ§ +ÊÁËÁÒ +ÊÁËÇѧ +ÊÁÑ +ÊÁÒ¹ +ÊÁÔ·žÔ +ÊÁÔ·žÔì +ÊÁتªÅ +ÊÂÒÁ +ÊÂÒÁ€Í¹àÇàÂÍÃì +ÊÂÒÁªÑÂâŸÅÕàÁÍÃì +ÊÂÒÁäŽà€ÕÂÇ +ÊÂÒÁ¹ÔÊÊѹ ÍÍâµéâÁºÔÅ +ÊÂÒÁŸÃà·ÃŽà«ç¹àµÍÃì +ÊÂÒÁàÁŠÕâŸÅÕàÁÍÃì +ÊÂÒÁÂÙ¹Ôâ«Å +ÊÂØÁŸÃ +ÊÃÃàÊÃÔ° +ÊÃÑÒ +ÊÃÒ¡Ã +ÊÃÒšÔµ +ÊÃÒÂØž +ÊÃÒÇØ²Ô +ÊÃÒÇØž +ÊÃÔ¹ÃÒ +ÊÃØš +ÊÅÑ¡šÔµÃ +ÊàÅ€·ì¿ÍÃìÁà¿ÍÃì¹ÔàšÍÃìáÅкصà +ÊÇÅѡɳì +ÊÇÑÊŽÔì +ÊÇÕâÚ¹ì +ÊÇÕÇÃó +ÊÊԟѹžØì +ÊËà¡ÕÂõÔâÅËÐà¡ÕÂÃµÔ +ÊËŸÅ +ÊÍÒŽ +Êзé͹ +ÊѧÇÒÅÂì +ÊÑšŸ§Éì +ÊѪ¹Ò +ÊѪÑ +ÊÑÒ +ÊѹµÔ +ÊѹµÔªÑ +ÊÑÁŸÑ¹žì +ÊÑÁÄ·žÔì +ÊҀà +ÊÒžÔµ +ÊÒ¹ÔµÂì +ÊÒÁÀŸ +ÊÒÁÒö +ÊÒÂãš +ÊÒªŠ+ÊÒ¹·Õ +ÊÒœ¹ +ÊÒÂä¿¿éÒä·Â-ÂÒ«Ò¡Ô +ÊÒ¹µì +ÊÒÂÅÁ +ÊÒÂÊÁà +ÊÒÂÊØ³Õ +ÊÒÂÊØ¹ÕÂì +ÊÒÂѳ +ÊÒÂѳËì +ÊÒâÚ¹ì +ÊÒâê +ÊÒÅÕ +ÊÒÅÕè +ÊÒÇÔµÃÕ +Êӹѡ¹âºÒÂáÅÐጹ¡ÃاෟÁËÒ¹€Ã +ÊÓà¹Õ§ +ÊÓÃÇÁ +ÊÓÃÇ +ÊÓÃÒ +ÊÓÄ·žÔì +ÊÓÅÕ +ÊÔ§Ëì +ÊÔ§ËìŸÅ +ÊÔ§ËÒ +ÊԵҹѹ +ÊÔµÒŸÃ +ÊÔ·žÒ +ÊÔ·žÔì +ÊÔ·žÔªÑ +ÊÔ·žÔàŽª +ÊÔ·žÔŸÃ +ÊÔ·žÔŸÃó +ÊÔ·žÔŸÅ +ÊÔ¹·ÇÕ +ÊÔÃԪѠ+ÊÔÃÔàŽª +ÊÔÃÔ¹ŸÃ +ÊÔÃÔ¹Ãѵ¹ì +ÊÔÃÔ»ÃÐÀÒ +ÊÔÃÔŸ§Éì +ÊÔÃÔŸÃ +ÊÔÃÔŸÃó +ÊÔÃԟѹžì +ÊÔÃÔÁÒ +ÊÔÃÔÃѵ¹ì +ÊÔÃÔÅѡɳì +ÊÔÃÔÇÃó +ÊÔÃÔÇѲ¡ì +ÊÔÃÔÇѲ¹Ò +ÊÔâÚ¹ì +ÊÔÇÅÕ +ÊÕ¹ÇÅ +ÊÕÇÔ¡Ò +ÊØ¡ÃÕ +ÊØ¡ÑÒ +ÊØ¡Ò¹ŽÒ +ÊØ¡Ôš +ÊØ¡ÔµÔì +ÊØ¡ÕµÔì +ÊØ¡ØÁÒ +ÊØ¢ +ÊØ¢ªÒ +ÊØ¢ÄŽÕ +ÊØ¢ÊÇÑÊŽÔì¡Å¡Òà +ÊØ¢Êѹµì +ÊØ¢ØÁ +ÊØ€¹žì +ÊØ€¹žÒ +ÊØšÒÃÕ +ÊØšÔµ +ÊØšÔµµÒ +ÊØšÔµÃÒ +ÊØšÔ¹ŽÒ +ÊØšÔ¹µì +ÊØšÔ¹µ¹ì +ÊØªÅ +ÊØªÑ +ÊØªÒŽÒ +ÊØªÒµÔ +ÊØªÒ +ÊØªÒÊÔ¹Õ +ÊØªÔµ +ÊØªÔ¹ +ÊØ±ÒÁÒÈ +ÊØ³Õ +ÊØŽÊ§Ç¹ +ÊØŽÊÇÒ· +ÊØŽÒ +ÊØŽÒªÅÕ +ÊØŽÒŸÃ +ÊØŽÒÀÒ +ÊØŽÒÃѵ¹ì +ÊØŽÒÃÒ +ÊØŽÕàŸé¹·ìà«ç¹àµÍÃì +ÊØ·žÒ·ÔŸÂì +ÊØ·žÔ¡Òš +ÊØ·žÔªÑ +ÊØ·žÔ¹Ñ¹·ì +ÊØ·žÔ¹Õ +ÊØ·žÔ쟧Éì +ÊØ·žÔŸÃó +ÊØ·žÔÇѲ¹ì +ÊØ·žÔÈÑ¡ŽÔì +ÊØ·ÃÕ +ÊØ·ÑÈ +ÊØ·Ñȹì +ÊØ·ÔµÂì +ÊØ·Ô¹ +ÊØ·ÔŸÒ +ÊØ·ÔÈÒ +ÊØà·Ÿ +ÊØžÒ·ÔŸÂì +ÊØžÒ¹ÔžÔ +ÊØžÔŽÒ +ÊØžÔÈÑ¡ŽÔì +ÊØžÕ +ÊØžÕÃì +ÊØžÕÃÒ +ÊØ¹·Ã +ÊØ¹·ÃÕ +ÊØ¹Ñ··Õ +ÊØ¹Ñ¹·ì +ÊØ¹Ñ¹·Ò +ÊØ¹ÔµÒ +ÊØ¹ÔÈÒ +ÊØ¹ÔÉÒ +ÊØ¹ÔÊÒ +ÊØ¹ÕÂì +ÊØà¹µÃ +ÊØ»ÃÐŽÔɰì +ÊØ»ÃÐÇÕ³ì +ÊØ»ÃÒ³Õ +ÊØ»ÃÕÂÒ +ÊØ»ÃÕÃÐŽÒ +ÊØ»ÑÒ +ÊØŸš¹ì +ÊØŸšÁÒÅÂì +ÊØŸÃ +ÊØŸÃÃ³Õ +ÊØŸÃÃÉÒ +ÊØŸÅ +ÊØŸÑ²¹ì +ÊØŸÑµÃÒ +ÊØŸÔªìªÒ +ÊØŸÔ¹ +ÊØŸÔÈ +ÊØŸÕÃìªÑ +ÊØÀ¡Ôš +ÊØÀªÒ +ÊØÀ⪀ +ÊØÀÁÒÊ +ÊØÀÑ€ +ÊØÀѵÃÒ +ÊØÀÑ·ÃÒ +ÊØÀÒ +ÊØÀÒ³Õ +ÊØÀÒŸ +ÊØÀÒŸÃ +ÊØÀÒŸÃó +ÊØÀÒÀóì +ÊØÀÒÃŽÕ +ÊØÀÒÇŽÕ +ÊØÀÔÒ +ÊØÁ¹µì +ÊØÁ¹Ò +ÊØÁÒÅÕ +ÊØÁÒÊÕ +ÊØÁԵà +ÊØÁÔµÃÒ +ÊØàÁž +ÊØàÁžÕ¡ì +ÊØÃ¡Ôš +ÊØÃªÑ +ÊØÃªÒµÔ +ÊØÃàªÉ°ì +ÊØÃàŽª +ÊØÃ·Ô¹ +ÊØÃŸ§Éì +ÊØÃŸÅ +ÊØÃŸÑ¹žì +ÊØÃŸÑ¹žØì +ÊØÃÈÑ¡ŽÔì +ÊØÃÊÔ·žÔì +ÊØÃѪ¹Õ¡Ã +ÊØÃѵ¹ì +ÊØÃѵ¹ÇŽÕ +ÊØÃѵ¹ìÇŽÕ +ÊØÃѵ¹Ò +ÊØÃѵÂÒ +ÊØÃÒ§€¹Ò +ÊØÃԪѠ+ÊØÃÔ¹·Ãì +ÊØÃÔ§Èì +ÊØÃÔ¹ +ÊØÃÔ¹µì +ÊØÃÔŸ§Èì +ÊØÃÔÂѹ +ÊØÃÔÂѹµì +ÊØÃÔÂÒ +ÊØÃÕžÒŸÃ +ÊØÃÕŸÃ +ÊØÃÕÁÒÈ +ÊØÃÕÂì +ÊØÃÕÂìŸÃ +ÊØÃÕÃѵ¹ì +ÊØÅÑŽŽÒ +ÊØÇÀÑ·Ãì +ÊØÇÃó +ÊØÇÃóªÑ +ÊØÇÃÃ³Ò +ÊØÇÃÃ³Õ +ÊØÇÃóÕÂì +ÊØÇÃѵ¹ì +ÊØÇѲ¹ì +ÊØÇѲ¹ìªÑ +ÊØÇѲ¹Ò +ÊØÇѵªÑ +ÊØÇÒÃÕ +ÊØÇԪѠ+ÊØÇÔªÒ +ÊØÇÔŽÒ +ÊØÇÔ·Âì +ÊØÇÔÁÅ +ÊØÇÔÃѪ +ÊØÊÔÃÔ +ÊØËÑÊªÒ +àÊ¡ÊÃà +àÊ¡ÊÃÀì +àʶÕÂà +àʹËì +àʹÕÂì +àÊÁÒ +àÊÃÔÁäªÂ€éÒ¡ÃÐŽÒÉ +àÊÃÔÁÈÑ¡ŽÔì +àÊÃÕ +àÊÇ +àÊÒÇ€¹žì +àÊÒÇ³Õ +àÊÒdzÕÂì +àÊÒǹԵÂì +àÊÒǹÕÂì +àÊÒÇÅѡɳì +áʧªÑ +áʧàŽ×͹ +áʧ·Í§ +áʧÃÐÇÕ +áʹ·ÇÕà·ç¡«ìä·Åì +áʹÀŸ +áʹÂÒ¡Ã +áʹÃÑ¡ +áÊ¹ÊØ¢ +áÊǧ +âÊÀ³ +âÊÀÒ +âÊÀÒŸš¹Õ +âÊÀÒŸÃó +âÊÀÕ +âÊÚԵ +âÊÃŽÒ +âÊÃÊ +âÊÃÑš +âÊÌÊ +˧ +Ë·Ñ +Ë·Ñ·ԟÂì +Ë·ÑÂÃѵ¹ì +˹Öè§Ä·Ñ +ËÃÔ¹ +ËÄ·Â +ËÇÒ¹ +ËÍÁšÑ¹·Ãì +ËÑÊ¹Õ +ËÑÊÂÒ +àËÁÇŽÕ +àËÁ×͹¢ÇÑ +àËÁ×͹Ÿ¹Í +àËÃÕ +áËÅÁ·Í§ÊË¡Òà +Í.àšÃÔÎÒÃìŽáÇÃì +ͧÍÒš +Íâ³·ÂÒ +ÍŽÔàá +ÍŽÔÈà +ÍŽÔÈÑ¡ŽÔì +ÍŽØÅ +ÍŽØÅŸÑ²¹ì +ÍŽØÅÂìàŽª +͵Թت +͵ԟà +Í¶ÔªÒ +ÍžÔ»ŸÅ +͹§€ì¹Ò® +͹§€ìÇÃó +͹¹·ì +͹ÇѪ +͹ÑÒ +͹ѹµì +͹ѹµÈÑ¡ŽÔì +Í¹Ø¡ÔµÔ +͹ءÙÅ +Í¹ØªÒ +͹تԵ +Í¹ØŽÒ +͹صµÃÒ +͹صà +Í¹Ø·ÔµÒ +͹؟§Èì +͹؟§Éì +͹؟à +͹؟ѹžì +͹ØÃÑ¡Éì +͹ØÃѵ¹ì +͹ØÃÑÉì +͹ØÇѲ¹ì +͹ØÈÑ¡ŽÔì +͹ØÊóì +Íâ¹ªÒ +ÍÀѹµÃÕÊì +ÍÀԪѠ+ÍÀÔªÒ µÔ +ÍÀÔªÒµ +ÍÀÔªÒµÔ +ÍÀÔવ +ÍÀÔÒ +ÍÀÔàŽª +ÍÀԹѹ·ì +ÍÀÔÀÒŽÒ +ÍÀÔÃŽÕ +ÍÀÔÃÑ¡Éì +ÍÀÔÇѲ¹ì +ÍÀÔÇѹ·ì +ÍÀÔÈÑ¡ŽÔì +ÍÀÔÊà +ÍÀÔÊÔ·žÔì +ÍÁêÑ +ÍÁÃà·Ÿ +ÍÁÃÃѵ¹ì +ÍÁÃÈÑ¡ŽÔì +ÍÁÃÊÔÃÔ +ÍÁÃÒÅѡɳì +ÍÁÔµÒ +ÍÁÔ¹µÒ +ÍÂØžÂѹ +ÍÚÔÃÒ +Íêà +ÍêسËì +ÍóѪì +Í÷Ñ +ÍÃ·ÔªÒ +ÍùԵÂì +Íùت +ÍÃ๵à +ÍßÃó +ÍßԹ +ÍßԹ·Ãì +ÍÃÀÑ·Ãì +ÍÃÊÂì +ÍÃóŸ +ÍÃöŸ¹žì +ÍÃöŸÃ +ÍÃöŸÅ +ÍÃöÊÔ·žÔì +ÍÃÄŽÕ +ÍÃÇÃó +ÍÃÇÔ· ÍÔ¹àµÍÃì๪Ñè¹á¹Å +ÍÃÈÁ +ÍÃÈÃÕ +ÍÃÊÒ +ÍÃ͹§€ì +ÍÃÍØÁÒ +ÍÃÑ +ÍÃÑÒ +ÍÃèÒÁÈÃÕ +ÍÃԪѠ+ÍÃÔ¹ª¹Ò +ÍÃÔ¹·ÁÒ +ÍÃÔÂÒ +ÍÃÔÂÒÀóì +ÍÃÔÈÃÒ +ÍÃÔÊÃÒ +ÍÃÔÊÒ +ÍÃØ³ +ÍÃØ³Ãѵ¹ì +ÍÃØ³ÃØè§ +ÍÃØ³ÈÃÕ +ÍÃØ³Õ +Íŧ¡µ +Íŧ¡Ã³ì +ÍǪѠ+ÍÍ€µéÒ àÁÁâÁàÃÕÂÅ +ÍÍ€µéÒàÁÁâÁàÃÕÂÅ +ÍÍâµàÁªÑè¹à«ÍÃìÇÔÊ +ÍéÍ·ԟÂì +ÍÍÊ·ì ÍÍÂÊì +ÍЀÙà·ç€·ì +ÍÐÅÒ¹ +ÍÑ€ÃàŽª +Íрß¹žì +Íрßњ¹ì +ÍÑ€ÃÇÔ·Âì +ÍÑ€ÃÇÔ¹·ì +ÍÑ€ÃÒ +ÍÑ§Ê¹Ò +ÍÑš©ÃÒ +ÍѪÂÒ +ÍѪ³ÒŸÃ +ÍѪŽÒ +ÍѪ¹Ò +ÍѪÅÕ +ÍѪØÅÕ +ÍÑ®ÉÁÒ +ÍѹÊÃÕÂì +ÍÑ»Êà +ÍÑÁŸÃ +ÍÑÁŸÃó +ÍÑÁäŸÇÃó +ÍÒ€Á +ÍÒš³Ã§€ì +ÍÒ«ÒÎÕ-ä·Â ÍÑÅÅÍ +ÍҳѹÂì +ÍÒ·Ô¡Ã +ÍÒ·Ôµ +ÍÒ¹¹·ì +ÍÒ¹Ÿ +Íҹю +ÍҹѹµÂÒ +ÍÒ¹ØÀÒŸ +ÍÒÀóì +ÍÒÀÒ +ÍÒÀÒ¡Ã +ÍÒÀÒ³Õ +ÍÒÀÒŸÃ +ÍÒÀÒÀóì +ÍéÒÂÍÔé§ +ÍÒÃì«Õ ¹ÔµáÇÃì +ÍÒÃì«Ø»à»ÍÃì⫹ԀŸÔ€ÍÑŸÊì +ÍÒÃÁ³ì +ÍÒÃÂѹ +ÍÒÃÂÒ +ÍÒÃÑ¡Éì +ÍÒÃÒŸÃ +ÍÒÃÔÂÒ +ÍÒÃÕ +ÍÒÃÕÂì +ÍÒÃÕÂì àÊÁÒ©ÔÁ (ä·Âູ¡Ñ¹ +ÍÒÃÕÃѵ¹ì +ÍÒÃÕÇÃó +ÍӹǠ+ÍÓ¹Òš +ÍÓŸÃ +ÍÓŸÃó +ÍÓŸÅ +Íӟѹžì +ÍÓäŸ +ÍÓÀÒ +ÍÔê¡«èÒ ÍÔ¹àµÍÃì๪Ñè¹á¹Åàš¹à¹ÃÑÅ à«ÅÅì +ÍÔ§Ë·Ñ +ÍÔ·žÔŸÅ +ÍԹ䫷ìà€Á +ÍÔ¹àµÍÃìàÇç·(»ÃÐà·Èä·Â) +ÍÔ¹·ÔÃÒ +ÍÔŸ +ÍÔÁâ¡éáŸç€ €ÍÃì»ÍÃìàêÑè¹ +ÍÔÈÃÒ +ÍÕ·Õ«Õ +ÍØè§á€Ð +ÍØ³ÒÇŽÕ +ÍØŽÁ +ÍØŽÁŸ§Èì +ÍØŽÁŸÃ +ÍØŽÁŸÑ¹žì +ÍØŽÁàÁŽÔ€ÍÅ ÍÔ€ÇÔ»àÁé¹ +ÍØŽÁÅѡɳì +ÍØŽÁÇßѹžì +ÍØŽÁÈÑ¡ŽÔì +ÍØŽÃ +ÍØµâÁ·Âì +ÍØµÊÒË¡ÃÃÁŒéÒà€Å×ͺŸÅÒʵԡä·Â +ÍØ·Ñ +ÍØ·ÑÂÇÃó +ÍØ·ØÁŸÃ +ÍØà·¹·Ãì +ÍØè¹ãš +ÍØºÅ +ÍØºÅŸÃó +ÍØºÅÇÃó +ÍØÁÒ +ÍØÁÒŸÃ +ÍØÃÕÂì +ÍØäà +ÍØäßà +ÍØäÃÃѵ¹ì +ÍØäÃÇÃó +ÍØÉ³Õ +ÍØÉÒ +ÍØÊÒËì +ÍØÌÒà +àÍ.àš.ŸÅÒÊ·ì +àÍ¡ªÑ +àÍç¡«Õà«ÅàŹ¿ÍÃìÁ +àÍ¡ÃÒª +àÍ¡ÃÔ¹·Ãì +àÍ¡ÊÔ·žÔì +à͡͹ѹµì +àÍ¡ÍÃö +àÍçª àÍçÁ «Õ â»ÅÕàÁÍÃì +àÍçª.àÍçÁ.«Õ.â»ÅÔàÁÍÃì +àÍçª.àÍçÁ.«Õ.â»ÅÕàÁÍÃì (ºš¡.) +àÍàªÕÂàÊÃÔÁ¡ÔšÅÔÊ«Ôè§ +àÍç¹ ŽÕ à€ (»ÃÐà·Èä·Â) +àÍ¿ ÍÕ «Ô€ÅÔ€ (¡Ãاෟ) +àÍçÁ .«Õ.ŸÕÅÔÊ«Ôè§ +àÍçÁ «Õ ÍÐâ¡Ãà€ÁÕ€ÍÅ +àÍçÁ.«Õ.ŸÕ. ÅÔÊ«Ôè§ +àÍçÁ.àÍçÁ.«Õ.â»ÅÔàÁÍÃì +àÍçÁ«ÕÊÂÒÁ âÅšÕʵԀÊì +àÍÊ àš ŸÅÒÊ·ì á͹Žì ៀ +àÍÊ ŸÕ Ê᡹ +àÍÊ àÍÊ à€ ¡Å¡Òà +àÍÊ.à€.ÍÕ. +àÍÊ.«Õ.ŸÕ.ៀ +àÍÊ.ŸÕ.¹ÔµµÔé§ +àÍÊ.àÍçÁ.ÇÕ ÊË¡Òà +àÍÊ.àÍÊ.à€ ¡Å¡Òà +àÍÊ.àÍÊ.à€.¡Å¡Òà +àÍÊ.àÍÊ.ÍÔ¹¡Íµ ÍÅÙÁÔà¹ÕÂÁ1999 +àÍÊÇÕ¹Ô··Ñ¹ŸÃÔ«ÔªÑè¹ +àÍ×é͟ѹžØì +àÍ×éÍÁŸÃ +àÍ×éÍÍÒÃÕ +á͹¹Ò +á͹¹ÒÃÕ +áͺºÕà€ÃÊ·ì(»ÃÐà·Èä·Â) +áÍÃì«Õ à¿Ã· ¿ÍÃìàÇÔŽàµÍÃì +áÍÃìŸÕàŸÔÅÍÔ¹àµÍÃì๪Ñè¹á¹Å +áÍÅ¿èÒ â»Ãà«Ê«Ôè§ +áÍÊષŸÅÑÊ +âÍàÃÕÂÅ·ÍÅ ¿ØéŽ +âÍÇÍÐËÅÑèŸÒÃì·à«ç¹àµÍÃì +äÍ.«Õ.«Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å (ÁËÒª¹) +äÍ.·Õ.áÍŽìÇÒ¹« à·€ šÓ¡ÑŽ +äÍ.·Õ.á͹ŽìÇÒ¹« à·€ šÓ¡ÑŽ +äÍ.àÍÊ.äÍ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å +äÍÂàÃÈ +ÎÍÊ·ì ÍÍÂÅì +ÎÙàÇÍÃìÍØµÊÒË¡ÃÃÁ(»ÃÐà·Èä·Â) +àΧàšÃԪѠ¡ÃØê» ÍÔ¹ŽÑÊàµÃÕÂÅ +DROP TABLE t1; +SELECT 'a' = 'a '; +'a' = 'a ' +1 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +1 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +1 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +CREATE TABLE t1 (a char(10) not null); +INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); +SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; +hex(a) STRCMP(a,'a') STRCMP(a,'a ') +61 0 0 +6100 -1 -1 +6109 -1 -1 +61 0 0 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result new file mode 100644 index 00000000000..94fe15fed26 --- /dev/null +++ b/mysql-test/r/ctype_uca.result @@ -0,0 +1,1874 @@ +DROP TABLE IF EXISTS t1; +set names utf8; +create table t1 (c1 char(10) character set utf8 collate utf8_bin); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,à ,â,ã,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,á +Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ã,ð +Ä,Ä +Æ +Æ +Æ,Æ +E,e,Ã,Ã,Ã,Ú,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Ã,é +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,ì,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Ã,à +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,ò,ÃŽ,õ,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,ó +ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,ù,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Ã,ú +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,ÿ,Ŷ,Å·,Åž +Ã,Ü +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ã,ß +Ã,Ã,À,Ê +Ã,Ã,ö,Þ +Ã
,Ã¥ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Ä,Ä +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,ÇŠ,ǧ,ÇŽ,ǵ +Ä¢,Ä£ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Y,y +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Çš,Ç© +Ķ,Ä· +Æ,Æ +L,l,Ĺ,ĺ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Ä»,ÄŒ +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Å
,Å +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å +RR,Rr,rR,rr +Å,Å +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å¿ +SS,Ss,sS,ss,à +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ +Æ +Åœ,ÅŸ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã
,à ,á,ã,À,Ã¥,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä,Ä +Ã,â +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,ì,Ã,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Ã,î +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Å,Å +Æ© +ƪ +T,t,Å€,Å¥ +ÆŸ +Å¢,Å£ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Ä,Ä +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å¿ +SS,Ss,sS,ss,à +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ +Æ +Åœ,ÅŸ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä,Ä
+Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Ä,Ä +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Å,Å +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,ò,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,ó +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Å,Å +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Åœ,ÅŸ +Æ +Ź,ź +Å»,ÅŒ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz +Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,ò,ó,ÃŽ,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å¿ +SS,Ss,sS,ss,à +Å ,Å¡ +Z,z +Åœ,ÅŸ +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,ù,ú,û,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +Ã,õ +Ã,À +Ã,ö +Ã,ÃŒ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Ź,ź,Å»,ÅŒ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Ã,ñ +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,à ,á,â,ã,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,ù,ú,û,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ã,ÃŒ,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ã
,Ã¥ +Ã,Ã,À,Ê +Ã,Ã,ö,Þ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Ã,ç +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ä,Ä +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +I,ı +IJ,Ij +Æ,Ƕ +ÄŠ,ħ +i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +iJ,ij,IJ,ij +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,ö +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Å,Å +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,ù,ú,û,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Ã,ÃŒ +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä +cH +Ä,Ä +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +CH,Ch,ch +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å +RR,Rr,rR,rr +Å,Å +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å¿ +SS,Ss,sS,ss,à +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ +Æ +Åœ,ÅŸ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,à ,á,â,ã,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +aA +Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,ù,ú,û,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ã,ÃŒ,Ü,ÿ,Ű,ű,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ã,Ã,À,Ê +Ã,Ã,ö,Þ,Å,Å +AA,Aa,aa,Ã
,Ã¥ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,CH,Ch,c,ch,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä +cH +Ä,Ä +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,Y,i,y,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å¿ +SS,Ss,sS,ss,à +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ +Æ +Åœ,ÅŸ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,À +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä +cH +Ä,Ä +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +CH,Ch,ch +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,ò,ó,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,ÃŽ +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å¿ +SS,Ss,sS,ss,à +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ +Æ +Åœ,ÅŸ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +cH +CH,Ch,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,i,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ +Æ +J,j,ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj,Ç,Ç,Ç +lL +LL,Ll,ll +Å,Å +Æ +Æ +M,m +N,n,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj,Ç,Ç,Ç +Ã,ñ +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,RR,Rr,r,rr,Å,Å,Å,Å,Å,Å +rR +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +V,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; +group_concat(c1 order by c1) +÷ +à +A,a,Ã,Ã,Ã,Ã,Ã,Ã
,à ,á,â,ã,À,Ã¥,Ä,Ä,Ä,Ä,Ä,Ä
,Ç,Ç,Ç,Ç,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,Ê,Ç¢,Ç£,ÇŒ,Çœ +B,b +Æ +Æ +Æ,Æ +C,c,Ã,ç,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +CH,Ch,cH,ch +Æ,Æ +D,d,Ä,Ä +DZ,Dz,dZ,dz,Ç,Ç
,Ç,DZ,Dz,dz +Ä,Ä +Æ +Æ +Æ,Æ +Ã,ð +E,e,Ã,Ã,Ã,Ã,Ú,é,ê,ë,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä,Ä +Æ,Ç +Æ +Æ +F,f +Æ,Æ +G,g,Ä,Ä,Ä,Ä,Ä ,Ä¡,Ä¢,Ä£,ÇŠ,ǧ,ÇŽ,ǵ +Ç€,Ç¥ +Æ +Æ +Æ¢,Æ£ +H,h,Ä€,Ä¥ +Æ,Ƕ +ÄŠ,ħ +I,J,i,j,Ã,Ã,Ã,Ã,ì,Ã,î,ï,Äš,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij +IJ,ij +ı +Æ +Æ +ÄŽ,ĵ,ǰ +K,k,Ķ,Ä·,Çš,Ç© +Æ,Æ +L,l,Ĺ,ĺ,Ä»,ÄŒ,Äœ,ÄŸ +Ä¿,Å +LJ,Lj,lJ,lj +Ç,Ç,Ç +LL,Ll,lL,ll +Å,Å +Æ +Æ +M,m +N,n,Ã,ñ,Å,Å,Å
,Å,Å,Å,Çž,ǹ +NJ,Nj,nJ,nj +Ç,Ç,Ç +Æ +Æ +Å,Å +O,o,Ã,Ã,Ã,Ã,Ã,ò,ó,ÃŽ,õ,ö,Å,Å,Å,Å,Å,Å,Æ ,Æ¡,Ç,Ç,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å,Å +Ã,Þ,ÇŸ,Ç¿ +Æ +Æ +P,p +Æ€,Æ¥ +Q,q +Äž +R,r,Å,Å,Å,Å,Å,Å +RR,Rr,rR,rr +ÆŠ +S,s,Å,Å,Å,Å,Å,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,à +Æ© +ƪ +T,t,Å¢,Å£,Å€,Å¥ +ÆŸ +ÅŠ,ŧ +Æ« +Ƭ,Æ +Æ® +Ã,Ã,Ã,Ã,ù,ú,û,ÃŒ,Åš,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç,Ç +Æ +Ʊ +U,V,u,v +Ʋ +W,w,ÅŽ,ŵ +X,x +Y,y,Ã,Ü,ÿ,Ŷ,Å·,Åž +Ƴ,ÆŽ +Z,z,Ź,ź,Å»,ÅŒ,Åœ,ÅŸ +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Æž,ƹ +ƺ +Ã,ß +Æ¿,Ç· +Æ» +Ƨ,Æš +ÆŒ,Æœ +Æ,Æ
+Å +Ç +Ç +Ç +Ç diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result new file mode 100644 index 00000000000..1d3deb0b09a --- /dev/null +++ b/mysql-test/r/ctype_ucs.result @@ -0,0 +1,482 @@ +DROP TABLE IF EXISTS t1; +SET CHARACTER SET koi8r; +CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2); +INSERT INTO t1 VALUES (_koi8r'ò'), (X'2004'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +0420 +2004 +DELETE FROM t1; +INSERT INTO t1 VALUES (X'042000200020'), (X'200400200020'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +0420 +2004 +DROP TABLE t1; +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'0421'); +LPAD(_ucs2 X'0420',10,_ucs2 X'0421') +óóóóóóóóóò +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'04210422'); +LPAD(_ucs2 X'0420',10,_ucs2 X'04210422') +óôóôóôóôóò +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423'); +LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423') +óôõóôõóôõò +SELECT LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); +LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423') +òóôõæèãþûý +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'0421'); +RPAD(_ucs2 X'0420',10,_ucs2 X'0421') +òóóóóóóóóó +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'04210422'); +RPAD(_ucs2 X'0420',10,_ucs2 X'04210422') +òóôóôóôóôó +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423'); +RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423') +òóôõóôõóôõ +SELECT RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); +RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423') +òóôõæèãþûý +CREATE TABLE t1 SELECT +LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l, +RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `l` char(10) character set ucs2 NOT NULL default '', + `r` char(10) character set ucs2 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +create table t2(f1 Char(30)); +insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000"); +select lpad(f1, 12, "-o-/") from t2; +lpad(f1, 12, "-o-/") +-o-/-o103000 +-o-/22720000 +-o-/-3401200 +-o-/-o-78000 +drop table t2; +SET NAMES koi8r; +SET character_set_connection=ucs2; +create table t1 (a varchar(10) character set ucs2, key(a)); +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +explain select * from t1 where a like 'abc%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 21 NULL 1 Using where; Using index +explain select * from t1 where a like concat('abc','%'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 21 NULL 1 Using where; Using index +select * from t1 where a like "abc%"; +a +abc +abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd +select * from t1 where a like "ABC%"; +a +abc +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +a +abc +abcd +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +select 'AA' like 'AA'; +'AA' like 'AA' +1 +select 'AA' like 'A%A'; +'AA' like 'A%A' +1 +select 'AA' like 'A%%A'; +'AA' like 'A%%A' +1 +select 'AA' like 'AA%'; +'AA' like 'AA%' +1 +select 'AA' like '%AA%'; +'AA' like '%AA%' +1 +select 'AA' like '%A'; +'AA' like '%A' +1 +select 'AA' like '%AA'; +'AA' like '%AA' +1 +select 'AA' like 'A%A%'; +'AA' like 'A%A%' +1 +select 'AA' like '_%_%'; +'AA' like '_%_%' +1 +select 'AA' like '%A%A'; +'AA' like '%A%A' +1 +select 'AAA'like 'A%A%A'; +'AAA'like 'A%A%A' +1 +select 'AZ' like 'AZ'; +'AZ' like 'AZ' +1 +select 'AZ' like 'A%Z'; +'AZ' like 'A%Z' +1 +select 'AZ' like 'A%%Z'; +'AZ' like 'A%%Z' +1 +select 'AZ' like 'AZ%'; +'AZ' like 'AZ%' +1 +select 'AZ' like '%AZ%'; +'AZ' like '%AZ%' +1 +select 'AZ' like '%Z'; +'AZ' like '%Z' +1 +select 'AZ' like '%AZ'; +'AZ' like '%AZ' +1 +select 'AZ' like 'A%Z%'; +'AZ' like 'A%Z%' +1 +select 'AZ' like '_%_%'; +'AZ' like '_%_%' +1 +select 'AZ' like '%A%Z'; +'AZ' like '%A%Z' +1 +select 'AZ' like 'A_'; +'AZ' like 'A_' +1 +select 'AZ' like '_Z'; +'AZ' like '_Z' +1 +select 'AMZ'like 'A%M%Z'; +'AMZ'like 'A%M%Z' +1 +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ucs2); +INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏÌÄÖ'),('æÙ×ÁÐÒÏÌÄÖ'),('Æù×ÁÐÒÏÌÄÖ'),('ÆÙ÷ÁÐÒÏÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×áÐÒÏÌÄÖ'),('ÆÙ×ÁðÒÏÌÄÖ'),('ÆÙ×ÁÐòÏÌÄÖ'),('ÆÙ×ÁÐÒïÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏìÄÖ'),('ÆÙ×ÁÐÒÏÌäÖ'),('ÆÙ×ÁÐÒÏÌÄö'),('æù÷áðòïìäö'); +SELECT * FROM t1 WHERE a LIKE '%Æù×Á%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE '%Æù×%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%' COLLATE ucs2_bin; +a +Æù×Á +Æù×ÁÐÒÏÌÄÖ +DROP TABLE t1; +CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word)) +ENGINE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci; +INSERT INTO t1 (word) VALUES ("cat"); +SELECT * FROM t1 WHERE word LIKE "c%"; +word +cat +SELECT * FROM t1 WHERE word LIKE "ca_"; +word +cat +SELECT * FROM t1 WHERE word LIKE "cat"; +word +cat +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630025'; +word +cat +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630061005F'; +word +cat +DROP TABLE t1; +select insert(_ucs2 0x006100620063,10,2,_ucs2 0x006400650066); +insert(_ucs2 0x006100620063,10,2,_ucs2 0x006400650066) +abc +select insert(_ucs2 0x006100620063,1,2,_ucs2 0x006400650066); +insert(_ucs2 0x006100620063,1,2,_ucs2 0x006400650066) +defc +SET NAMES latin1; +CREATE TABLE t1 ( +word VARCHAR(64), +bar INT(11) default 0, +PRIMARY KEY (word)) +ENGINE=MyISAM +CHARSET ucs2 +COLLATE ucs2_general_ci ; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a"); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +SELECT * FROM t1 ORDER BY word; +word bar +a 0 +aar 0 +aardvar 0 +aardvara 0 +aardvark 0 +aardvarz 0 +EXPLAIN SELECT word FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 128 NULL 6 Using index +SELECT word FROM t1 ORDER by word; +word +a +aar +aardvar +aardvara +aardvark +aardvarz +DROP TABLE t1; +CREATE TABLE t1 ( +word VARCHAR(64) , +PRIMARY KEY (word)) +ENGINE=MyISAM +CHARSET ucs2 +COLLATE ucs2_general_ci; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a"); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY WORD; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 128 NULL 6 Using index +SELECT * FROM t1 ORDER BY word; +word +a +aar +aardvar +aardvara +aardvark +aardvarz +DROP TABLE t1; +CREATE TABLE t1 ( +word TEXT, +bar INT(11) AUTO_INCREMENT, +PRIMARY KEY (bar)) +ENGINE=MyISAM +CHARSET ucs2 +COLLATE ucs2_general_ci ; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a" ); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +SELECT * FROM t1 ORDER BY word; +word bar +a 2 +aar 1 +aardvar 3 +aardvara 5 +aardvark 4 +aardvarz 6 +EXPLAIN SELECT word FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +SELECT word FROM t1 ORDER BY word; +word +a +aar +aardvar +aardvara +aardvark +aardvarz +DROP TABLE t1; +SELECT HEX(_ucs2 0x0); +HEX(_ucs2 0x0) +0000 +SELECT HEX(_ucs2 0x01); +HEX(_ucs2 0x01) +0001 +SELECT HEX(_ucs2 0x012); +HEX(_ucs2 0x012) +0012 +SELECT HEX(_ucs2 0x0123); +HEX(_ucs2 0x0123) +0123 +SELECT HEX(_ucs2 0x01234); +HEX(_ucs2 0x01234) +00001234 +SELECT HEX(_ucs2 0x012345); +HEX(_ucs2 0x012345) +00012345 +SELECT HEX(_ucs2 0x0123456); +HEX(_ucs2 0x0123456) +00123456 +SELECT HEX(_ucs2 0x01234567); +HEX(_ucs2 0x01234567) +01234567 +SELECT HEX(_ucs2 0x012345678); +HEX(_ucs2 0x012345678) +000012345678 +SELECT HEX(_ucs2 0x0123456789); +HEX(_ucs2 0x0123456789) +000123456789 +SELECT HEX(_ucs2 0x0123456789A); +HEX(_ucs2 0x0123456789A) +00123456789A +SELECT HEX(_ucs2 0x0123456789AB); +HEX(_ucs2 0x0123456789AB) +0123456789AB +SELECT HEX(_ucs2 0x0123456789ABC); +HEX(_ucs2 0x0123456789ABC) +0000123456789ABC +SELECT HEX(_ucs2 0x0123456789ABCD); +HEX(_ucs2 0x0123456789ABCD) +000123456789ABCD +SELECT HEX(_ucs2 0x0123456789ABCDE); +HEX(_ucs2 0x0123456789ABCDE) +00123456789ABCDE +SELECT HEX(_ucs2 0x0123456789ABCDEF); +HEX(_ucs2 0x0123456789ABCDEF) +0123456789ABCDEF +SELECT hex(cast(0xAA as char character set ucs2)); +hex(cast(0xAA as char character set ucs2)) +00AA +SELECT hex(convert(0xAA using ucs2)); +hex(convert(0xAA using ucs2)) +00AA +CREATE TABLE t1 (a char(10) character set ucs2); +INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA); +SELECT HEX(a) FROM t1; +HEX(a) +000A +00AA +0AAA +AAAA +000AAAAA +DROP TABLE t1; +CREATE TABLE t1 (a varchar(10) character set ucs2); +INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA); +SELECT HEX(a) FROM t1; +HEX(a) +000A +00AA +0AAA +AAAA +000AAAAA +DROP TABLE t1; +CREATE TABLE t1 (a text character set ucs2); +INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA); +SELECT HEX(a) FROM t1; +HEX(a) +000A +00AA +0AAA +AAAA +000AAAAA +DROP TABLE t1; +CREATE TABLE t1 (a mediumtext character set ucs2); +INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA); +SELECT HEX(a) FROM t1; +HEX(a) +000A +00AA +0AAA +AAAA +000AAAAA +DROP TABLE t1; +CREATE TABLE t1 (a longtext character set ucs2); +INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA); +SELECT HEX(a) FROM t1; +HEX(a) +000A +00AA +0AAA +AAAA +000AAAAA +DROP TABLE t1; +create table t1 (s1 char character set `ucs2` collate `ucs2_czech_ci`); +insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c'); +select s1 from t1 where s1 > 'a' order by s1; +s1 +b +c +drop table t1; +create table t1(a char(1)) default charset = ucs2; +insert into t1 values ('a'),('b'),('c'); +alter table t1 modify a char(5); +select a, hex(a) from t1; +a hex(a) +a 0061 +b 0062 +c 0063 +drop table t1; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 223a18f19e9..7c3ae52cbc9 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -1,8 +1,128 @@ drop table if exists t1; -create table t1 (c text); +set names ujis; +create table t1 (c text character set ujis); insert into t1 values (0xa4a2),(0xa4a3); select hex(left(c,1)) from t1 group by c; hex(left(c,1)) A4A2 A4A3 drop table t1; +select locate(0xa2a1,0xa1a2a1a3); +locate(0xa2a1,0xa1a2a1a3) +2 +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3); +locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3) +0 +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin); +locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin) +0 +select locate('he','hello'); +locate('he','hello') +1 +select locate('he','hello',2); +locate('he','hello',2) +0 +select locate('lo','hello',2); +locate('lo','hello',2) +4 +select locate('HE','hello'); +locate('HE','hello') +1 +select locate('HE','hello',2); +locate('HE','hello',2) +0 +select locate('LO','hello',2); +locate('LO','hello',2) +4 +select locate('HE','hello' collate ujis_bin); +locate('HE','hello' collate ujis_bin) +0 +select locate('HE','hello' collate ujis_bin,2); +locate('HE','hello' collate ujis_bin,2) +0 +select locate('LO','hello' collate ujis_bin,2); +locate('LO','hello' collate ujis_bin,2) +0 +select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3); +locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3) +2 +select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%'); +0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%') +1 +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%'); +_ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') +0 +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin; +_ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin +0 +select 'a' like 'a'; +'a' like 'a' +1 +select 'A' like 'a'; +'A' like 'a' +1 +select 'A' like 'a' collate ujis_bin; +'A' like 'a' collate ujis_bin +0 +set @ujis1= _ujis 0x8EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAB8EAC8EAD8EAE8EAF; +set @ujis2= _ujis 0x8EB08EB18EB28EB38EB48EB58EB68EB78EB88EB98EBA8EBB8EBC8EBD8EBE8EBF; +set @ujis3= _ujis 0x8EC08EC18EC28EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF; +set @ujis4= _ujis 0x8ED08ED18ED28ED38ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF; +select hex(@utf81:= CONVERT(@ujis1 USING utf8)); +hex(@utf81:= CONVERT(@ujis1 USING utf8)) +EFBDA1EFBDA2EFBDA3EFBDA4EFBDA5EFBDA6EFBDA7EFBDA8EFBDA9EFBDAAEFBDABEFBDACEFBDADEFBDAEEFBDAF +select hex(@utf82:= CONVERT(@ujis2 USING utf8)); +hex(@utf82:= CONVERT(@ujis2 USING utf8)) +EFBDB0EFBDB1EFBDB2EFBDB3EFBDB4EFBDB5EFBDB6EFBDB7EFBDB8EFBDB9EFBDBAEFBDBBEFBDBCEFBDBDEFBDBEEFBDBF +select hex(@utf83:= CONVERT(@ujis3 USING utf8)); +hex(@utf83:= CONVERT(@ujis3 USING utf8)) +EFBE80EFBE81EFBE82EFBE83EFBE84EFBE85EFBE86EFBE87EFBE88EFBE89EFBE8AEFBE8BEFBE8CEFBE8DEFBE8EEFBE8F +select hex(@utf84:= CONVERT(@ujis4 USING utf8)); +hex(@utf84:= CONVERT(@ujis4 USING utf8)) +EFBE90EFBE91EFBE92EFBE93EFBE94EFBE95EFBE96EFBE97EFBE98EFBE99EFBE9AEFBE9BEFBE9CEFBE9DEFBE9EEFBE9F +select @ujis1 = CONVERT(@utf81 USING ujis); +@ujis1 = CONVERT(@utf81 USING ujis) +1 +select @ujis2 = CONVERT(@utf82 USING ujis); +@ujis2 = CONVERT(@utf82 USING ujis) +1 +select @ujis3 = CONVERT(@utf83 USING ujis); +@ujis3 = CONVERT(@utf83 USING ujis) +1 +select @ujis4 = CONVERT(@utf84 USING ujis); +@ujis4 = CONVERT(@utf84 USING ujis) +1 +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +create table t1 (c1 varchar(8)) default character set 'ujis'; +insert into t1 values (0xA4A2),(0xA2A2),(0xA4A2); +select c1 as 'no index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis); +no index +€¢ +€¢ +create index idx_c1 on t1(c1); +select c1 as 'using index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis); +using index +€¢ +€¢ +select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis); +no index +€¢ +€¢ +drop table t1; +CREATE TABLE t1 ( +a char(1) NOT NULL default '', +b enum('€¢','€€') default NULL +) CHARACTER SET ujis; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) NOT NULL default '', + `b` enum('€¢','€€') default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +a char(1) +b enum('€¢','€€') YES NULL +DROP TABLE t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result new file mode 100644 index 00000000000..f3be539251a --- /dev/null +++ b/mysql-test/r/ctype_utf8.result @@ -0,0 +1,641 @@ +drop table if exists t1,t2; +set names utf8; +select left(_utf8 0xD0B0D0B1D0B2,1); +left(_utf8 0xD0B0D0B1D0B2,1) +а +select right(_utf8 0xD0B0D0B2D0B2,1); +right(_utf8 0xD0B0D0B2D0B2,1) +в +select locate('he','hello'); +locate('he','hello') +1 +select locate('he','hello',2); +locate('he','hello',2) +0 +select locate('lo','hello',2); +locate('lo','hello',2) +4 +select locate('HE','hello'); +locate('HE','hello') +1 +select locate('HE','hello',2); +locate('HE','hello',2) +0 +select locate('LO','hello',2); +locate('LO','hello',2) +4 +select locate('HE','hello' collate utf8_bin); +locate('HE','hello' collate utf8_bin) +0 +select locate('HE','hello' collate utf8_bin,2); +locate('HE','hello' collate utf8_bin,2) +0 +select locate('LO','hello' collate utf8_bin,2); +locate('LO','hello' collate utf8_bin,2) +0 +select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2); +locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2) +2 +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2); +locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2) +2 +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2); +locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2) +2 +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin); +locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin) +0 +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin); +locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin) +0 +select length(_utf8 0xD0B1), bit_length(_utf8 0xD0B1), char_length(_utf8 0xD0B1); +length(_utf8 0xD0B1) bit_length(_utf8 0xD0B1) char_length(_utf8 0xD0B1) +2 16 1 +select 'a' like 'a'; +'a' like 'a' +1 +select 'A' like 'a'; +'A' like 'a' +1 +select 'A' like 'a' collate utf8_bin; +'A' like 'a' collate utf8_bin +0 +select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%'); +_utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%') +1 +SELECT 'a' = 'a '; +'a' = 'a ' +1 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +1 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +1 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +SELECT 'a' = 'a ' collate utf8_bin; +'a' = 'a ' collate utf8_bin +1 +SELECT 'a\0' < 'a' collate utf8_bin; +'a\0' < 'a' collate utf8_bin +1 +SELECT 'a\0' < 'a ' collate utf8_bin; +'a\0' < 'a ' collate utf8_bin +1 +SELECT 'a\t' < 'a' collate utf8_bin; +'a\t' < 'a' collate utf8_bin +1 +SELECT 'a\t' < 'a ' collate utf8_bin; +'a\t' < 'a ' collate utf8_bin +1 +CREATE TABLE t1 (a char(10) character set utf8 not null); +INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); +SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; +hex(a) STRCMP(a,'a') STRCMP(a,'a ') +61 0 0 +6100 -1 -1 +6109 -1 -1 +61 0 0 +DROP TABLE t1; +select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); +insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') +this is a test +select insert("aa",100,1,"b"),insert("aa",1,3,"b"); +insert("aa",100,1,"b") insert("aa",1,3,"b") +aa b +select char_length(left(@a:='ÑеÑÑ',5)), length(@a), @a; +char_length(left(@a:='ÑеÑÑ',5)) length(@a) @a +4 8 ÑеÑÑ +create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d"); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` binary(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +date_format("2004-01-19 10:10:10", "%Y-%m-%d") +2004-01-19 +drop table t1; +set names koi8r; +create table t1 (s1 char(1) character set utf8); +insert into t1 values (_koi8r'ÁÂ'); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select s1,hex(s1),char_length(s1),octet_length(s1) from t1; +s1 hex(s1) char_length(s1) octet_length(s1) +Á D0B0 1 2 +drop table t1; +create table t1 (s1 tinytext character set utf8); +insert into t1 select repeat('a',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('Ñ',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('aÑ',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('Ña',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('ÑÑ',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 +D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F +61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F +D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61 +D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F +select length(s1),char_length(s1) from t1; +length(s1) char_length(s1) +255 255 +254 127 +255 170 +255 170 +254 127 +drop table t1; +create table t1 (s1 text character set utf8); +insert into t1 select repeat('a',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('Ñ',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('aÑ',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('Ña',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('ÑÑ',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select length(s1),char_length(s1) from t1; +length(s1) char_length(s1) +65535 65535 +65534 32767 +65535 43690 +65535 43690 +65534 32767 +drop table t1; +create table t1 (s1 char(10) character set utf8); +insert into t1 values (0x41FF); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +41 +drop table t1; +create table t1 (s1 varchar(10) character set utf8); +insert into t1 values (0x41FF); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +41 +drop table t1; +create table t1 (s1 text character set utf8); +insert into t1 values (0x41FF); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +41 +drop table t1; +create table t1 (a text character set utf8, primary key(a(360))); +ERROR 42000: Specified key was too long; max key length is 1000 bytes +CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8; +INSERT INTO t1 VALUES ( 'test' ); +SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a; +a a +test test +SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test'; +a a +test test +SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test'; +a a +test test +DROP TABLE t1; +create table t1 (a char(255) character set utf8); +insert into t1 values('b'),('b'); +select * from t1 where a = 'b'; +a +b +b +select * from t1 where a = 'b' and a = 'b'; +a +b +b +select * from t1 where a = 'b' and a != 'b'; +a +drop table t1; +set names utf8; +select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select 'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select ' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select ' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select 'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]' +0 +select 'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' +0 +select 'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]' +0 +CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci); +ALTER TABLE t1 ADD COLUMN b CHAR(20); +DROP TABLE t1; +set names utf8; +create table t1 (a enum('aaaa','пÑПба') character set utf8); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('aaaa','пÑПба') character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('пÑПба'); +select * from t1; +a +пÑПба +create table t2 select ifnull(a,a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ifnull(a,a)` char(5) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t2; +ifnull(a,a) +пÑПба +drop table t1; +drop table t2; +create table t1 (c varchar(30) character set utf8, unique(c(10))); +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 1 +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 1 +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t1 (c char(3) character set utf8, unique (c(2))); +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bbb' for key 1 +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'ааа' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'ббб' for key 1 +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 1 +drop table t1; +create table t1 ( +c char(10) character set utf8, +unique key a using hash (c(1)) +) engine=heap; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 default NULL, + UNIQUE KEY `a` (`c`(1)) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'aa' for key 1 +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8, +unique key a using btree (c(1)) +) engine=heap; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 default NULL, + UNIQUE KEY `a` TYPE BTREE (`c`(1)) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'aa' for key 1 +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8, +unique key a (c(1)) +) engine=bdb; +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'aa' for key 1 +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 (c varchar(30) character set utf8 collate utf8_bin, unique(c(10))); +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 1 +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 1 +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t1 (c char(3) character set utf8 collate utf8_bin, unique (c(2))); +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bbb' for key 1 +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'ааа' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'ббб' for key 1 +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 1 +drop table t1; +create table t1 ( +c char(10) character set utf8 collate utf8_bin, +unique key a using hash (c(1)) +) engine=heap; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 collate utf8_bin default NULL, + UNIQUE KEY `a` (`c`(1)) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'aa' for key 1 +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8 collate utf8_bin, +unique key a using btree (c(1)) +) engine=heap; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 collate utf8_bin default NULL, + UNIQUE KEY `a` TYPE BTREE (`c`(1)) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'aa' for key 1 +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8 collate utf8_bin, +unique key a (c(1)) +) engine=bdb; +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'aa' for key 1 +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бÐ' for key 1 +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +str varchar(255) character set utf8 not null, +key str (str(2)) +) engine=myisam; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8 not null, +key str using btree (str(2)) +) engine=heap; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8 not null, +key str using hash (str(2)) +) engine=heap; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8 not null, +key str (str(2)) +) engine=bdb; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result new file mode 100644 index 00000000000..758a83defed --- /dev/null +++ b/mysql-test/r/date_formats.result @@ -0,0 +1,455 @@ +drop table if exists t1; +SHOW GLOBAL VARIABLES LIKE "%_format%"; +Variable_name Value +date_format %d.%m.%Y +datetime_format %Y-%m-%d %H:%i:%s +default_week_format 0 +time_format %H.%i.%s +SHOW SESSION VARIABLES LIKE "%_format%"; +Variable_name Value +date_format %d.%m.%Y +datetime_format %Y-%m-%d %H:%i:%s +default_week_format 0 +time_format %H.%i.%s +SET time_format='%H%i%s'; +SET time_format='%H:%i:%s.%f'; +SET time_format='%h-%i-%s.%f%p'; +SET time_format='%h:%i:%s.%f %p'; +SET time_format='%h:%i:%s%p'; +SET date_format='%Y%m%d'; +SET date_format='%Y.%m.%d'; +SET date_format='%d.%m.%Y'; +SET date_format='%m-%d-%Y'; +set datetime_format= '%Y%m%d%H%i%s'; +set datetime_format= '%Y-%m-%d %H:%i:%s'; +set datetime_format= '%m-%d-%y %H:%i:%s.%f'; +set datetime_format= '%d-%m-%Y %h:%i:%s%p'; +set datetime_format= '%H:%i:%s %Y-%m-%d'; +set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; +set datetime_format= '%h:%i:%s %p %Y-%m-%d'; +set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; +SHOW SESSION VARIABLES LIKE "%format"; +Variable_name Value +date_format %m-%d-%Y +datetime_format %h:%i:%s.%f %p %Y-%m-%d +default_week_format 0 +time_format %h:%i:%s%p +SET time_format='%h:%i:%s'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s' +SET time_format='%H %i:%s'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H %i:%s' +SET time_format='%H::%i:%s'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H::%i:%s' +SET time_format='%H:%i:%s%f'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%f' +SET time_format='%H:%i.%f:%s'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i.%f:%s' +SET time_format='%H:%i:%s%p'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%p' +SET time_format='%h:%i:%s.%f %p %Y-%m-%d'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s.%f %p %Y-%m-%d' +SET time_format='%H%i%s.%f'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H%i%s.%f' +SET time_format='%H:%i-%s.%f'; +ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i-%s.%f' +SET date_format='%d.%m.%d'; +ERROR 42000: Variable 'date_format' can't be set to the value of '%d.%m.%d' +SET datetime_format='%h.%m.%y %d.%i.%s'; +ERROR 42000: Variable 'datetime_format' can't be set to the value of '%h.%m.%y %d.%i.%s' +set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d'; +ERROR 42000: Variable 'datetime_format' can't be set to the value of '%H:%i:%s.%f %p %Y-%m-%d' +set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d'; +SET SESSION datetime_format=default; +select @@global.datetime_format, @@session.datetime_format; +@@global.datetime_format @@session.datetime_format +%H:%i:%s %Y-%m-%d %H:%i:%s %Y-%m-%d +SET GLOBAL datetime_format=default; +SET SESSION datetime_format=default; +select @@global.datetime_format, @@session.datetime_format; +@@global.datetime_format @@session.datetime_format +%Y-%m-%d %H:%i:%s %Y-%m-%d %H:%i:%s +SET GLOBAL date_format=default; +SET GLOBAL time_format=default; +SET GLOBAL datetime_format=default; +SET time_format=default; +SET date_format=default; +SET datetime_format=default; +select str_to_date(concat('15-01-2001',' 2:59:58.999'), +concat('%d-%m-%Y',' ','%H:%i:%s.%f')); +str_to_date(concat('15-01-2001',' 2:59:58.999'), +concat('%d-%m-%Y',' ','%H:%i:%s.%f')) +2001-01-15 02:59:58.999000 +create table t1 (date char(30), format char(30) not null); +insert into t1 values +('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), +('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'), +('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'), +('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'), +('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'), +('2003-01-02 12:11:12.12345 am', '%Y-%m-%d %h:%i:%S.%f%p'), +('2003-01-02 11:11:12Pm', '%Y-%m-%d %h:%i:%S%p'), +('10:20:10', '%H:%i:%s'), +('10:20:10', '%h:%i:%s.%f'), +('10:20:10', '%T'), +('10:20:10AM', '%h:%i:%s%p'), +('10:20:10AM', '%r'), +('10:20:10.44AM', '%h:%i:%s.%f%p'), +('15-01-2001 12:59:58', '%d-%m-%Y %H:%i:%S'), +('15 September 2001', '%d %M %Y'), +('15 SEPTEMB 2001', '%d %M %Y'), +('15 MAY 2001', '%d %b %Y'), +('15th May 2001', '%D %b %Y'), +('Sunday 15 MAY 2001', '%W %d %b %Y'), +('Sund 15 MAY 2001', '%W %d %b %Y'), +('Tuesday 00 2002', '%W %U %Y'), +('Thursday 53 1998', '%W %u %Y'), +('Sunday 01 2001', '%W %v %x'), +('Tuesday 52 2001', '%W %V %X'), +('060 2004', '%j %Y'), +('4 53 1998', '%w %u %Y'), +('15-01-2001', '%d-%m-%Y %H:%i:%S'), +('15-01-20', '%d-%m-%y'), +('15-2001-1', '%d-%Y-%c'); +select date,format,str_to_date(date, format) as str_to_date from t1; +date format str_to_date +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 +2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450 +2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 +2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12 +10:20:10 %H:%i:%s 0000-00-00 10:20:10 +10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10 +10:20:10 %T 0000-00-00 10:20:10 +10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10 +10:20:10AM %r 0000-00-00 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58 +15 September 2001 %d %M %Y 2001-09-15 00:00:00 +15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00 +15 MAY 2001 %d %b %Y 2001-05-15 00:00:00 +15th May 2001 %D %b %Y 2001-05-15 00:00:00 +Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00 +Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00 +Tuesday 00 2002 %W %U %Y 2002-01-01 00:00:00 +Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00 +Sunday 01 2001 %W %v %x 2001-01-07 00:00:00 +Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00 +060 2004 %j %Y 2004-02-29 00:00:00 +4 53 1998 %w %u %Y 1998-12-31 00:00:00 +15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00 +15-01-20 %d-%m-%y 2020-01-15 00:00:00 +15-2001-1 %d-%Y-%c 2001-01-15 00:00:00 +select date,format,concat('',str_to_date(date, format)) as con from t1; +date format con +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 +2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450 +2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 +2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12 +10:20:10 %H:%i:%s 0000-00-00 10:20:10 +10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10 +10:20:10 %T 0000-00-00 10:20:10 +10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10 +10:20:10AM %r 0000-00-00 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58 +15 September 2001 %d %M %Y 2001-09-15 00:00:00 +15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00 +15 MAY 2001 %d %b %Y 2001-05-15 00:00:00 +15th May 2001 %D %b %Y 2001-05-15 00:00:00 +Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00 +Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00 +Tuesday 00 2002 %W %U %Y 2002-01-01 00:00:00 +Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00 +Sunday 01 2001 %W %v %x 2001-01-07 00:00:00 +Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00 +060 2004 %j %Y 2004-02-29 00:00:00 +4 53 1998 %w %u %Y 1998-12-31 00:00:00 +15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00 +15-01-20 %d-%m-%y 2020-01-15 00:00:00 +15-2001-1 %d-%Y-%c 2001-01-15 00:00:00 +select date,format,cast(str_to_date(date, format) as datetime) as datetime from t1; +date format datetime +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 +2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450 +2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 +2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12 +10:20:10 %H:%i:%s 0000-00-00 10:20:10 +10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10 +10:20:10 %T 0000-00-00 10:20:10 +10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10 +10:20:10AM %r 0000-00-00 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58 +15 September 2001 %d %M %Y 2001-09-15 00:00:00 +15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00 +15 MAY 2001 %d %b %Y 2001-05-15 00:00:00 +15th May 2001 %D %b %Y 2001-05-15 00:00:00 +Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00 +Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00 +Tuesday 00 2002 %W %U %Y 2002-01-01 00:00:00 +Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00 +Sunday 01 2001 %W %v %x 2001-01-07 00:00:00 +Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00 +060 2004 %j %Y 2004-02-29 00:00:00 +4 53 1998 %w %u %Y 1998-12-31 00:00:00 +15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00 +15-01-20 %d-%m-%y 2020-01-15 00:00:00 +15-2001-1 %d-%Y-%c 2001-01-15 00:00:00 +select date,format,DATE(str_to_date(date, format)) as date2 from t1; +date format date2 +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 +2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 +2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 +2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 +10:20:10 %H:%i:%s 0000-00-00 +10:20:10 %h:%i:%s.%f 0000-00-00 +10:20:10 %T 0000-00-00 +10:20:10AM %h:%i:%s%p 0000-00-00 +10:20:10AM %r 0000-00-00 +10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 +15 September 2001 %d %M %Y 2001-09-15 +15 SEPTEMB 2001 %d %M %Y 2001-09-15 +15 MAY 2001 %d %b %Y 2001-05-15 +15th May 2001 %D %b %Y 2001-05-15 +Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 +Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 +Tuesday 00 2002 %W %U %Y 2002-01-01 +Thursday 53 1998 %W %u %Y 1998-12-31 +Sunday 01 2001 %W %v %x 2001-01-07 +Tuesday 52 2001 %W %V %X 2002-01-01 +060 2004 %j %Y 2004-02-29 +4 53 1998 %w %u %Y 1998-12-31 +15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 +15-01-20 %d-%m-%y 2020-01-15 +15-2001-1 %d-%Y-%c 2001-01-15 +select date,format,TIME(str_to_date(date, format)) as time from t1; +date format time +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12 +2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450 +2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 +2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 +10:20:10 %H:%i:%s 10:20:10 +10:20:10 %h:%i:%s.%f 10:20:10 +10:20:10 %T 10:20:10 +10:20:10AM %h:%i:%s%p 10:20:10 +10:20:10AM %r 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 +15 September 2001 %d %M %Y 00:00:00 +15 SEPTEMB 2001 %d %M %Y 00:00:00 +15 MAY 2001 %d %b %Y 00:00:00 +15th May 2001 %D %b %Y 00:00:00 +Sunday 15 MAY 2001 %W %d %b %Y 00:00:00 +Sund 15 MAY 2001 %W %d %b %Y 00:00:00 +Tuesday 00 2002 %W %U %Y 00:00:00 +Thursday 53 1998 %W %u %Y 00:00:00 +Sunday 01 2001 %W %v %x 00:00:00 +Tuesday 52 2001 %W %V %X 00:00:00 +060 2004 %j %Y 00:00:00 +4 53 1998 %w %u %Y 00:00:00 +15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 +15-01-20 %d-%m-%y 00:00:00 +15-2001-1 %d-%Y-%c 00:00:00 +select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; +date format time2 +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12 +2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450 +2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 +2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 +10:20:10 %H:%i:%s 10:20:10 +10:20:10 %h:%i:%s.%f 10:20:10 +10:20:10 %T 10:20:10 +10:20:10AM %h:%i:%s%p 10:20:10 +10:20:10AM %r 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 +15 September 2001 %d %M %Y 00:00:00 +15 SEPTEMB 2001 %d %M %Y 00:00:00 +15 MAY 2001 %d %b %Y 00:00:00 +15th May 2001 %D %b %Y 00:00:00 +Sunday 15 MAY 2001 %W %d %b %Y 00:00:00 +Sund 15 MAY 2001 %W %d %b %Y 00:00:00 +Tuesday 00 2002 %W %U %Y 00:00:00 +Thursday 53 1998 %W %u %Y 00:00:00 +Sunday 01 2001 %W %v %x 00:00:00 +Tuesday 52 2001 %W %V %X 00:00:00 +060 2004 %j %Y 00:00:00 +4 53 1998 %w %u %Y 00:00:00 +15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 +15-01-20 %d-%m-%y 00:00:00 +15-2001-1 %d-%Y-%c 00:00:00 +truncate table t1; +insert into t1 values +('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'), +('2003-01-02 10:11:12.123456', '%Y-%m-%d %h:%i:%S %p'), +('2003-01-02 10:11:12AM', '%Y-%m-%d %h:%i:%S.%f %p'), +('2003-01-02 10:11:12AN', '%Y-%m-%d %h:%i:%S%p'), +('2003-01-02 10:11:12 PM', '%y-%m-%d %H:%i:%S %p'), +('10:20:10AM', '%H:%i:%s%p'), +('15 Septembei 2001', '%d %M %Y'), +('15 Ju 2001', '%d %M %Y'), +('Sund 15 MA', '%W %d %b %Y'), +('Thursdai 12 1998', '%W %u %Y'), +('Sunday 01 2001', '%W %v %X'), +('Tuesday 52 2001', '%W %V %x'), +('Tuesday 52 2001', '%W %V %Y'), +('Tuesday 52 2001', '%W %u %x'), +('7 53 1998', '%w %u %Y'), +(NULL, get_format(DATE,'USA')); +select date,format,str_to_date(date, format) as str_to_date from t1; +date format str_to_date +2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL +2003-01-02 10:11:12.123456 %Y-%m-%d %h:%i:%S %p NULL +2003-01-02 10:11:12AM %Y-%m-%d %h:%i:%S.%f %p NULL +2003-01-02 10:11:12AN %Y-%m-%d %h:%i:%S%p NULL +2003-01-02 10:11:12 PM %y-%m-%d %H:%i:%S %p NULL +10:20:10AM %H:%i:%s%p NULL +15 Septembei 2001 %d %M %Y NULL +15 Ju 2001 %d %M %Y NULL +Sund 15 MA %W %d %b %Y NULL +Thursdai 12 1998 %W %u %Y NULL +Sunday 01 2001 %W %v %X NULL +Tuesday 52 2001 %W %V %x NULL +Tuesday 52 2001 %W %V %Y NULL +Tuesday 52 2001 %W %u %x NULL +7 53 1998 %w %u %Y NULL +NULL %m.%d.%Y NULL +select date,format,concat(str_to_date(date, format),'') as con from t1; +date format con +2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL +2003-01-02 10:11:12.123456 %Y-%m-%d %h:%i:%S %p NULL +2003-01-02 10:11:12AM %Y-%m-%d %h:%i:%S.%f %p NULL +2003-01-02 10:11:12AN %Y-%m-%d %h:%i:%S%p NULL +2003-01-02 10:11:12 PM %y-%m-%d %H:%i:%S %p NULL +10:20:10AM %H:%i:%s%p NULL +15 Septembei 2001 %d %M %Y NULL +15 Ju 2001 %d %M %Y NULL +Sund 15 MA %W %d %b %Y NULL +Thursdai 12 1998 %W %u %Y NULL +Sunday 01 2001 %W %v %X NULL +Tuesday 52 2001 %W %V %x NULL +Tuesday 52 2001 %W %V %Y NULL +Tuesday 52 2001 %W %u %x NULL +7 53 1998 %w %u %Y NULL +NULL %m.%d.%Y NULL +truncate table t1; +insert into t1 values +('10:20:10AM', '%h:%i:%s'), +('2003-01-02 10:11:12', '%Y-%m-%d %h:%i:%S'), +('03-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'); +select date,format,str_to_date(date, format) as str_to_date from t1; +date format str_to_date +10:20:10AM %h:%i:%s 0000-00-00 10:20:10 +2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12 +03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12 +Warnings: +Warning 1292 Truncated incorrect datetime value: '10:20:10AM' +select date,format,concat(str_to_date(date, format),'') as con from t1; +date format con +10:20:10AM %h:%i:%s 0000-00-00 10:20:10 +2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12 +03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12 +Warnings: +Warning 1292 Truncated incorrect datetime value: '10:20:10AM' +drop table t1; +select get_format(DATE, 'USA') as a; +a +%m.%d.%Y +select get_format(TIME, 'internal') as a; +a +%H%i%s +select get_format(DATETIME, 'eur') as a; +a +%Y-%m-%d %H.%i.%s +select get_format(TIMESTAMP, 'eur') as a; +a +%Y-%m-%d %H.%i.%s +select get_format(DATE, 'TEST') as a; +a +NULL +select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); +str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) +NULL +explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` +create table t1 (d date); +insert into t1 values ('2004-07-14'),('2005-07-14'); +select date_format(d,"%d") from t1 order by 1; +date_format(d,"%d") +14 +14 +drop table t1; +select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a; +a +2003-01-02 10:11:12.001200 +create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1, +str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2, +str_to_date("2003-01-02", "%Y-%m-%d") as f3, +str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5; +describe t1; +Field Type Null Key Default Extra +f1 datetime YES NULL +f2 time YES NULL +f3 date YES NULL +f4 date YES NULL +f5 time YES NULL +select * from t1; +f1 f2 f3 f4 f5 +2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00 +drop table t1; +create table t1 select "02 10" as a, "%d %H" as b; +select str_to_date(a,b) from t1; +str_to_date(a,b) +0000-00-02 10:00:00 +create table t2 select str_to_date(a,b) from t1; +describe t2; +Field Type Null Key Default Extra +str_to_date(a,b) binary(29) YES NULL +select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1, +str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2, +str_to_date("2003-01-02", "%Y-%m-%d") as f3, +str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4, +str_to_date("02 10:11:12", "%d %H:%i:%S") as f5, +str_to_date("02 10", "%d %f") as f6; +f1 f2 f3 f4 f5 f6 +2003-01-02 10:11:12.001200 2003-01-02 10:11:12 2003-01-02 58:11:12 58:11:12 48:00:00.100000 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012' +drop table t1, t2; +select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1, +addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2, +microsecond("1997-12-31 23:59:59.01XXXX") as f3; +f1 f2 f3 +2003-01-02 10:11:12.001200 -25:01:00.110000 10000 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012ABCD' +Warning 1292 Truncated incorrect time value: '-01:01:01.01 GGG' +Warning 1292 Truncated incorrect time value: '1997-12-31 23:59:59.01XXXX' +select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1, +str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2; +f1 f2 +2003-04-05 2003-04-05 10:11:12.101010 +Warnings: +Warning 1292 Truncated incorrect date value: '2003-04-05 g' +Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567' diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 9e375203e49..ceb511a7891 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -12,16 +12,16 @@ select * from t1 where tmsp=0; a tmsp select * from t1 where tmsp=19711006010203; a tmsp -5 19711006010203 -6 19711006010203 -8 19711006010203 +5 1971-10-06 01:02:03 +6 1971-10-06 01:02:03 +8 1971-10-06 01:02:03 drop table t1; create table t1 (a int not null auto_increment primary key, b char(10)); insert delayed into t1 values (1,"b"); insert delayed into t1 values (null,"c"); insert delayed into t1 values (3,"d"),(null,"e"); insert delayed into t1 values (3,"this will give an","error"); -Column count doesn't match value count at row 1 +ERROR 21S01: Column count doesn't match value count at row 1 select * from t1; a b 1 b diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index abc8245e69f..c6b7a40214d 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t11,t12,t2; CREATE TABLE t1 (a tinyint(3), b tinyint(5)); INSERT INTO t1 VALUES (1,1); INSERT LOW_PRIORITY INTO t1 VALUES (1,2); @@ -24,12 +24,20 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; +CREATE TABLE `t1` ( +`i` int(10) NOT NULL default '0', +`i2` int(10) NOT NULL default '0', +PRIMARY KEY (`i`) +); +DELETE FROM t1 USING t1 WHERE post='1'; +ERROR 42S22: Unknown column 'post' in 'where clause' +drop table t1; CREATE TABLE t1 ( bool char(0) default NULL, not_null varchar(20) binary NOT NULL default '', misc integer not null, PRIMARY KEY (not_null) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); select * from t1 where misc > 5 and bool is null; bool not_null misc @@ -50,3 +58,75 @@ select count(*) from t1; count(*) 0 drop table t1; +create table t11 (a int NOT NULL, b int, primary key (a)); +create table t12 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t11 values (0, 10),(1, 11),(2, 12); +insert into t12 values (33, 10),(0, 11),(2, 12); +insert into t2 values (1, 21),(2, 12),(3, 23); +select * from t11; +a b +0 10 +1 11 +2 12 +select * from t12; +a b +33 10 +0 11 +2 12 +select * from t2; +a b +1 21 +2 12 +3 23 +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a); +ERROR 21000: Subquery returns more than 1 row +select * from t11; +a b +0 10 +1 11 +2 12 +select * from t12; +a b +33 10 +0 11 +2 12 +delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a); +Warnings: +Error 1242 Subquery returns more than 1 row +Error 1242 Subquery returns more than 1 row +select * from t11; +a b +0 10 +1 11 +select * from t12; +a b +33 10 +0 11 +insert into t11 values (2, 12); +delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a); +ERROR 21000: Subquery returns more than 1 row +select * from t11; +a b +0 10 +1 11 +2 12 +delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a); +Warnings: +Error 1242 Subquery returns more than 1 row +Error 1242 Subquery returns more than 1 row +select * from t11; +a b +0 10 +1 11 +drop table t11, t12, t2; +create table t1 (a int, b int, unique key (a), key (b)); +insert into t1 values (3, 3), (7, 7); +delete t1 from t1 where a = 3; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a b +7 7 +drop table t1; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result new file mode 100644 index 00000000000..7e6b9b44566 --- /dev/null +++ b/mysql-test/r/derived.result @@ -0,0 +1,332 @@ +drop table if exists t1,t2,t3; +select * from (select 2 from DUAL) b; +2 +2 +SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; +ERROR 42S22: Unknown column 'a' in 'field list' +CREATE TABLE t1 (a int not null, b char (10) not null); +insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); +CREATE TABLE t2 (a int not null, b char (10) not null); +insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e'); +select t1.a,t3.y from t1,(select a as y from t2 where b='c') as t3 where t1.a = t3.y; +a y +3 3 +3 3 +select t1.a,t3.a from t1,(select * from t2 where b='c') as t3 where t1.a = t3.a; +a a +3 3 +3 3 +CREATE TABLE t3 (a int not null, b char (10) not null); +insert into t3 values (3,'f'),(4,'y'),(5,'z'),(6,'c'); +select t1.a,t4.y from t1,(select t2.a as y from t2,(select t3.b from t3 where t3.a>3) as t5 where t2.b=t5.b) as t4 where t1.a = t4.y; +a y +3 3 +3 3 +SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b; +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1; +ERROR 23000: Column 'a' in having clause is ambiguous +SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2; +a a +1 2 +SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=1; +a a +SELECT 1 FROM (SELECT 1) a WHERE a=2; +ERROR 42S22: Unknown column 'a' in 'where clause' +SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) as a; +ERROR 42S22: Unknown column 'a' in 'having clause' +select * from t1 as x1, (select * from t1) as x2; +a b a b +1 a 1 a +2 b 1 a +3 c 1 a +3 c 1 a +1 a 2 b +2 b 2 b +3 c 2 b +3 c 2 b +1 a 3 c +2 b 3 c +3 c 3 c +3 c 3 c +1 a 3 c +2 b 3 c +3 c 3 c +3 c 3 c +explain select * from t1 as x1, (select * from t1) as x2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY x1 ALL NULL NULL NULL NULL 4 +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 +2 DERIVED t1 ALL NULL NULL NULL NULL 4 +drop table if exists t2,t3; +select * from (select 1) as a; +1 +1 +select a from (select 1 as a) as b; +a +1 +select 1 from (select 1) as a; +1 +1 +select * from (select * from t1 union select * from t1) a; +a b +1 a +2 b +3 c +select * from (select * from t1 union all select * from t1) a; +a b +1 a +2 b +3 c +3 c +1 a +2 b +3 c +3 c +select * from (select * from t1 union all select * from t1 limit 2) a; +a b +1 a +2 b +explain select * from (select * from t1 union select * from t1) a; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 +2 DERIVED t1 ALL NULL NULL NULL NULL 4 +3 UNION t1 ALL NULL NULL NULL NULL 4 +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +explain select * from (select * from t1 union all select * from t1) a; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 8 +2 DERIVED t1 ALL NULL NULL NULL NULL 4 +3 UNION t1 ALL NULL NULL NULL NULL 4 +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +CREATE TABLE t2 (a int not null); +insert into t2 values(1); +select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a; +a b +1 a +select * from (select * from t1 where t1.a=(select t2.a from t2 where t2.a=t1.a) union select t1.a, t1.b from t1) a; +a b +1 a +2 b +3 c +explain select * from (select * from t1,t2 where t1.a=t2.a) t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 +2 DERIVED t2 system NULL NULL NULL NULL 1 +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where +drop table t1, t2; +create table t1(a int not null, t char(8), index(a)); +SELECT * FROM (SELECT * FROM t1) as b ORDER BY a ASC LIMIT 0,20; +a t +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +explain select count(*) from t1 as tt1, (select * from t1) as tt2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +2 DERIVED t1 ALL NULL NULL NULL NULL 10000 +drop table t1; +SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b; +(SELECT * FROM (SELECT 1 as a) as a ) +1 +select * from (select 1 as a) b left join (select 2 as a) c using(a); +a a +1 NULL +SELECT * FROM (SELECT 1 UNION SELECT a) b; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; +ERROR 42S22: Unknown column 'a' in 'field list' +select 1 from (select 2) a order by 0; +ERROR 42S22: Unknown column '0' in 'order clause' +create table t1 (id int); +insert into t1 values (1),(2),(3); +describe select * from (select * from t1 group by id) bar; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 +2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort +drop table t1; +create table t1 (mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, matintnum CHAR(6) NOT NULL, test MEDIUMINT UNSIGNED NULL); +create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED NOT NULL); +insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9); +insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105); +SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +pla_id mat_id +100 1 +101 1 +102 1 +103 2 +104 2 +105 3 +SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +pla_id test +100 1 +101 1 +102 1 +103 2 +104 2 +105 3 +explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY m2 ALL NULL NULL NULL NULL 9 +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where +2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort +2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1 +explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY m2 ALL NULL NULL NULL NULL 9 +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where +2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort +2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1 +drop table t1,t2; +SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1; +x +1 +create table t1 select 1 as a; +select 2 as a from (select * from t1) b; +ERROR 3D000: No database selected +use test; +select 2 as a from (select * from t1) b; +a +2 +drop table t1; +select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id; +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 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1 +create table t1 (a int); +insert into t1 values (1),(2),(3); +update (select * from t1) as t1 set a = 5; +ERROR HY000: The target table t1 of the UPDATE is not updatable +delete from (select * from t1); +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 * from t1)' at line 1 +insert into (select * from t1) values (5); +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 * from t1) values (5)' at line 1 +drop table t1; +create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1) +); +insert into t1 VALUES(1,1,1), (2,2,1); +select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2; +count(*) +2 +explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 THEMAX.E2 1 Using where +2 DERIVED A ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2); +select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b; +a a +1 1 +2 1 +1 2 +2 2 +explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2 +4 DERIVED t1 ALL NULL NULL NULL NULL 2 +5 UNION t1 ALL NULL NULL NULL NULL 2 +NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL +2 DERIVED t1 ALL NULL NULL NULL NULL 2 +3 UNION t1 ALL NULL NULL NULL NULL 2 +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +drop table t1; +CREATE TABLE `t1` ( +`N` int(11) unsigned NOT NULL default '0', +`M` tinyint(1) default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0); +UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; +select * from t1; +N M +1 2 +1 2 +1 2 +2 2 +2 2 +3 0 +UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2; +ERROR HY000: The target table P2 of the UPDATE is not updatable +UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; +ERROR 42S22: Unknown column 'aaaa' in 'field list' +delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; +select * from t1; +N M +3 0 +delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N; +ERROR HY000: The target table p2 of the DELETE is not updatable +delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; +ERROR 42S22: Unknown column 'aaa' in 'field list' +drop table t1; +CREATE TABLE t1 ( +OBJECTID int(11) NOT NULL default '0', +SORTORDER int(11) NOT NULL auto_increment, +KEY t1_SortIndex (SORTORDER), +KEY t1_IdIndex (OBJECTID) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE t2 ( +ID int(11) default NULL, +PARID int(11) default NULL, +UNIQUE KEY t2_ID_IDX (ID), +KEY t2_PARID_IDX (PARID) +) engine=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (1000,0),(1001,0),(1002,0),(1003,0),(1008,1),(1009,1),(1010,1),(1011,1),(1016,2); +CREATE TABLE t3 ( +ID int(11) default NULL, +DATA decimal(10,2) default NULL, +UNIQUE KEY t3_ID_IDX (ID) +) engine=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75); +select 497, TMP.ID, NULL from (select 497 as ID, MAX(t3.DATA) as DATA from t1 join t2 on (t1.ObjectID = t2.ID) join t3 on (t1.ObjectID = t3.ID) group by t2.ParID order by DATA DESC) as TMP; +497 ID NULL +drop table t1, t2, t3; +CREATE TABLE t1 (name char(1) default NULL, val int(5) default NULL); +INSERT INTO t1 VALUES ('a',1), ('a',2), ('a',2), ('a',2), ('a',3), ('a',6), ('a',7), ('a',11), ('a',11), ('a',12), ('a',13), ('a',13), ('a',20), ('b',2), ('b',3), ('b',4), ('b',5); +SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name; +name median +a 7.0000 +b 3.5000 +explain SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using temporary; Using filesort +2 DERIVED x ALL NULL NULL NULL NULL 17 Using temporary; Using filesort +2 DERIVED y ALL NULL NULL NULL NULL 17 Using where +drop table t1; +create table t2 (a int, b int, primary key (a)); +insert into t2 values (1,7),(2,7); +explain select a from t2 where a>1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +explain select a from (select a from t2 where a>1) tt; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 +2 DERIVED t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +drop table t2; +CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`)); +insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10); +SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices; +min max avg +10.00 10.00 10 +DROP TABLE t1; diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index a0343f13394..80af2dd0983 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -172,10 +172,10 @@ b INSERT INTO t2 values (1),(2),(3); INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2'); explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t3 index a a 5 NULL 6 Using index; Using temporary -t2 index a a 4 NULL 5 Using index; Distinct -t1 eq_ref PRIMARY PRIMARY 4 t2.a 1 Using where; Distinct +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using temporary +1 SIMPLE t3 ref a a 5 test.t1.b 2 Using where; Using index +1 SIMPLE t2 index a a 4 NULL 4 Using where; Using index; Distinct SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a; a 1 @@ -188,9 +188,9 @@ insert into t3 select * from t4; insert into t4 select * from t3; insert into t3 select * from t4; explain select distinct t1.a from t1,t3 where t1.a=t3.a; -table type possible_keys key key_len ref rows Extra -t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary -t3 ref a a 5 t1.a 10 Using where; Using index; Distinct +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary +1 SIMPLE t3 ref a a 5 test.t1.a 10 Using where; Using index; Distinct select distinct t1.a from t1,t3 where t1.a=t3.a; a 1 @@ -199,29 +199,29 @@ select distinct 1 from t1,t3 where t1.a=t3.a; 1 1 explain SELECT distinct t1.a from t1; -table type possible_keys key key_len ref rows Extra -t1 index NULL PRIMARY 4 NULL 4 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index explain SELECT distinct t1.a from t1 order by a desc; -table type possible_keys key key_len ref rows Extra -t1 index NULL PRIMARY 4 NULL 4 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index explain SELECT t1.a from t1 group by a order by a desc; -table type possible_keys key key_len ref rows Extra -t1 index NULL PRIMARY 4 NULL 4 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index explain SELECT distinct t1.a from t1 order by a desc limit 1; -table type possible_keys key key_len ref rows Extra -t1 index NULL PRIMARY 4 NULL 4 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index explain SELECT distinct a from t3 order by a desc limit 2; -table type possible_keys key key_len ref rows Extra -t3 index NULL a 5 NULL 204 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index NULL a 5 NULL 204 Using index explain SELECT distinct a,b from t3 order by a+1; -table type possible_keys key key_len ref rows Extra -t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort explain SELECT distinct a,b from t3 order by a limit 10; -table type possible_keys key key_len ref rows Extra -t3 index NULL a 5 NULL 204 Using temporary +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index NULL a 5 NULL 204 Using temporary explain SELECT a,b from t3 group by a,b order by a+1; -table type possible_keys key key_len ref rows Extra -t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort drop table t1,t2,t3,t4; CREATE TABLE t1 (name varchar(255)); INSERT INTO t1 VALUES ('aa'),('ab'),('ac'),('ad'),('ae'); @@ -298,14 +298,14 @@ on j_lj_t3.id=t3_lj.id WHERE ((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2)) AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2)); -table type possible_keys key key_len ref rows Extra -t1 index id id 4 NULL 2 Using index; Using temporary -t2 index id id 8 NULL 1 Using index; Distinct -t3 index id id 8 NULL 1 Using index; Distinct -j_lj_t2 index id id 4 NULL 2 Using where; Using index; Distinct -t2_lj ref id id 4 j_lj_t2.id 1 Using where; Using index; Distinct -j_lj_t3 index id id 4 NULL 2 Using where; Using index; Distinct -t3_lj ref id id 4 j_lj_t3.id 1 Using where; Using index; Distinct +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index id id 4 NULL 2 Using index; Using temporary +1 SIMPLE t2 index id id 8 NULL 1 Using index; Distinct +1 SIMPLE t3 index id id 8 NULL 1 Using index; Distinct +1 SIMPLE j_lj_t2 index id id 4 NULL 2 Using where; Using index; Distinct +1 SIMPLE t2_lj ref id id 4 test.j_lj_t2.id 1 Using where; Using index; Distinct +1 SIMPLE j_lj_t3 index id id 4 NULL 2 Using where; Using index; Distinct +1 SIMPLE t3_lj ref id id 4 test.j_lj_t3.id 1 Using where; Using index; Distinct SELECT DISTINCT t1.id from @@ -326,7 +326,6 @@ AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2)); id 2 drop table t1,t2,t3; -drop table if exists t1; create table t1 (a int not null, b int not null, t time); insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15"); select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b; @@ -361,7 +360,7 @@ a c 4 NULL 3 NULL drop table t1; -create table t1 (a char(1), key(a)) type=myisam; +create table t1 (a char(1), key(a)) engine=myisam; insert into t1 values('1'),('1'); select * from t1 where a >= '1'; a @@ -403,14 +402,14 @@ test2@testdomain.com Z001 test2@testdomain.com R002 test3@testdomain.com Z001 drop table t1,t2; -CREATE TABLE t1 (privatemessageid int(10) unsigned NOT NULL auto_increment, folderid smallint(6) NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', touserid int(10) unsigned NOT NULL default '0', fromuserid int(10) unsigned NOT NULL default '0', title varchar(250) NOT NULL default '', message mediumtext NOT NULL, dateline int(10) unsigned NOT NULL default '0', showsignature smallint(6) NOT NULL default '0', iconid smallint(5) unsigned NOT NULL default '0', messageread smallint(6) NOT NULL default '0', readtime int(10) unsigned NOT NULL default '0', receipt smallint(6) unsigned NOT NULL default '0', deleteprompt smallint(6) unsigned NOT NULL default '0', multiplerecipients smallint(6) unsigned NOT NULL default '0', PRIMARY KEY (privatemessageid), KEY userid (userid)) TYPE=MyISAM; +CREATE TABLE t1 (privatemessageid int(10) unsigned NOT NULL auto_increment, folderid smallint(6) NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', touserid int(10) unsigned NOT NULL default '0', fromuserid int(10) unsigned NOT NULL default '0', title varchar(250) NOT NULL default '', message mediumtext NOT NULL, dateline int(10) unsigned NOT NULL default '0', showsignature smallint(6) NOT NULL default '0', iconid smallint(5) unsigned NOT NULL default '0', messageread smallint(6) NOT NULL default '0', readtime int(10) unsigned NOT NULL default '0', receipt smallint(6) unsigned NOT NULL default '0', deleteprompt smallint(6) unsigned NOT NULL default '0', multiplerecipients smallint(6) unsigned NOT NULL default '0', PRIMARY KEY (privatemessageid), KEY userid (userid)) ENGINE=MyISAM; INSERT INTO t1 VALUES (128,0,33,33,8,':D','',996121863,1,0,2,996122850,2,0,0); -CREATE TABLE t2 (userid int(10) unsigned NOT NULL auto_increment, usergroupid smallint(5) unsigned NOT NULL default '0', username varchar(50) NOT NULL default '', password varchar(50) NOT NULL default '', email varchar(50) NOT NULL default '', styleid smallint(5) unsigned NOT NULL default '0', parentemail varchar(50) NOT NULL default '', coppauser smallint(6) NOT NULL default '0', homepage varchar(100) NOT NULL default '', icq varchar(20) NOT NULL default '', aim varchar(20) NOT NULL default '', yahoo varchar(20) NOT NULL default '', signature mediumtext NOT NULL, adminemail smallint(6) NOT NULL default '0', showemail smallint(6) NOT NULL default '0', invisible smallint(6) NOT NULL default '0', usertitle varchar(250) NOT NULL default '', customtitle smallint(6) NOT NULL default '0', joindate int(10) unsigned NOT NULL default '0', cookieuser smallint(6) NOT NULL default '0', daysprune smallint(6) NOT NULL default '0', lastvisit int(10) unsigned NOT NULL default '0', lastactivity int(10) unsigned NOT NULL default '0', lastpost int(10) unsigned NOT NULL default '0', posts smallint(5) unsigned NOT NULL default '0', timezoneoffset varchar(4) NOT NULL default '', emailnotification smallint(6) NOT NULL default '0', buddylist mediumtext NOT NULL, ignorelist mediumtext NOT NULL, pmfolders mediumtext NOT NULL, receivepm smallint(6) NOT NULL default '0', emailonpm smallint(6) NOT NULL default '0', pmpopup smallint(6) NOT NULL default '0', avatarid smallint(6) NOT NULL default '0', avatarrevision int(6) unsigned NOT NULL default '0', options smallint(6) NOT NULL default '15', birthday date NOT NULL default '0000-00-00', maxposts smallint(6) NOT NULL default '-1', startofweek smallint(6) NOT NULL default '1', ipaddress varchar(20) NOT NULL default '', referrerid int(10) unsigned NOT NULL default '0', nosessionhash smallint(6) NOT NULL default '0', autorefresh smallint(6) NOT NULL default '-1', messagepopup tinyint(2) NOT NULL default '0', inforum smallint(5) unsigned NOT NULL default '0', ratenum smallint(5) unsigned NOT NULL default '0', ratetotal smallint(5) unsigned NOT NULL default '0', allowrate smallint(5) unsigned NOT NULL default '1', PRIMARY KEY (userid), KEY usergroupid (usergroupid), KEY username (username), KEY inforum (inforum)) TYPE=MyISAM; +CREATE TABLE t2 (userid int(10) unsigned NOT NULL auto_increment, usergroupid smallint(5) unsigned NOT NULL default '0', username varchar(50) NOT NULL default '', password varchar(50) NOT NULL default '', email varchar(50) NOT NULL default '', styleid smallint(5) unsigned NOT NULL default '0', parentemail varchar(50) NOT NULL default '', coppauser smallint(6) NOT NULL default '0', homepage varchar(100) NOT NULL default '', icq varchar(20) NOT NULL default '', aim varchar(20) NOT NULL default '', yahoo varchar(20) NOT NULL default '', signature mediumtext NOT NULL, adminemail smallint(6) NOT NULL default '0', showemail smallint(6) NOT NULL default '0', invisible smallint(6) NOT NULL default '0', usertitle varchar(250) NOT NULL default '', customtitle smallint(6) NOT NULL default '0', joindate int(10) unsigned NOT NULL default '0', cookieuser smallint(6) NOT NULL default '0', daysprune smallint(6) NOT NULL default '0', lastvisit int(10) unsigned NOT NULL default '0', lastactivity int(10) unsigned NOT NULL default '0', lastpost int(10) unsigned NOT NULL default '0', posts smallint(5) unsigned NOT NULL default '0', timezoneoffset varchar(4) NOT NULL default '', emailnotification smallint(6) NOT NULL default '0', buddylist mediumtext NOT NULL, ignorelist mediumtext NOT NULL, pmfolders mediumtext NOT NULL, receivepm smallint(6) NOT NULL default '0', emailonpm smallint(6) NOT NULL default '0', pmpopup smallint(6) NOT NULL default '0', avatarid smallint(6) NOT NULL default '0', avatarrevision int(6) unsigned NOT NULL default '0', options smallint(6) NOT NULL default '15', birthday date NOT NULL default '0000-00-00', maxposts smallint(6) NOT NULL default '-1', startofweek smallint(6) NOT NULL default '1', ipaddress varchar(20) NOT NULL default '', referrerid int(10) unsigned NOT NULL default '0', nosessionhash smallint(6) NOT NULL default '0', autorefresh smallint(6) NOT NULL default '-1', messagepopup tinyint(2) NOT NULL default '0', inforum smallint(5) unsigned NOT NULL default '0', ratenum smallint(5) unsigned NOT NULL default '0', ratetotal smallint(5) unsigned NOT NULL default '0', allowrate smallint(5) unsigned NOT NULL default '1', PRIMARY KEY (userid), KEY usergroupid (usergroupid), KEY username (username), KEY inforum (inforum)) ENGINE=MyISAM; INSERT INTO t2 VALUES (33,6,'Kevin','0','kevin@stileproject.com',1,'',0,'http://www.stileproject.com','','','','',1,1,0,'Administrator',0,996120694,1,-1,1030996168,1031027028,1030599436,36,'-6',0,'','','',1,0,1,0,0,15,'0000-00-00',-1,1,'64.0.0.0',0,1,-1,0,0,4,19,1); SELECT DISTINCT t1.*, t2.* FROM t1 LEFT JOIN t2 ON (t2.userid = t1.touserid); privatemessageid folderid userid touserid fromuserid title message dateline showsignature iconid messageread readtime receipt deleteprompt multiplerecipients userid usergroupid username password email styleid parentemail coppauser homepage icq aim yahoo signature adminemail showemail invisible usertitle customtitle joindate cookieuser daysprune lastvisit lastactivity lastpost posts timezoneoffset emailnotification buddylist ignorelist pmfolders receivepm emailonpm pmpopup avatarid avatarrevision options birthday maxposts startofweek ipaddress referrerid nosessionhash autorefresh messagepopup inforum ratenum ratetotal allowrate 128 0 33 33 8 :D 996121863 1 0 2 996122850 2 0 0 33 6 Kevin 0 kevin@stileproject.com 1 0 http://www.stileproject.com 1 1 0 Administrator 0 996120694 1 -1 1030996168 1031027028 1030599436 36 -6 0 1 0 1 0 0 15 0000-00-00 -1 1 64.0.0.0 0 1 -1 0 0 4 19 1 -DROP TABLE IF EXISTS t1,t2; +DROP TABLE t1,t2; CREATE TABLE t1 (a int primary key, b int, c int); INSERT t1 VALUES (1,2,3); CREATE TABLE t2 (a int primary key, b int, c int); @@ -418,8 +417,8 @@ INSERT t2 VALUES (3,4,5); SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c; a b 1 4 -DROP TABLE IF EXISTS t1,t2; -CREATE table t1 ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) TYPE=MyISAM AUTO_INCREMENT=3 ; +DROP TABLE t1,t2; +CREATE table t1 ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=3 ; INSERT INTO t1 VALUES (1, 'aaaaa'); INSERT INTO t1 VALUES (3, 'aaaaa'); INSERT INTO t1 VALUES (2, 'eeeeeee'); @@ -428,3 +427,40 @@ name a e drop table t1; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NAME varchar(75) DEFAULT '' NOT NULL, +LINK_ID int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (ID), +KEY NAME (NAME), +KEY LINK_ID (LINK_ID) +); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); +CREATE TABLE t2 ( +ID int(11) NOT NULL auto_increment, +NAME varchar(150) DEFAULT '' NOT NULL, +PRIMARY KEY (ID), +KEY NAME (NAME) +); +SELECT DISTINCT +t2.id AS key_link_id, +t2.name AS link +FROM t1 +LEFT JOIN t2 ON t1.link_id=t2.id +GROUP BY t1.id +ORDER BY link; +key_link_id link +NULL NULL +drop table t1,t2; +CREATE TABLE t1 ( +html varchar(5) default NULL, +rin int(11) default '0', +out int(11) default '0' +) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1',1,0); +SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; +html prod +1 0.00 +drop table t1; diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result index 5c732aebbcc..8b919964163 100644 --- a/mysql-test/r/drop.result +++ b/mysql-test/r/drop.result @@ -1,17 +1,17 @@ drop table if exists t1; +drop database if exists mysqltest; drop table t1; -Unknown table 't1' +ERROR 42S02: Unknown table 't1' create table t1(n int); insert into t1 values(1); create temporary table t1( n int); insert into t1 values(2); create table t1(n int); -Table 't1' already exists +ERROR 42S01: Table 't1' already exists drop table t1; select * from t1; n 1 -drop database if exists mysqltest; create database mysqltest; drop database if exists mysqltest; create database mysqltest; @@ -21,6 +21,7 @@ select * from mysqltest.mysqltest; n 4 drop database if exists mysqltest; +affected rows: 1 create database mysqltest; drop database mysqltest; flush tables with read lock; @@ -43,4 +44,14 @@ Database mysql test drop database mysqltest; -Can't drop database 'mysqltest'. Database doesn't exist +ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist +drop table t1; +flush tables with read lock; +create table t1(n int); +ERROR HY000: Can't execute the query because you have a conflicting read lock +unlock tables; +create table t1(n int); +show tables; +Tables_in_test +t1 +drop table t1; diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result index fa3a72d9472..99ee0143c05 100644 --- a/mysql-test/r/drop_temp_table.result +++ b/mysql-test/r/drop_temp_table.result @@ -10,9 +10,9 @@ get_lock("a",10) 1 show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.001 79 Query 1 79 use `test`; create database `drop-temp+table-test` -master-bin.001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int) -master-bin.001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` -master-bin.001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a") +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create database `drop-temp+table-test` +master-bin.000001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int) +master-bin.000001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` +master-bin.000001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a") drop database `drop-temp+table-test`; diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result new file mode 100644 index 00000000000..96210a0e16d --- /dev/null +++ b/mysql-test/r/endspace.result @@ -0,0 +1,217 @@ +drop table if exists t1; +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +0 1 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +0 0 1 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +0 1 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +0 0 1 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 1 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 +create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)); +insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 > 'teststring\t'; +text1 +teststring +select * from t1 order by text1; +text1 +nothing +teststring +teststring +explain select * from t1 order by text1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL key1 32 NULL 3 Using index +alter table t1 modify text1 char(32) binary not null; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; +concat('|', text1, '|') +|teststring | +|teststring| +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; +concat('|', text1, '|') +|teststring| +select text1, length(text1) from t1 order by text1; +text1 length(text1) +nothing 7 +teststring 11 +teststring 10 +select text1, length(text1) from t1 order by binary text1; +text1 length(text1) +nothing 7 +teststring 10 +teststring 11 +alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20)); +insert into t1 values ('teststring '); +select concat('|', text1, '|') from t1 order by text1; +concat('|', text1, '|') +|nothing| +|teststring| +|teststring | +|teststring | +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; +concat('|', text1, '|') +|teststring| +|teststring | +select concat('|', text1, '|') from t1 where text1='teststring'; +concat('|', text1, '|') +|teststring| +select concat('|', text1, '|') from t1 where text1='teststring '; +concat('|', text1, '|') +|teststring | +alter table t1 modify text1 text not null, pack_keys=1; +select concat('|', text1, '|') from t1 where text1='teststring'; +concat('|', text1, '|') +|teststring| +|teststring | +select concat('|', text1, '|') from t1 where text1='teststring '; +concat('|', text1, '|') +|teststring| +|teststring | +explain select concat('|', text1, '|') from t1 where text1='teststring '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range key1 key1 22 NULL 2 Using where +select * from t1 where text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +teststring +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; +concat('|', text1, '|') +|teststring| +|teststring | +select concat('|', text1, '|') from t1 order by text1; +concat('|', text1, '|') +|nothing| +|teststring | +|teststring| +|teststring | +drop table t1; +create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0; +insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); +select * from t1 where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 >= 'teststring\t'; +text1 +teststring +teststring +drop table t1; +create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap; +insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); +select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 >= 'teststring\t'; +text1 +teststring +teststring +select * from t1 order by text1; +text1 +nothing +teststring +teststring +explain select * from t1 order by text1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL key1 32 NULL 3 +alter table t1 modify text1 char(32) binary not null; +select * from t1 order by text1; +text1 +nothing +teststring +teststring +drop table t1; +create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb; +insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1 where text1='teststring' or text1 like 'teststring_%'; +text1 +teststring +teststring +select * from t1 where text1='teststring' or text1 > 'teststring\t'; +text1 +teststring +select * from t1 order by text1; +text1 +nothing +teststring +teststring +explain select * from t1 order by text1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL key1 32 NULL 3 Using index +alter table t1 modify text1 char(32) binary not null; +select * from t1 order by text1; +text1 +nothing +teststring +teststring +alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20)); +insert into t1 values ('teststring '); +select concat('|', text1, '|') from t1 order by text1; +concat('|', text1, '|') +|nothing| +|teststring| +|teststring | +|teststring | +alter table t1 modify text1 text not null, pack_keys=1; +select * from t1 where text1 like 'teststring_%'; +text1 +teststring +teststring +select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%'; +text1 length(text1) +teststring 10 +teststring 11 +teststring 11 +select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t'; +text1 length(text1) +teststring 10 +teststring 11 +teststring 11 +select concat('|', text1, '|') from t1 order by text1; +concat('|', text1, '|') +|nothing| +|teststring | +|teststring| +|teststring | +drop table t1; diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 5afecc6d600..d0011c8deb6 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -1,25 +1,25 @@ drop table if exists t1; insert into t1 values(1); -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist delete from t1; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist update t1 set a=1; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist create table t1 (a int); select count(test.t1.b) from t1; -Unknown column 'test.t1.b' in 'field list' +ERROR 42S22: Unknown column 'test.t1.b' in 'field list' select count(not_existing_database.t1) from t1; -Unknown table 'not_existing_database' in field list +ERROR 42S02: Unknown table 'not_existing_database' in field list select count(not_existing_database.t1.a) from t1; -Unknown table 'not_existing_database.t1' in field list +ERROR 42S02: Unknown table 'not_existing_database.t1' in field list select count(not_existing_database.t1.a) from not_existing_database.t1; Got one of the listed errors select 1 from t1 order by 2; -Unknown column '2' in 'order clause' +ERROR 42S22: Unknown column '2' in 'order clause' select 1 from t1 group by 2; -Unknown column '2' in 'group statement' +ERROR 42S22: Unknown column '2' in 'group statement' select 1 from t1 order by t1.b; -Unknown column 't1.b' in 'order clause' +ERROR 42S22: Unknown column 't1.b' in 'order clause' select count(*),b from t1; -Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'field list' drop table t1; diff --git a/mysql-test/r/exampledb.result b/mysql-test/r/exampledb.result new file mode 100644 index 00000000000..9bfb77c1c0b --- /dev/null +++ b/mysql-test/r/exampledb.result @@ -0,0 +1,6 @@ +drop table if exists t1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE=example; +drop table t1; diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index d433078a251..d66dec741bd 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -1,8 +1,8 @@ drop table if exists t1; create table t1 (id int not null, str char(10), unique(str)); explain select * from t1; -table type possible_keys key key_len ref rows Extra -t1 system NULL NULL NULL NULL 0 const row not found +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar"); select * from t1 where str is null; id str @@ -12,35 +12,44 @@ select * from t1 where str="foo"; id str 3 foo explain select * from t1 where str is null; -table type possible_keys key key_len ref rows Extra -t1 ref str str 11 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref str str 11 const 1 Using where explain select * from t1 where str="foo"; -table type possible_keys key key_len ref rows Extra -t1 const str str 11 const 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const str str 11 const 1 explain select * from t1 ignore key (str) where str="foo"; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where explain select * from t1 use key (str,str) where str="foo"; -table type possible_keys key key_len ref rows Extra -t1 const str str 11 const 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const str str 11 const 1 explain select * from t1 use key (str,str,foo) where str="foo"; -Key column 'foo' doesn't exist in table +ERROR 42000: Key column 'foo' doesn't exist in table explain select * from t1 ignore key (str,str,foo) where str="foo"; -Key column 'foo' doesn't exist in table +ERROR 42000: Key column 'foo' doesn't exist in table drop table t1; explain select 1; -Comment -No tables used +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used create table t1 (a int not null); explain select count(*) from t1; -Comment -Select tables optimized away +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away insert into t1 values(1); explain select count(*) from t1; -Comment -Select tables optimized away +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away insert into t1 values(1); explain select count(*) from t1; -Comment -Select tables optimized away +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1; +set names koi8r; +create table ÔÁ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1)); +insert into ÔÁ (ËÏÌ0) values (1); +insert into ÔÁ (ËÏÌ0) values (2); +explain select ËÏÌ0 from ÔÁ where ËÏÌ0=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ÔÁ ref ÉÎÄ0,ÉÎÄ01 ÉÎÄ0 5 const 1 Using where; Using index +drop table ÔÁÂ; +set names latin1; diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index 8dc73e446c7..bab9b543307 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -1,7 +1,6 @@ -drop table if exists t1; +drop table if exists t1,t2; drop database if exists mysqltest; create temporary table t1(n int not null primary key); -drop table if exists t2; create table t2(n int); insert into t2 values(3); select * from t1; @@ -9,7 +8,7 @@ n 3 flush tables with read lock; drop table t2; -Table 't2' was locked with a READ lock and can't be updated +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated drop table t2; unlock tables; create database mysqltest; diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result index 3205dd9dad9..17991f15382 100644 --- a/mysql-test/r/flush_block_commit.result +++ b/mysql-test/r/flush_block_commit.result @@ -1,5 +1,5 @@ drop table if exists t1; -create table t1 (a int) type=innodb; +create table t1 (a int) engine=innodb; begin; insert into t1 values(1); flush tables with read lock; diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result index cfba428e2e8..257f69fa6d9 100644 --- a/mysql-test/r/flush_table.result +++ b/mysql-test/r/flush_table.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1 (a int not null auto_increment primary key); insert into t1 values(0); lock table t1 read; @@ -7,60 +7,6 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -drop database if exists test_test; -create database test_test; -use test_test; -create table t1(table_id char(20) primary key); -insert into t1 values ('test_test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -table_id -test_test.t1 - -create table t2(table_id char(20) primary key); -insert into t2 values ('test_test.t2'); -insert into t2 values (''); -handler t2 open; -handler t2 read first limit 9; -table_id -test_test.t2 - -use test; -drop table if exists t1; -create table t1(table_id char(20) primary key); -insert into t1 values ('test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -table_id -test.t1 - -use test; -handler test.t1 read first limit 9; -table_id -test.t1 - -handler test.t2 read first limit 9; -Unknown table 't2' in HANDLER -handler test_test.t1 read first limit 9; -table_id -test_test.t1 - -handler test_test.t2 read first limit 9; -table_id -test_test.t2 - -handler test_test.t1 close; -drop table test_test.t1; -handler test_test.t2 close; -drop table test_test.t2; -drop database test_test; -use test; -handler test.t1 close; -drop table test.t1; -drop table if exists t1; -drop table if exists t2; create table t1(table_id char(20) primary key); create table t2(table_id char(20) primary key); insert into t1 values ('test.t1'); @@ -84,11 +30,11 @@ test.t2 flush tables; handler a1 read first limit 9; -Unknown table 'a1' in HANDLER +ERROR 42S02: Unknown table 'a1' in HANDLER handler a2 read first limit 9; -Unknown table 'a2' in HANDLER +ERROR 42S02: Unknown table 'a2' in HANDLER handler t2 read first limit 9; -Unknown table 't2' in HANDLER +ERROR 42S02: Unknown table 't2' in HANDLER handler t1 open as a1; handler t1 open as a2; handler t2 open; @@ -106,15 +52,15 @@ test.t2 flush table t1; handler a1 read first limit 9; -Unknown table 'a1' in HANDLER +ERROR 42S02: Unknown table 'a1' in HANDLER handler a2 read first limit 9; -Unknown table 'a2' in HANDLER +ERROR 42S02: Unknown table 'a2' in HANDLER handler t2 read first limit 9; table_id test.t2 flush table t2; handler t2 close; -Unknown table 't2' in HANDLER +ERROR 42S02: Unknown table 't2' in HANDLER drop table t1; drop table t2; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 19bd355f537..30c4c75f3d1 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -7,12 +7,17 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Full-text search in MySQL', 'implements vector space model'); SHOW INDEX FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 a 1 a A NULL NULL NULL YES FULLTEXT -t1 1 a 2 b A NULL NULL NULL YES FULLTEXT +t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT +t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT select * from t1 where MATCH(a,b) AGAINST ("collections"); a b Only MyISAM tables support collections Full-text indexes are called collections +explain extended select * from t1 where MATCH(a,b) AGAINST ("collections"); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where +Warnings: +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections')) select * from t1 where MATCH(a,b) AGAINST ("indexes"); a b Full-text indexes are called collections @@ -20,39 +25,60 @@ select * from t1 where MATCH(a,b) AGAINST ("indexes collections"); a b Full-text indexes are called collections Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST ("only"); +a b +select * from t1 where MATCH(a,b) AGAINST ("collections" WITH QUERY EXPANSION); +a b +Only MyISAM tables support collections +Full-text indexes are called collections +MySQL has now support for full-text search +select * from t1 where MATCH(a,b) AGAINST ("indexes" WITH QUERY EXPANSION); +a b +Full-text indexes are called collections +Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST ("indexes collections" WITH QUERY EXPANSION); +a b +Full-text indexes are called collections +Only MyISAM tables support collections +MySQL has now support for full-text search explain select * from t1 where MATCH(a,b) AGAINST ("collections"); -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>0; -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>1; -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>=0; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>=1; -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where 0<MATCH(a,b) AGAINST ("collections"); -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where 1<MATCH(a,b) AGAINST ("collections"); -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where 0<=MATCH(a,b) AGAINST ("collections"); -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain select * from t1 where 1<=MATCH(a,b) AGAINST ("collections"); -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>0 and a like '%ll%'; -table type possible_keys key key_len ref rows Extra -t1 fulltext a a 0 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); a b MySQL has now support for full-text search +explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where +Warnings: +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode)) select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); a b MySQL has now support for full-text search @@ -122,6 +148,8 @@ select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN B a b select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); a b +select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); +a b select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE); a b Full-text search in MySQL implements vector space model @@ -195,7 +223,7 @@ id show keys from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t2 1 tig 1 ticket A NULL NULL NULL YES BTREE -t2 1 tix 1 inhalt A NULL NULL NULL YES FULLTEXT +t2 1 tix 1 inhalt NULL NULL NULL NULL YES FULLTEXT show create table t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -203,7 +231,7 @@ t2 CREATE TABLE `t2` ( `inhalt` text, KEY `tig` (`ticket`), FULLTEXT KEY `tix` (`inhalt`) -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t2 where MATCH inhalt AGAINST (NULL); ticket inhalt select * from t2 where MATCH inhalt AGAINST ('foobar'); @@ -212,6 +240,12 @@ ticket inhalt select * from t2 having MATCH inhalt AGAINST ('foobar'); ticket inhalt 3 foobar +CREATE TABLE t3 (t int(11),i text,fulltext tix (t,i)); +ERROR HY000: Column 't' cannot be part of FULLTEXT index +CREATE TABLE t3 (t int(11),i text, +j varchar(200) CHARACTER SET latin2, +fulltext tix (i,j)); +ERROR HY000: Column 'j' cannot be part of FULLTEXT index CREATE TABLE t3 ( ticket int(11), inhalt text, @@ -219,19 +253,19 @@ KEY tig (ticket), fulltext index tix (inhalt) ); select * from t2 where MATCH inhalt AGAINST (t2.inhalt); -Wrong arguments to AGAINST +ERROR HY000: Incorrect arguments to AGAINST select * from t2 where MATCH ticket AGAINST ('foobar'); -Can't find FULLTEXT index matching the column list +ERROR HY000: Can't find FULLTEXT index matching the column list select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar'); -Wrong arguments to MATCH +ERROR HY000: Incorrect arguments to MATCH drop table t1,t2,t3; CREATE TABLE t1 ( id int(11) auto_increment, title varchar(100) default '', PRIMARY KEY (id), -KEY ind5 (title), -FULLTEXT KEY FT1 (title) -) TYPE=MyISAM; +KEY ind5 (title) +) ENGINE=MyISAM; +CREATE FULLTEXT INDEX ft1 ON t1(title); insert into t1 (title) values ('this is a test'); select * from t1 where match title against ('test' in boolean mode); id title @@ -246,7 +280,7 @@ id title 1 this test once revealed a bug update t1 set title=NULL where id=1; drop table t1; -CREATE TABLE t1 (a int(11), b text, FULLTEXT KEY (b)) TYPE=MyISAM; +CREATE TABLE t1 (a int(11), b text, FULLTEXT KEY (b)) ENGINE=MyISAM; insert into t1 values (1,"I wonder why the fulltext index doesnt work?"); SELECT * from t1 where MATCH (b) AGAINST ('apples'); a b @@ -256,7 +290,7 @@ a b 2 fullaaa fullzzz 1 I wonder why the fulltext index doesnt work? drop table t1; -CREATE TABLE t1 ( id int(11) NOT NULL auto_increment primary key, mytext text NOT NULL, FULLTEXT KEY mytext (mytext)) TYPE=MyISAM; +CREATE TABLE t1 ( id int(11) NOT NULL auto_increment primary key, mytext text NOT NULL, FULLTEXT KEY mytext (mytext)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'my small mouse'),(2,'la-la-la'),(3,'It is so funny'),(4,'MySQL Tutorial'); select 8 from t1; 8 @@ -265,7 +299,6 @@ select 8 from t1; 8 8 drop table t1; -drop table if exists t1; create table t1 (a text, fulltext key (a)); insert into t1 values ('aaaa'); repair table t1; @@ -274,7 +307,6 @@ test.t1 repair status OK select * from t1 where match (a) against ('aaaa'); a drop table t1; -drop table if exists t1; create table t1 ( ref_mag text not null, fulltext (ref_mag)); insert into t1 values ('test'); select ref_mag from t1 where match ref_mag against ('+test' in boolean mode); @@ -298,3 +330,47 @@ t1_id name t2_id t1_id name select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); t2_id t1_id name drop table t1,t2; +SET NAMES latin1; +CREATE TABLE t1 (t text character set utf8 not null, fulltext(t)); +INSERT t1 VALUES ('Mit freundlichem Grüß'), ('aus Osnabrück'); +SET NAMES koi8r; +INSERT t1 VALUES ("üÔÏ ÍÙ - ÏÐÉÌËÉ"),("ïÔÌÅÚØ, ÇÎÉÄÁ!"), +("îÅ ×ÌÅÚÁÊ, ÕÂØÅÔ!"),("É ÂÕÄÅÔ ÐÒÁ×!"); +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('ïðéìëé'); +t collation(t) +üÔÏ ÍÙ - ÏÐÉÌËÉ utf8_general_ci +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('ðÒá*' IN BOOLEAN MODE); +t collation(t) +É ÂÕÄÅÔ ÐÒÁ×! utf8_general_ci +SELECT * FROM t1 WHERE MATCH t AGAINST ('ÜÔÏ' IN BOOLEAN MODE); +t +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); +t collation(t) +SET NAMES latin1; +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); +t collation(t) +aus Osnabrück utf8_general_ci +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); +t collation(t) +SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); +t collation(t) MATCH t AGAINST ('Osnabruck') +aus Osnabrück utf8_general_ci 1.591139793396 +alter table t1 modify t varchar(200) collate latin1_german2_ci not null; +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); +t collation(t) +aus Osnabrück latin1_german2_ci +SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); +t collation(t) +aus Osnabrück latin1_german2_ci +DROP TABLE t1; +CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8; +insert into t1 (s) values ('pära para para'),('para para para'); +select * from t1 where match(s) against('para' in boolean mode); +s +pära para para +para para para +select * from t1 where match(s) against('par*' in boolean mode); +s +pära para para +para para para +DROP TABLE t1; diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result new file mode 100644 index 00000000000..0b1d8eb9a15 --- /dev/null +++ b/mysql-test/r/fulltext2.result @@ -0,0 +1,217 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +i int(10) unsigned not null auto_increment primary key, +a varchar(255) not null, +FULLTEXT KEY (a) +) ENGINE=MyISAM; +repair table t1 quick; +Table Op Msg_type Msg_text +test.t1 repair status OK +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select count(*) from t1 where match a against ('aaaxxx'); +count(*) +260 +select count(*) from t1 where match a against ('aaayyy'); +count(*) +250 +select count(*) from t1 where match a against ('aaazzz'); +count(*) +255 +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +260 +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +count(*) +250 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +255 +select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz'); +count(*) +765 +select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode); +count(*) +765 +select count(*) from t1 where match a against ('aaax*' in boolean mode); +count(*) +260 +select count(*) from t1 where match a against ('aaay*' in boolean mode); +count(*) +250 +select count(*) from t1 where match a against ('aaa*' in boolean mode); +count(*) +765 +insert t1 (a) values ('aaaxxx'),('aaayyy'); +insert t1 (a) values ('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'); +select count(*) from t1 where match a against ('aaaxxx'); +count(*) +261 +select count(*) from t1 where match a against ('aaayyy'); +count(*) +251 +select count(*) from t1 where match a against ('aaazzz'); +count(*) +260 +insert t1 (a) values ('aaaxxx 000000'); +select count(*) from t1 where match a against ('000000'); +count(*) +1 +delete from t1 where match a against ('000000'); +select count(*) from t1 where match a against ('000000'); +count(*) +0 +select count(*) from t1 where match a against ('aaaxxx'); +count(*) +261 +delete from t1 where match a against ('aaazzz'); +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +261 +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +count(*) +251 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +0 +select count(*) from t1 where a = 'aaaxxx'; +count(*) +261 +select count(*) from t1 where a = 'aaayyy'; +count(*) +251 +select count(*) from t1 where a = 'aaazzz'; +count(*) +0 +insert t1 (a) values ('aaaxxx 000000'); +select count(*) from t1 where match a against ('000000'); +count(*) +1 +update t1 set a='aaazzz' where match a against ('000000'); +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +261 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +1 +update t1 set a='aaazzz' where a = 'aaaxxx'; +update t1 set a='aaaxxx' where a = 'aaayyy'; +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +251 +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +count(*) +0 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +262 +drop table t1; +CREATE TABLE t1 ( +i int(10) unsigned not null auto_increment primary key, +a varchar(255) not null, +FULLTEXT KEY (a) +) ENGINE=MyISAM; +select count(*) from t1 where match a against ('aaaxxx'); +count(*) +260 +select count(*) from t1 where match a against ('aaayyy'); +count(*) +250 +select count(*) from t1 where match a against ('aaazzz'); +count(*) +255 +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +260 +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +count(*) +250 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +255 +select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz'); +count(*) +765 +select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode); +count(*) +765 +select count(*) from t1 where match a against ('aaax*' in boolean mode); +count(*) +260 +select count(*) from t1 where match a against ('aaay*' in boolean mode); +count(*) +250 +select count(*) from t1 where match a against ('aaa*' in boolean mode); +count(*) +765 +insert t1 (a) values ('aaaxxx'),('aaayyy'); +insert t1 (a) values ('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'); +select count(*) from t1 where match a against ('aaaxxx'); +count(*) +261 +select count(*) from t1 where match a against ('aaayyy'); +count(*) +251 +select count(*) from t1 where match a against ('aaazzz'); +count(*) +260 +insert t1 (a) values ('aaaxxx 000000'); +select count(*) from t1 where match a against ('000000'); +count(*) +1 +delete from t1 where match a against ('000000'); +select count(*) from t1 where match a against ('000000'); +count(*) +0 +select count(*) from t1 where match a against ('aaaxxx'); +count(*) +261 +delete from t1 where match a against ('aaazzz'); +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +261 +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +count(*) +251 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +0 +select count(*) from t1 where a = 'aaaxxx'; +count(*) +261 +select count(*) from t1 where a = 'aaayyy'; +count(*) +251 +select count(*) from t1 where a = 'aaazzz'; +count(*) +0 +insert t1 (a) values ('aaaxxx 000000'); +select count(*) from t1 where match a against ('000000'); +count(*) +1 +update t1 set a='aaazzz' where match a against ('000000'); +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +261 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +1 +update t1 set a='aaazzz' where a = 'aaaxxx'; +update t1 set a='aaaxxx' where a = 'aaayyy'; +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +count(*) +251 +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +count(*) +0 +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +count(*) +262 +drop table t1; diff --git a/mysql-test/r/fulltext_distinct.result b/mysql-test/r/fulltext_distinct.result index abb4929d0ec..de0668ff28c 100644 --- a/mysql-test/r/fulltext_distinct.result +++ b/mysql-test/r/fulltext_distinct.result @@ -7,14 +7,14 @@ PRIMARY KEY (id), KEY kt(tag), KEY kv(value(15)), FULLTEXT KEY kvf(value) -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( id_t2 mediumint unsigned NOT NULL default '0', id_t1 mediumint unsigned NOT NULL default '0', field_number tinyint unsigned NOT NULL default '0', PRIMARY KEY (id_t2,id_t1,field_number), KEY id_t1(id_t1) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 (tag,value) VALUES ('foo123','bar111'); INSERT INTO t1 (tag,value) VALUES ('foo123','bar222'); INSERT INTO t1 (tag,value) VALUES ('bar345','baz333 ar'); diff --git a/mysql-test/r/fulltext_left_join.result b/mysql-test/r/fulltext_left_join.result index d215ea0cea8..bf3fe73690a 100644 --- a/mysql-test/r/fulltext_left_join.result +++ b/mysql-test/r/fulltext_left_join.result @@ -31,9 +31,9 @@ match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) 1 0 drop table t1, t2; -create table t1 (venue_id int(11) default null, venue_text varchar(255) default null, dt datetime default null) type=myisam; +create table t1 (venue_id int(11) default null, venue_text varchar(255) default null, dt datetime default null) engine=myisam; insert into t1 (venue_id, venue_text, dt) values (1, 'a1', '2003-05-23 19:30:00'),(null, 'a2', '2003-05-23 19:30:00'); -create table t2 (name varchar(255) not null default '', entity_id int(11) not null auto_increment, primary key (entity_id), fulltext key name (name)) type=myisam; +create table t2 (name varchar(255) not null default '', entity_id int(11) not null auto_increment, primary key (entity_id), fulltext key name (name)) engine=myisam; insert into t2 (name, entity_id) values ('aberdeen town hall', 1), ('glasgow royal concert hall', 2), ('queen\'s hall, edinburgh', 3); select * from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen' in boolean mode) and dt = '2003-05-23 19:30:00'; venue_id venue_text dt name entity_id diff --git a/mysql-test/r/fulltext_var.result b/mysql-test/r/fulltext_var.result index dda8e332fba..50afea2a500 100644 --- a/mysql-test/r/fulltext_var.result +++ b/mysql-test/r/fulltext_var.result @@ -1,7 +1,38 @@ +drop table if exists t1; show variables like "ft\_%"; Variable_name Value ft_boolean_syntax + -><()~*:""&| +ft_max_word_len 84 ft_min_word_len 4 -ft_max_word_len 254 -ft_max_word_len_for_sort 20 +ft_query_expansion_limit 20 ft_stopword_file (built-in) +create table t1 (b text not null); +insert t1 values ('aaaaaa bbbbbb cccccc'); +insert t1 values ('bbbbbb cccccc'); +insert t1 values ('aaaaaa cccccc'); +select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode); +b +aaaaaa bbbbbb cccccc +aaaaaa cccccc +set ft_boolean_syntax=' +-><()~*:""&|'; +ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL +set global ft_boolean_syntax=' +-><()~*:""&|'; +select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode); +b +aaaaaa bbbbbb cccccc +bbbbbb cccccc +set global ft_boolean_syntax='@ -><()~*:""&|'; +select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode); +b +aaaaaa bbbbbb cccccc +bbbbbb cccccc +aaaaaa cccccc +select * from t1 where match b against ('+aaaaaa @bbbbbb' in boolean mode); +b +aaaaaa bbbbbb cccccc +bbbbbb cccccc +set global ft_boolean_syntax='@ -><()~*:""@|'; +ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '@ -><()~*:""@|' +set global ft_boolean_syntax='+ -><()~*:""@!|'; +ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '+ -><()~*:""@!|' +drop table t1; diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result new file mode 100644 index 00000000000..a3d28471993 --- /dev/null +++ b/mysql-test/r/func_compress.result @@ -0,0 +1,70 @@ +select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '; +@test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ' +string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +select length(@test_compress_string); +length(@test_compress_string) +117 +select uncompress(compress(@test_compress_string)); +uncompress(compress(@test_compress_string)) +string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +explain extended select uncompress(compress(@test_compress_string)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))` +select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); +uncompressed_length(compress(@test_compress_string))=length(@test_compress_string) +1 +explain extended select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` +select uncompressed_length(compress(@test_compress_string)); +uncompressed_length(compress(@test_compress_string)) +117 +select length(compress(@test_compress_string))<length(@test_compress_string); +length(compress(@test_compress_string))<length(@test_compress_string) +1 +create table t1 (a text, b char(255), c char(4)) engine=myisam; +insert into t1 (a,b,c) values (compress(@test_compress_string),compress(@test_compress_string),'d '); +select uncompress(a) from t1; +uncompress(a) +string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +select uncompress(b) from t1; +uncompress(b) +string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +select concat('|',c,'|') from t1; +concat('|',c,'|') +|d| +drop table t1; +select compress(""); +compress("") + +select uncompress(""); +uncompress("") + +select uncompress(compress("")); +uncompress(compress("")) + +select uncompressed_length(""); +uncompressed_length("") +0 +create table t1 (a text); +insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000)); +select length(a) from t1; +length(a) +NULL +12 +76 +50000 +select length(uncompress(a)) from t1; +length(uncompress(a)) +NULL +NULL +50000 +NULL +Warnings: +Error 1259 ZLIB: Input data corrupted +Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) +drop table t1; diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 96bbaa6cae7..2ee3e770a2e 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -1,14 +1,8 @@ +drop table if exists t1; select length(encrypt('foo', 'ff')) <> 0; length(encrypt('foo', 'ff')) <> 0 1 -select old_password('test'), password('test'); -old_password('test') password('test') -378b243e220ca493 378b243e220ca493 -select length(encrypt('test')), encrypt('test','aa'); -length(encrypt('test')) encrypt('test','aa') -13 aaqPiZY5xR5l. -drop table if exists t1; -create table t1 (name varchar(50), pw varchar(16)); +create table t1 (name varchar(50), pw varchar(64)); insert into t1 values ('tom', password('my_pass')); set @pass='my_pass'; select name from t1 where name='tom' and pw=password(@pass); @@ -17,3 +11,84 @@ tom select name from t1 where name='tom' and pw=password(@undefined); name drop table t1; +select password('abc'); +password('abc') +*0D3CED9BEC10A777AEC23CCC353A8C08A633045E +select password(''); +password('') + +select old_password('abc'); +old_password('abc') +7cd2b5942be28759 +select old_password(''); +old_password('') + +select password('gabbagabbahey'); +password('gabbagabbahey') +*B0F99D2963660DD7E16B751EC9EE2F17B6A68FA6 +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +select length(password('1')); +length(password('1')) +41 +select length(encrypt('test')); +length(encrypt('test')) +13 +select encrypt('test','aa'); +encrypt('test','aa') +aaqPiZY5xR5l. +select old_password(NULL); +old_password(NULL) +NULL +select password(NULL); +password(NULL) +NULL +set global old_passwords=on; +select password(''); +password('') + +select old_password(''); +old_password('') + +select password('idkfa'); +password('idkfa') +*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +set old_passwords=on; +select password('idkfa'); +password('idkfa') +5c078dc54ca0fcca +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +set global old_passwords=off; +select password('idkfa'); +password('idkfa') +5c078dc54ca0fcca +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +set old_passwords=off; +select password('idkfa '); +password('idkfa ') +*2DC31D90647B4C1ABC9231563D2236E96C9A2DB2 +select password('idkfa'); +password('idkfa') +*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA +select password(' idkfa'); +password(' idkfa') +*12B099E56BB7FE8D43C78FD834A9D1D11178D045 +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +select old_password(' i d k f a '); +old_password(' i d k f a ') +5c078dc54ca0fcca +explain extended select password('idkfa '), old_password('idkfa'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` diff --git a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result index acdf2c5d7be..f4091ff4c0e 100644 --- a/mysql-test/r/func_date_add.result +++ b/mysql-test/r/func_date_add.result @@ -6,7 +6,7 @@ hits int(10) unsigned DEFAULT '0' NOT NULL, sessions int(10) unsigned DEFAULT '0' NOT NULL, ts timestamp(14), PRIMARY KEY (visitor_id,group_id) -)/*! type=MyISAM */; +)/*! engine=MyISAM */; INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952); INSERT INTO t1 VALUES (173865424,2,2,2,20000318233615); INSERT INTO t1 VALUES (173865424,8,2,2,20000318233615); @@ -31,17 +31,17 @@ INSERT INTO t1 VALUES (357917728,7,2,2,20000319145027); select visitor_id,max(ts) as mts from t1 group by visitor_id having mts < DATE_SUB(NOW(),INTERVAL 3 MONTH); visitor_id mts -48985536 20000319013932 -173865424 20000318233615 -357917728 20000319145027 -465931136 20000318160953 -1092858576 20000319013445 +48985536 2000-03-19 01:39:32 +173865424 2000-03-18 23:36:15 +357917728 2000-03-19 14:50:27 +465931136 2000-03-18 16:09:53 +1092858576 2000-03-19 01:34:45 select visitor_id,max(ts) as mts from t1 group by visitor_id having DATE_ADD(mts,INTERVAL 3 MONTH) < NOW(); visitor_id mts -48985536 20000319013932 -173865424 20000318233615 -357917728 20000319145027 -465931136 20000318160953 -1092858576 20000319013445 +48985536 2000-03-19 01:39:32 +173865424 2000-03-18 23:36:15 +357917728 2000-03-19 14:50:27 +465931136 2000-03-18 16:09:53 +1092858576 2000-03-19 01:34:45 drop table t1; diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result new file mode 100644 index 00000000000..2993d79a870 --- /dev/null +++ b/mysql-test/r/func_default.result @@ -0,0 +1,18 @@ +drop table if exists t1,t2; +create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14'); +insert into t1 values ('','',0,0.0); +select default(str), default(strnull), default(intg), default(rel) from t1; +default(str) default(strnull) default(intg) default(rel) +def NULL 10 3.14 +explain extended select default(str), default(strnull), default(intg), default(rel) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1 +select * from t1 where str <> default(str); +str strnull intg rel + 0 0 +explain select * from t1 where str <> default(str); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +drop table t1; diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index 39c734999b2..d32e67fe7d5 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -134,3 +134,8 @@ NULL select hex(des_decrypt(des_encrypt("hello","hidden"))); hex(des_decrypt(des_encrypt("hello","hidden"))) NULL +explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden")); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` diff --git a/mysql-test/r/func_equal.result b/mysql-test/r/func_equal.result index 32a911eedf8..352b76f2744 100644 --- a/mysql-test/r/func_equal.result +++ b/mysql-test/r/func_equal.result @@ -1,3 +1,4 @@ +drop table if exists t1,t2; select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL; 0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL 1 1 1 1 @@ -10,7 +11,6 @@ select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0; select "A"<=>"B","A"<=>NULL,NULL<=>"A"; "A"<=>"B" "A"<=>NULL NULL<=>"A" 0 0 0 -drop table if exists t1,t2; create table t1 (id int, value int); create table t2 (id int, value int); insert into t1 values (1,null); diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result new file mode 100644 index 00000000000..e0883a6297e --- /dev/null +++ b/mysql-test/r/func_gconcat.result @@ -0,0 +1,368 @@ +drop table if exists t1, t2; +create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null); +insert into t1 values (1,1,"a","a"); +insert into t1 values (2,2,"b","a"); +insert into t1 values (2,3,"c","b"); +insert into t1 values (3,4,"E","a"); +insert into t1 values (3,5,"C","b"); +insert into t1 values (3,6,"D","b"); +insert into t1 values (3,7,"d","d"); +insert into t1 values (3,8,"d","d"); +insert into t1 values (3,9,"D","c"); +select grp,group_concat(c) from t1 group by grp; +grp group_concat(c) +1 a +2 b,c +3 E,C,D,d,d,D +explain extended select grp,group_concat(c) from t1 group by grp; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort +Warnings: +Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c separator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp +select grp,group_concat(a,c) from t1 group by grp; +grp group_concat(a,c) +1 1a +2 2b,3c +3 4E,5C,6D,7d,8d,9D +select grp,group_concat("(",a,":",c,")") from t1 group by grp; +grp group_concat("(",a,":",c,")") +1 (1:a) +2 (2:b),(3:c) +3 (4:E),(5:C),(6:D),(7:d),(8:d),(9:D) +select grp,group_concat(c separator ",") from t1 group by grp; +grp group_concat(c separator ",") +1 a +2 b,c +3 E,C,D,d,d,D +select grp,group_concat(c separator "---->") from t1 group by grp; +grp group_concat(c separator "---->") +1 a +2 b---->c +3 E---->C---->D---->d---->d---->D +select grp,group_concat(c order by c) from t1 group by grp; +grp group_concat(c order by c) +1 a +2 b,c +3 C,D,d,d,D,E +select grp,group_concat(c order by c desc) from t1 group by grp; +grp group_concat(c order by c desc) +1 a +2 c,b +3 E,D,d,d,D,C +select grp,group_concat(d order by a) from t1 group by grp; +grp group_concat(d order by a) +1 a +2 a,b +3 a,b,b,d,d,c +select grp,group_concat(d order by a desc) from t1 group by grp; +grp group_concat(d order by a desc) +1 a +2 b,a +3 c,d,d,b,b,a +select grp,group_concat(a order by a,d+c-ascii(c)-a) from t1 group by grp; +grp group_concat(a order by a,d+c-ascii(c)-a) +1 1 +2 2,3 +3 4,5,6,7,8,9 +select grp,group_concat(a order by d+c-ascii(c),a) from t1 group by grp; +grp group_concat(a order by d+c-ascii(c),a) +1 1 +2 3,2 +3 7,8,4,6,9,5 +select grp,group_concat(c order by 1) from t1 group by grp; +grp group_concat(c order by 1) +1 a +2 b,c +3 C,D,d,d,D,E +select grp,group_concat(c order by "c") from t1 group by grp; +grp group_concat(c order by "c") +1 a +2 b,c +3 C,D,d,d,D,E +select grp,group_concat(distinct c order by c) from t1 group by grp; +grp group_concat(distinct c order by c) +1 a +2 b,c +3 C,D,E +select grp,group_concat(distinct c order by c desc) from t1 group by grp; +grp group_concat(distinct c order by c desc) +1 a +2 c,b +3 E,D,C +explain extended select grp,group_concat(distinct c order by c desc) from t1 group by grp; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort +Warnings: +Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c separator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp +select grp,group_concat(c order by c separator ",") from t1 group by grp; +grp group_concat(c order by c separator ",") +1 a +2 b,c +3 C,D,d,d,D,E +select grp,group_concat(c order by c desc separator ",") from t1 group by grp; +grp group_concat(c order by c desc separator ",") +1 a +2 c,b +3 E,D,d,d,D,C +select grp,group_concat(distinct c order by c separator ",") from t1 group by grp; +grp group_concat(distinct c order by c separator ",") +1 a +2 b,c +3 C,D,E +explain extended select grp,group_concat(distinct c order by c separator ",") from t1 group by grp; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort +Warnings: +Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c separator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp +select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp; +grp group_concat(distinct c order by c desc separator ",") +1 a +2 c,b +3 E,D,C +select grp,group_concat(c order by grp desc) from t1 group by grp order by grp; +grp group_concat(c order by grp desc) +1 a +2 c,b +3 D,d,d,D,C,E +select grp, group_concat(a separator "")+0 from t1 group by grp; +grp group_concat(a separator "")+0 +1 1 +2 23 +3 456789 +select grp, group_concat(a separator "")+0.0 from t1 group by grp; +grp group_concat(a separator "")+0.0 +1 1.0 +2 23.0 +3 456789.0 +select grp, ROUND(group_concat(a separator "")) from t1 group by grp; +grp ROUND(group_concat(a separator "")) +1 1 +2 23 +3 456789 +drop table t1; +create table t1 (grp int, c char(10)); +insert into t1 values (1,NULL),(2,"b"),(2,NULL),(3,"E"),(3,NULL),(3,"D"),(3,NULL),(3,NULL),(3,"D"),(4,""),(5,NULL); +select grp,group_concat(c order by c) from t1 group by grp; +grp group_concat(c order by c) +1 NULL +2 b +3 D,D,E +4 +5 NULL +set group_concat_max_len = 4; +select grp,group_concat(c) from t1 group by grp; +grp group_concat(c) +1 NULL +2 b +3 D,D, +4 +5 NULL +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() +show warnings; +Level Code Message +Warning 1260 1 line(s) were cut by GROUP_CONCAT() +set group_concat_max_len = 1024; +select group_concat(sum(a)) from t1 group by grp; +ERROR HY000: Invalid use of group function +select grp,group_concat(c order by 2) from t1 group by grp; +ERROR 42S22: Unknown column '2' in 'group statement' +drop table t1; +create table t1 ( URL_ID int(11), URL varchar(80)); +create table t2 ( REQ_ID int(11), URL_ID int(11)); +insert into t1 values (4,'www.host.com'), (5,'www.google.com'),(5,'www.help.com'); +insert into t2 values (1,4), (5,4), (5,5); +select REQ_ID, Group_Concat(URL) as URL from t1, t2 where +t2.URL_ID = t1.URL_ID group by REQ_ID; +REQ_ID URL +1 X +5 X,X,X +select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll, +Max(t1.URL_ID) urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID; +REQ_ID URL urll urlg +1 X 4 4 +5 X,X,X 4 5 +drop table t1; +drop table t2; +create table t1 (id int, name varchar(16)); +insert into t1 values (1,'longername'),(1,'evenlongername'); +select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'without distinct: how it should be' from t1; +without distinct: how it should be +1:longername,1:evenlongername +select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1; +with distinct: cutoff at length of shortname +1:longername,1:evenlongername +drop table t1; +create table t1(id int); +create table t2(id int); +insert into t1 values(0),(1); +select group_concat(t1.id) FROM t1,t2; +group_concat(t1.id) +NULL +drop table t1; +drop table t2; +create table t1 (bar varchar(32)); +insert into t1 values('test1'),('test2'); +select group_concat(bar order by concat(bar,bar)) from t1; +group_concat(bar order by concat(bar,bar)) +test1,test2 +select group_concat(bar order by concat(bar,bar) desc) from t1; +group_concat(bar order by concat(bar,bar) desc) +test2,test1 +select bar from t1 having group_concat(bar)=''; +bar +select bar from t1 having instr(group_concat(bar), "test") > 0; +bar +test1 +select bar from t1 having instr(group_concat(bar order by concat(bar,bar) desc), "test2,test1") > 0; +bar +test1 +drop table t1; +create table t1 (a int, a1 varchar(10)); +create table t2 (a0 int); +insert into t1 values (0,"a"),(0,"b"),(1,"c"); +insert into t2 values (1),(2),(3); +select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1; +group_concat(a1 order by (t1.a IN (select a0 from t2))) +b,a,c +select group_concat(a1 order by (t1.a)) from t1; +group_concat(a1 order by (t1.a)) +b,a,c +drop table t1, t2; +CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL); +INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3); +CREATE TABLE t2 (id1 tinyint(4) NOT NULL); +INSERT INTO t2 VALUES (1),(2),(3),(4),(5); +SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1; +id1 concat_id +1 1,2,3,4,5 +SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1; +id1 concat_id +1 1,2,3,4,5 +2 1,2,3 +SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 DESC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1; +id1 concat_id +1 5,4,3,2,1 +2 3,2,1 +SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1; +id1 concat_id +1 5,4,3,2,1 +2 3,2,1 +SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1; +id1 concat_id +1 51,42,33,24,15 +2 33,24,15 +SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1; +id1 concat_id +1 51,42,33,24,15 +2 33,24,15 +SELECT t1.id1, GROUP_CONCAT(t1.id2,"/",6-t1.id2 ORDER BY 1+0,6-t1.id2,t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1; +id1 concat_id +1 5/1,4/2,3/3,2/4,1/5 +2 3/3,2/4,1/5 +drop table t1,t2; +create table t1 (s1 char(10), s2 int not null); +insert into t1 values ('a',2),('b',2),('c',1),('a',3),('b',4),('c',4); +select distinct s1 from t1 order by s2,s1; +s1 +c +a +b +select group_concat(distinct s1) from t1; +group_concat(distinct s1) +a,b,c +select group_concat(distinct s1 order by s2) from t1 where s2 < 4; +group_concat(distinct s1 order by s2) +c,b,a +select group_concat(distinct s1 order by s2) from t1; +group_concat(distinct s1 order by s2) +c,b,a,c +drop table t1; +create table t1 (a int, c int); +insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5); +create table t2 (a int, c int); +insert into t2 values (1, 5), (2, 4), (3, 3), (3,3); +select group_concat(c) from t1; +group_concat(c) +2,3,4,5 +select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1; +grp +5,4,3,2 +select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1; +grp +5,4,3,2 +select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1; +grp +2,4,3,5 +select t1.a, group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1 group by 1; +a grp +1 2 +2 4,3 +3 5 +select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1 group by 1; +a grp +1 2 +2 4,3 +3 5 +select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1; +a grp +1 2 +2 4,3 +3 5 +select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp; +a c grp +3 5 3,3 +2 3 4 +2 4 4 +1 2 5 +drop table t1,t2; +CREATE TABLE t1 ( a int ); +CREATE TABLE t2 ( a int ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; +GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) +1,2 +2,4 +DROP TABLE t1, t2; +CREATE TABLE t1 (a char(4)); +INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill'); +SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1 +HAVING names LIKE '%An%'; +names +John||Anna||Bill +SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1 +HAVING LEFT(names, 1) ='J'; +names +John###Anna###Bill +DROP TABLE t1; +CREATE TABLE t1 ( a int, b TEXT ); +INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row'); +SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a; +GROUP_CONCAT(b ORDER BY b) +First Row +Second Row +DROP TABLE t1; +CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a), +CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); +SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; +a_id b_list +1 1,2,3 +2 4,5 +3 NULL +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID)); +INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ'); +CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC)); +INSERT INTO t2 VALUES (1,'A'),(1,'B'),(3,'F'); +SELECT t1.A_ID, GROUP_CONCAT(t2.B_DESC) AS B_DESC FROM t1 LEFT JOIN t2 ON t1.A_ID=t2.A_ID GROUP BY t1.A_ID ORDER BY t1.A_DESC; +A_ID B_DESC +1 A,B +2 NULL +3 F +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index ef29d0f2f5b..06259ff4931 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -42,21 +42,21 @@ insert into t1 values (null,null,''); select count(distinct a),count(distinct grp) from t1; count(distinct a) count(distinct grp) 6 3 -select sum(all a),count(all a),avg(all a),std(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; -sum(all a) count(all a) avg(all a) std(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c) -21 6 3.5000 1.7078 7 0 1 6 E -select grp, sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; -grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) -NULL NULL 0 NULL NULL 0 18446744073709551615 NULL NULL -1 1 1 1.0000 0.0000 1 1 1 1 a a -2 5 2 2.5000 0.5000 3 2 2 3 b c -3 15 3 5.0000 0.8165 7 4 4 6 C E -select grp, sum(a)+count(a)+avg(a)+std(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; +select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; +sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c) +21 6 3.5000 1.7078 2.9167 7 0 1 6 E +select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; +grp sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) +NULL NULL 0 NULL NULL NULL 0 18446744073709551615 NULL NULL +1 1 1 1.0000 0.0000 0.0000 1 1 1 1 a a +2 5 2 2.5000 0.5000 0.2500 3 2 2 3 b c +3 15 3 5.0000 0.8165 0.6667 7 4 4 6 C E +select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; grp sum NULL NULL 1 7 -2 20 -3 44.816496580928 +2 20.25 +3 45.483163247594 create table t2 (grp int, a bigint unsigned, c char(10)); insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; replace into t2 select grp, a, c from t1 limit 2,1; @@ -72,14 +72,14 @@ CREATE TABLE t1 (id int(11),value1 float(10,2)); INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00); CREATE TABLE t2 (id int(11),name char(20)); INSERT INTO t2 VALUES (1,'Set One'),(2,'Set Two'); -select id, avg(value1), std(value1) from t1 group by id; -id avg(value1) std(value1) -1 1.000000 0.816497 -2 11.000000 0.816497 -select name, avg(value1), std(value1) from t1, t2 where t1.id = t2.id group by t1.id; -name avg(value1) std(value1) -Set One 1.000000 0.816497 -Set Two 11.000000 0.816497 +select id, avg(value1), std(value1), variance(value1) from t1 group by id; +id avg(value1) std(value1) variance(value1) +1 1.000000 0.816497 0.666667 +2 11.000000 0.816497 0.666667 +select name, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id; +name avg(value1) std(value1) variance(value1) +Set One 1.000000 0.816497 0.666667 +Set Two 11.000000 0.816497 0.666667 drop table t1,t2; create table t1 (id int not null); create table t2 (id int not null,rating int null); @@ -173,12 +173,23 @@ select max(t2.a2), max(t1.a1) from t1, t2; max(t2.a2) max(t1.a1) NULL NULL explain select min(a2) from t1; -Comment -Select tables optimized away +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select max(t1.a1), max(t2.a2) from t1, t2; -Comment -No matching min/max row +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row insert into t2 values('AAA', 10, 0.5); +insert into t2 values('BBB', 20, 1.0); +select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2; +a1 a2 a1 a2 +10 aaa AAA 10 +10 NULL AAA 10 +10 bbb AAA 10 +20 zzz AAA 10 +10 aaa BBB 20 +10 NULL BBB 20 +10 bbb BBB 20 +20 zzz BBB 20 select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9; max(t1.a1) max(t2.a1) NULL NULL @@ -188,21 +199,27 @@ NULL NULL select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10; a1 a2 a1 a2 10 aaa AAA 10 +10 aaa BBB 20 10 NULL AAA 10 +10 NULL BBB 20 10 bbb AAA 10 +10 bbb BBB 20 20 zzz NULL NULL select max(t1.a2) from t1 left outer join t2 on t1.a1=10; max(t1.a2) zzz -select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=20; -max(t1.a2) -zzz -select max(t1.a2) from t1 left outer join t2 on t1.a1=10 where t1.a1=10; -max(t1.a2) -bbb +select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=20; +max(t2.a1) +BBB +select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=10; +max(t2.a1) +AAA select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; max(t2.a1) NULL +select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.a1=10; +max(t1.a2) max(t2.a1) +zzz BBB drop table t1,t2; CREATE TABLE t1 (a int, b int); select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1; @@ -239,11 +256,16 @@ a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) 1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 2 1 1 1.0000 0.0000 1 1 1 1 3 1 1 1.0000 0.0000 1 1 1 1 -select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; -a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) -1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 -2 1 1 1.0000 0.0000 1 1 1 1 -3 1 1 1.0000 0.0000 1 1 1 1 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) bit_xor(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 0 +2 1 1 1.0000 0.0000 1 1 1 1 1 +3 1 1 1.0000 0.0000 1 1 1 1 1 +explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort +Warnings: +Note 1003 select sql_big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a drop table t1; create table t1 (col int); insert into t1 values (-1), (-2), (-3); @@ -261,3 +283,404 @@ select avg(2) from t1; avg(2) NULL drop table t1; +create table t1( +a1 char(3) primary key, +a2 smallint, +a3 char(3), +a4 real, +a5 date, +key k1(a2,a3), +key k2(a4 desc,a1), +key k3(a5,a1) +); +create table t2( +a1 char(3) primary key, +a2 char(17), +a3 char(2), +a4 char(3), +key k1(a3, a2), +key k2(a4) +); +insert into t1 values('AME',0,'SEA',0.100,date'1942-02-19'); +insert into t1 values('HBR',1,'SEA',0.085,date'1948-03-05'); +insert into t1 values('BOT',2,'SEA',0.085,date'1951-11-29'); +insert into t1 values('BMC',3,'SEA',0.085,date'1958-09-08'); +insert into t1 values('TWU',0,'LAX',0.080,date'1969-10-05'); +insert into t1 values('BDL',0,'DEN',0.080,date'1960-11-27'); +insert into t1 values('DTX',1,'NYC',0.080,date'1961-05-04'); +insert into t1 values('PLS',1,'WDC',0.075,date'1949-01-02'); +insert into t1 values('ZAJ',2,'CHI',0.075,date'1960-06-15'); +insert into t1 values('VVV',2,'MIN',0.075,date'1959-06-28'); +insert into t1 values('GTM',3,'DAL',0.070,date'1977-09-23'); +insert into t1 values('SSJ',null,'CHI',null,date'1974-03-19'); +insert into t1 values('KKK',3,'ATL',null,null); +insert into t1 values('XXX',null,'MIN',null,null); +insert into t2 values('TKF','Seattle','WA','AME'); +insert into t2 values('LCC','Los Angeles','CA','TWU'); +insert into t2 values('DEN','Denver','CO','BDL'); +insert into t2 values('SDC','San Diego','CA','TWU'); +insert into t2 values('NOL','New Orleans','LA','GTM'); +insert into t2 values('LAK','Los Angeles','CA','TWU'); +select * from t1; +a1 a2 a3 a4 a5 +AME 0 SEA 0.1 1942-02-19 +HBR 1 SEA 0.085 1948-03-05 +BOT 2 SEA 0.085 1951-11-29 +BMC 3 SEA 0.085 1958-09-08 +TWU 0 LAX 0.08 1969-10-05 +BDL 0 DEN 0.08 1960-11-27 +DTX 1 NYC 0.08 1961-05-04 +PLS 1 WDC 0.075 1949-01-02 +ZAJ 2 CHI 0.075 1960-06-15 +VVV 2 MIN 0.075 1959-06-28 +GTM 3 DAL 0.07 1977-09-23 +SSJ NULL CHI NULL 1974-03-19 +KKK 3 ATL NULL NULL +XXX NULL MIN NULL NULL +select * from t2; +a1 a2 a3 a4 +TKF Seattle WA AME +LCC Los Angeles CA TWU +DEN Denver CO BDL +SDC San Diego CA TWU +NOL New Orleans LA GTM +LAK Los Angeles CA TWU +explain +select min(a1) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a1) from t1; +min(a1) +AME +explain +select max(a4) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a4) from t1; +max(a4) +0.1 +explain +select min(a5), max(a5) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a5), max(a5) from t1; +min(a5) max(a5) +1942-02-19 1977-09-23 +explain +select min(a3) from t1 where a2 = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a3) from t1 where a2 = 2; +min(a3) +CHI +explain +select min(a1), max(a1) from t1 where a4 = 0.080; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a1), max(a1) from t1 where a4 = 0.080; +min(a1) max(a1) +BDL TWU +explain +select min(t1.a5), max(t2.a3) from t1, t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(t1.a5), max(t2.a3) from t1, t2; +min(t1.a5) max(t2.a3) +1942-02-19 WA +explain +select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; +min(t1.a3) max(t2.a2) +DEN San Diego +explain +select min(a1) from t1 where a1 > 'KKK'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a1) from t1 where a1 > 'KKK'; +min(a1) +PLS +explain +select min(a1) from t1 where a1 >= 'KKK'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a1) from t1 where a1 >= 'KKK'; +min(a1) +KKK +explain +select max(a3) from t1 where a2 = 2 and a3 < 'SEA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a3) from t1 where a2 = 2 and a3 < 'SEA'; +max(a3) +MIN +explain +select max(a5) from t1 where a5 < date'1970-01-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a5) from t1 where a5 < date'1970-01-01'; +max(a5) +1969-10-05 +explain +select max(a3) from t1 where a2 is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a3) from t1 where a2 is null; +max(a3) +MIN +explain +select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; +max(a3) +LAX +explain +select min(a1), max(a1) from t1 where a1 between 'A' and 'P'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a1), max(a1) from t1 where a1 between 'A' and 'P'; +min(a1) max(a1) +AME KKK +explain +select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; +max(a3) +MIN +explain +select max(a3) from t1 where a3 = 'MIN' and a2 = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a3) from t1 where a3 = 'MIN' and a2 = 2; +max(a3) +MIN +explain +select max(a3) from t1 where a3 = 'DEN' and a2 = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row +select max(a3) from t1 where a3 = 'DEN' and a2 = 2; +max(a3) +NULL +explain +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; +max(t1.a3) min(t2.a2) +CHI Los Angeles +explain +select max(a3) from t1 where a2 is null and a2 = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +select max(a3) from t1 where a2 is null and a2 = 2; +max(a3) +NULL +explain +select max(a2) from t1 where a2 >= 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a2) from t1 where a2 >= 1; +max(a2) +3 +explain +select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; +min(a3) +CHI +explain +select min(a3) from t1 where a2 = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row +select min(a3) from t1 where a2 = 4; +min(a3) +NULL +explain +select min(a3) from t1 where a2 = 2 and a3 > 'SEA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row +select min(a3) from t1 where a2 = 2 and a3 > 'SEA'; +min(a3) +NULL +explain +select (min(a4)+max(a4))/2 from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select (min(a4)+max(a4))/2 from t1; +(min(a4)+max(a4))/2 +0.085 +explain +select min(a3) from t1 where 2 = a2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a3) from t1 where 2 = a2; +min(a3) +CHI +explain +select max(a3) from t1 where a2 = 2 and 'SEA' > a3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(a3) from t1 where a2 = 2 and 'SEA' > a3; +max(a3) +MIN +explain +select max(a3) from t1 where a2 = 2 and 'SEA' < a3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row +select max(a3) from t1 where a2 = 2 and 'SEA' < a3; +max(a3) +NULL +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI'; +min(a3) +CHI +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; +min(a3) +CHI +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; +min(a3) +MIN +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN'; +min(a3) +NULL +explain +select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; +min(t1.a1) min(t2.a4) +AME AME +explain +select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 0 NULL 15 Using where; Using index +explain +select min(a1) from t1 where a1 != 'KKK'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 3 NULL 14 Using where; Using index +explain +select max(a3) from t1 where a2 < 2 and a3 < 'SEA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range k1 k1 3 NULL 5 Using where; Using index +explain +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index +1 SIMPLE t2 range k1 k1 3 NULL 4 Using where; Using index +explain +select min(a4 - 0.01) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k2 12 NULL 14 Using index +explain +select max(a4 + 0.01) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k2 12 NULL 14 Using index +explain +select min(a3) from t1 where (a2 +1 ) is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 7 NULL 14 Using where; Using index +explain +select min(a3) from t1 where (a2 + 1) = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 7 NULL 14 Using where; Using index +explain +select min(a3) from t1 where 2 = (a2 + 1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 7 NULL 14 Using where; Using index +explain +select min(a2) from t1 where a2 < 2 * a2 - 8; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 7 NULL 14 Using where; Using index +explain +select min(a1) from t1 where a1 between a3 and 'KKK'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 14 Using where +explain +select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k2 12 NULL 14 Using where; Using index +explain +select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index +1 SIMPLE t1 index NULL PRIMARY 3 NULL 14 Using index +drop table t1, t2; +create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB; +insert into t1 values (1, 3); +select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ; +count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ +1 +select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ; +Case When Count(*) < MAX_REQ Then 1 Else 0 End +1 +drop table t1; +create table t1 (a char(10)); +insert into t1 values ('a'),('b'),('c'); +select coercibility(max(a)) from t1; +coercibility(max(a)) +3 +drop table t1; +create table t1 (a int); +insert into t1 values (1); +select max(a) as b from t1 having b=1; +b +1 +select a from t1 having a=1; +a +1 +drop table t1; +create table t1 (a int); +select variance(2) from t1; +variance(2) +NULL +select stddev(2) from t1; +stddev(2) +NULL +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT COUNT(*) FROM t1'; +execute stmt1; +COUNT(*) +2 +execute stmt1; +COUNT(*) +2 +execute stmt1; +COUNT(*) +2 +deallocate prepare stmt1; +drop table t1; +create table t1 (a int, primary key(a)); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT max(a) FROM t1'; +execute stmt1; +max(a) +2 +execute stmt1; +max(a) +2 +execute stmt1; +max(a) +2 +deallocate prepare stmt1; +drop table t1; diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index aee54ede324..dd916d06372 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -2,7 +2,7 @@ drop table if exists t1; select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ; IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0 this is a 2 2.0 -CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) TYPE=MyISAM; +CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) ENGINE=MyISAM; INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0); select if(1,st,st) s from t1 order by s; s @@ -39,6 +39,25 @@ a a aa aaa +explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order by s; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort +Warnings: +Note 1003 select if((test.t1.u = 1),test.t1.st,cast(test.t1.st as char charset binary)) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,cast(test.t1.st as char charset binary)) +select nullif(u=0, 'test') from t1; +nullif(u=0, 'test') +NULL +NULL +NULL +NULL +NULL +1 +1 +explain extended select nullif(u=0, 'test') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 7 +Warnings: +Note 1003 select nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1 drop table t1; select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test") diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index ba33ee0831d..374affce8c5 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -1,11 +1,95 @@ drop table if exists t1; +select 1 in (1,2,3); +1 in (1,2,3) +1 +select 10 in (1,2,3); +10 in (1,2,3) +0 +select NULL in (1,2,3); +NULL in (1,2,3) +NULL +select 1 in (1,NULL,3); +1 in (1,NULL,3) +1 +select 3 in (1,NULL,3); +3 in (1,NULL,3) +1 +select 10 in (1,NULL,3); +10 in (1,NULL,3) +NULL +select 1.5 in (1.5,2.5,3.5); +1.5 in (1.5,2.5,3.5) +1 +select 10.5 in (1.5,2.5,3.5); +10.5 in (1.5,2.5,3.5) +0 +select NULL in (1.5,2.5,3.5); +NULL in (1.5,2.5,3.5) +NULL +select 1.5 in (1.5,NULL,3.5); +1.5 in (1.5,NULL,3.5) +1 +select 3.5 in (1.5,NULL,3.5); +3.5 in (1.5,NULL,3.5) +1 +select 10.5 in (1.5,NULL,3.5); +10.5 in (1.5,NULL,3.5) +NULL +CREATE TABLE t1 (a int, b int, c int); +insert into t1 values (1,2,3), (1,NULL,3); +select 1 in (a,b,c) from t1; +1 in (a,b,c) +1 +1 +select 3 in (a,b,c) from t1; +3 in (a,b,c) +1 +1 +select 10 in (a,b,c) from t1; +10 in (a,b,c) +0 +NULL +select NULL in (a,b,c) from t1; +NULL in (a,b,c) +NULL +NULL +drop table t1; +CREATE TABLE t1 (a float, b float, c float); +insert into t1 values (1.5,2.5,3.5), (1.5,NULL,3.5); +select 1.5 in (a,b,c) from t1; +1.5 in (a,b,c) +1 +1 +select 3.5 in (a,b,c) from t1; +3.5 in (a,b,c) +1 +1 +select 10.5 in (a,b,c) from t1; +10.5 in (a,b,c) +0 +NULL +drop table t1; +CREATE TABLE t1 (a varchar(10), b varchar(10), c varchar(10)); +insert into t1 values ('A','BC','EFD'), ('A',NULL,'EFD'); +select 'A' in (a,b,c) from t1; +'A' in (a,b,c) +1 +1 +select 'EFD' in (a,b,c) from t1; +'EFD' in (a,b,c) +1 +1 +select 'XSFGGHF' in (a,b,c) from t1; +'XSFGGHF' in (a,b,c) +0 +NULL +drop table t1; CREATE TABLE t1 (field char(1)); INSERT INTO t1 VALUES ('A'),(NULL); SELECT * from t1 WHERE field IN (NULL); field SELECT * from t1 WHERE field NOT IN (NULL); field -A SELECT * from t1 where field = field; field A @@ -16,6 +100,7 @@ NULL DELETE FROM t1 WHERE field NOT IN (NULL); SELECT * FROM t1; field +A NULL drop table t1; create table t1 (id int(10) primary key); @@ -26,3 +111,71 @@ id 5 9 drop table t1; +create table t1 ( +a char(1) character set latin1 collate latin1_general_ci, +b char(1) character set latin1 collate latin1_swedish_ci, +c char(1) character set latin1 collate latin1_danish_ci +); +insert into t1 values ('A','B','C'); +insert into t1 values ('a','c','c'); +select * from t1 where a in (b); +ERROR HY000: Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation ' IN ' +select * from t1 where a in (b,c); +ERROR HY000: Illegal mix of collations (latin1_general_ci,IMPLICIT), (latin1_swedish_ci,IMPLICIT), (latin1_danish_ci,IMPLICIT) for operation ' IN ' +select * from t1 where 'a' in (a,b,c); +ERROR HY000: Illegal mix of collations for operation ' IN ' +select * from t1 where 'a' in (a); +a b c +A B C +a c c +select * from t1 where a in ('a'); +a b c +A B C +a c c +select * from t1 where 'a' collate latin1_general_ci in (a,b,c); +a b c +A B C +a c c +select * from t1 where 'a' collate latin1_bin in (a,b,c); +a b c +a c c +select * from t1 where 'a' in (a,b,c collate latin1_bin); +a b c +a c c +explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +Warnings: +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin'))) +drop table t1; +set names utf8; +create table t1 (a char(10) character set utf8 not null); +insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ'); +select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a; +a +ÃÃÃà +bbbb +ÑÑÑÑ +drop table t1; +set names latin1; +select '1.0' in (1,2); +'1.0' in (1,2) +1 +select 1 in ('1.0',2); +1 in ('1.0',2) +1 +select 1 in (1,'2.0'); +1 in (1,'2.0') +1 +select 1 in ('1.0',2.0); +1 in ('1.0',2.0) +1 +select 1 in (1.0,'2.0'); +1 in (1.0,'2.0') +1 +select 1 in ('1.1',2); +1 in ('1.1',2) +0 +select 1 in ('1.1',2.0); +1 in ('1.1',2.0) +0 diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index b196b50f53b..a58432cb06e 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -2,11 +2,11 @@ drop table if exists t1; create table t1 (a varchar(10), key(a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; -table type possible_keys key key_len ref rows Extra -t1 range a a 11 NULL 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 1 Using where; Using index explain select * from t1 where a like concat('abc','%'); -table type possible_keys key key_len ref rows Extra -t1 range a a 11 NULL 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 1 Using where; Using index select * from t1 where a like "abc%"; a abc @@ -45,4 +45,116 @@ a\b select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; a a\b +prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?'; +set @esc='#'; +execute stmt1 using @esc; +a +a\b +deallocate prepare stmt1; +drop table t1; +create table t1 (a datetime); +insert into t1 values ('2004-03-11 12:00:21'); +select * from t1 where a like '2004-03-11 12:00:21'; +a +2004-03-11 12:00:21 drop table t1; +SET NAMES koi8r; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r); +INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏÌÄÖ'),('æÙ×ÁÐÒÏÌÄÖ'),('Æù×ÁÐÒÏÌÄÖ'),('ÆÙ÷ÁÐÒÏÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×áÐÒÏÌÄÖ'),('ÆÙ×ÁðÒÏÌÄÖ'),('ÆÙ×ÁÐòÏÌÄÖ'),('ÆÙ×ÁÐÒïÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏìÄÖ'),('ÆÙ×ÁÐÒÏÌäÖ'),('ÆÙ×ÁÐÒÏÌÄö'),('æù÷áðòïìäö'); +SELECT * FROM t1 WHERE a LIKE '%Æù×Á%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE '%Æù×%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +DROP TABLE t1; +SET NAMES cp1250; +CREATE TABLE t1 (a varchar(250) NOT NULL) DEFAULT CHARACTER SET=cp1250; +INSERT INTO t1 VALUES +('Techni Tapes Sp. z o.o.'), +('Pojazdy Szynowe PESA Bydgoszcz SA Holding'), +('AKAPESTER 1 P.P.H.U.'), +('Pojazdy Szynowe PESA Bydgoszcz S A Holding'), +('PPUH PESKA-I Maria Struniarska'); +select * from t1 where a like '%PESA%'; +a +Pojazdy Szynowe PESA Bydgoszcz SA Holding +Pojazdy Szynowe PESA Bydgoszcz S A Holding +select * from t1 where a like '%PESA %'; +a +Pojazdy Szynowe PESA Bydgoszcz SA Holding +Pojazdy Szynowe PESA Bydgoszcz S A Holding +select * from t1 where a like '%PES%'; +a +Techni Tapes Sp. z o.o. +Pojazdy Szynowe PESA Bydgoszcz SA Holding +AKAPESTER 1 P.P.H.U. +Pojazdy Szynowe PESA Bydgoszcz S A Holding +PPUH PESKA-I Maria Struniarska +select * from t1 where a like '%PESKA%'; +a +PPUH PESKA-I Maria Struniarska +select * from t1 where a like '%ESKA%'; +a +PPUH PESKA-I Maria Struniarska +DROP TABLE t1; +select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin; +_cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin +1 diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 4688adc61d8..90aa04515d7 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -1,43 +1,103 @@ select floor(5.5),floor(-5.5); floor(5.5) floor(-5.5) 5 -6 +explain extended select floor(5.5),floor(-5.5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)` select ceiling(5.5),ceiling(-5.5); ceiling(5.5) ceiling(-5.5) 6 -5 +explain extended select ceiling(5.5),ceiling(-5.5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)` select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1) 52.6 52.64 50 0 -52.6 -50 +explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)` select round(5.5),round(-5.5); round(5.5) round(-5.5) 6 -6 +explain extended select round(5.5),round(-5.5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)` select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2) 5.6 5.64 10 0 select abs(-10), sign(-5), sign(5), sign(0); abs(-10) sign(-5) sign(5) sign(0) 10 -1 1 0 +explain extended select abs(-10), sign(-5), sign(5), sign(0); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) 10 10 NULL NULL NULL 2 NULL NULL +explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) 10 10 NULL NULL NULL +explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) 3 3.9068905956085 NULL NULL NULL +explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) 2 1.2552725051033 NULL NULL NULL +explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` select pow(10,log10(10)),power(2,4); pow(10,log10(10)) power(2,4) 10 16 +explain extended select pow(10,log10(10)),power(2,4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)` set @@rand_seed1=10000000,@@rand_seed2=1000000; select rand(999999),rand(); rand(999999) rand() 0.014231365187309 0.028870999839968 +explain extended select rand(999999),rand(); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()` select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6); pi() format(sin(pi()/2),6) format(cos(pi()/2),6) format(abs(tan(pi())),6) format(cot(1),6) format(asin(1),6) format(acos(0),6) format(atan(1),6) 3.141593 1.000000 0.000000 0.000000 0.642093 1.570796 1.570796 0.785398 +explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` select degrees(pi()),radians(360); degrees(pi()) radians(360) 180 6.2831853071796 @@ -59,3 +119,8 @@ ASIN(0.8+0.2) SELECT ASIN(1.2-0.2); ASIN(1.2-0.2) 1.5707963267949 +explain extended select degrees(pi()),radians(360); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index d51bea020ed..5a9f0f68228 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -1,15 +1,27 @@ -select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2); -format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2) +select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2); +format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.55555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2) 2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24 select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255")); inet_ntoa(inet_aton("255.255.255.255.255.255.255.255")) NULL select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255"); inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255") -1099511627775 4294902271 511 +1099511627775 4294902271 65791 select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511); inet_ntoa(1099511627775) inet_ntoa(4294902271) inet_ntoa(511) NULL 255.255.1.255 0.0.1.255 +select hex(inet_aton('127')); +hex(inet_aton('127')) +7F +select hex(inet_aton('127.1')); +hex(inet_aton('127.1')) +7F000001 +select hex(inet_aton('127.1.1')); +hex(inet_aton('127.1.1')) +7F010001 +select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8''))); +length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8''))) +36 utf8 16 select length(format('nan', 2)) > 0; length(format('nan', 2)) > 0 1 diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index d009a66353e..6cd975b0911 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -1,9 +1,19 @@ select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; 1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2 2 0 3 1.60 3 3 3 4 +explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2` select 1 | (1+1),5 & 3,bit_count(7) ; 1 | (1+1) 5 & 3 bit_count(7) 3 1 3 +explain extended select 1 | (1+1),5 & 3,bit_count(7) ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)` select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60; 1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 4294967296 9223372036854775808 0 1 0 8 diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 8d22994ef2b..8228d6982d3 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -36,6 +36,11 @@ insert into t1 (xxx) values('this is a test of some long text to see what happen select * from t1 where xxx regexp('is a test of some long text to'); xxx this is a test of some long text to see what happens +explain extended select * from t1 where xxx regexp('is a test of some long text to'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to') select * from t1 where xxx regexp('is a test of some long text to '); xxx this is a test of some long text to see what happens @@ -52,3 +57,44 @@ select * from t1 where xxx REGEXP '^this is some text: to test - out\\.reg exp [ xxx this is some text: to test - out.reg exp (22/45) drop table t1; +select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin; +_latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin +1 +select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin; +_koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin +0 +select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin; +_latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin +0 +select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin; +_koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin +1 +select _latin1 0xF7 regexp _latin1 '[[:alpha:]]'; +_latin1 0xF7 regexp _latin1 '[[:alpha:]]' +0 +select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]'; +_koi8r 0xF7 regexp _koi8r '[[:alpha:]]' +1 +select _latin1'a' regexp _latin1'A' collate latin1_general_ci; +_latin1'a' regexp _latin1'A' collate latin1_general_ci +1 +select _latin1'a' regexp _latin1'A' collate latin1_bin; +_latin1'a' regexp _latin1'A' collate latin1_bin +0 +create table t1 (a varchar(40)); +insert into t1 values ('C1'),('C2'),('R1'),('C3'),('R2'),('R3'); +prepare stmt1 from 'select a from t1 where a rlike ? order by a'; +set @a="^C.*"; +execute stmt1 using @a; +a +C1 +C2 +C3 +set @a="^R.*"; +execute stmt1 using @a; +a +R1 +R2 +R3 +deallocate prepare stmt1; +drop table t1; diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result new file mode 100644 index 00000000000..cf2bd687115 --- /dev/null +++ b/mysql-test/r/func_sapdb.result @@ -0,0 +1,221 @@ +drop table if exists t1, test; +select extract(DAY_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +extract(DAY_MICROSECOND FROM "1999-01-02 10:11:12.000123") +2101112000123 +select extract(HOUR_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +extract(HOUR_MICROSECOND FROM "1999-01-02 10:11:12.000123") +101112000123 +select extract(MINUTE_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +extract(MINUTE_MICROSECOND FROM "1999-01-02 10:11:12.000123") +1112000123 +select extract(SECOND_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +extract(SECOND_MICROSECOND FROM "1999-01-02 10:11:12.000123") +12000123 +select extract(MICROSECOND FROM "1999-01-02 10:11:12.000123"); +extract(MICROSECOND FROM "1999-01-02 10:11:12.000123") +123 +select date_format("1997-12-31 23:59:59.000002", "%f"); +date_format("1997-12-31 23:59:59.000002", "%f") +000002 +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000 99:99:99.999999" DAY_MICROSECOND); +date_add("1997-12-31 23:59:59.000002",INTERVAL "10000 99:99:99.999999" DAY_MICROSECOND) +2025-05-23 04:40:39.000001 +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99:99.999999" HOUR_MICROSECOND); +date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99:99.999999" HOUR_MICROSECOND) +1999-02-21 17:40:39.000001 +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99.999999" MINUTE_MICROSECOND); +date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99.999999" MINUTE_MICROSECOND) +1998-01-07 22:41:39.000001 +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000.999999" SECOND_MICROSECOND); +date_add("1997-12-31 23:59:59.000002",INTERVAL "10000.999999" SECOND_MICROSECOND) +1998-01-01 02:46:40.000001 +select date_add("1997-12-31 23:59:59.000002",INTERVAL "999999" MICROSECOND); +date_add("1997-12-31 23:59:59.000002",INTERVAL "999999" MICROSECOND) +1998-01-01 00:00:00.000001 +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1 1:1:1.000002" DAY_MICROSECOND); +date_sub("1998-01-01 00:00:00.000001",INTERVAL "1 1:1:1.000002" DAY_MICROSECOND) +1997-12-30 22:58:58.999999 +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1:1.000002" HOUR_MICROSECOND); +date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1:1.000002" HOUR_MICROSECOND) +1997-12-31 22:58:58.999999 +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1.000002" MINUTE_MICROSECOND); +date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1.000002" MINUTE_MICROSECOND) +1997-12-31 23:58:58.999999 +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1.000002" SECOND_MICROSECOND); +date_sub("1998-01-01 00:00:00.000001",INTERVAL "1.000002" SECOND_MICROSECOND) +1997-12-31 23:59:58.999999 +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "000002" MICROSECOND); +date_sub("1998-01-01 00:00:00.000001",INTERVAL "000002" MICROSECOND) +1997-12-31 23:59:59.999999 +select adddate("1997-12-31 23:59:59.000001", 10); +adddate("1997-12-31 23:59:59.000001", 10) +1998-01-10 23:59:59.000001 +select subdate("1997-12-31 23:59:59.000001", 10); +subdate("1997-12-31 23:59:59.000001", 10) +1997-12-21 23:59:59.000001 +select datediff("1997-12-31 23:59:59.000001","1997-12-30"); +datediff("1997-12-31 23:59:59.000001","1997-12-30") +1 +select datediff("1997-11-31 23:59:59.000001","1997-12-31"); +datediff("1997-11-31 23:59:59.000001","1997-12-31") +-30 +select datediff("1997-11-31 23:59:59.000001",null); +datediff("1997-11-31 23:59:59.000001",null) +NULL +select weekofyear("1997-11-31 23:59:59.000001"); +weekofyear("1997-11-31 23:59:59.000001") +49 +select makedate(1997,1); +makedate(1997,1) +1997-01-01 +select makedate(1997,0); +makedate(1997,0) +NULL +select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002"); +addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002") +1998-01-02 01:01:01.000001 +select subtime("1997-12-31 23:59:59.000001", "1 1:1:1.000002"); +subtime("1997-12-31 23:59:59.000001", "1 1:1:1.000002") +1997-12-30 22:58:57.999999 +select addtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999"); +addtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999") +NULL +select subtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999"); +subtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999") +NULL +select subtime("01:00:00.999999", "02:00:00.999998"); +subtime("01:00:00.999999", "02:00:00.999998") +-00:59:59.999999 +select subtime("02:01:01.999999", "01:01:01.999999"); +subtime("02:01:01.999999", "01:01:01.999999") +01:00:00.000000 +select timediff("1997-01-01 23:59:59.000001","1995-12-31 23:59:59.000002"); +timediff("1997-01-01 23:59:59.000001","1995-12-31 23:59:59.000002") +8807:59:59.999999 +select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); +timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") +46:58:57.999999 +select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); +timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") +-23:59:59.999999 +select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); +timediff("1997-12-31 23:59:59.000001","23:59:59.000001") +NULL +select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001") +-00:00:00.000001 +select maketime(10,11,12); +maketime(10,11,12) +10:11:12 +select maketime(25,11,12); +maketime(25,11,12) +25:11:12 +select maketime(-25,11,12); +maketime(-25,11,12) +-25:11:12 +select timestamp("2001-12-01", "01:01:01.999999"); +timestamp("2001-12-01", "01:01:01.999999") +2001-12-01 01:01:01.999999 +select timestamp("2001-13-01", "01:01:01.000001"); +timestamp("2001-13-01", "01:01:01.000001") +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '2001-13-01' +select timestamp("2001-12-01", "25:01:01"); +timestamp("2001-12-01", "25:01:01") +2001-12-02 01:01:01 +select timestamp("2001-12-01 01:01:01.000100"); +timestamp("2001-12-01 01:01:01.000100") +2001-12-01 01:01:01.000100 +select timestamp("2001-12-01"); +timestamp("2001-12-01") +2001-12-01 00:00:00 +select day("1997-12-31 23:59:59.000001"); +day("1997-12-31 23:59:59.000001") +31 +select date("1997-12-31 23:59:59.000001"); +date("1997-12-31 23:59:59.000001") +1997-12-31 +select date("1997-13-31 23:59:59.000001"); +date("1997-13-31 23:59:59.000001") +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '1997-13-31 23:59:59.000001' +select time("1997-12-31 23:59:59.000001"); +time("1997-12-31 23:59:59.000001") +23:59:59.000001 +select time("1997-12-31 25:59:59.000001"); +time("1997-12-31 25:59:59.000001") +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '1997-12-31 25:59:59.000001' +select microsecond("1997-12-31 23:59:59.000001"); +microsecond("1997-12-31 23:59:59.000001") +1 +create table t1 +select makedate(1997,1) as f1, +addtime(cast("1997-12-31 23:59:59.000001" as datetime), "1 1:1:1.000002") as f2, +addtime(cast("23:59:59.999999" as time) , "1 1:1:1.000002") as f3, +timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") as f4, +timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") as f5, +maketime(10,11,12) as f6, +timestamp(cast("2001-12-01" as date), "01:01:01") as f7, +date("1997-12-31 23:59:59.000001") as f8, +time("1997-12-31 23:59:59.000001") as f9; +describe t1; +Field Type Null Key Default Extra +f1 date 0000-00-00 +f2 datetime YES NULL +f3 time YES NULL +f4 time 00:00:00 +f5 time 00:00:00 +f6 time 00:00:00 +f7 datetime YES NULL +f8 date YES NULL +f9 time YES NULL +select * from t1; +f1 f2 f3 f4 f5 f6 f7 f8 f9 +1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -23:59:59 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 +create table test(t1 datetime, t2 time, t3 time, t4 datetime); +insert into test values +('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'), +('2001-01-01 01:01:01', '-01:01:01', '-23:59:59', "1997-12-31 23:59:59.000001"), +('1997-12-31 23:59:59.000001', '-23:59:59', '-01:01:01', '2001-01-01 01:01:01'), +('2001-01-01 01:01:01', '01:01:01', '-1 01:01:01', null), +('2001-01-01 01:01:01', null, '-1 01:01:01', null), +(null, null, null, null), +('2001-01-01 01:01:01', '01:01:01', '1 01:01:01', '2001-01-01 01:01:01'); +SELECT ADDTIME(t1,t2) As ttt, ADDTIME(t2, t3) As qqq from test; +ttt qqq +2001-01-01 02:02:02 NULL +2001-01-01 00:00:00 -25:01:00 +1997-12-31 00:00:00 -25:01:00 +2001-01-01 02:02:02 -24:00:00 +NULL NULL +NULL NULL +2001-01-01 02:02:02 26:02:02 +SELECT TIMEDIFF(t1,t4) As ttt, TIMEDIFF(t2, t3) As qqq from test; +ttt qqq +-744:00:00 NULL +26305:01:02 22:58:58 +-26305:01:02 -22:58:58 +NULL 26:02:02 +NULL NULL +NULL NULL +00:00:00 -24:00:00 +drop table t1, test; +select addtime("-01:01:01.01", "-23:59:59.1") as a; +a +-25:01:00.110000 +select microsecond("1997-12-31 23:59:59.01") as a; +a +10000 +select microsecond(19971231235959.01) as a; +a +10000 +select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; +a +1997-12-31 00:00:10.090000 +select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); +str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") +2003-01-02 10:11:12.001200 diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 9181fe9e54d..2431406c128 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -1,6 +1,17 @@ select interval(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0; interval(55,10,20,30,40,50,60,70,80,90,100) interval(3,1,1+1,1+1+1+1) field("IBM","NCA","ICL","SUN","IBM","DIGITAL") field("A","B","C") elt(2,"ONE","TWO","THREE") interval(0,1,2,3,4) elt(1,1,2,3)|0 elt(1,1.1,1.2,1.3)+0 5 2 4 0 TWO 0 1 1.1 +explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` +SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56); +INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56) +1 +SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56, 77); +INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56, 77) +1 select find_in_set("b","a,b,c"),find_in_set("c","a,b,c"),find_in_set("dd","a,bbb,dd"),find_in_set("bbb","a,bbb,dd"); find_in_set("b","a,b,c") find_in_set("c","a,b,c") find_in_set("dd","a,bbb,dd") find_in_set("bbb","a,bbb,dd") 2 3 3 2 @@ -28,6 +39,22 @@ find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc") select interval(null, 1, 10, 100); interval(null, 1, 10, 100) -1 +drop table if exists t1,t2; +create table t1 (id int(10) not null unique); +create table t2 (id int(10) not null primary key, val int(10) not null); +insert into t1 values (1),(2),(4); +insert into t2 values (1,1),(2,1),(3,1),(4,2); +select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id; +id elt(two.val,'one','two') +1 one +2 one +4 two +select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id; +id elt(two.val,'one','two') +1 one +2 one +4 two +drop table t1,t2; select find_in_set(binary 'a',binary 'A,B,C'); find_in_set(binary 'a',binary 'A,B,C') 0 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 12c1cf78f7c..7b2fc4b21a5 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1,4 +1,5 @@ drop table if exists t1; +set names latin1; select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo @@ -11,9 +12,15 @@ length('\n\t\r\b\0\_\%\\') select bit_length('\n\t\r\b\0\_\%\\'); bit_length('\n\t\r\b\0\_\%\\') 80 -select concat('monty',' was here ','again'),length('hello'),char(ascii('h')); -concat('monty',' was here ','again') length('hello') char(ascii('h')) -monty was here again 5 h +select char_length('\n\t\r\b\0\_\%\\'); +char_length('\n\t\r\b\0\_\%\\') +10 +select length(_latin1'\n\t\n\b\0\\_\\%\\'); +length(_latin1'\n\t\n\b\0\\_\\%\\') +10 +select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); +concat('monty',' was here ','again') length('hello') char(ascii('h')) ord('h') +monty was here again 5 h 104 select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; locate('he','hello') locate('he','hello',2) locate('lo','hello',2) 1 0 4 @@ -80,9 +87,27 @@ this is a REAL test select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') H000 H4142 I51231 +select 'mood' sounds like 'mud'; +'mood' sounds like 'mud' +1 +select 'Glazgo' sounds like 'Liverpool'; +'Glazgo' sounds like 'Liverpool' +0 +select null sounds like 'null'; +null sounds like 'null' +NULL +select 'null' sounds like null; +'null' sounds like null +NULL +select null sounds like null; +null sounds like null +NULL select md5('hello'); md5('hello') 5d41402abc4b2a76b9719d911017c592 +select crc32("123"); +crc32("123") +2286445522 select sha('abc'); sha('abc') a9993e364706816aba3e25717850c26c9cd0d89d @@ -167,6 +192,15 @@ length(quote(concat(char(0),"test"))) select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))) 27E0E3E6E7E8EAEB27 +select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL); +unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") unhex(NULL) +foobar 1234567890ABCDEF 4Vx NULL +select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456")); +hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456")) +01 12 0123 1234 012345 123456 +select length(unhex(md5("abrakadabra"))); +length(unhex(md5("abrakadabra"))) +16 select reverse(""); reverse("") @@ -191,6 +225,8 @@ substring_index("www.tcx.se","",3) select length(repeat("a",100000000)),length(repeat("a",1000*64)); length(repeat("a",100000000)) length(repeat("a",1000*64)) NULL 64000 +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql")); position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql")) 1 0 3 @@ -223,22 +259,22 @@ created datetime default NULL, modified timestamp(14) NOT NULL, bugstatus int(10) unsigned default NULL, submitter int(10) unsigned default NULL -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','2001-02-28 08:40:16',20010228084016,0,4); -SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"') FROM t1; -CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"') +SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"') FROM t1; +CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"') "Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4" SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') FROM t1; CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') "Link";"1";"1";"1";"0";"4" -SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter) FROM t1; -CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter) +SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter) FROM t1; +CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter) Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4 SELECT bugdesc, REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb') from t1 group by bugdesc; bugdesc REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb') aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa drop table t1; -CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) TYPE=MyISAM; +CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf'); SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password"); 1 @@ -256,9 +292,7 @@ elt(status_wnio,data_podp) NULL NULL DROP TABLE t1; -CREATE TABLE t1 ( -title text -) TYPE=MyISAM; +CREATE TABLE t1 (title text) ENGINE=MyISAM; INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education'); INSERT INTO t1 VALUES ('House passes the CAREERS bill'); SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1; @@ -282,3 +316,363 @@ NULL NULL 1 1 n two 'two' 0 0 'two' four 'four' 0 0 'four' drop table t1; +select 1=_latin1'1'; +1=_latin1'1' +1 +select _latin1'1'=1; +_latin1'1'=1 +1 +select _latin2'1'=1; +_latin2'1'=1 +1 +select 1=_latin2'1'; +1=_latin2'1' +1 +select _latin1'1'=_latin2'1'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation '=' +select row('a','b','c') = row('a','b','c'); +row('a','b','c') = row('a','b','c') +1 +select row('A','b','c') = row('a','b','c'); +row('A','b','c') = row('a','b','c') +1 +select row('A' COLLATE latin1_bin,'b','c') = row('a','b','c'); +row('A' COLLATE latin1_bin,'b','c') = row('a','b','c') +0 +select row('A','b','c') = row('a' COLLATE latin1_bin,'b','c'); +row('A','b','c') = row('a' COLLATE latin1_bin,'b','c') +0 +select row('A' COLLATE latin1_general_ci,'b','c') = row('a' COLLATE latin1_bin,'b','c'); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation '=' +select concat(_latin1'a',_latin2'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat' +select concat(_latin1'a',_latin2'a',_latin5'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin5_turkish_ci,COERCIBLE) for operation 'concat' +select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a'); +ERROR HY000: Illegal mix of collations for operation 'concat' +select concat_ws(_latin1'a',_latin2'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_ws' +select FIELD('b','A','B'); +FIELD('b','A','B') +2 +select FIELD('B','A','B'); +FIELD('B','A','B') +2 +select FIELD('b' COLLATE latin1_bin,'A','B'); +FIELD('b' COLLATE latin1_bin,'A','B') +0 +select FIELD('b','A' COLLATE latin1_bin,'B'); +FIELD('b','A' COLLATE latin1_bin,'B') +0 +select FIELD(_latin2'b','A','B'); +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field' +select FIELD('b',_latin2'A','B'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field' +select FIELD('b',_latin2'A','B',1); +FIELD('b',_latin2'A','B',1) +1 +select POSITION(_latin1'B' IN _latin1'abcd'); +POSITION(_latin1'B' IN _latin1'abcd') +2 +select POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin); +POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin) +0 +select POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd'); +POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd') +0 +select POSITION(_latin1'B' COLLATE latin1_general_ci IN _latin1'abcd' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_bin,EXPLICIT) and (latin1_general_ci,EXPLICIT) for operation 'locate' +select POSITION(_latin1'B' IN _latin2'abcd'); +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'locate' +select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'); +FIND_IN_SET(_latin1'B',_latin1'a,b,c,d') +2 +select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'find_in_set' +select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'find_in_set' +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2); +SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2) +abcdabc +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'substr_index' +select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_general_ci,_latin1'd' COLLATE latin1_bin,2); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'substr_index' +select _latin1'B' between _latin1'a' and _latin1'c'; +_latin1'B' between _latin1'a' and _latin1'c' +1 +select _latin1'B' collate latin1_bin between _latin1'a' and _latin1'c'; +_latin1'B' collate latin1_bin between _latin1'a' and _latin1'c' +0 +select _latin1'B' between _latin1'a' collate latin1_bin and _latin1'c'; +_latin1'B' between _latin1'a' collate latin1_bin and _latin1'c' +0 +select _latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin; +_latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin +0 +select _latin2'B' between _latin1'a' and _latin1'b'; +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'between' +select _latin1'B' between _latin2'a' and _latin1'b'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'between' +select _latin1'B' between _latin1'a' and _latin2'b'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE) for operation 'between' +select _latin1'B' collate latin1_general_ci between _latin1'a' collate latin1_bin and _latin1'b'; +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_bin,EXPLICIT), (latin1_swedish_ci,COERCIBLE) for operation 'between' +select _latin1'B' in (_latin1'a',_latin1'b'); +_latin1'B' in (_latin1'a',_latin1'b') +1 +select _latin1'B' collate latin1_bin in (_latin1'a',_latin1'b'); +_latin1'B' collate latin1_bin in (_latin1'a',_latin1'b') +0 +select _latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b'); +_latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b') +0 +select _latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin); +_latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin) +0 +select _latin2'B' in (_latin1'a',_latin1'b'); +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation ' IN ' +select _latin1'B' in (_latin2'a',_latin1'b'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation ' IN ' +select _latin1'B' in (_latin1'a',_latin2'b'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE) for operation ' IN ' +select _latin1'B' COLLATE latin1_general_ci in (_latin1'a' COLLATE latin1_bin,_latin1'b'); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_bin,EXPLICIT), (latin1_swedish_ci,COERCIBLE) for operation ' IN ' +select _latin1'B' COLLATE latin1_general_ci in (_latin1'a',_latin1'b' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_swedish_ci,COERCIBLE), (latin1_bin,EXPLICIT) for operation ' IN ' +select collation(bin(130)), coercibility(bin(130)); +collation(bin(130)) coercibility(bin(130)) +latin1_swedish_ci 3 +select collation(oct(130)), coercibility(oct(130)); +collation(oct(130)) coercibility(oct(130)) +latin1_swedish_ci 3 +select collation(conv(130,16,10)), coercibility(conv(130,16,10)); +collation(conv(130,16,10)) coercibility(conv(130,16,10)) +latin1_swedish_ci 3 +select collation(hex(130)), coercibility(hex(130)); +collation(hex(130)) coercibility(hex(130)) +latin1_swedish_ci 3 +select collation(char(130)), coercibility(hex(130)); +collation(char(130)) coercibility(hex(130)) +binary 3 +select collation(format(130,10)), coercibility(format(130,10)); +collation(format(130,10)) coercibility(format(130,10)) +latin1_swedish_ci 3 +select collation(lcase(_latin2'a')), coercibility(lcase(_latin2'a')); +collation(lcase(_latin2'a')) coercibility(lcase(_latin2'a')) +latin2_general_ci 3 +select collation(ucase(_latin2'a')), coercibility(ucase(_latin2'a')); +collation(ucase(_latin2'a')) coercibility(ucase(_latin2'a')) +latin2_general_ci 3 +select collation(left(_latin2'a',1)), coercibility(left(_latin2'a',1)); +collation(left(_latin2'a',1)) coercibility(left(_latin2'a',1)) +latin2_general_ci 3 +select collation(right(_latin2'a',1)), coercibility(right(_latin2'a',1)); +collation(right(_latin2'a',1)) coercibility(right(_latin2'a',1)) +latin2_general_ci 3 +select collation(substring(_latin2'a',1,1)), coercibility(substring(_latin2'a',1,1)); +collation(substring(_latin2'a',1,1)) coercibility(substring(_latin2'a',1,1)) +latin2_general_ci 3 +select collation(concat(_latin2'a',_latin2'b')), coercibility(concat(_latin2'a',_latin2'b')); +collation(concat(_latin2'a',_latin2'b')) coercibility(concat(_latin2'a',_latin2'b')) +latin2_general_ci 3 +select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b')); +collation(lpad(_latin2'a',4,_latin2'b')) coercibility(lpad(_latin2'a',4,_latin2'b')) +latin2_general_ci 3 +select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b')); +collation(rpad(_latin2'a',4,_latin2'b')) coercibility(rpad(_latin2'a',4,_latin2'b')) +latin2_general_ci 3 +select collation(concat_ws(_latin2'a',_latin2'b')), coercibility(concat_ws(_latin2'a',_latin2'b')); +collation(concat_ws(_latin2'a',_latin2'b')) coercibility(concat_ws(_latin2'a',_latin2'b')) +latin2_general_ci 3 +select collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')), coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c')); +collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')) coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c')) +latin2_general_ci 3 +select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' ')); +collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')) coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' ')) +binary 3 +select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a ')); +collation(trim(_latin2' a ')) coercibility(trim(_latin2' a ')) +latin2_general_ci 3 +select collation(ltrim(_latin2' a ')), coercibility(ltrim(_latin2' a ')); +collation(ltrim(_latin2' a ')) coercibility(ltrim(_latin2' a ')) +latin2_general_ci 3 +select collation(rtrim(_latin2' a ')), coercibility(rtrim(_latin2' a ')); +collation(rtrim(_latin2' a ')) coercibility(rtrim(_latin2' a ')) +latin2_general_ci 3 +select collation(trim(LEADING _latin2' ' FROM _latin2'a')), coercibility(trim(LEADING _latin2'a' FROM _latin2'a')); +collation(trim(LEADING _latin2' ' FROM _latin2'a')) coercibility(trim(LEADING _latin2'a' FROM _latin2'a')) +latin2_general_ci 3 +select collation(trim(TRAILING _latin2' ' FROM _latin2'a')), coercibility(trim(TRAILING _latin2'a' FROM _latin2'a')); +collation(trim(TRAILING _latin2' ' FROM _latin2'a')) coercibility(trim(TRAILING _latin2'a' FROM _latin2'a')) +latin2_general_ci 3 +select collation(trim(BOTH _latin2' ' FROM _latin2'a')), coercibility(trim(BOTH _latin2'a' FROM _latin2'a')); +collation(trim(BOTH _latin2' ' FROM _latin2'a')) coercibility(trim(BOTH _latin2'a' FROM _latin2'a')) +latin2_general_ci 3 +select collation(repeat(_latin2'a',10)), coercibility(repeat(_latin2'a',10)); +collation(repeat(_latin2'a',10)) coercibility(repeat(_latin2'a',10)) +latin2_general_ci 3 +select collation(reverse(_latin2'ab')), coercibility(reverse(_latin2'ab')); +collation(reverse(_latin2'ab')) coercibility(reverse(_latin2'ab')) +latin2_general_ci 3 +select collation(quote(_latin2'ab')), coercibility(quote(_latin2'ab')); +collation(quote(_latin2'ab')) coercibility(quote(_latin2'ab')) +latin2_general_ci 3 +select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab')); +collation(soundex(_latin2'ab')) coercibility(soundex(_latin2'ab')) +latin2_general_ci 3 +select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1)); +collation(substring(_latin2'ab',1)) coercibility(substring(_latin2'ab',1)) +latin2_general_ci 3 +select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef')); +collation(insert(_latin2'abcd',2,3,_latin2'ef')) coercibility(insert(_latin2'abcd',2,3,_latin2'ef')) +latin2_general_ci 3 +select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')); +collation(replace(_latin2'abcd',_latin2'b',_latin2'B')) coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')) +latin2_general_ci 3 +select collation(encode('abcd','ab')), coercibility(encode('abcd','ab')); +collation(encode('abcd','ab')) coercibility(encode('abcd','ab')) +binary 3 +create table t1 +select +bin(130), +oct(130), +conv(130,16,10), +hex(130), +char(130), +format(130,10), +left(_latin2'a',1), +right(_latin2'a',1), +lcase(_latin2'a'), +ucase(_latin2'a'), +substring(_latin2'a',1,1), +concat(_latin2'a',_latin2'b'), +lpad(_latin2'a',4,_latin2'b'), +rpad(_latin2'a',4,_latin2'b'), +concat_ws(_latin2'a',_latin2'b'), +make_set(255,_latin2'a',_latin2'b',_latin2'c'), +export_set(255,_latin2'y',_latin2'n',_latin2' '), +trim(_latin2' a '), +ltrim(_latin2' a '), +rtrim(_latin2' a '), +trim(LEADING _latin2' ' FROM _latin2' a '), +trim(TRAILING _latin2' ' FROM _latin2' a '), +trim(BOTH _latin2' ' FROM _latin2' a '), +repeat(_latin2'a',10), +reverse(_latin2'ab'), +quote(_latin2'ab'), +soundex(_latin2'ab'), +substring(_latin2'ab',1), +insert(_latin2'abcd',2,3,_latin2'ef'), +replace(_latin2'abcd',_latin2'b',_latin2'B'), +encode('abcd','ab') +; +Warnings: +Warning 1265 Data truncated for column 'format(130,10)' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `bin(130)` char(64) NOT NULL default '', + `oct(130)` char(64) NOT NULL default '', + `conv(130,16,10)` char(64) NOT NULL default '', + `hex(130)` char(6) NOT NULL default '', + `char(130)` char(1) NOT NULL default '', + `format(130,10)` char(4) NOT NULL default '', + `left(_latin2'a',1)` char(1) character set latin2 NOT NULL default '', + `right(_latin2'a',1)` char(1) character set latin2 NOT NULL default '', + `lcase(_latin2'a')` char(1) character set latin2 NOT NULL default '', + `ucase(_latin2'a')` char(1) character set latin2 NOT NULL default '', + `substring(_latin2'a',1,1)` char(1) character set latin2 NOT NULL default '', + `concat(_latin2'a',_latin2'b')` char(2) character set latin2 NOT NULL default '', + `lpad(_latin2'a',4,_latin2'b')` char(4) character set latin2 NOT NULL default '', + `rpad(_latin2'a',4,_latin2'b')` char(4) character set latin2 NOT NULL default '', + `concat_ws(_latin2'a',_latin2'b')` char(1) character set latin2 NOT NULL default '', + `make_set(255,_latin2'a',_latin2'b',_latin2'c')` char(5) character set latin2 NOT NULL default '', + `export_set(255,_latin2'y',_latin2'n',_latin2' ')` char(127) character set latin2 NOT NULL default '', + `trim(_latin2' a ')` char(3) character set latin2 NOT NULL default '', + `ltrim(_latin2' a ')` char(3) character set latin2 NOT NULL default '', + `rtrim(_latin2' a ')` char(3) character set latin2 NOT NULL default '', + `trim(LEADING _latin2' ' FROM _latin2' a ')` char(3) character set latin2 NOT NULL default '', + `trim(TRAILING _latin2' ' FROM _latin2' a ')` char(3) character set latin2 NOT NULL default '', + `trim(BOTH _latin2' ' FROM _latin2' a ')` char(3) character set latin2 NOT NULL default '', + `repeat(_latin2'a',10)` char(10) character set latin2 NOT NULL default '', + `reverse(_latin2'ab')` char(2) character set latin2 NOT NULL default '', + `quote(_latin2'ab')` char(6) character set latin2 NOT NULL default '', + `soundex(_latin2'ab')` char(4) character set latin2 NOT NULL default '', + `substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default '', + `insert(_latin2'abcd',2,3,_latin2'ef')` char(6) character set latin2 NOT NULL default '', + `replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default '', + `encode('abcd','ab')` binary(4) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select SUBSTR('abcdefg',3,2); +SUBSTR('abcdefg',3,2) +cd +select SUBSTRING('abcdefg',3,2); +SUBSTRING('abcdefg',3,2) +cd +select SUBSTR('abcdefg',-3,2) FROM DUAL; +SUBSTR('abcdefg',-3,2) +ef +select SUBSTR('abcdefg',-1,5) FROM DUAL; +SUBSTR('abcdefg',-1,5) +g +select SUBSTR('abcdefg',0,0) FROM DUAL; +SUBSTR('abcdefg',0,0) + +select SUBSTR('abcdefg',-1,-1) FROM DUAL; +SUBSTR('abcdefg',-1,-1) + +select SUBSTR('abcdefg',1,-1) FROM DUAL; +SUBSTR('abcdefg',1,-1) + +create table t7 (s1 char); +select * from t7 +where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA'; +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat' +drop table t7; +select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2); +substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2) substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2) +1abcd;2abcd 3abcd;4abcd +explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'mood' sounds like 'mud', aes_decrypt(aes_encrypt('abc','1'),'1'),concat('*',space(5),'*'), reverse('abc'), rpad('a',4,'1'), lpad('a',4,'1'), concat_ws(',','',NULL,'a'),make_set(255,_latin2'a',_latin2'b',_latin2'c'),elt(2,1),locate("a","b",2),format(130,10),char(0),conv(130,16,10),hex(130),binary 'HE', export_set(255,_latin2'y',_latin2'n',_latin2' '),FIELD('b' COLLATE latin1_bin,'A','B'),FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'),collation(conv(130,16,10)), coercibility(conv(130,16,10)),length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'),quote(1/0),crc32("123"),replace('aaaa','a','b'),insert('txs',2,1,'hi'),left(_latin2'a',1),right(_latin2'a',1),lcase(_latin2'a'),ucase(_latin2'a'),SUBSTR('abcdefg',3,2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),trim(_latin2' a '),ltrim(_latin2' a '),rtrim(_latin2' a '), decode(encode(repeat("a",100000),"monty"),"monty"); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,cast(_latin1'HE' as char charset binary) AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")` +SELECT lpad(12345, 5, "#"); +lpad(12345, 5, "#") +12345 +SELECT conv(71, 10, 36), conv('1Z', 36, 10); +conv(71, 10, 36) conv('1Z', 36, 10) +1Z 71 +create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; +insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb'); +create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; +insert into t2 values (1,'cccccccccc'), (2,'dddddddddd'); +select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2 +where t2.id=t1.id order by name; +name +aaaaaaaaaaccccc +bbbbbbbbbbddddd +drop table t1, t2; +create table t1 (c1 INT, c2 INT UNSIGNED); +insert into t1 values ('21474836461','21474836461'); +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +insert into t1 values ('-21474836461','-21474836461'); +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +show warnings; +Level Code Message +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +select * from t1; +c1 c2 +2147483647 4294967295 +-2147483648 0 +drop table t1; +select left(1234, 3) + 0; +left(1234, 3) + 0 +123 diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 5ea4ed5e4e0..d3db2cc5151 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -1,6 +1,70 @@ -select database(),user() like "%@%"; -database() user() like "%@%" -test 1 +select database(); +database() +test +select charset(database()); +charset(database()) +utf8 +select database() = "test"; +database() = "test" +1 +select database() = _utf8"test"; +database() = _utf8"test" +1 +select database() = _latin1"test"; +database() = _latin1"test" +1 +select user() like "%@%"; +user() like "%@%" +1 +select user() like _utf8"%@%"; +user() like _utf8"%@%" +1 +select user() like _latin1"%@%"; +user() like _latin1"%@%" +1 +select charset(user()); +charset(user()) +utf8 select version()>="3.23.29"; version()>="3.23.29" 1 +select version()>=_utf8"3.23.29"; +version()>=_utf8"3.23.29" +1 +select version()>=_latin1"3.23.29"; +version()>=_latin1"3.23.29" +1 +select charset(version()); +charset(version()) +utf8 +explain extended select database(), user(); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache database() AS `database()`,user() AS `user()` +create table t1 (version char(40)) select database(), user(), version() as 'version'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `database()` char(34) character set utf8 default NULL, + `user()` char(77) character set utf8 NOT NULL default '', + `version` char(40) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select charset(charset(_utf8'a')), charset(collation(_utf8'a')); +charset(charset(_utf8'a')) charset(collation(_utf8'a')) +utf8 utf8 +select collation(charset(_utf8'a')), collation(collation(_utf8'a')); +collation(charset(_utf8'a')) collation(collation(_utf8'a')) +utf8_general_ci utf8_general_ci +create table t1 select charset(_utf8'a'), collation(_utf8'a'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `charset(_utf8'a')` char(64) character set utf8 NOT NULL default '', + `collation(_utf8'a')` char(64) character set utf8 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select TRUE,FALSE,NULL; +TRUE FALSE NULL +1 0 NULL diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index aaf5039eb43..c3fe1de15db 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -1,3 +1,4 @@ +drop table if exists t1,t2; select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ; 0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a") 1 1 1 0 0 1 -1 1 0 @@ -43,16 +44,50 @@ select -1.49 or -1.49,0.6 or 0.6; select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; 3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1 8 0 1 NULL NULL +explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; 1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL 0 1 1 0 NULL NULL NULL select 1 like 2 xor 2 like 1; 1 like 2 xor 2 like 1 0 +select 10 % 7, 10 mod 7, 10 div 3; +10 % 7 10 mod 7 10 div 3 +3 3 3 +explain extended select 10 % 7, 10 mod 7, 10 div 3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` +select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; +(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 +18446744073709551615 18446744073709551615 9223372036854775807 +explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` create table t1 (a int); insert t1 values (1); select * from t1 where 1 xor 1; a +explain extended select * from t1 where 1 xor 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1) +select - a from t1; +- a +-1 +explain extended select - a from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select -(test.t1.a) AS `- a` from test.t1 drop table t1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 @@ -63,12 +98,79 @@ select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; select 1 and 0 or 2, 2 or 1 and 0; 1 and 0 or 2 2 or 1 and 0 1 1 -DROP TABLE IF EXISTS t1,t2; -CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) TYPE=MyISAM; +select _koi8r'a' = _koi8r'A'; +_koi8r'a' = _koi8r'A' +1 +select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; +_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci +1 +explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` +select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; +_koi8r'a' = _koi8r'A' COLLATE koi8r_bin +0 +select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'; +_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A' +1 +select _koi8r'a' COLLATE koi8r_bin = _koi8r'A'; +_koi8r'a' COLLATE koi8r_bin = _koi8r'A' +0 +select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci; +ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '=' +select _koi8r'a' = _latin1'A'; +ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' +select strcmp(_koi8r'a', _koi8r'A'); +strcmp(_koi8r'a', _koi8r'A') +0 +select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci); +strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci) +0 +select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin); +strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin) +1 +select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A'); +strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A') +0 +select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A'); +strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A') +1 +select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin); +ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp' +select strcmp(_koi8r'a', _latin1'A'); +ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp' +select _koi8r'a' LIKE _koi8r'A'; +_koi8r'a' LIKE _koi8r'A' +1 +select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci; +_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci +1 +select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin; +_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin +0 +select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'; +_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' +1 +select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'; +_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A' +0 +select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; +ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like' +select _koi8r'a' LIKE _latin1'A'; +ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like' +CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM; INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"> </td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"> </td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL); -CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) TYPE=MyISAM; +CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1); SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank; rank rank rank 2 2 NULL DROP TABLE t1,t2; +CREATE TABLE t1 (d varchar(6), k int); +INSERT INTO t1 VALUES (NULL, 2); +SELECT GREATEST(d,d) FROM t1 WHERE k=2; +GREATEST(d,d) +NULL +DROP TABLE t1; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 877ca0e2d51..2dc6bffd071 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -406,14 +406,18 @@ monthname(date) NULL January drop table t1,t2; -CREATE TABLE t1 (updated text) TYPE=MyISAM; +CREATE TABLE t1 (updated text) ENGINE=MyISAM; INSERT INTO t1 VALUES (''); SELECT month(updated) from t1; month(updated) NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '' SELECT year(updated) from t1; year(updated) NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '' drop table t1; create table t1 (d date, dt datetime, t timestamp, c char(10)); insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); @@ -453,10 +457,10 @@ CREATE TABLE t3 (ctime1 char(19) NOT NULL, ctime2 char(19) NOT NULL); INSERT INTO t3 VALUES ("2002-10-29 16:51:06","2002-11-05 16:47:31"); select * from t1, t2 where t1.start between t2.ctime1 and t2.ctime2; start ctime1 ctime2 -2002-11-04 00:00:00 20021029165106 20021105164731 +2002-11-04 00:00:00 2002-10-29 16:51:06 2002-11-05 16:47:31 select * from t1, t2 where t1.start >= t2.ctime1 and t1.start <= t2.ctime2; start ctime1 ctime2 -2002-11-04 00:00:00 20021029165106 20021105164731 +2002-11-04 00:00:00 2002-10-29 16:51:06 2002-11-05 16:47:31 select * from t1, t3 where t1.start between t3.ctime1 and t3.ctime2; start ctime1 ctime2 2002-11-04 00:00:00 2002-10-29 16:51:06 2002-11-05 16:47:31 @@ -470,3 +474,131 @@ unix_timestamp(@a) select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') 0 +CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time); +INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08"); +SELECT * from t1; +datetime timestamp date time +2001-01-02 03:04:05 2002-01-02 03:04:05 2003-01-02 06:07:08 +select date_add("1997-12-31",INTERVAL 1 SECOND); +date_add("1997-12-31",INTERVAL 1 SECOND) +1997-12-31 00:00:01 +select date_add("1997-12-31",INTERVAL "1 1" YEAR_MONTH); +date_add("1997-12-31",INTERVAL "1 1" YEAR_MONTH) +1999-01-31 +select date_add(datetime, INTERVAL 1 SECOND) from t1; +date_add(datetime, INTERVAL 1 SECOND) +2001-01-02 03:04:06 +select date_add(datetime, INTERVAL 1 YEAR) from t1; +date_add(datetime, INTERVAL 1 YEAR) +2002-01-02 03:04:05 +select date_add(date,INTERVAL 1 SECOND) from t1; +date_add(date,INTERVAL 1 SECOND) +2003-01-02 00:00:01 +select date_add(date,INTERVAL 1 MINUTE) from t1; +date_add(date,INTERVAL 1 MINUTE) +2003-01-02 00:01:00 +select date_add(date,INTERVAL 1 HOUR) from t1; +date_add(date,INTERVAL 1 HOUR) +2003-01-02 01:00:00 +select date_add(date,INTERVAL 1 DAY) from t1; +date_add(date,INTERVAL 1 DAY) +2003-01-03 +select date_add(date,INTERVAL 1 MONTH) from t1; +date_add(date,INTERVAL 1 MONTH) +2003-02-02 +select date_add(date,INTERVAL 1 YEAR) from t1; +date_add(date,INTERVAL 1 YEAR) +2004-01-02 +select date_add(date,INTERVAL "1:1" MINUTE_SECOND) from t1; +date_add(date,INTERVAL "1:1" MINUTE_SECOND) +2003-01-02 00:01:01 +select date_add(date,INTERVAL "1:1" HOUR_MINUTE) from t1; +date_add(date,INTERVAL "1:1" HOUR_MINUTE) +2003-01-02 01:01:00 +select date_add(date,INTERVAL "1:1" DAY_HOUR) from t1; +date_add(date,INTERVAL "1:1" DAY_HOUR) +2003-01-03 01:00:00 +select date_add(date,INTERVAL "1 1" YEAR_MONTH) from t1; +date_add(date,INTERVAL "1 1" YEAR_MONTH) +2004-02-02 +select date_add(date,INTERVAL "1:1:1" HOUR_SECOND) from t1; +date_add(date,INTERVAL "1:1:1" HOUR_SECOND) +2003-01-02 01:01:01 +select date_add(date,INTERVAL "1 1:1" DAY_MINUTE) from t1; +date_add(date,INTERVAL "1 1:1" DAY_MINUTE) +2003-01-03 01:01:00 +select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1; +date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) +2003-01-03 01:01:01 +select date_add(time,INTERVAL 1 SECOND) from t1; +date_add(time,INTERVAL 1 SECOND) +NULL +Warnings: +Warning 1264 Data truncated; out of range for column 'time' at row 1 +drop table t1; +select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2, +last_day('2003-03-32') as f3, last_day('2003-04-01') as f4, +last_day('2001-01-01 01:01:01') as f5, last_day(NULL), +last_day('2001-02-12'); +f1 f2 f3 f4 f5 last_day(NULL) last_day('2001-02-12') +2000-02-29 2002-12-31 NULL 2003-04-30 2001-01-31 NULL 2001-02-28 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2003-03-32' +create table t1 select last_day('2000-02-05') as a, +from_days(to_days("960101")) as b; +describe t1; +Field Type Null Key Default Extra +a date 0000-00-00 +b date YES NULL +select * from t1; +a b +2000-02-29 1996-01-01 +drop table t1; +select last_day('2000-02-05') as a, +from_days(to_days("960101")) as b; +a b +2000-02-29 1996-01-01 +select date_add(last_day("1997-12-1"), INTERVAL 1 DAY); +date_add(last_day("1997-12-1"), INTERVAL 1 DAY) +1998-01-01 +select length(last_day("1997-12-1")); +length(last_day("1997-12-1")) +10 +select last_day("1997-12-1")+0; +last_day("1997-12-1")+0 +19971231 +select last_day("1997-12-1")+0.0; +last_day("1997-12-1")+0.0 +19971231.0 +select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0; +strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0 +1 +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0; +strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0 +1 +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0; +strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0 +1 +select strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0; +strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0 +1 +select strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0; +strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0 +1 +select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0; +strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0 +1 +explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_days(to_days("960101")),dayofmonth("1997-01-02"), month("1997-01-02"), monthname("1972-03-04"),dayofyear("0000-00-00"),HOUR("1997-03-03 23:03:22"),MINUTE("23:03:22"),SECOND(230322),QUARTER(980303),WEEK("1998-03-03"),yearweek("2000-01-01",1),week(19950101,1),year("98-02-03"),weekday(curdate())-weekday(now()),dayname("1962-03-03"),unix_timestamp(),sec_to_time(time_to_sec("0:30:47")/6.21),curtime(),utc_time(),curdate(),utc_date(),utc_timestamp(),date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"),from_unixtime(unix_timestamp("1994-03-02 10:11:12")),"1997-12-31 23:59:59" + INTERVAL 1 SECOND,"1998-01-01 00:00:00" - INTERVAL 1 SECOND,INTERVAL 1 DAY + "1997-12-31", extract(YEAR FROM "1999-01-02 10:11:12"),date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +SET @TMP=NOW(); +CREATE TABLE t1 (d DATETIME); +INSERT INTO t1 VALUES (NOW()); +INSERT INTO t1 VALUES (NOW()); +INSERT INTO t1 VALUES (NOW()); +SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1); +count(*) +3 +DROP TABLE t1; diff --git a/mysql-test/r/gcc296.result b/mysql-test/r/gcc296.result index 8f78f70cc1f..628bbbf3f93 100644 --- a/mysql-test/r/gcc296.result +++ b/mysql-test/r/gcc296.result @@ -1,5 +1,5 @@ -drop table if exists obory; -CREATE TABLE obory ( +drop table if exists t1; +CREATE TABLE t1 ( kodoboru varchar(10) default NULL, obor tinytext, aobor tinytext, @@ -7,14 +7,14 @@ UNIQUE INDEX kodoboru (kodoboru), FULLTEXT KEY obor (obor), FULLTEXT KEY aobor (aobor) ); -INSERT INTO obory VALUES ('0101000000','aaa','AAA'); -INSERT INTO obory VALUES ('0102000000','bbb','BBB'); -INSERT INTO obory VALUES ('0103000000','ccc','CCC'); -INSERT INTO obory VALUES ('0104000000','xxx','XXX'); -select * from obory; +INSERT INTO t1 VALUES ('0101000000','aaa','AAA'); +INSERT INTO t1 VALUES ('0102000000','bbb','BBB'); +INSERT INTO t1 VALUES ('0103000000','ccc','CCC'); +INSERT INTO t1 VALUES ('0104000000','xxx','XXX'); +select * from t1; kodoboru obor aobor 0101000000 aaa AAA 0102000000 bbb BBB 0103000000 ccc CCC 0104000000 xxx XXX -drop table obory; +drop table t1; diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result new file mode 100644 index 00000000000..3fb1a5dd31c --- /dev/null +++ b/mysql-test/r/gis-rtree.result @@ -0,0 +1,759 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL, +SPATIAL KEY(g) +) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fid` int(11) NOT NULL auto_increment, + `g` geometry NOT NULL default '', + PRIMARY KEY (`fid`), + SPATIAL KEY `g` (`g`(32)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(148 148, 152 152)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(147 147, 153 153)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(146 146, 154 154)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(145 145, 155 155)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(144 144, 156 156)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(143 143, 157 157)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(142 142, 158 158)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(141 141, 159 159)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(140 140, 160 160)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(139 139, 161 161)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(138 138, 162 162)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(137 137, 163 163)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(136 136, 164 164)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(135 135, 165 165)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(134 134, 166 166)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(133 133, 167 167)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(132 132, 168 168)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(131 131, 169 169)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(130 130, 170 170)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(129 129, 171 171)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(128 128, 172 172)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(127 127, 173 173)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(126 126, 174 174)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(125 125, 175 175)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(124 124, 176 176)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(123 123, 177 177)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(122 122, 178 178)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(121 121, 179 179)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(120 120, 180 180)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(119 119, 181 181)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(118 118, 182 182)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(117 117, 183 183)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(116 116, 184 184)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(115 115, 185 185)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(114 114, 186 186)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(113 113, 187 187)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(112 112, 188 188)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(111 111, 189 189)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(110 110, 190 190)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(109 109, 191 191)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(108 108, 192 192)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(107 107, 193 193)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(106 106, 194 194)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(105 105, 195 195)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(104 104, 196 196)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(103 103, 197 197)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(102 102, 198 198)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(101 101, 199 199)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(100 100, 200 200)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(99 99, 201 201)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(98 98, 202 202)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(97 97, 203 203)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(96 96, 204 204)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(95 95, 205 205)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(94 94, 206 206)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(93 93, 207 207)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(92 92, 208 208)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(91 91, 209 209)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(90 90, 210 210)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(89 89, 211 211)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(88 88, 212 212)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(87 87, 213 213)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(86 86, 214 214)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(85 85, 215 215)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(84 84, 216 216)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(83 83, 217 217)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(82 82, 218 218)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(81 81, 219 219)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(80 80, 220 220)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(79 79, 221 221)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(78 78, 222 222)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(77 77, 223 223)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(76 76, 224 224)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(75 75, 225 225)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(74 74, 226 226)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(73 73, 227 227)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(72 72, 228 228)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(71 71, 229 229)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(70 70, 230 230)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(69 69, 231 231)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(68 68, 232 232)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(67 67, 233 233)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(66 66, 234 234)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(65 65, 235 235)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(64 64, 236 236)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(63 63, 237 237)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(62 62, 238 238)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(61 61, 239 239)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(60 60, 240 240)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(59 59, 241 241)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(58 58, 242 242)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(57 57, 243 243)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(56 56, 244 244)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(55 55, 245 245)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(54 54, 246 246)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(53 53, 247 247)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(52 52, 248 248)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(51 51, 249 249)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(50 50, 250 250)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(49 49, 251 251)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(48 48, 252 252)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(47 47, 253 253)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(46 46, 254 254)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(45 45, 255 255)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(44 44, 256 256)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(43 43, 257 257)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(42 42, 258 258)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(41 41, 259 259)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(40 40, 260 260)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(39 39, 261 261)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(38 38, 262 262)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(37 37, 263 263)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(36 36, 264 264)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(35 35, 265 265)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(34 34, 266 266)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(33 33, 267 267)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(32 32, 268 268)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(31 31, 269 269)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(30 30, 270 270)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(29 29, 271 271)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(28 28, 272 272)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(27 27, 273 273)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(26 26, 274 274)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(25 25, 275 275)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(24 24, 276 276)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(23 23, 277 277)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(22 22, 278 278)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(21 21, 279 279)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(20 20, 280 280)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(19 19, 281 281)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(18 18, 282 282)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(17 17, 283 283)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(16 16, 284 284)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(15 15, 285 285)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(14 14, 286 286)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(13 13, 287 287)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(12 12, 288 288)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(11 11, 289 289)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(10 10, 290 290)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(9 9, 291 291)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(8 8, 292 292)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(7 7, 293 293)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(6 6, 294 294)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(5 5, 295 295)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(4 4, 296 296)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(3 3, 297 297)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(2 2, 298 298)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 1, 299 299)')); +SELECT count(*) FROM t1; +count(*) +150 +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range g g 32 NULL 7 Using where +SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); +fid AsText(g) +1 LINESTRING(150 150,150 150) +3 LINESTRING(148 148,152 152) +4 LINESTRING(147 147,153 153) +5 LINESTRING(146 146,154 154) +6 LINESTRING(145 145,155 155) +7 LINESTRING(144 144,156 156) +8 LINESTRING(143 143,157 157) +9 LINESTRING(142 142,158 158) +10 LINESTRING(141 141,159 159) +11 LINESTRING(140 140,160 160) +2 LINESTRING(149 149,151 151) +DROP TABLE t1; +CREATE TABLE t2 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL +) ENGINE=MyISAM; +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))); +ALTER TABLE t2 ADD SPATIAL KEY(g); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fid` int(11) NOT NULL auto_increment, + `g` geometry NOT NULL default '', + PRIMARY KEY (`fid`), + SPATIAL KEY `g` (`g`(32)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT count(*) FROM t2; +count(*) +100 +EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g, +GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range g g 32 NULL 4 Using where +SELECT fid, AsText(g) FROM t2 WHERE Within(g, +GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +fid AsText(g) +46 LINESTRING(51 41,60 50) +56 LINESTRING(41 41,50 50) +45 LINESTRING(51 51,60 60) +55 LINESTRING(41 51,50 60) +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +99 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +98 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +97 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +96 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +95 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +94 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +93 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +92 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +91 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +90 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +89 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +88 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +87 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +86 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +85 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +84 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +83 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +82 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +81 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +80 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +79 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +78 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +77 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +76 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +75 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +74 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +73 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +72 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +71 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +70 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +69 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +68 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +67 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +66 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +65 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +64 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +63 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +62 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +61 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +60 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +59 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +58 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +57 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +56 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +55 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +54 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +53 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +52 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +51 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +50 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +49 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +48 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +47 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +46 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +45 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +44 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +43 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +42 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +41 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +40 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +39 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +38 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +37 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +36 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +35 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +34 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +33 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +32 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +31 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +30 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +29 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +28 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +27 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +26 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +25 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +24 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +23 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +22 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +21 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +20 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +19 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +18 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +17 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +16 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +15 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +14 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +13 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +12 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +11 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +10 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +9 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +8 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +7 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +6 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +5 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +4 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +3 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +2 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +1 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +0 +DROP TABLE t2; +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a)); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +drop table t1; +CREATE TABLE t1 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL, +SPATIAL KEY(g) +) ENGINE=MyISAM; +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); +drop table t1; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result new file mode 100644 index 00000000000..9f5dd286cf9 --- /dev/null +++ b/mysql-test/r/gis.result @@ -0,0 +1,487 @@ +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); +CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING); +CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON); +CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT); +CREATE TABLE gis_multi_line (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING); +CREATE TABLE gis_multi_polygon (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); +CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); +CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g point YES NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g linestring YES NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g polygon YES NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g multipoint YES NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g multilinestring YES NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g multipolygon YES NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g geometrycollection YES NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) PRI 0 +g geometry YES NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10)))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 +Warnings: +Note 1003 select dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +explain extended select X(g),Y(g) FROM gis_point; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 +Warnings: +Note 1003 select x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.142135623731 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 +Warnings: +Note 1003 select astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666667 25.416666666667) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 +Warnings: +Note 1003 select astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.588527753042 17.426536064114) +118 POINT(55.588527753042 17.426536064114) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +explain extended SELECT fid, NumGeometries(g) from gis_multi_point; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 +Warnings: +Note 1003 select test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 +Warnings: +Note 1003 select test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 0 1 0 +120 121 0 0 0 0 0 0 1 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 0 1 0 +explain extended SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +1 SIMPLE g2 ALL NULL NULL NULL NULL 2 +Warnings: +Note 1003 select test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +CREATE TABLE t1 ( +gp point, +ln linestring, +pg polygon, +mp multipoint, +mln multilinestring, +mpg multipolygon, +gc geometrycollection, +gm geometry +); +SHOW FIELDS FROM t1; +Field Type Null Key Default Extra +gp point YES NULL +ln linestring YES NULL +pg polygon YES NULL +mp multipoint YES NULL +mln multilinestring YES NULL +mpg multipolygon YES NULL +gc geometrycollection YES NULL +gm geometry YES NULL +ALTER TABLE t1 ADD fid INT NOT NULL; +SHOW FIELDS FROM t1; +Field Type Null Key Default Extra +gp point YES NULL +ln linestring YES NULL +pg polygon YES NULL +mp multipoint YES NULL +mln multilinestring YES NULL +mpg multipolygon YES NULL +gc geometrycollection YES NULL +gm geometry YES NULL +fid int(11) 0 +DROP TABLE t1; +SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))); +AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))) +POINT(1 4) +explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` +explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)')))); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` +SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); +SRID(GeomFromText('LineString(1 1,2 2)',101)) +101 +explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` +explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` +create table t1 (a geometry not null); +insert into t1 values (GeomFromText('Point(1 2)')); +insert into t1 values ('Garbage'); +ERROR HY000: Unknown error +insert IGNORE into t1 values ('Garbage'); +ERROR HY000: Unknown error +alter table t1 add spatial index(a); +drop table t1; +create table t1(a geometry not null, spatial index(a)); +insert into t1 values +(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')), +(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)')); +select AsText(a) from t1 where +MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a) +or +MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a); +AsText(a) +POINT(1 1) +POINT(3 3) +POINT(4 4) +select AsText(a) from t1 where +MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a) +and +MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); +AsText(a) +POINT(1 1) +drop table t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index d4d8dd1f026..35b90349804 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1,4 +1,5 @@ drop table if exists t1; +SET NAMES binary; delete from mysql.user where user='mysqltest_1'; delete from mysql.db where user='mysqltest_1'; flush privileges; @@ -76,6 +77,8 @@ delete from mysql.db where user='mysqltest_1'; delete from mysql.tables_priv where user='mysqltest_1'; delete from mysql.columns_priv where user='mysqltest_1'; flush privileges; +show grants for mysqltest_1@localhost; +ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host 'localhost' create table t1 (a int); GRANT select,update,insert on t1 to mysqltest_1@localhost; GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost; @@ -127,10 +130,105 @@ delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or flush privileges; drop table t1; GRANT FILE on mysqltest.* to mysqltest_1@localhost; -Wrong usage of DB GRANT and GLOBAL PRIVILEGES +ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 +create table t1 (a int); +grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; +show grants for drop_user2@localhost; +Grants for drop_user2@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user2'@'localhost' WITH GRANT OPTION +revoke all privileges, grant option from drop_user2@localhost; +drop user drop_user2@localhost; +grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION; +grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION; +grant select(a) on test.t1 to drop_user@localhost; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost' +set sql_mode=ansi_quotes; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost' +set sql_mode=default; +set sql_quote_show_create=0; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost' +set sql_mode="ansi_quotes"; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost' +set sql_quote_show_create=1; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost' +set sql_mode=""; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost' +revoke all privileges, grant option from drop_user@localhost; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT USAGE ON *.* TO 'drop_user'@'localhost' +drop user drop_user@localhost; +revoke all privileges, grant option from drop_user@localhost; +ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users +grant select(a) on test.t1 to drop_user1@localhost; +grant select on test.t1 to drop_user2@localhost; +grant select on test.* to drop_user3@localhost; +grant select on *.* to drop_user4@localhost; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +ERROR HY000: Can't drop one or more of the requested users +revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost, +drop_user3@localhost, drop_user4@localhost; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +drop table t1; +grant usage on *.* to mysqltest_1@localhost identified by "password"; +grant select, update, insert on test.* to mysqltest@localhost; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' +drop user mysqltest_1@localhost; +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁ (ËÏÌ int); +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +GRANT SELECT ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +DROP DATABASE ÂÄ; +SET NAMES latin1; insert into mysql.user (host, user) values ('localhost', 'test11'); insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result new file mode 100644 index 00000000000..31e506d2679 --- /dev/null +++ b/mysql-test/r/grant2.result @@ -0,0 +1,27 @@ +SET NAMES binary; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; +grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option; +select current_user(); +current_user() +mysqltest_1@localhost +select current_user; +current_user +mysqltest_1@localhost +grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option; +grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'my_%' +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `my\_%`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +GRANT ALL PRIVILEGES ON `my\_1`.* TO 'mysqltest_2'@'localhost' WITH GRANT OPTION +show grants for mysqltest_3@localhost; +ERROR 42000: There is no such grant defined for user 'mysqltest_3' on host 'localhost' +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index 96eb9d2bc62..892f1d940a6 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -2,6 +2,12 @@ drop table if exists test.t1,mysqltest.t1,mysqltest.t2; drop database if exists mysqltest; reset query cache; flush status; +show grants for current_user; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION +show grants; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION create database if not exists mysqltest; create table mysqltest.t1 (a int,b int,c int); create table mysqltest.t2 (a int,b int,c int); @@ -41,6 +47,10 @@ grant SELECT on mysqltest.* to mysqltest_1@localhost; grant SELECT on mysqltest.t1 to mysqltest_2@localhost; grant SELECT on test.t1 to mysqltest_2@localhost; grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost; +show grants for current_user(); +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -101,6 +111,9 @@ Qcache_hits 3 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 1 +show grants for current_user(); +Grants for @localhost +GRANT USAGE ON *.* TO ''@'localhost' select "user2"; user2 user2 @@ -121,7 +134,7 @@ a b c a 1 1 1 test.t1 2 2 2 test.t1 select * from t2; -select command denied to user: 'mysqltest_2@localhost' for table 't2' +ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -135,17 +148,17 @@ select "user3"; user3 user3 select * from t1; -select command denied to user: 'mysqltest_3@localhost' for column 'b' in table 't1' +ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' select a from t1; a 1 2 select c from t1; -SELECT command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' select * from t2; -select command denied to user: 'mysqltest_3@localhost' for table 't2' +ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2' select mysqltest.t1.c from test.t1,mysqltest.t1; -SELECT command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -158,8 +171,12 @@ Qcache_not_cached 7 select "user4"; user4 user4 +show grants; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' select a from t1; -No Database Selected +ERROR 3D000: No database selected select * from mysqltest.t1,test.t1; a b c a 1 1 1 test.t1 @@ -181,6 +198,7 @@ Qcache_hits 8 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 8 +set names binary; delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index dba95614052..9af7304c167 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1,4 +1,6 @@ drop table if exists t1,t2,t3; +SELECT 1 FROM (SELECT 1) as a GROUP BY SUM(1); +ERROR HY000: Invalid use of group function CREATE TABLE t1 ( spID int(10) unsigned, userID int(10) unsigned, @@ -52,10 +54,10 @@ userid MIN(t1.score+0.0) 2 2.0 1 1.0 EXPLAIN SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary -t2 eq_ref PRIMARY PRIMARY 4 t1.userID 1 Using index -drop table test.t1,test.t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.userID 1 Using index +drop table t1,t2; CREATE TABLE t1 ( PID int(10) unsigned NOT NULL auto_increment, payDate date DEFAULT '0000-00-00' NOT NULL, @@ -77,7 +79,7 @@ KEY payDate (payDate) ); INSERT INTO t1 VALUES (1,'1970-01-01','1997-10-17 00:00:00',2529,1,21000,11886,'check',0,'F',16200,6); SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew; -Can't group on 'IsNew' +ERROR 42000: Can't group on 'IsNew' drop table t1; CREATE TABLE t1 ( cid mediumint(9) NOT NULL auto_increment, @@ -113,7 +115,7 @@ groupset bigint(20) DEFAULT '0' NOT NULL, assigned_to mediumint(9) DEFAULT '0' NOT NULL, bug_file_loc text, bug_severity enum('blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL, -bug_status enum('NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL, +bug_status enum('','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL, creation_ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, delta_ts timestamp(14), short_desc mediumtext, @@ -250,11 +252,11 @@ key (score) ); INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3),(6,3,3),(7,3,3); explain select userid,count(*) from t1 group by userid desc; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort explain select userid,count(*) from t1 group by userid desc order by null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 8 Using temporary +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary select userid,count(*) from t1 group by userid desc; userid count(*) 3 5 @@ -266,14 +268,14 @@ userid count(*) select userid,count(*) from t1 group by userid desc having 3 IN (1,COUNT(*)); userid count(*) explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; -table type possible_keys key key_len ref rows Extra -t1 range spID spID 5 NULL 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range spID spID 5 NULL 3 Using where; Using index explain select spid,count(*) from t1 where spid between 1 and 2 group by spid; -table type possible_keys key key_len ref rows Extra -t1 range spID spID 5 NULL 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range spID spID 5 NULL 3 Using where; Using index explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null; -table type possible_keys key key_len ref rows Extra -t1 range spID spID 5 NULL 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range spID spID 5 NULL 3 Using where; Using index select spid,count(*) from t1 where spid between 1 and 2 group by spid; spid count(*) 1 1 @@ -282,12 +284,14 @@ select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; spid count(*) 2 2 1 1 -explain select sql_big_result spid,sum(userid) from t1 group by spid desc; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 8 Using filesort +explain extended select sql_big_result spid,sum(userid) from t1 group by spid desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort +Warnings: +Note 1003 select sql_big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 8 Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort select sql_big_result spid,sum(userid) from t1 group by spid desc; spid sum(userid) 7 3 @@ -298,11 +302,11 @@ spid sum(userid) 2 3 1 1 explain select sql_big_result score,count(*) from t1 group by score desc; -table type possible_keys key key_len ref rows Extra -t1 index NULL score 3 NULL 8 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL score 3 NULL 8 Using index explain select sql_big_result score,count(*) from t1 group by score desc order by null; -table type possible_keys key key_len ref rows Extra -t1 index NULL score 3 NULL 8 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL score 3 NULL 8 Using index select sql_big_result score,count(*) from t1 group by score desc; score count(*) 3 5 @@ -422,7 +426,6 @@ CONCAT(a, b) count(*) abcdef 1 hijklm 2 DROP TABLE t1; -drop table if exists t1; create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned); insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4); select One, Two, sum(Four) from t1 group by One,Two; @@ -473,13 +476,13 @@ c2id int(11) unsigned default NULL, value int(11) unsigned NOT NULL default '0', UNIQUE KEY pid2 (pid,c1id,c2id), UNIQUE KEY pid (pid,value) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1, 1, NULL, 1),(1, 2, NULL, 2),(1, NULL, 3, 3),(1, 4, NULL, 4),(1, 5, NULL, 5); CREATE TABLE t2 ( id int(11) unsigned NOT NULL default '0', active enum('Yes','No') NOT NULL default 'Yes', PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES (1, 'Yes'),(2, 'No'),(4, 'Yes'),(5, 'No'); CREATE TABLE t3 ( id int(11) unsigned NOT NULL default '0', @@ -532,13 +535,13 @@ a b 2 2 1 1 explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort -t2 ALL a NULL NULL NULL 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +1 SIMPLE t2 ALL a NULL NULL NULL 3 Using where explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 6 Using temporary -t2 ALL a NULL NULL NULL 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary +1 SIMPLE t2 ALL a NULL NULL NULL 3 Using where drop table t1,t2; create table t1 (a int, b int); insert into t1 values (1, 4),(10, 40),(1, 4),(10, 43),(1, 4),(10, 41),(1, 4),(10, 43),(1, 4); @@ -609,8 +612,8 @@ userid count(*) 2 1 1 2 EXPLAIN SELECT userid,count(*) FROM t1 GROUP BY userid DESC; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 ( i int(11) default NULL, @@ -623,6 +626,6 @@ i COUNT(DISTINCT(i)) 2 1 4 4 explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 6 Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index 50d51cf14f4..f66e9f1759d 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -5,6 +5,8 @@ insert into t1 values (14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"), (20,"ggg"),(21,"hhh"),(22,"iii"); handler t1 open as t2; +handler t2 read a=(SELECT 1); +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 handler t2 read a first; a b 14 aaa @@ -49,7 +51,7 @@ handler t2 read a=(16); a b 16 ccc handler t2 read a=(19,"fff"); -Too many key parts specified. Max 1 parts allowed +ERROR 42000: Too many key parts specified; max 1 parts allowed handler t2 read b=(19,"fff"); a b 19 fff @@ -60,7 +62,7 @@ handler t2 read b=(19); a b 19 fff handler t1 read a last; -Unknown table 't1' in HANDLER +ERROR 42S02: Unknown table 't1' in HANDLER handler t2 read a=(11); a b handler t2 read a>=(11); @@ -133,18 +135,18 @@ handler t2 read next; a b 19 fff handler t2 read last; -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 +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 handler t2 close; handler t1 open as t2; drop table t1; create table t1 (a int); insert into t1 values (17); handler t2 read first; -Unknown table 't2' in HANDLER +ERROR 42S02: Unknown table 't2' in HANDLER handler t1 open as t2; alter table t1 engine=MyISAM; handler t2 read first; -Unknown table 't2' in HANDLER +ERROR 42S02: Unknown table 't2' in HANDLER drop table t1; create table t1 (a int); insert into t1 values (1),(2),(3),(4),(5),(6); @@ -169,9 +171,9 @@ create table t1(a int, index(a)); insert into t1 values (1), (2), (3); handler t1 open; handler t1 read a=(W); -Unknown column 'W' in 'field list' +ERROR 42S22: Unknown column 'W' in 'field list' handler t1 read a=(a); -Wrong arguments to HANDLER ... READ +ERROR HY000: Incorrect arguments to HANDLER ... READ drop table t1; create table t1 (a char(5)); insert into t1 values ("Ok"); diff --git a/mysql-test/r/have_archive.require b/mysql-test/r/have_archive.require new file mode 100644 index 00000000000..c4b4ba24fcd --- /dev/null +++ b/mysql-test/r/have_archive.require @@ -0,0 +1,2 @@ +Variable_name Value +have_archive YES diff --git a/mysql-test/r/have_big5.require b/mysql-test/r/have_big5.require new file mode 100644 index 00000000000..74aacf74b62 --- /dev/null +++ b/mysql-test/r/have_big5.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +big5_chinese_ci big5 1 Yes Yes 1 diff --git a/mysql-test/r/have_compress.require b/mysql-test/r/have_compress.require new file mode 100644 index 00000000000..8bda2190fbe --- /dev/null +++ b/mysql-test/r/have_compress.require @@ -0,0 +1,2 @@ +Variable_name Value +have_compress YES diff --git a/mysql-test/r/have_csv.require b/mysql-test/r/have_csv.require new file mode 100644 index 00000000000..cc2fb28289c --- /dev/null +++ b/mysql-test/r/have_csv.require @@ -0,0 +1,2 @@ +Variable_name Value +have_csv YES diff --git a/mysql-test/r/have_debug.require b/mysql-test/r/have_debug.require new file mode 100644 index 00000000000..714922cee63 --- /dev/null +++ b/mysql-test/r/have_debug.require @@ -0,0 +1,2 @@ +debug +1 diff --git a/mysql-test/r/have_exampledb.require b/mysql-test/r/have_exampledb.require new file mode 100644 index 00000000000..4b0938660fe --- /dev/null +++ b/mysql-test/r/have_exampledb.require @@ -0,0 +1,2 @@ +Variable_name Value +have_exampledb YES diff --git a/mysql-test/r/have_geometry.require b/mysql-test/r/have_geometry.require new file mode 100644 index 00000000000..ba515a4bbb6 --- /dev/null +++ b/mysql-test/r/have_geometry.require @@ -0,0 +1,2 @@ +Variable_name Value +have_geometry YES diff --git a/mysql-test/r/have_ndb.require b/mysql-test/r/have_ndb.require new file mode 100644 index 00000000000..f0402b72c6a --- /dev/null +++ b/mysql-test/r/have_ndb.require @@ -0,0 +1,2 @@ +Variable_name Value +have_ndbcluster YES diff --git a/mysql-test/r/have_sjis.require b/mysql-test/r/have_sjis.require new file mode 100644 index 00000000000..72ce8ec88fe --- /dev/null +++ b/mysql-test/r/have_sjis.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +sjis_japanese_ci sjis 13 Yes Yes 1 diff --git a/mysql-test/r/have_tis620.require b/mysql-test/r/have_tis620.require new file mode 100644 index 00000000000..a1bf93ac491 --- /dev/null +++ b/mysql-test/r/have_tis620.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +tis620_thai_ci tis620 18 Yes Yes 4 diff --git a/mysql-test/r/have_ucs2.require b/mysql-test/r/have_ucs2.require new file mode 100644 index 00000000000..c53250aeaef --- /dev/null +++ b/mysql-test/r/have_ucs2.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +ucs2_general_ci ucs2 35 Yes Yes 1 diff --git a/mysql-test/r/have_ujis.require b/mysql-test/r/have_ujis.require new file mode 100644 index 00000000000..43a309ad74e --- /dev/null +++ b/mysql-test/r/have_ujis.require @@ -0,0 +1,2 @@ +Collation Charset Id Default Compiled Sortlen +ujis_japanese_ci ujis 12 Yes Yes 1 diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index f0e9172991c..218276406b1 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -8,6 +8,11 @@ b select count(a) as b from t1 where a=0 having b >=0; b 0 +explain extended select count(a) as b from t1 where a=0 having b >=0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0) drop table t1; CREATE TABLE t1 ( raw_id int(10) NOT NULL default '0', @@ -62,6 +67,10 @@ select Fld1, max(Fld2) from t1 group by Fld1 having std(Fld2) is not null; Fld1 max(Fld2) 1 20 3 50 +select Fld1, max(Fld2) from t1 group by Fld1 having variance(Fld2) is not null; +Fld1 max(Fld2) +1 20 +3 50 drop table t1; create table t1 (id int not null, qty int not null); insert into t1 values (1,2),(1,3),(2,4),(2,5); @@ -81,17 +90,17 @@ drop table t1; CREATE TABLE t1 ( `id` bigint(20) NOT NULL default '0', `description` text -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( `id` bigint(20) NOT NULL default '0', `description` varchar(20) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1, 'test'); INSERT INTO t2 VALUES (1, 'test'); CREATE TABLE t3 ( `id` bigint(20) NOT NULL default '0', `order_id` bigint(20) NOT NULL default '0' -) TYPE=MyISAM; +) ENGINE=MyISAM; select a.id, a.description, count(b.id) as c @@ -118,3 +127,4 @@ having (a.description is not null) and (c=0); id description c 1 test 0 2 test2 0 +drop table t1,t2,t3; diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 11958f0a619..c49c9abb368 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -1,5 +1,5 @@ drop table if exists t1; -create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; +create table t1 (a int not null,b int not null, primary key (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a=1 or a=0; show keys from t1; @@ -23,15 +23,15 @@ a b 4 6 alter table t1 add c int not null, add key (c,a); drop table t1; -create table t1 (a int not null,b int not null, primary key (a)) type=memory comment="testing heaps"; +create table t1 (a int not null,b int not null, primary key (a)) engine=memory comment="testing heaps"; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a > 0; select * from t1; a b drop table t1; -create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps"; +create table t1 (a int not null,b int not null, primary key (a)) engine=heap comment="testing heaps"; insert into t1 values(1,1),(2,2),(3,3),(4,4); -alter table t1 modify a int not null auto_increment, type=myisam, comment="new myisam table"; +alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table"; select * from t1; a b 1 1 @@ -39,7 +39,7 @@ a b 3 3 4 4 drop table t1; -create table t1 (a int not null) type=heap; +create table t1 (a int not null) engine=heap; insert into t1 values (869751),(736494),(226312),(802616); select * from t1 where a > 736494; a @@ -63,13 +63,13 @@ a 736494 802616 869751 -alter table t1 type=myisam; +alter table t1 engine=myisam; explain select * from t1 where a in (869751,736494,226312,802616); -table type possible_keys key key_len ref rows Extra -t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index drop table t1; -create table t1 (x int not null, y int not null, key x(x), unique y(y)) -type=heap; +create table t1 (x int not null, y int not null, key x (x), unique y (y)) +engine=heap; insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6); select * from t1 where x=1; x y @@ -84,17 +84,17 @@ x y x y 2 5 2 2 2 6 2 2 explain select * from t1,t1 as t2 where t1.x=t2.y; -table type possible_keys key key_len ref rows Extra -t1 ALL x NULL NULL NULL 6 -t2 eq_ref y y 4 t1.x 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL x NULL NULL NULL 6 +1 SIMPLE t2 eq_ref y y 4 test.t1.x 1 drop table t1; -create table t1 (a int) type=heap; +create table t1 (a int) engine=heap; insert into t1 values(1); select max(a) from t1; max(a) 1 drop table t1; -CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key(a), key(b) ) TYPE=HEAP; +CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key(a), key(b) ) ENGINE=HEAP; insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); select * from t1 where a=1; a b @@ -120,7 +120,7 @@ a b 1 2 1 1 drop table t1; -create table t1 (id int unsigned not null, primary key (id)) type=HEAP; +create table t1 (id int unsigned not null, primary key (id)) engine=HEAP; insert into t1 values(1); select max(id) from t1; max(id) @@ -131,12 +131,12 @@ max(id) 2 replace into t1 values(1); drop table t1; -create table t1 (n int) type=heap; +create table t1 (n int) engine=heap; drop table t1; -create table t1 (n int) type=heap; +create table t1 (n int) engine=heap; drop table if exists t1; CREATE table t1(f1 int not null,f2 char(20) not -null,index(f2)) type=heap; +null,index(f2)) engine=heap; INSERT into t1 set f1=12,f2="bill"; INSERT into t1 set f1=13,f2="bill"; INSERT into t1 set f1=14,f2="bill"; @@ -155,63 +155,63 @@ f1 f2 12 ted 12 ted drop table t1; -create table t1 (btn char(10) not null, key(btn)) type=heap; +create table t1 (btn char(10) not null, key(btn)) engine=heap; insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i"); explain select * from t1 where btn like "q%"; -table type possible_keys key key_len ref rows Extra -t1 ALL btn NULL NULL NULL 14 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where select * from t1 where btn like "q%"; btn alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn; -update t1 set new_col=btn; +update t1 set new_col=left(btn,1); explain select * from t1 where btn="a"; -table type possible_keys key key_len ref rows Extra -t1 ALL btn NULL NULL NULL 11 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL btn NULL NULL NULL 11 Using where explain select * from t1 where btn="a" and new_col="a"; -table type possible_keys key key_len ref rows Extra -t1 ref btn btn 11 const,const 10 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref btn btn 11 const,const 10 Using where drop table t1; CREATE TABLE t1 ( a int default NULL, b int default NULL, KEY a (a), UNIQUE b (b) -) type=heap; +) engine=heap; INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3); SELECT * FROM t1 WHERE a=NULL; a b explain SELECT * FROM t1 WHERE a IS NULL; -table type possible_keys key key_len ref rows Extra -t1 ref a a 5 const 10 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 10 Using where SELECT * FROM t1 WHERE a<=>NULL; a b NULL 99 SELECT * FROM t1 WHERE b=NULL; a b explain SELECT * FROM t1 WHERE b IS NULL; -table type possible_keys key key_len ref rows Extra -t1 ref b b 5 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref b b 5 const 1 Using where SELECT * FROM t1 WHERE b<=>NULL; a b 99 NULL INSERT INTO t1 VALUES (1,3); -Duplicate entry '3' for key 1 +ERROR 23000: Duplicate entry '3' for key 1 DROP TABLE t1; CREATE TABLE t1 ( a int default NULL, key a (a) -) TYPE=HEAP; +) ENGINE=HEAP; INSERT INTO t1 VALUES (10), (10), (10); EXPLAIN SELECT * FROM t1 WHERE a=10; -table type possible_keys key key_len ref rows Extra -t1 ref a a 5 const 10 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 10 Using where SELECT * FROM t1 WHERE a=10; a 10 10 10 DROP TABLE t1; -CREATE TABLE t1 (a int not null, primary key(a)) type=heap; +CREATE TABLE t1 (a int not null, primary key(a)) engine=heap; INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); DELETE from t1 where a < 100; SELECT * from t1; @@ -222,7 +222,7 @@ CREATE TABLE `job_titles` ( `job_title` char(18) NOT NULL default '', PRIMARY KEY (`job_title_id`), UNIQUE KEY `job_title_id` (`job_title_id`,`job_title`) -) TYPE=HEAP; +) ENGINE=HEAP; SELECT MAX(job_title_id) FROM job_titles; MAX(job_title_id) NULL diff --git a/mysql-test/r/heap_auto_increment.result b/mysql-test/r/heap_auto_increment.result new file mode 100644 index 00000000000..5b04a77e9eb --- /dev/null +++ b/mysql-test/r/heap_auto_increment.result @@ -0,0 +1,41 @@ +drop table if exists t1; +create table t1 (a int not null auto_increment,b int, primary key (a)) engine=heap auto_increment=3; +insert into t1 values (1,1),(NULL,3),(NULL,4); +delete from t1 where a=4; +insert into t1 values (NULL,5),(NULL,6); +select * from t1; +a b +1 1 +3 3 +5 5 +6 6 +delete from t1 where a=6; +replace t1 values (3,1); +ALTER TABLE t1 add c int; +replace t1 values (3,3,3); +insert into t1 values (NULL,7,7); +update t1 set a=8,b=b+1,c=c+1 where a=7; +insert into t1 values (NULL,9,9); +select * from t1; +a b c +1 1 NULL +3 3 3 +5 5 NULL +8 8 8 +9 9 9 +drop table t1; +create table t1 ( +skey tinyint unsigned NOT NULL auto_increment PRIMARY KEY, +sval char(20) +) engine=heap; +insert into t1 values (NULL, "hello"); +insert into t1 values (NULL, "hey"); +select * from t1; +skey sval +1 hello +2 hey +select _rowid,t1._rowid,skey,sval from t1; +_rowid _rowid skey sval +1 1 1 hello +2 2 2 hey +drop table t1; diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result new file mode 100644 index 00000000000..5c60c97d674 --- /dev/null +++ b/mysql-test/r/heap_btree.result @@ -0,0 +1,248 @@ +drop table if exists t1; +create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; +insert into t1 values(1,1),(2,2),(3,3),(4,4); +delete from t1 where a=1 or a=0; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A NULL NULL NULL BTREE +select * from t1; +a b +2 2 +3 3 +4 4 +select * from t1 where a=4; +a b +4 4 +update t1 set b=5 where a=4; +update t1 set b=b+1 where a>=3; +replace t1 values (3,3); +select * from t1; +a b +2 2 +3 3 +4 6 +alter table t1 add c int not null, add key using BTREE (c,a); +drop table t1; +create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps"; +insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4); +delete from t1 where a > -3; +select * from t1; +a b +drop table t1; +create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps"; +insert into t1 values(1,1),(2,2),(3,3),(4,4); +alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table"; +select * from t1; +a b +1 1 +2 2 +3 3 +4 4 +drop table t1; +create table t1 (a int not null) engine=heap; +insert into t1 values (869751),(736494),(226312),(802616); +select * from t1 where a > 736494; +a +869751 +802616 +alter table t1 add unique uniq_id using BTREE (a); +select * from t1 where a > 736494; +a +802616 +869751 +select * from t1 where a = 736494; +a +736494 +select * from t1 where a=869751 or a=736494; +a +736494 +869751 +select * from t1 where a in (869751,736494,226312,802616); +a +226312 +736494 +802616 +869751 +alter table t1 engine=myisam; +explain select * from t1 where a in (869751,736494,226312,802616); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index +drop table t1; +create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y)) +engine=heap; +insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6); +explain select * from t1 where x=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref x x 4 const 1 Using where +select * from t1 where x=1; +x y +1 1 +1 3 +select * from t1,t1 as t2 where t1.x=t2.y; +x y x y +1 1 1 1 +2 2 2 2 +1 3 1 1 +2 4 2 2 +2 5 2 2 +2 6 2 2 +explain select * from t1,t1 as t2 where t1.x=t2.y; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL x NULL NULL NULL 6 +1 SIMPLE t2 eq_ref y y 4 test.t1.x 1 +drop table t1; +create table t1 (a int) engine=heap; +insert into t1 values(1); +select max(a) from t1; +max(a) +1 +drop table t1; +CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using BTREE (a,b), key using BTREE (b) ) ENGINE=HEAP; +insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); +select * from t1 where a=1; +a b +1 1 +1 2 +1 3 +1 4 +1 5 +1 6 +insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); +select * from t1 where a=1; +a b +1 1 +1 1 +1 2 +1 2 +1 3 +1 3 +1 4 +1 4 +1 5 +1 5 +1 6 +1 6 +explain select * from tx where a=x order by a,b; +id select_type table type possible_keys key key_len ref rows Extra +x SIMPLE tx ref a a x const x Using where +explain select * from tx where a=x order by b; +id select_type table type possible_keys key key_len ref rows Extra +x SIMPLE tx ref a a x const x Using where +select * from t1 where b=1; +a b +1 1 +1 1 +explain select * from tx where b=x; +id select_type table type possible_keys key key_len ref rows Extra +x SIMPLE tx ref b b x const x Using where +drop table t1; +create table t1 (id int unsigned not null, primary key using BTREE (id)) engine=HEAP; +insert into t1 values(1); +select max(id) from t1; +max(id) +1 +insert into t1 values(2); +select max(id) from t1; +max(id) +2 +replace into t1 values(1); +drop table t1; +create table t1 (n int) engine=heap; +drop table t1; +create table t1 (n int) engine=heap; +drop table if exists t1; +CREATE table t1(f1 int not null,f2 char(20) not +null,index(f2)) engine=heap; +INSERT into t1 set f1=12,f2="bill"; +INSERT into t1 set f1=13,f2="bill"; +INSERT into t1 set f1=14,f2="bill"; +INSERT into t1 set f1=15,f2="bill"; +INSERT into t1 set f1=16,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +delete from t1 where f2="bill"; +select * from t1; +f1 f2 +16 ted +12 ted +12 ted +12 ted +12 ted +drop table t1; +create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap; +insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i"); +explain select * from t1 where btn like "i%"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range btn btn 10 NULL 1 Using where +explain select * from t1 where btn like "h%"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range btn btn 10 NULL # Using where +explain select * from t1 where btn like "a%"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range btn btn 10 NULL 1 Using where +explain select * from t1 where btn like "b%"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range btn btn 10 NULL 1 Using where +select * from t1 where btn like "ff%"; +btn +select * from t1 where btn like " %"; +btn +select * from t1 where btn like "q%"; +btn +alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn; +update t1 set new_col=left(btn,1); +explain select * from t1 where btn="a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref btn btn 10 const 1 Using where +explain select * from t1 where btn="a" and new_col="a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref btn btn 11 const,const 1 Using where +drop table t1; +CREATE TABLE t1 ( +a int default NULL, +b int default NULL, +KEY a using BTREE (a), +UNIQUE b using BTREE (b) +) engine=heap; +INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3); +SELECT * FROM t1 WHERE a=NULL; +a b +explain SELECT * FROM t1 WHERE a IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where +SELECT * FROM t1 WHERE a<=>NULL; +a b +NULL 99 +SELECT * FROM t1 WHERE b=NULL; +a b +explain SELECT * FROM t1 WHERE b IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref b b 5 const 1 Using where +SELECT * FROM t1 WHERE b<=>NULL; +a b +99 NULL +INSERT INTO t1 VALUES (1,3); +ERROR 23000: Duplicate entry '3' for key 1 +DROP TABLE t1; +CREATE TABLE t1 (a int, b int, c int, key using BTREE (a, b, c)) engine=heap; +INSERT INTO t1 VALUES (1, NULL, NULL), (1, 1, NULL), (1, NULL, 1); +SELECT * FROM t1 WHERE a=1 and b IS NULL; +a b c +1 NULL NULL +1 NULL 1 +SELECT * FROM t1 WHERE a=1 and c IS NULL; +a b c +1 NULL NULL +1 1 NULL +SELECT * FROM t1 WHERE a=1 and b IS NULL and c IS NULL; +a b c +1 NULL NULL +DROP TABLE t1; +CREATE TABLE t1 (a int not null, primary key using BTREE (a)) engine=heap; +INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); +DELETE from t1 where a < 100; +SELECT * from t1; +a +DROP TABLE t1; diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result new file mode 100644 index 00000000000..7affbf788fb --- /dev/null +++ b/mysql-test/r/heap_hash.result @@ -0,0 +1,205 @@ +drop table if exists t1; +create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; +insert into t1 values(1,1),(2,2),(3,3),(4,4); +delete from t1 where a=1 or a=0; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a NULL NULL NULL NULL HASH +select * from t1; +a b +2 2 +3 3 +4 4 +select * from t1 where a=4; +a b +4 4 +update t1 set b=5 where a=4; +update t1 set b=b+1 where a>=3; +replace t1 values (3,3); +select * from t1; +a b +2 2 +3 3 +4 6 +alter table t1 add c int not null, add key using HASH (c,a); +drop table t1; +create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps"; +insert into t1 values(1,1),(2,2),(3,3),(4,4); +delete from t1 where a > 0; +select * from t1; +a b +drop table t1; +create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps"; +insert into t1 values(1,1),(2,2),(3,3),(4,4); +alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table"; +select * from t1; +a b +1 1 +2 2 +3 3 +4 4 +drop table t1; +create table t1 (a int not null) engine=heap; +insert into t1 values (869751),(736494),(226312),(802616); +select * from t1 where a > 736494; +a +869751 +802616 +alter table t1 add unique uniq_id using HASH (a); +select * from t1 where a > 736494; +a +869751 +802616 +select * from t1 where a = 736494; +a +736494 +select * from t1 where a=869751 or a=736494; +a +736494 +869751 +select * from t1 where a in (869751,736494,226312,802616); +a +226312 +736494 +802616 +869751 +alter table t1 engine=myisam; +explain select * from t1 where a in (869751,736494,226312,802616); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index +drop table t1; +create table t1 (x int not null, y int not null, key x using HASH (x), unique y using HASH (y)) +engine=heap; +insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6); +select * from t1 where x=1; +x y +1 3 +1 1 +select * from t1,t1 as t2 where t1.x=t2.y; +x y x y +1 1 1 1 +2 2 2 2 +1 3 1 1 +2 4 2 2 +2 5 2 2 +2 6 2 2 +explain select * from t1,t1 as t2 where t1.x=t2.y; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL x NULL NULL NULL 6 +1 SIMPLE t2 eq_ref y y 4 test.t1.x 1 +drop table t1; +create table t1 (a int) engine=heap; +insert into t1 values(1); +select max(a) from t1; +max(a) +1 +drop table t1; +CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using HASH (a), key using HASH (b) ) ENGINE=HEAP; +insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); +select * from t1 where a=1; +a b +1 6 +1 5 +1 4 +1 3 +1 2 +1 1 +insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); +select * from t1 where a=1; +a b +1 6 +1 5 +1 4 +1 3 +1 2 +1 1 +1 6 +1 5 +1 4 +1 3 +1 2 +1 1 +drop table t1; +create table t1 (id int unsigned not null, primary key using HASH (id)) engine=HEAP; +insert into t1 values(1); +select max(id) from t1; +max(id) +1 +insert into t1 values(2); +select max(id) from t1; +max(id) +2 +replace into t1 values(1); +drop table t1; +create table t1 (n int) engine=heap; +drop table t1; +create table t1 (n int) engine=heap; +drop table if exists t1; +CREATE table t1(f1 int not null,f2 char(20) not +null,index(f2)) engine=heap; +INSERT into t1 set f1=12,f2="bill"; +INSERT into t1 set f1=13,f2="bill"; +INSERT into t1 set f1=14,f2="bill"; +INSERT into t1 set f1=15,f2="bill"; +INSERT into t1 set f1=16,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +INSERT into t1 set f1=12,f2="ted"; +delete from t1 where f2="bill"; +select * from t1; +f1 f2 +16 ted +12 ted +12 ted +12 ted +12 ted +drop table t1; +create table t1 (btn char(10) not null, key using HASH (btn)) engine=heap; +insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i"); +explain select * from t1 where btn like "q%"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where +select * from t1 where btn like "q%"; +btn +alter table t1 add column new_col char(1) not null, add key using HASH (btn,new_col), drop key btn; +update t1 set new_col=left(btn,1); +explain select * from t1 where btn="a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL btn NULL NULL NULL 11 Using where +explain select * from t1 where btn="a" and new_col="a"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref btn btn 11 const,const 10 Using where +drop table t1; +CREATE TABLE t1 ( +a int default NULL, +b int default NULL, +KEY a using HASH (a), +UNIQUE b using HASH (b) +) engine=heap; +INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3); +SELECT * FROM t1 WHERE a=NULL; +a b +explain SELECT * FROM t1 WHERE a IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 10 Using where +SELECT * FROM t1 WHERE a<=>NULL; +a b +NULL 99 +SELECT * FROM t1 WHERE b=NULL; +a b +explain SELECT * FROM t1 WHERE b IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref b b 5 const 1 Using where +SELECT * FROM t1 WHERE b<=>NULL; +a b +99 NULL +INSERT INTO t1 VALUES (1,3); +ERROR 23000: Duplicate entry '3' for key 1 +DROP TABLE t1; +CREATE TABLE t1 (a int not null, primary key using HASH (a)) engine=heap; +INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); +DELETE from t1 where a < 100; +SELECT * from t1; +a +DROP TABLE t1; diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result new file mode 100644 index 00000000000..edf7d0e91cb --- /dev/null +++ b/mysql-test/r/help.result @@ -0,0 +1,243 @@ +insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1'); +select @category1_id:= 1; +@category1_id:= 1 +1 +insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2'); +select @category2_id:= 2; +@category2_id:= 2 +2 +insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id); +select @category3_id:= 3; +@category3_id:= 3 +3 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); +select @topic1_id:= 1; +@topic1_id:= 1 +1 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); +select @topic2_id:= 2; +@topic2_id:= 2 +2 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); +select @topic3_id:= 3; +@topic3_id:= 3 +3 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); +select @topic4_id:= 4; +@topic4_id:= 4 +4 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); +select @topic5_id:= 5; +@topic5_id:= 5 +5 +insert into mysql.help_keyword(help_keyword_id,name)values(1,'impossible_function_1'); +select @keyword1_id:= 1; +@keyword1_id:= 1 +1 +insert into mysql.help_keyword(help_keyword_id,name)values(2,'impossible_function_5'); +select @keyword2_id:= 2; +@keyword2_id:= 2 +2 +insert into mysql.help_keyword(help_keyword_id,name)values(3,'impossible_function_6'); +select @keyword3_id:= 3; +@keyword3_id:= 3 +3 +insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id); +insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id); +insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword3_id,@topic3_id); +insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword3_id,@topic4_id); +help 'function_of_my_dream'; +name is_it_category +help '%possible_f%'; +name is_it_category +impossible_function_1 N +impossible_function_2 N +impossible_function_3 N +impossible_function_4 N +impossible_function_7 N +help 'impossible_func%'; +name is_it_category +impossible_function_1 N +impossible_function_2 N +impossible_function_3 N +impossible_function_4 N +impossible_function_7 N +help 'impossible_category%'; +name is_it_category +impossible_category_1 Y +impossible_category_2 Y +impossible_category_3 Y +help 'impossible_%'; +name is_it_category +impossible_function_1 N +impossible_function_2 N +impossible_function_3 N +impossible_function_4 N +impossible_function_7 N +impossible_category_1 Y +impossible_category_2 Y +impossible_category_3 Y +help '%function_1'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +help '%function_2'; +name description example +impossible_function_2 description of + impossible_function2 + example of + impossible_function2 +help '%function_3'; +name description example +impossible_function_3 description of + impossible_function3 + example of + impossible_function3 +help '%function_4'; +name description example +impossible_function_4 description of + impossible_function4 + example of + impossible_function4 +help '%function_5'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +help '%function_6'; +name is_it_category +impossible_function_3 N +impossible_function_4 N +help '%function_7'; +name description example +impossible_function_7 description of + impossible_function5 + example of + impossible_function7 +help '%category_2'; +source_category_name name is_it_category +impossible_category_2 impossible_function_3 N +impossible_category_2 impossible_function_4 N +impossible_category_2 impossible_category_3 Y +help 'impossible_function_1'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +help 'impossible_category_1'; +source_category_name name is_it_category +impossible_category_1 impossible_function_1 N +impossible_category_1 impossible_function_2 N +alter table mysql.help_relation engine=innodb; +alter table mysql.help_keyword engine=innodb; +alter table mysql.help_topic engine=innodb; +alter table mysql.help_category engine=innodb; +help 'function_of_my_dream'; +name is_it_category +help '%possible_f%'; +name is_it_category +impossible_function_1 N +impossible_function_2 N +impossible_function_3 N +impossible_function_4 N +impossible_function_7 N +help 'impossible_func%'; +name is_it_category +impossible_function_1 N +impossible_function_2 N +impossible_function_3 N +impossible_function_4 N +impossible_function_7 N +help 'impossible_category%'; +name is_it_category +impossible_category_1 Y +impossible_category_2 Y +impossible_category_3 Y +help 'impossible_%'; +name is_it_category +impossible_function_1 N +impossible_function_2 N +impossible_function_3 N +impossible_function_4 N +impossible_function_7 N +impossible_category_1 Y +impossible_category_2 Y +impossible_category_3 Y +help '%function_1'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +help '%function_2'; +name description example +impossible_function_2 description of + impossible_function2 + example of + impossible_function2 +help '%function_3'; +name description example +impossible_function_3 description of + impossible_function3 + example of + impossible_function3 +help '%function_4'; +name description example +impossible_function_4 description of + impossible_function4 + example of + impossible_function4 +help '%function_5'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +help '%function_6'; +name is_it_category +impossible_function_3 N +impossible_function_4 N +help '%function_7'; +name description example +impossible_function_7 description of + impossible_function5 + example of + impossible_function7 +help '%category_2'; +source_category_name name is_it_category +impossible_category_2 impossible_function_3 N +impossible_category_2 impossible_function_4 N +impossible_category_2 impossible_category_3 Y +help 'impossible_function_1'; +name description example +impossible_function_1 description of + impossible_function1 + example of + impossible_function1 +help 'impossible_category_1'; +source_category_name name is_it_category +impossible_category_1 impossible_function_1 N +impossible_category_1 impossible_function_2 N +alter table mysql.help_relation engine=myisam; +alter table mysql.help_keyword engine=myisam; +alter table mysql.help_topic engine=myisam; +alter table mysql.help_category engine=myisam; +delete from mysql.help_topic where help_topic_id=@topic1_id; +delete from mysql.help_topic where help_topic_id=@topic2_id; +delete from mysql.help_topic where help_topic_id=@topic3_id; +delete from mysql.help_topic where help_topic_id=@topic4_id; +delete from mysql.help_topic where help_topic_id=@topic5_id; +delete from mysql.help_category where help_category_id=@category3_id; +delete from mysql.help_category where help_category_id=@category2_id; +delete from mysql.help_category where help_category_id=@category1_id; +delete from mysql.help_keyword where help_keyword_id=@keyword1_id; +delete from mysql.help_keyword where help_keyword_id=@keyword2_id; +delete from mysql.help_keyword where help_keyword_id=@keyword3_id; +delete from mysql.help_relation where help_keyword_id=@keyword1_id and help_topic_id=@topic2_id; +delete from mysql.help_relation where help_keyword_id=@keyword2_id and help_topic_id=@topic1_id; +delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic3_id; +delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic4_id; diff --git a/mysql-test/r/init_connect.result b/mysql-test/r/init_connect.result new file mode 100644 index 00000000000..db1e72dfca9 --- /dev/null +++ b/mysql-test/r/init_connect.result @@ -0,0 +1,24 @@ +select hex(@a); +hex(@a) +NULL +select hex(@a); +hex(@a) +610063 +set global init_connect="set @a=2;set @b=3"; +select @a, @b; +@a @b +2 3 +set GLOBAL init_connect=DEFAULT; +select @a; +@a +NULL +set global init_connect="create table t1(a char(10));\ +insert into t1 values ('\0');insert into t1 values('abc')"; +select hex(a) from t1; +hex(a) +00 +616263 +set GLOBAL init_connect="adsfsdfsdfs"; +select @a; +Got one of the listed errors +drop table t1; diff --git a/mysql-test/r/innodb-deadlock.result b/mysql-test/r/innodb-deadlock.result index 121bfa8c6cb..2ca82101fb4 100644 --- a/mysql-test/r/innodb-deadlock.result +++ b/mysql-test/r/innodb-deadlock.result @@ -1,5 +1,5 @@ -drop table if exists t1; -create table t1 (id integer, x integer) type=INNODB; +drop table if exists t1,t2; +create table t1 (id integer, x integer) engine=INNODB; insert into t1 values(0, 0); set autocommit=0; SELECT * from t1 where id = 0 FOR UPDATE; @@ -18,3 +18,79 @@ id x 0 2 commit; drop table t1; +create table t1 (id integer, x integer) engine=INNODB; +create table t2 (b integer, a integer) engine=INNODB; +insert into t1 values(0, 0), (300, 300); +insert into t2 values(0, 10), (1, 20), (2, 30); +commit; +set autocommit=0; +select * from t2; +b a +0 10 +1 20 +2 30 +update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE); +select * from t2; +b a +0 100 +1 20 +2 30 +select * from t1; +id x +0 0 +300 300 +set autocommit=0; +update t1 set x=2 where id = 0; +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +300 300 +commit; +commit; +select * from t1; +id x +0 2 +300 300 +commit; +drop table t1, t2; +create table t1 (id integer, x integer) engine=INNODB; +create table t2 (b integer, a integer) engine=INNODB; +insert into t1 values(0, 0), (300, 300); +insert into t2 values(0, 0), (1, 20), (2, 30); +commit; +select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE; +a b +0 0 +20 1 +30 2 +300 300 +select * from t2; +b a +0 0 +1 20 +2 30 +select * from t1; +id x +0 0 +300 300 +update t2 set a=2 where b = 0; +select * from t2; +b a +0 2 +1 20 +2 30 +update t1 set x=2 where id = 0; +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +300 300 +commit; +commit; +select * from t1; +id x +0 2 +300 300 +commit; +drop table t1, t2; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index c282ec68c78..9d830367745 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1,6 +1,6 @@ -drop table if exists t1,t2,t3; +drop table if exists t1,t2,t3,t4; drop database if exists mysqltest; -create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); select id, code, name from t1 order by id; id code name @@ -39,7 +39,7 @@ level tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY parent_id (parent_id), KEY level (level) -) type=innodb; +) engine=innodb; INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2); update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; @@ -139,6 +139,15 @@ id parent_id level 1008 102 2 1010 102 2 1015 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +explain select level,id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +explain select level,id,parent_id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where select level,id from t1 where level=1; level id 1 1002 @@ -158,12 +167,17 @@ level id parent_id optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id A # NULL NULL BTREE +t1 1 parent_id 1 parent_id A # NULL NULL BTREE +t1 1 level 1 level A # NULL NULL BTREE drop table t1; CREATE TABLE t1 ( gesuchnr int(11) DEFAULT '0' NOT NULL, benutzer_id int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (gesuchnr,benutzer_id) -) type=innodb; +) engine=innodb; replace into t1 (gesuchnr,benutzer_id) values (2,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); @@ -172,7 +186,7 @@ gesuchnr benutzer_id 1 1 2 1 drop table t1; -create table t1 (a int) type=innodb; +create table t1 (a int) engine=innodb; insert into t1 values (1), (2); optimize table t1; Table Op Msg_type Msg_text @@ -185,7 +199,7 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -create table t1 (a int,b varchar(20)) type=innodb; +create table t1 (a int,b varchar(20)) engine=innodb; insert into t1 values (1,""), (2,"testing"); delete from t1 where a = 1; select * from t1; @@ -196,14 +210,17 @@ insert into t1 values (3,""), (4,"testing"); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 skr 1 a A # NULL NULL YES BTREE drop table t1; -create table t1 (a int,b varchar(20),key(a)) type=innodb; +create table t1 (a int,b varchar(20),key(a)) engine=innodb; insert into t1 values (1,""), (2,"testing"); select * from t1 where a = 1; a b 1 drop table t1; -create table t1 (n int not null primary key) type=innodb; +create table t1 (n int not null primary key) engine=innodb; set autocommit=0; insert into t1 values (4); rollback; @@ -217,7 +234,7 @@ n after commit commit; insert into t1 values (5); insert into t1 values (4); -Duplicate entry '4' for key 1 +ERROR 23000: Duplicate entry '4' for key 1 commit; select n, "after commit" from t1; n after commit @@ -226,7 +243,7 @@ n after commit set autocommit=1; insert into t1 values (6); insert into t1 values (4); -Duplicate entry '4' for key 1 +ERROR 23000: Duplicate entry '4' for key 1 select n from t1; n 4 @@ -234,7 +251,18 @@ n 6 rollback; drop table t1; -create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=innodb; +create table t1 (n int not null primary key) engine=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +commit; +unlock tables; +commit; +select * from t1; +n +4 +drop table t1; +create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb; begin; insert into t1 values(1,'hamdouni'); select id as afterbegin_id,nom as afterbegin_nom from t1; @@ -253,10 +281,10 @@ select id as afterrollback_id,nom as afterrollback_nom from t1; afterrollback_id afterrollback_nom set autocommit=1; drop table t1; -CREATE TABLE t1 (id char(8) not null primary key, val int not null) type=innodb; +CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; insert into t1 values ('pippo', 12); insert into t1 values ('pippo', 12); -Duplicate entry 'pippo' for key 1 +ERROR 23000: Duplicate entry 'pippo' for key 1 delete from t1; delete from t1 where id = 'pippo'; select * from t1; @@ -273,23 +301,23 @@ commit; select * from t1; id val drop table t1; -create table t1 (a integer) type=innodb; +create table t1 (a integer) engine=innodb; start transaction; rename table t1 to t2; -create table t1 (b integer) type=innodb; +create table t1 (b integer) engine=innodb; insert into t1 values (1); rollback; drop table t1; rename table t2 to t1; drop table t1; set autocommit=1; -CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) TYPE=innodb; +CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb; INSERT INTO t1 VALUES (1, 'Jochen'); select * from t1; ID NAME 1 Jochen drop table t1; -CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) TYPE=innodb; +CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb; set autocommit=0; INSERT INTO t1 SET _userid='marc@anyware.co.uk'; COMMIT; @@ -308,7 +336,7 @@ phone varchar(100), ref_email varchar(100) DEFAULT '' NOT NULL, detail varchar(200), PRIMARY KEY (user_id,ref_email) -)type=innodb; +)engine=innodb; INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar'); select * from t1 where user_id=10292; user_id name phone ref_email detail @@ -336,9 +364,17 @@ user_id name phone ref_email detail drop table t1; CREATE TABLE t1 (a int not null, b int not null,c int not null, key(a),primary key(a,b), unique(c),key(a),unique(b)); +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +t1 0 PRIMARY 2 b A # NULL NULL BTREE +t1 0 c 1 c A # NULL NULL BTREE +t1 0 b 1 b A # NULL NULL BTREE +t1 1 a 1 a A # NULL NULL BTREE +t1 1 a_2 1 a A # NULL NULL BTREE drop table t1; create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); -alter table t1 type=innodb; +alter table t1 engine=innodb; insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4'); select * from t1; col1 col2 @@ -372,8 +408,8 @@ col1 col2 co3 4 7 0 5 2 0 drop table t1; -create table t1 (a int not null , b int, primary key (a)) type = innodb; -create table t2 (a int not null , b int, primary key (a)) type = myisam; +create table t1 (a int not null , b int, primary key (a)) engine = innodb; +create table t2 (a int not null , b int, primary key (a)) engine = myisam; insert into t1 VALUES (1,3) , (2,3), (3,3); select * from t1; a b @@ -408,13 +444,13 @@ email varchar(64) DEFAULT '' NOT NULL, passwd varchar(32) binary DEFAULT '' NOT NULL, PRIMARY KEY (id), UNIQUE ggid (ggid) -) TYPE=innodb; +) ENGINE=innodb; insert into t1 (ggid,passwd) values ('test1','xxx'); insert into t1 (ggid,passwd) values ('test2','yyy'); insert into t1 (ggid,passwd) values ('test2','this will fail'); -Duplicate entry 'test2' for key 2 +ERROR 23000: Duplicate entry 'test2' for key 2 insert into t1 (ggid,id) values ('this will fail',1); -Duplicate entry '1' for key 1 +ERROR 23000: Duplicate entry '1' for key 1 select * from t1 where ggid='test1'; id ggid email passwd 1 test1 xxx @@ -427,7 +463,7 @@ id ggid email passwd replace into t1 (ggid,id) values ('this will work',1); replace into t1 (ggid,passwd) values ('test2','this will work'); update t1 set id=100,ggid='test2' where id=1; -Duplicate entry 'test2' for key 2 +ERROR 23000: Duplicate entry 'test2' for key 2 select * from t1; id ggid email passwd 1 this will work @@ -450,7 +486,7 @@ access_time time, approved datetime, dummy_primary_key int(11) NOT NULL auto_increment, PRIMARY KEY (dummy_primary_key) -) TYPE=innodb; +) ENGINE=innodb; INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1); INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2); INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3); @@ -471,7 +507,7 @@ level tinyint(4) DEFAULT '0' NOT NULL, KEY (id), KEY parent_id (parent_id), KEY level (level) -) type=innodb; +) engine=innodb; INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1); INSERT INTO t1 values (179,5,2); update t1 set parent_id=parent_id+100; @@ -571,6 +607,9 @@ id parent_id level 1009 102 2 1025 102 2 1016 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index select level,id from t1 where level=1; level id 1 1004 @@ -642,7 +681,7 @@ sca_sdesc varchar(50), sca_sch_desc varchar(16), PRIMARY KEY (sca_code, cat_code, lan_code), INDEX sca_pic (sca_pic) -) type = innodb ; +) engine = innodb ; INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING'); select count(*) from t1 where sca_code = 'PD'; count(*) @@ -675,7 +714,7 @@ update t1 set sca_pic="test" where sca_pic is null; delete from t1 where sca_code='pd'; drop table t1; set @a:=now(); -CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) type=innodb; +CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb; insert into t1 (a) values(1),(2),(3); select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a; a @@ -689,7 +728,7 @@ a 3 5 drop table t1; -create table t1 (a varchar(100) not null, primary key(a), b int not null) type=innodb; +create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb; insert into t1 values("hello",1),("world",2); select * from t1 order by b desc; a b @@ -698,8 +737,11 @@ hello 1 optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE drop table t1; -create table t1 (i int, j int ) TYPE=innodb; +create table t1 (i int, j int ) ENGINE=innodb; insert into t1 values (1,2); select * from t1 where i=1 and j=2; i j @@ -713,26 +755,29 @@ CREATE TABLE t1 ( a int3 unsigned NOT NULL, b int1 unsigned NOT NULL, UNIQUE (a, b) -) TYPE = innodb; +) ENGINE = innodb; INSERT INTO t1 VALUES (1, 1); SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; MIN(B) MAX(b) 1 1 drop table t1; -CREATE TABLE t1 (a int unsigned NOT NULL) type=innodb; +CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb; INSERT INTO t1 VALUES (1); SELECT * FROM t1; a 1 DROP TABLE t1; -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) type = innodb; +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 = innodb; 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); +explain select * from t1 where a > 0 and a < 50; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL # Using where drop table t1; -create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=innodb; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; insert into t1 values (99,1,2,'D'),(1,1,2,'D'); -Duplicate entry '1-1' for key 1 +ERROR 23000: Duplicate entry '1-1' for key 1 select id from t1; id 0 @@ -745,12 +790,12 @@ id 2 UNLOCK TABLES; DROP TABLE t1; -create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=innodb; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; begin; insert into t1 values (99,1,2,'D'),(1,1,2,'D'); -Duplicate entry '1-1' for key 1 +ERROR 23000: Duplicate entry '1-1' for key 1 select id from t1; id 0 @@ -766,7 +811,17 @@ id id3 100 2 UNLOCK TABLES; DROP TABLE t1; -create temporary table t1 (a int not null auto_increment, primary key(a)) type=innodb; +create table t1 (a char(20), unique (a(5))) engine=innodb; +drop table t1; +create table t1 (a char(20), index (a(5))) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) default NULL, + KEY `a` (`a`(5)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb; insert into t1 values (NULL),(NULL),(NULL); delete from t1 where a=3; insert into t1 values (NULL); @@ -789,7 +844,7 @@ name varchar(32) not null, value text not null, uid int not null, unique key(name,uid) -) type=innodb; +) engine=innodb; insert into t1 values (1,'one','one value',101), (2,'two','two value',102),(3,'three','three value',103); set insert_id=5; @@ -806,19 +861,21 @@ id name value uid 6 two other value 102 drop table t1; create database mysqltest; -create table mysqltest.t1 (a int not null) type= innodb; +create table mysqltest.t1 (a int not null) engine= innodb; insert into mysqltest.t1 values(1); -create table mysqltest.t2 (a int not null) type= myisam; +create table mysqltest.t2 (a int not null) engine= myisam; insert into mysqltest.t2 values(1); -create table mysqltest.t3 (a int not null) type= heap; +create table mysqltest.t3 (a int not null) engine= heap; insert into mysqltest.t3 values(1); commit; drop database mysqltest; +show tables from mysqltest; +Got one of the listed errors set autocommit=0; -create table t1 (a int not null) type= innodb; +create table t1 (a int not null) engine= innodb; insert into t1 values(1),(2); truncate table t1; -Can't execute the given command because you have active locked tables or an active transaction +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction commit; truncate table t1; select * from t1; @@ -830,7 +887,7 @@ a commit; drop table t1; set autocommit=1; -create table t1 (a int not null) type= innodb; +create table t1 (a int not null) engine= innodb; insert into t1 values(1),(2); truncate table t1; insert into t1 values(1),(2); @@ -844,10 +901,34 @@ delete from t1; select * from t1; a drop table t1; -create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) type=innodb; +create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb; insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4); +explain select * from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # +explain select * from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # +explain select * from t1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort +explain select a from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # Using index +explain select b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b,c from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # drop table t1; -create table t1 (t int not null default 1, key (t)) type=innodb; +create table t1 (t int not null default 1, key (t)) engine=innodb; desc t1; Field Type Null Key Default Extra t int(11) MUL 1 @@ -864,7 +945,7 @@ last_app_id smallint(6) default '-1', version smallint(6) NOT NULL default '0', assigned_scps int(11) default '0', status tinyint(4) default '0' -) TYPE=InnoDB; +) ENGINE=InnoDB; INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1); INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0); INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1); @@ -883,38 +964,38 @@ last_app_id smallint(6) default '-1', version smallint(6) NOT NULL default '0', assigned_scps int(11) default '0', status tinyint(4) default '0' -) TYPE=InnoDB; +) ENGINE=InnoDB; INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1); INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0); INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1); INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0); select * from t1; number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status -4077711111 SeanWheeler 90 2 20020111112846 500 00000000000000 -1 2 3 1 -9197722223 berry 90 3 20020111112809 500 20020102114532 501 4 10 0 -650 San Francisco 0 0 20011227111336 342 00000000000000 -1 1 24 1 -302467 Sue's Subshop 90 3 20020109113241 500 20020102115111 501 7 24 0 -6014911113 SudzCarwash 520 1 20020102115234 500 20020102115259 501 33 32768 0 -333 tubs 99 2 20020109113440 501 20020109113440 500 3 10 0 +4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 0 0 2001-12-27 11:13:36 342 0000-00-00 00:00:00 -1 1 24 1 +302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0 +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 select * from t2; number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status -4077711111 SeanWheeler 0 2 20020111112853 500 00000000000000 -1 2 3 1 -9197722223 berry 90 3 20020111112818 500 20020102114532 501 4 10 0 -650 San Francisco 90 0 20020109113158 342 00000000000000 -1 1 24 1 -333 tubs 99 2 20020109113453 501 20020109113453 500 3 10 0 +4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 90 0 2002-01-09 11:31:58 342 0000-00-00 00:00:00 -1 1 24 1 +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 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); select * from t1; number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status -6014911113 SudzCarwash 520 1 20020102115234 500 20020102115259 501 33 32768 0 -333 tubs 99 2 20020109113440 501 20020109113440 500 3 10 0 +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 select * from t2; number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status -333 tubs 99 2 20020109113453 501 20020109113453 500 3 10 0 +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 select * from t2; number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status -333 tubs 99 2 20020109113453 501 20020109113453 500 3 10 0 +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 drop table t1,t2; -create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SELECT @@tx_isolation,@@global.tx_isolation; @@ -952,9 +1033,8 @@ id code name 7 4 Matt COMMIT; DROP TABLE t1; -drop table if exists t1,t2; -create table t1 (n int(10), d int(10)) type=innodb; -create table t2 (n int(10), d int(10)) type=innodb; +create table t1 (n int(10), d int(10)) engine=innodb; +create table t2 (n int(10), d int(10)) engine=innodb; insert into t1 values(1,1),(1,2); insert into t2 values(1,10),(2,20); UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; @@ -967,7 +1047,7 @@ n d 1 30 2 20 drop table t1,t2; -create table t1 (a int, b int) type=innodb; +create table t1 (a int, b int) engine=innodb; insert into t1 values(20,null); select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on t2.b=t3.a; @@ -984,19 +1064,19 @@ b ifnull(t2.b,"this is null") NULL this is null NULL this is null drop table t1; -create table t1 (a varchar(10) not null) type=myisam; -create table t2 (b varchar(10) not null unique) type=innodb; +create table t1 (a varchar(10) not null) engine=myisam; +create table t2 (b varchar(10) not null unique) engine=innodb; select t1.a from t1,t2 where t1.a=t2.b; a drop table t1,t2; -create table t1 (a int not null, b int, primary key (a)) type = innodb; -create table t2 (a int not null, b int, primary key (a)) type = innodb; +create table t1 (a int not null, b int, primary key (a)) engine = innodb; +create table t2 (a int not null, b int, primary key (a)) engine = innodb; insert into t1 values (10, 20); insert into t2 values (10, 20); update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; drop table t1,t2; -CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; -CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) TYPE=INNODB; +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB; insert into t1 set id=1; insert into t2 set id=1, t1_id=1; delete t1,t2 from t1,t2 where t1.id=t2.t1_id; @@ -1005,9 +1085,8 @@ id select * from t2; id t1_id drop table t2,t1; -DROP TABLE IF EXISTS t1,t2; -CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; -CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB; INSERT INTO t1 VALUES(1); INSERT INTO t2 VALUES(1, 1); SELECT * from t1; @@ -1023,9 +1102,9 @@ id 3 DROP TABLE t1,t2; set autocommit=0; -CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; -CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; -CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB; +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB; INSERT INTO t3 VALUES("my-test-1", "my-test-2"); COMMIT; INSERT INTO t1 VALUES("this-key", "will disappear"); @@ -1053,7 +1132,7 @@ my-test-1 my-test-2 COMMIT; set autocommit=1; DROP TABLE t1,t2,t3; -CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) type=innodb; +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb; INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; SELECT * from t1; @@ -1068,8 +1147,8 @@ a b 8 8 9 9 drop table t1; -CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) type=innodb; -CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) type=innodb; +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; 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); INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); update t1,t2 set t1.a=t1.a+100; @@ -1144,17 +1223,18 @@ a b 4 14 5 15 drop table t1,t2; -CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) TYPE=MyISAM; -CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) TYPE=InnoDB; +CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=0; INSERT INTO t1 ( B_ID ) VALUES ( 1 ); INSERT INTO t2 ( NEXT_T ) VALUES ( 1 ); ROLLBACK; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back SELECT * FROM t1; B_ID drop table t1,t2; -create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) type = innodb; +create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb; insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2); select distinct parent,child from t1 order by parent; parent child @@ -1163,7 +1243,7 @@ parent child 1 3 2 1 drop table t1; -create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) type=innodb; +create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb; create table t2 (a int not null auto_increment primary key, b int); insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null); insert into t2 (a) select b from t1; @@ -1187,9 +1267,15 @@ insert into t1 (a) select b from t2; select count(*) from t1; count(*) 29267 +explain select * from t1 where c between 1 and 10000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 5 NULL # Using where update t1 set c=a; +explain select * from t1 where c between 1 and 10000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL c NULL NULL NULL # Using where drop table t1,t2; -create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) type=innodb; +create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb; insert into t1 (id) values (null),(null),(null),(null),(null); update t1 set fk=69 where fk is null order by id limit 1; SELECT * from t1; @@ -1222,19 +1308,19 @@ a b 111 100 111 100 drop table t1; -create table t1 ( c char(8) not null ) type=innodb; +create table t1 ( c char(8) not null ) engine=innodb; insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); alter table t1 add b char(8) not null; alter table t1 add a char(8) not null; alter table t1 add primary key (a,b,c); update t1 set a=c, b=c; -create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) type=innodb; +create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb; insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; SET AUTOCOMMIT=1; -create table t1 (a integer auto_increment primary key) type=innodb; +create table t1 (a integer auto_increment primary key) engine=innodb; insert into t1 (a) values (NULL),(NULL); truncate table t1; insert into t1 (a) values (NULL),(NULL); @@ -1243,31 +1329,304 @@ a 3 4 drop table t1; -CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) TYPE=INNODB; -CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) TYPE=INNODB; +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB; drop table t2,t1; -create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb; +create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb; insert into `t1`values ( 1 ) ; -create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb; +create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb; insert into `t2`values ( 1 ) ; -create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb; +create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; insert into `t3`values ( 1 ) ; delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; -Cannot delete or update a parent row: a foreign key constraint fails +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; -Cannot delete or update a parent row: a foreign key constraint fails +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; -Unknown table 't1' in where clause +ERROR 42S02: Unknown table 't1' in where clause drop table t3,t2,t1; create table t1( id int primary key, pid int, index(pid), -foreign key(pid) references t1(id) on delete cascade) type=innodb; +foreign key(pid) references t1(id) on delete cascade) engine=innodb; insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); delete from t1 where id=0; -Cannot delete or update a parent row: a foreign key constraint fails +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails delete from t1 where id=15; delete from t1 where id=0; drop table t1; +CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB; +CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx +(stamp))ENGINE=InnoDB; +insert into t1 values (1),(2),(3); +insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000); +Warnings: +Warning 1265 Data truncated for column 'stamp' at row 3 +SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp < +'20020204120000' GROUP BY col1; +col1 +1 +2 +3 +4 +drop table t1,t2; +CREATE TABLE t1 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_object` int(10) unsigned default '0', +`id_version` int(10) unsigned NOT NULL default '1', +label varchar(100) NOT NULL default '', +`description` text, +PRIMARY KEY (`id`), +KEY `id_object` (`id_object`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +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); +CREATE TABLE t2 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_version` int(10) unsigned NOT NULL default '1', +PRIMARY KEY (`id`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); +SELECT t2.id, t1.label FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.label LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +id label +3382 Test +102 Le Pekin (Test) +1794 Test de resto +1822 Test 3 +3524 Societe Test +3525 Fournisseur Test +drop table t1,t2; +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb; +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12"); +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" ); +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1; +c1 c2 stamp +drop table t1; +create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +Table Checksum +test.t1 968604391 +test.t2 NULL +test.t3 NULL +test.t4 NULL +checksum table t1, t2, t3, t4; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +checksum table t1, t2, t3, t4 extended; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +drop table t1,t2,t3; +create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; +insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); +select name2 from t1 union all select name from t1 union all select id from t1; +name2 +fff +sss +ttt +first +second +third +1 +2 +3 +drop table t1; +create table t1 (a int) engine=innodb; +create table t2 like t1; +drop table t1,t2; +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id2 on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + KEY `id2` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index id2 on t2; +drop index id on t2; +Got one of the listed errors +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create unique index id on t2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `id_test` (`id`), + KEY `id_test2` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; +ERROR HY000: Can't create table './test/t2.frm' (errno: 150) +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b_2` (`b`), + KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`), + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 24 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 0 +create table t1 (a int) engine=innodb; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 25 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 26 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +drop table t1; diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result index 634b9b860c9..ec43cbe10b2 100644 --- a/mysql-test/r/innodb_cache.result +++ b/mysql-test/r/innodb_cache.result @@ -1,7 +1,7 @@ -drop table if exists t1, t2, t3; +drop table if exists t1,t2,t3; flush status; set autocommit=0; -create table t1 (a int not null) type=innodb; +create table t1 (a int not null) engine=innodb; insert into t1 values (1),(2),(3); select * from t1; a @@ -15,7 +15,7 @@ drop table t1; commit; set autocommit=1; begin; -create table t1 (a int not null) type=innodb; +create table t1 (a int not null) engine=innodb; insert into t1 values (1),(2),(3); select * from t1; a @@ -27,9 +27,9 @@ Variable_name Value Qcache_queries_in_cache 0 drop table t1; commit; -create table t1 (a int not null) type=innodb; -create table t2 (a int not null) type=innodb; -create table t3 (a int not null) type=innodb; +create table t1 (a int not null) engine=innodb; +create table t2 (a int not null) engine=innodb; +create table t3 (a int not null) engine=innodb; insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1),(2); @@ -69,7 +69,7 @@ Variable_name Value Qcache_queries_in_cache 3 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 0 +Qcache_hits 3 insert into t1 values (3); insert into t2 values (3); insert into t1 values (4); @@ -90,16 +90,16 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 3 +Qcache_queries_in_cache 1 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 0 +Qcache_hits 4 commit; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 drop table t3,t2,t1; -CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB; +CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; select count(*) from t1; count(*) 0 @@ -109,9 +109,9 @@ count(*) 1 drop table t1; set GLOBAL query_cache_size=1355776; -CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) TYPE=innodb; -CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) TYPE=innodb; -CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) TYPE=innodb; +CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; +CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; +CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; INSERT INTO t1 VALUES (1,'me'); INSERT INTO t2 VALUES (1,'you'); INSERT INTO t3 VALUES (2,1,1,2); @@ -121,7 +121,7 @@ id a begin; insert into t3 VALUES ( NULL, 1, 1, 2 ); insert into t3 VALUES ( NULL, 1, 1, 2 ); -Duplicate entry '1-1' for key 2 +ERROR 23000: Duplicate entry '1-1' for key 2 commit; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; id a diff --git a/mysql-test/r/innodb_handler.result b/mysql-test/r/innodb_handler.result index 8aa5309308f..7f4960ffa35 100644 --- a/mysql-test/r/innodb_handler.result +++ b/mysql-test/r/innodb_handler.result @@ -1,5 +1,5 @@ -drop table if exists t1; -create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb; +drop table if exists t1,t2; +create table t1 (a int, b char(10), key a(a), key b(a,b)) engine=innodb; insert into t1 values (17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"), (14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"), @@ -49,7 +49,7 @@ handler t2 read a=(16); a b 16 ccc handler t2 read a=(19,"fff"); -Too many key parts specified. Max 1 parts allowed +ERROR 42000: Too many key parts specified; max 1 parts allowed handler t2 read b=(19,"fff"); a b 19 fff @@ -60,7 +60,7 @@ handler t2 read b=(19); a b 19 fff handler t1 read a last; -Unknown table 't1' in HANDLER +ERROR 42S02: Unknown table 't1' in HANDLER handler t2 read a=(11); a b handler t2 read a>=(11); @@ -130,17 +130,17 @@ handler t2 read next; a b 18 eee handler t2 read last; -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 +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 handler t2 close; handler t1 open as t2; handler t2 read first; a b 17 ddd -alter table t1 type=innodb; +alter table t1 engine=innodb; handler t2 read first; -Unknown table 't2' in HANDLER +ERROR 42S02: Unknown table 't2' in HANDLER drop table t1; -CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2)) TYPE=InnoDB; +CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2)) ENGINE=InnoDB; INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2); HANDLER t1 OPEN; HANDLER t1 READ `primary` = (1, 1000); diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 7520fd7e6cc..71b10699fa9 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -60,8 +60,10 @@ test 2 drop table t1; create table t1 (id int NOT NULL DEFAULT 8); insert into t1 values(NULL); -Column 'id' cannot be null +ERROR 23000: Column 'id' cannot be null insert into t1 values (1), (NULL), (2); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id' at row 2 select * from t1; id 1 @@ -84,3 +86,242 @@ use mysqltest; create table t1 (c int); insert into mysqltest.t1 set mysqltest.t1.c = '1'; drop database mysqltest; +use test; +create table t1(number int auto_increment primary key, original_value varchar(50), f_double double, f_float float, f_double_7_2 double(7,2), f_float_4_3 float (4,3), f_double_u double unsigned, f_float_u float unsigned, f_double_15_1_u double(15,1) unsigned, f_float_3_1_u float (3,1) unsigned); +set @value= "aa"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double' at row 1 +Warning 1265 Data truncated for column 'f_float' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3' at row 1 +Warning 1265 Data truncated for column 'f_double_u' at row 1 +Warning 1265 Data truncated for column 'f_float_u' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 1 +original_value aa +f_double 0 +f_float 0 +f_double_7_2 0.00 +f_float_4_3 0.000 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= "1aa"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double' at row 1 +Warning 1265 Data truncated for column 'f_float' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3' at row 1 +Warning 1265 Data truncated for column 'f_double_u' at row 1 +Warning 1265 Data truncated for column 'f_float_u' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 2 +original_value 1aa +f_double 1 +f_float 1 +f_double_7_2 1.00 +f_float_4_3 1.000 +f_double_u 1 +f_float_u 1 +f_double_15_1_u 1.0 +f_float_3_1_u 1.0 +set @value= "aa1"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double' at row 1 +Warning 1265 Data truncated for column 'f_float' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3' at row 1 +Warning 1265 Data truncated for column 'f_double_u' at row 1 +Warning 1265 Data truncated for column 'f_float_u' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 3 +original_value aa1 +f_double 0 +f_float 0 +f_double_7_2 0.00 +f_float_4_3 0.000 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= "1e+1111111111a"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double' at row 1 +Warning 1265 Data truncated for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1265 Data truncated for column 'f_double_u' at row 1 +Warning 1265 Data truncated for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 4 +original_value 1e+1111111111a +f_double 1.79769313486232e+308 +f_float 3.40282e+38 +f_double_7_2 99999.99 +f_float_4_3 9.999 +f_double_u 1.79769313486232e+308 +f_float_u 3.40282e+38 +f_double_15_1_u 99999999999999.9 +f_float_3_1_u 99.9 +set @value= "-1e+1111111111a"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double' at row 1 +Warning 1265 Data truncated for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1265 Data truncated for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1265 Data truncated for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 5 +original_value -1e+1111111111a +f_double -1.79769313486232e+308 +f_float -3.40282e+38 +f_double_7_2 -99999.99 +f_float_4_3 -9.999 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= 1e+1111111111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 6 +original_value 1.7976931348623e+308 +f_double 1.79769313486232e+308 +f_float 3.40282e+38 +f_double_7_2 99999.99 +f_float_4_3 9.999 +f_double_u 1.79769313486232e+308 +f_float_u 3.40282e+38 +f_double_15_1_u 99999999999999.9 +f_float_3_1_u 99.9 +set @value= -1e+1111111111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 7 +original_value -1.7976931348623e+308 +f_double -1.79769313486232e+308 +f_float -3.40282e+38 +f_double_7_2 -99999.99 +f_float_4_3 -9.999 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= 1e+111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 8 +original_value 1e+111 +f_double 1e+111 +f_float 3.40282e+38 +f_double_7_2 99999.99 +f_float_4_3 9.999 +f_double_u 1e+111 +f_float_u 3.40282e+38 +f_double_15_1_u 99999999999999.9 +f_float_3_1_u 99.9 +set @value= -1e+111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 9 +original_value -1e+111 +f_double -1e+111 +f_float -3.40282e+38 +f_double_7_2 -99999.99 +f_float_4_3 -9.999 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= 1; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +select * from t1 where number =last_insert_id(); +number 10 +original_value 1 +f_double 1 +f_float 1 +f_double_7_2 1.00 +f_float_4_3 1.000 +f_double_u 1 +f_float_u 1 +f_double_15_1_u 1.0 +f_float_3_1_u 1.0 +set @value= -1; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 +select * from t1 where number =last_insert_id(); +number 11 +original_value -1 +f_double -1 +f_float -1 +f_double_7_2 -1.00 +f_float_4_3 -1.000 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +drop table t1; diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index a10e7fc02bb..7c7ac152aa5 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -4,7 +4,7 @@ insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7, create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY); insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; insert into t2 (payoutID) SELECT payoutID+10 FROM t1; -Duplicate entry '16' for key 1 +ERROR 23000: Duplicate entry '16' for key 1 insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; select * from t2; payoutID @@ -35,7 +35,7 @@ PRIMARY KEY (`numeropost`,`numreponse`) KEY `date` (`date`), KEY `pseudo` (`pseudo`), KEY `numreponse` (`numreponse`) -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE `t2` ( `numeropost` bigint(20) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0', @@ -50,7 +50,7 @@ KEY `ip` (`ip`), KEY `date` (`date`), KEY `pseudo` (`pseudo`), KEY `numreponse` (`numreponse`) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 (numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES (9,1,56,'test','joce','2001-07-25 13:50:53' @@ -71,13 +71,16 @@ create table t2(a int); insert into t2 values(1),(2); reset master; insert into t1 select * from t2; -Duplicate entry '2' for key 1 +ERROR 23000: Duplicate entry '2' for key 1 show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.001 79 Query 1 79 use `test`; insert into t1 select * from t2 +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; insert into t1 select * from t2 +select * from t1; +a +1 +2 drop table t1, t2; -drop table if exists t1, t2; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); @@ -567,14 +570,14 @@ a 5 5 insert into t1 select * from t1,t1; -Not unique table/alias: 't1' +ERROR 42000: Not unique table/alias: 't1' drop table t1,t2; create table t1 (a int not null primary key, b char(10)); create table t2 (a int not null, b char(10)); insert into t1 values (1,"t1:1"),(3,"t1:3"); insert into t2 values (2,"t2:2"), (3,"t2:3"); insert into t1 select * from t2; -Duplicate entry '3' for key 1 +ERROR 23000: Duplicate entry '3' for key 1 select * from t1; a b 1 t1:1 @@ -618,6 +621,9 @@ NULL 1 100 NULL 2 100 create table t2(No int not null, Field int not null, Count int not null); insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 2 select * from t2; No Field Count 0 1 100 diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result new file mode 100644 index 00000000000..303d7186015 --- /dev/null +++ b/mysql-test/r/insert_update.result @@ -0,0 +1,107 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 VALUES (5,6,30) ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 30 +INSERT t1 VALUES (5,7,40) ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 130 +INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +a b c +1 2 10 +3 4 1020 +5 6 130 +INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4; +ERROR 23000: Duplicate entry '4' for key 2 +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 6 30 +8 9 60 +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 0 30 +8 9 60 +INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +a b c VALUES(a) +1 2 10 NULL +3 4 127 NULL +5 0 30 NULL +8 9 60 NULL +2 1 11 NULL +explain extended SELECT *, VALUES(a) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +Warnings: +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1 +explain extended select * from t1 where values(a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 +DROP TABLE t1; +create table t1(a int primary key, b int); +insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); +select * from t1; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18) +on duplicate key update b=b+10; +affected rows: 7 +info: Records: 5 Duplicates: 2 Warnings: 0 +select * from t1; +a b +1 1 +2 2 +3 3 +4 14 +5 15 +6 16 +7 17 +8 18 +replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29); +affected rows: 9 +info: Records: 5 Duplicates: 4 Warnings: 0 +select * from t1; +a b +1 1 +2 2 +3 3 +4 14 +5 25 +6 26 +7 27 +8 28 +9 29 +drop table t1; diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result index 680d1d6d322..52eb2d73ed5 100644 --- a/mysql-test/r/isam.result +++ b/mysql-test/r/isam.result @@ -1,11 +1,11 @@ drop table if exists t1,t2; -create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) type=isam; +create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) engine=isam; delete from t1 where (a & 1); select sum(length(b)) from t1; sum(length(b)) 3274494 drop table t1; -create table t1 (a int not null auto_increment,b int, primary key (a)) type=isam; +create table t1 (a int not null auto_increment,b int, primary key (a)) engine=isam; insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4); delete from t1 where a=4 or a=2; insert into t1 values (NULL,4),(NULL,5),(6,6); @@ -29,32 +29,34 @@ a b c 4 4 NULL 6 6 6 drop table t1; -create table t1 (a int,b text, index(a)) type=isam; -Column 'a' is used with UNIQUE or INDEX but is not defined as NOT NULL -create table t1 (a int,b text, index(b)) type=isam; -BLOB column 'b' can't be used in key specification with the used table type -create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=isam; -Incorrect table definition; There can only be one auto column and it must be defined as a key -create table t1 (ordid int(8), unique (ordid)) type=isam; -Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL +create table t1 (a int,b text, index(a)) engine=isam; +ERROR 42000: Column 'a' is used with UNIQUE or INDEX but is not defined as NOT NULL +create table t1 (a int,b text, index(b)) engine=isam; +ERROR 42000: BLOB column 'b' can't be used in key specification with the used table type +create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam; +ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key +create table t1 (ordid int(8), unique (ordid)) engine=isam; +ERROR 42000: Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' create table t1 (a int not null primary key, b int not null,c int not null, key(b,c)); insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4); -create table t2 type=isam select * from t1; +create table t2 engine=isam select * from t1; optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK check table t1,t2; Table Op Msg_type Msg_text test.t1 check status OK -test.t2 check error The handler for the table doesn't support check +test.t2 check note The storage engine for the table doesn't support check repair table t1,t2; Table Op Msg_type Msg_text test.t1 repair status OK -test.t2 repair error The handler for the table doesn't support repair +test.t2 repair note The storage engine for the table doesn't support repair check table t2,t1; Table Op Msg_type Msg_text -test.t2 check error The handler for the table doesn't support check +test.t2 check note The storage engine for the table doesn't support check test.t1 check status OK lock tables t1 write; check table t2,t1; @@ -67,10 +69,10 @@ a int(11) PRI 0 b int(11) MUL 0 c int(11) 0 show full columns from t1; -Field Type Null Key Default Extra Privileges -a int(11) PRI 0 select,insert,update,references -b int(11) MUL 0 select,insert,update,references -c int(11) 0 select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +a int(11) NULL PRI 0 select,insert,update,references +b int(11) NULL MUL 0 select,insert,update,references +c int(11) NULL 0 select,insert,update,references show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 a A 4 NULL NULL BTREE diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 039b6e1cba3..dc763472b0e 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -61,12 +61,12 @@ select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 id id NULL 75 explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition -t2 ALL NULL NULL NULL NULL 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0; -Comment -Impossible WHERE noticed after reading const tables +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1,t2; CREATE TABLE t1 ( id int(11) NOT NULL auto_increment, @@ -126,17 +126,17 @@ a 1 2 select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a); -Too many tables. MySQL can only use XX tables in a join +ERROR HY000: Too many tables; MySQL can only use XX tables in a join drop table t1; CREATE TABLE t1 ( a int(11) NOT NULL, b int(11) NOT NULL, PRIMARY KEY (a,b) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(2,3); CREATE TABLE t2 ( a int(11) default NULL -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES (2),(3); SELECT t1.a,t2.a,b FROM t1,t2 WHERE t1.a=t2.a AND (t1.a=1 OR t1.a=2) AND b>=1 AND b<=3; a a b @@ -236,13 +236,13 @@ min_value double default NULL, max_value double default NULL, t3_id int(11) default NULL, item_id int(11) default NULL -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (12,5,'Percent','Cost',-1,0,-1,-1),(14,4,'Percent','Cost',-1,0,-1,-1),(18,5,'Percent','Cost',-1,0,-1,-1),(19,4,'Percent','Cost',-1,0,-1,-1),(20,5,'Percent','Cost',100,-1,22,291),(21,5,'Percent','Cost',100,-1,18,291),(22,1,'Percent','Cost',100,-1,6,291),(23,1,'Percent','Cost',100,-1,21,291),(24,1,'Percent','Cost',100,-1,9,291),(25,1,'Percent','Cost',100,-1,4,291),(26,1,'Percent','Cost',100,-1,20,291),(27,4,'Percent','Cost',100,-1,7,202),(28,1,'Percent','Cost',50,-1,-1,137),(29,2,'Percent','Cost',100,-1,4,354),(30,2,'Percent','Cost',100,-1,9,137),(93,2,'Cost','Cost',-1,10000000,-1,-1); CREATE TABLE t2 ( id int(10) unsigned NOT NULL auto_increment, name varchar(255) default NULL, PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5'); select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2; t1_id t2_id type cost_unit min_value max_value t3_id item_id id name @@ -255,7 +255,7 @@ emp_id varchar(30) NOT NULL default '', rate_code varchar(10) default NULL, UNIQUE KEY site_emp (siteid,emp_id), KEY siteid (siteid) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); CREATE TABLE t2 ( siteid varchar(25) NOT NULL default '', @@ -263,7 +263,7 @@ rate_code varchar(10) NOT NULL default '', base_rate float NOT NULL default '0', PRIMARY KEY (siteid,rate_code), FULLTEXT KEY rate_code (rate_code) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES ('rivercats','cust',20); SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; rate_code base_rate @@ -277,12 +277,18 @@ CREATE TABLE t2 (ID INTEGER NOT NULL PRIMARY KEY, Value2 VARCHAR(255)); INSERT INTO t1 VALUES (1, 'A'); INSERT INTO t2 VALUES (1, 'B'); SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND (Value1 = 'A' AND Value2 <> 'B'); -ID Value1 ID Value2 +ID Value1 Value2 SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B'; -ID Value1 ID Value2 +ID Value1 Value2 SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1; -ID Value1 ID Value2 +ID Value1 Value2 drop table t1,t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (b int); +CREATE TABLE t3 (c int); +SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3; +a b c +DROP TABLE t1, t2, t3; create table t1 (i int); create table t2 (i int); create table t3 (i int); diff --git a/mysql-test/r/join_crash.result b/mysql-test/r/join_crash.result index c7bca9f7497..c1671ea7e20 100644 --- a/mysql-test/r/join_crash.result +++ b/mysql-test/r/join_crash.result @@ -10,7 +10,7 @@ billing_contact_ptr int(11) default NULL, comments mediumtext, PRIMARY KEY (project_id), UNIQUE KEY project (client_ptr,project_name) -) TYPE=MyISAM PACK_KEYS=1; +) ENGINE=MyISAM PACK_KEYS=1; INSERT INTO t1 VALUES (1,0,'Rejected Time',1,NULL,NULL,NULL,NULL); INSERT INTO t1 VALUES (209,0,'MDGRAD Proposal/Investigation',97,NULL,NULL,NULL,''); INSERT INTO t1 VALUES (208,0,'Font 9 Design',84,NULL,NULL,NULL,''); @@ -31,7 +31,7 @@ work_load int(11) default NULL, PRIMARY KEY (period_id), KEY period_index (period_type,period_key), KEY date_index (start_date,end_date) -) TYPE=MyISAM PACK_KEYS=1; +) ENGINE=MyISAM PACK_KEYS=1; INSERT INTO t2 VALUES (1,'user_table',98,'2000-01-01 00:00:00',NULL,NULL); INSERT INTO t2 VALUES (2,'user_table',99,'2000-01-01 00:00:00',NULL,NULL); INSERT INTO t2 VALUES (3,'user_table',100,'2000-01-01 00:00:00',NULL,NULL); @@ -57,7 +57,7 @@ amount_received float(10,2) default NULL, adjustment float(10,2) default NULL, PRIMARY KEY (budget_id), UNIQUE KEY po (project_ptr,po_number) -) TYPE=MyISAM PACK_KEYS=1; +) ENGINE=MyISAM PACK_KEYS=1; CREATE TABLE t4 ( client_id int(11) NOT NULL auto_increment, client_row_lock int(11) NOT NULL default '0', @@ -66,7 +66,7 @@ contact_ptr int(11) default NULL, comments mediumtext, PRIMARY KEY (client_id), UNIQUE KEY client_name (client_name) -) TYPE=MyISAM PACK_KEYS=1; +) ENGINE=MyISAM PACK_KEYS=1; INSERT INTO t4 VALUES (1,0,'CPS',NULL,NULL); select distinct t1.project_id as project_id, diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 5778b2f9b72..75bf96cb401 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -3,7 +3,7 @@ CREATE TABLE t1 ( grp int(11) default NULL, a bigint(20) unsigned default NULL, c char(10) NOT NULL default '' -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b'),(2,3,'c'),(3,4,'E'),(3,5,'C'),(3,6,'D'),(NULL,NULL,''); create table t2 (id int, a bigint unsigned not null, c char(10), d int, primary key (a)); insert into t2 values (1,1,"a",1),(3,4,"A",4),(3,5,"B",5),(3,6,"C",6),(4,7,"D",7); @@ -90,12 +90,12 @@ grp a c id a c d 2 3 c NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL explain select t1.*,t2.* from t1,t2 where t1.a=t2.a and isnull(t2.a)=1; -Comment -Impossible WHERE +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 7 -t2 eq_ref PRIMARY PRIMARY 8 t1.a 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 7 +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 8 test.t1.a 1 Using where select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a); grp a c id a c d a 1 1 a 1 1 a 1 1 @@ -106,11 +106,11 @@ grp a c id a c d a 3 6 D 3 6 C 6 6 NULL NULL NULL NULL NULL NULL NULL explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); -Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions select t1.*,t2.* from t1 inner join t2 using (a); grp a c id a c d 1 1 a 1 1 a 1 @@ -124,8 +124,8 @@ grp a c id a c d 3 5 C 3 5 B 5 3 6 D 3 6 C 6 select t1.*,t2.* from t1 natural join t2; -grp a c id a c d -1 1 a 1 1 a 1 +grp a c id d +1 1 a 1 1 drop table t1,t2; CREATE TABLE t1 ( usr_id INT unsigned NOT NULL, @@ -169,7 +169,7 @@ usr_id uniq_id increment usr2_id c_amount max 3 4 84676 NULL NULL NULL INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); -Duplicate entry '2-3' for key 1 +ERROR 23000: Duplicate entry '2-3' for key 1 INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes'); SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4 ORDER BY t2.c_amount; usr_id uniq_id increment usr2_id c_amount max @@ -181,7 +181,6 @@ SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 L usr_id uniq_id increment usr2_id c_amount max 3 4 84676 NULL NULL NULL drop table t1,t2; -drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( cod_asig int(11) DEFAULT '0' NOT NULL, desc_larga_cat varchar(80) DEFAULT '' NOT NULL, @@ -311,13 +310,13 @@ select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where name name id Lilliana Angelovska NULL NULL explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 3 -t2 ALL NULL NULL NULL NULL 3 Using where; Not exists +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Not exists explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.name is null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 3 -t2 ALL NULL NULL NULL NULL 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where select count(*) from t1 left join t2 on (t1.id = t2.owner); count(*) 4 @@ -331,13 +330,13 @@ select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where name name id Lilliana Angelovska NULL NULL explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 3 -t2 ALL NULL NULL NULL NULL 3 Using where; Not exists +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Not exists explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.name is null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 3 -t2 ALL NULL NULL NULL NULL 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where select count(*) from t2 right join t1 on (t1.id = t2.owner); count(*) 4 @@ -407,7 +406,7 @@ insert into t3 values (1); insert into t4 values (1,1); insert into t5 values (1,1); explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; -Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions drop table t1,t2,t3,t4,t5; create table t1 (n int, m int, o int, key(n)); create table t2 (n int not null, m int, o int, primary key(n)); @@ -468,10 +467,10 @@ count color 15 white 7 green select * from t2 natural join t1; -count color color name -10 green green lime -7 green green lime -5 black black grape +count color name +10 green lime +7 green lime +5 black grape select t2.count, t1.name from t2 natural join t1; count name 10 lime @@ -613,9 +612,9 @@ UNIQUE id (id,idx) ); INSERT INTO t2 VALUES (1,1); explain SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 2 -t2 ref id id 4 t1.id 1 Using where; Using index; Not exists +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ref id id 4 test.t1.id 1 Using where; Using index; Not exists SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL; id name id idx 2 no NULL NULL @@ -633,9 +632,9 @@ create table t2 (fooID smallint unsigned not null, barID smallint unsigned not n insert into t1 (fooID) values (10),(20),(30); insert into t2 values (10,1),(20,2),(30,3); explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30; -table type possible_keys key key_len ref rows Extra -t2 index NULL PRIMARY 4 NULL 3 Using index -t1 eq_ref PRIMARY PRIMARY 2 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL PRIMARY 4 NULL 3 Using index +1 SIMPLE t1 const PRIMARY PRIMARY 2 const 1 Using where; Using index select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30; fooID barID fooID 10 1 NULL @@ -647,7 +646,6 @@ fooID barID fooID 20 2 NULL 30 3 30 drop table t1,t2; -drop table if exists t3; create table t1 (i int); create table t2 (i int); create table t3 (i int); @@ -665,7 +663,7 @@ create table t3 (f3 integer,f5 integer); select * from t1 left outer join t2 using (f2) left outer join t3 using (f3); -Unknown column 'test.t2.f3' in 'on clause' +ERROR 42S22: Unknown column 'test.t2.f3' in 'on clause' drop table t1,t2,t3; create table t1 (a1 int, a2 int); create table t2 (b1 int not null, b2 int); @@ -679,8 +677,77 @@ a1 a2 b1 b2 c1 c2 2 2 2 3 NULL NULL 3 2 NULL NULL 3 4 explain select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 3 -t2 ALL NULL NULL NULL NULL 2 -t3 ALL NULL NULL NULL NULL 2 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 drop table t1, t2, t3; +create table t1 ( +match_id tinyint(3) unsigned not null auto_increment, +home tinyint(3) unsigned default '0', +unique key match_id (match_id), +key match_id_2 (match_id) +); +insert into t1 values("1", "2"); +create table t2 ( +player_id tinyint(3) unsigned default '0', +match_1_h tinyint(3) unsigned default '0', +key player_id (player_id) +); +insert into t2 values("1", "5"); +insert into t2 values("2", "9"); +insert into t2 values("3", "3"); +insert into t2 values("4", "7"); +insert into t2 values("5", "6"); +insert into t2 values("6", "8"); +insert into t2 values("7", "4"); +insert into t2 values("8", "12"); +insert into t2 values("9", "11"); +insert into t2 values("10", "10"); +explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from +(t2 s left join t1 m on m.match_id = 1) +order by m.match_id desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE s ALL NULL NULL NULL NULL 10 +1 SIMPLE m const match_id,match_id_2 match_id 1 const 1 Using where +explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from +(t2 s left join t1 m on m.match_id = 1) +order by UUX desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE s ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +1 SIMPLE m const match_id,match_id_2 match_id 1 const 1 Using where +select s.*, '*', m.*, (s.match_1_h - m.home) UUX from +(t2 s left join t1 m on m.match_id = 1) +order by UUX desc; +player_id match_1_h * match_id home UUX +8 12 * 1 2 10 +9 11 * 1 2 9 +10 10 * 1 2 8 +2 9 * 1 2 7 +6 8 * 1 2 6 +4 7 * 1 2 5 +5 6 * 1 2 4 +1 5 * 1 2 3 +7 4 * 1 2 2 +3 3 * 1 2 1 +explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from +t2 s straight_join t1 m where m.match_id = 1 +order by UUX desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE s ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +1 SIMPLE m const match_id,match_id_2 match_id 1 const 1 Using where +select s.*, '*', m.*, (s.match_1_h - m.home) UUX from +t2 s straight_join t1 m where m.match_id = 1 +order by UUX desc; +player_id match_1_h * match_id home UUX +8 12 * 1 2 10 +9 11 * 1 2 9 +10 10 * 1 2 8 +2 9 * 1 2 7 +6 8 * 1 2 6 +4 7 * 1 2 5 +5 6 * 1 2 4 +1 5 * 1 2 3 +7 4 * 1 2 2 +3 3 * 1 2 1 +drop table t1, t2; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 31d35a681aa..967ff47e1ea 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3; +SET SQL_WARNINGS=1; CREATE TABLE t1 ( ID CHAR(32) NOT NULL, name CHAR(32) NOT NULL, @@ -32,6 +33,11 @@ KEY price (price,area,type,transityes,shopsyes,schoolsyes,petsyes) INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','',''); +Warnings: +Warning 1265 Data truncated for column 'transityes' at row 1 +Warning 1265 Data truncated for column 'shopsyes' at row 1 +Warning 1265 Data truncated for column 'schoolsyes' at row 1 +Warning 1265 Data truncated for column 'petsyes' at row 1 INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y'); @@ -70,13 +76,12 @@ CCident varchar(50) DEFAULT '' NOT NULL, PRIMARY KEY (name,author,category) ); INSERT INTO t1 VALUES -('patnom','patauteur',0,'p.favre@cryo-networks.fr',NULL,NULL,'#p2sndnq6ae5g1u6t','essai\nsalut','scol://195.242.78.119:patauteur.patnom',NULL,NULL,NULL,950036174,-882087474,NULL,3,0,3,'1','Pub/patnom/futur_divers.scs',NULL,'pat','CC1'); +('patnom','patauteur',0,'p.favre@cryo-networks.fr',NULL,NULL,'#p2sndnq6ae5g1u6t','essai salut','scol://195.242.78.119:patauteur.patnom',NULL,NULL,NULL,950036174,-882087474,NULL,3,0,3,'1','Pub/patnom/futur_divers.scs',NULL,'pat','CC1'); INSERT INTO t1 VALUES ('LeNomDeMonSite','Marc',0,'m.barilley@cryo-networks.fr',NULL,NULL,NULL,NULL,'scol://195.242.78.119:Marc.LeNomDeMonSite',NULL,NULL,NULL,950560434,-881563214,NULL,3,0,3,'1','Pub/LeNomDeMonSite/domus_hibere.scs',NULL,'Marq','CC1'); select * from t1 where name='patnom' and author='patauteur' and category=0; name author category email password proxy bitmap msg urlscol urlhttp timeout nbcnx creation livinguntil lang type subcat subtype reg scs capacity userISP CCident -patnom patauteur 0 p.favre@cryo-networks.fr NULL NULL #p2sndnq6ae5g1u6t essai -salut scol://195.242.78.119:patauteur.patnom NULL NULL NULL 950036174 -882087474 NULL 3 0 3 1 Pub/patnom/futur_divers.scs NULL pat CC1 +patnom patauteur 0 p.favre@cryo-networks.fr NULL NULL #p2sndnq6ae5g1u6t essai salut scol://195.242.78.119:patauteur.patnom NULL NULL NULL 950036174 -882087474 NULL 3 0 3 1 Pub/patnom/futur_divers.scs NULL pat CC1 drop table t1; create table t1 ( @@ -118,13 +123,13 @@ primary key (SEQNO, MOTYPEID, MOINSTANCEID, ATTRID, VALUE ) INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); INSERT INTO t1 VALUES (1, 1, 1, 1, 'b'); INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); -Duplicate entry '1-1-1-1-a' for key 1 +ERROR 23000: Duplicate entry '1-1-1-1-a' for key 1 drop table t1; CREATE TABLE t1 ( a tinytext NOT NULL, b tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (a(32),b) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('a',1),('a',2); SELECT * FROM t1 WHERE a='a' AND b=2; a b @@ -146,10 +151,12 @@ t1 0 e 1 e A 0 NULL NULL BTREE t1 0 b 1 b A NULL NULL NULL YES BTREE t1 1 c 1 c A NULL NULL NULL YES BTREE drop table t1; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT, UNIQUE (c,i)); INSERT INTO t1 (c) VALUES (NULL),(NULL); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2 SELECT * FROM t1; c i 1 @@ -177,3 +184,86 @@ NULL 2 a 1 a 2 drop table t1; +create table t1 (i int, a char(200), b text, unique (a), unique (b(300))) charset utf8; +insert t1 values (1, repeat('a',210), repeat('b', 310)); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +insert t1 values (2, repeat(0xD0B1,215), repeat(0xD0B1, 310)); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select i, length(a), length(b), char_length(a), char_length(b) from t1; +i length(a) length(b) char_length(a) char_length(b) +1 200 310 200 310 +2 400 620 200 310 +select i from t1 where a=repeat(_utf8 'a',200); +i +1 +select i from t1 where a=repeat(_utf8 0xD0B1,200); +i +2 +select i from t1 where b=repeat(_utf8 'b',310); +i +1 +drop table t1; +CREATE TABLE t1 (id int unsigned auto_increment, name char(50), primary key (id)) engine=myisam; +insert into t1 (name) values ('a'), ('b'),('c'),('d'),('e'),('f'),('g'); +explain select 1 from t1 where id =2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +explain select 1 from t1 where id =2 or id=3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +explain select name from t1 where id =2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +ALTER TABLE t1 DROP PRIMARY KEY, ADD INDEX (id); +explain select 1 from t1 where id =2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref id id 4 const 1 Using where; Using index +drop table t1; +CREATE TABLE t1 (numeropost mediumint(8) unsigned NOT NULL default '0', numreponse int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (numeropost,numreponse), UNIQUE KEY numreponse (numreponse)); +INSERT INTO t1 (numeropost,numreponse) VALUES ('1','1'),('1','2'),('2','3'),('2','4'); +SELECT numeropost FROM t1 WHERE numreponse='1'; +numeropost +1 +EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const numreponse numreponse 4 const 1 Using index +FLUSH TABLES; +SELECT numeropost FROM t1 WHERE numreponse='1'; +numeropost +1 +drop table t1; +create table t1 (c varchar(30) character set utf8, t text character set utf8, unique (c(2)), unique (t(3))) engine=myisam; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(30) character set utf8 default NULL, + `t` text character set utf8, + UNIQUE KEY `c` (`c`(2)), + UNIQUE KEY `t` (`t`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert t1 values ('cccc', 'tttt'), +(0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1), +(0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1); +insert t1 (c) values ('cc22'); +ERROR 23000: Duplicate entry 'cc22' for key 1 +insert t1 (t) values ('ttt22'); +ERROR 23000: Duplicate entry 'ttt22' for key 2 +insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1); +ERROR 23000: Duplicate entry 'б!#"Ð' for key 1 +insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1); +ERROR 23000: Duplicate entry 'бб!#"б' for key 2 +select c from t1 where c='cccc'; +c +cccc +select t from t1 where t='tttt'; +t +tttt +select c from t1 where c=0xD0B1212223D0B1D0B1D0B1D0B1D0B1; +c +?!"#????? +select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; +t +??!"#???? +drop table t1; diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result new file mode 100644 index 00000000000..fe8708f882d --- /dev/null +++ b/mysql-test/r/key_cache.result @@ -0,0 +1,279 @@ +drop table if exists t1, t2, t3; +SET @save_key_buffer=@@key_buffer_size; +SELECT @@key_buffer_size, @@small.key_buffer_size; +@@key_buffer_size @@small.key_buffer_size +2097152 131072 +SET @@global.key_buffer_size=16*1024*1024; +SET @@global.default.key_buffer_size=16*1024*1024; +SET @@global.default.key_buffer_size=16*1024*1024; +SET @@global.small.key_buffer_size=1*1024*1024; +SET @@global.medium.key_buffer_size=4*1024*1024; +SET @@global.medium.key_buffer_size=0; +SET @@global.medium.key_buffer_size=0; +SHOW VARIABLES like "key_buffer_size"; +Variable_name Value +key_buffer_size 16777216 +SELECT @@key_buffer_size; +@@key_buffer_size +16777216 +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +16777216 +SELECT @@global.default.key_buffer_size; +@@global.default.key_buffer_size +16777216 +SELECT @@global.default.`key_buffer_size`; +@@global.default.key_buffer_size +16777216 +SELECT @@global.`default`.`key_buffer_size`; +@@global.default.key_buffer_size +16777216 +SELECT @@`default`.key_buffer_size; +@@default.key_buffer_size +16777216 +SELECT @@small.key_buffer_size; +@@small.key_buffer_size +1048576 +SELECT @@medium.key_buffer_size; +@@medium.key_buffer_size +0 +SET @@global.key_buffer_size=@save_key_buffer; +SELECT @@default.key_buffer_size; +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 'default.key_buffer_size' at line 1 +SELECT @@skr.storage_engine="test"; +ERROR HY000: Variable 'storage_engine' is not a variable component (can't be used as XXXX.variable_name) +select @@keycache1.key_cache_block_size; +@@keycache1.key_cache_block_size +0 +select @@keycache1.key_buffer_size; +@@keycache1.key_buffer_size +0 +set global keycache1.key_cache_block_size=2048; +select @@keycache1.key_buffer_size; +@@keycache1.key_buffer_size +0 +select @@keycache1.key_cache_block_size; +@@keycache1.key_cache_block_size +2048 +set global keycache1.key_buffer_size=1*1024*1024; +select @@keycache1.key_buffer_size; +@@keycache1.key_buffer_size +1048576 +select @@keycache1.key_cache_block_size; +@@keycache1.key_cache_block_size +2048 +set global keycache2.key_buffer_size=4*1024*1024; +select @@keycache2.key_buffer_size; +@@keycache2.key_buffer_size +4194304 +select @@keycache2.key_cache_block_size; +@@keycache2.key_cache_block_size +1024 +set global keycache1.key_buffer_size=0; +select @@keycache1.key_buffer_size; +@@keycache1.key_buffer_size +0 +select @@keycache1.key_cache_block_size; +@@keycache1.key_cache_block_size +2048 +select @@key_buffer_size; +@@key_buffer_size +2097152 +select @@key_cache_block_size; +@@key_cache_block_size +1024 +set global keycache1.key_buffer_size=1024*1024; +create table t1 (p int primary key, a char(10)) delay_key_write=1; +create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)); +show status like 'key_blocks_used'; +Variable_name Value +Key_blocks_used 0 +show status like 'key_blocks_unused'; +Variable_name Value +Key_blocks_unused KEY_BLOCKS_UNUSED +insert into t1 values (1, 'qqqq'), (11, 'yyyy'); +insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), +(3, 1, 'yyyy'), (4, 3, 'zzzz'); +select * from t1; +p a +1 qqqq +11 yyyy +select * from t2; +p i a +1 1 qqqq +2 1 pppp +3 1 yyyy +4 3 zzzz +update t1 set p=2 where p=1; +update t2 set i=2 where i=1; +show status like 'key_blocks_used'; +Variable_name Value +Key_blocks_used 4 +show status like 'key_blocks_unused'; +Variable_name Value +Key_blocks_unused KEY_BLOCKS_UNUSED +cache index t1 key (`primary`) in keycache1; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +explain select p from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index +select p from t1; +p +2 +11 +explain select i from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k1 5 NULL 4 Using index +select i from t2; +i +2 +2 +2 +3 +explain select count(*) from t1, t2 where t1.p = t2.i; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index +1 SIMPLE t2 ref k1 k1 5 test.t1.p 2 Using where; Using index +select count(*) from t1, t2 where t1.p = t2.i; +count(*) +3 +cache index t2 in keycache1; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +update t2 set p=p+1000, i=2 where a='qqqq'; +cache index t2 in keycache2; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +insert into t2 values (2000, 3, 'yyyy'); +cache index t2 in keycache1; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +update t2 set p=3000 where a='zzzz'; +select * from t2; +p i a +1001 2 qqqq +2 2 pppp +3 2 yyyy +3000 3 zzzz +2000 3 yyyy +explain select p from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL PRIMARY 4 NULL 5 Using index +select p from t2; +p +2 +3 +1001 +2000 +3000 +explain select i from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k1 5 NULL 5 Using index +select i from t2; +i +2 +2 +2 +3 +3 +explain select a from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k2 11 NULL 5 Using index +select a from t2; +a +pppp +qqqq +yyyy +yyyy +zzzz +cache index t1 in unknown_key_cache; +ERROR HY000: Unknown key cache 'unknown_key_cache' +cache index t1 key (unknown_key) in keycache1; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache error Key column 'unknown_key' doesn't exist in table +test.t1 assign_to_keycache status Operation failed +select @@keycache2.key_buffer_size; +@@keycache2.key_buffer_size +4194304 +select @@keycache2.key_cache_block_size; +@@keycache2.key_cache_block_size +1024 +set global keycache2.key_buffer_size=0; +select @@keycache2.key_buffer_size; +@@keycache2.key_buffer_size +0 +select @@keycache2.key_cache_block_size; +@@keycache2.key_cache_block_size +1024 +set global keycache2.key_buffer_size=1024*1024; +select @@keycache2.key_buffer_size; +@@keycache2.key_buffer_size +1048576 +update t2 set p=4000 where a='zzzz'; +update t1 set p=p+1; +set global keycache1.key_buffer_size=0; +select * from t2; +p i a +1001 2 qqqq +2 2 pppp +3 2 yyyy +4000 3 zzzz +2000 3 yyyy +select p from t2; +p +2 +3 +1001 +2000 +4000 +explain select i from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k1 5 NULL 5 Using index +select i from t2; +i +2 +2 +2 +3 +3 +explain select a from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k2 11 NULL 5 Using index +select a from t2; +a +pppp +qqqq +yyyy +yyyy +zzzz +select * from t1; +p a +3 qqqq +12 yyyy +select p from t1; +p +3 +12 +create table t3 (like t1); +cache index t3 in small; +Table Op Msg_type Msg_text +test.t3 assign_to_keycache status OK +insert into t3 select * from t1; +cache index t3 in keycache2; +Table Op Msg_type Msg_text +test.t3 assign_to_keycache status OK +cache index t1,t2 in default; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +test.t2 assign_to_keycache status OK +drop table t1,t2,t3; +show status like 'key_blocks_used'; +Variable_name Value +Key_blocks_used 4 +show status like 'key_blocks_unused'; +Variable_name Value +Key_blocks_unused KEY_BLOCKS_UNUSED +set global keycache2.key_buffer_size=0; +set global keycache3.key_buffer_size=100; +set global keycache3.key_buffer_size=0; diff --git a/mysql-test/r/key_diff.result b/mysql-test/r/key_diff.result index 2d4bc19474f..c3f4f743967 100644 --- a/mysql-test/r/key_diff.result +++ b/mysql-test/r/key_diff.result @@ -34,9 +34,9 @@ C c a a D E a a a a a a explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B; -table type possible_keys key key_len ref rows Extra -t1 ALL a NULL NULL NULL 5 -t2 ALL b NULL NULL NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a NULL NULL NULL 5 +1 SIMPLE t2 ALL b NULL NULL NULL 4 Using where select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a; a b a b A B a a diff --git a/mysql-test/r/key_primary.result b/mysql-test/r/key_primary.result index 87289f1cf54..7726a8e1d63 100644 --- a/mysql-test/r/key_primary.result +++ b/mysql-test/r/key_primary.result @@ -12,9 +12,9 @@ select * from t1 where t1 like "a_\%"; t1 AB% describe select * from t1 where t1="ABC"; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 3 const 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 3 const 1 Using index describe select * from t1 where t1="ABCD"; -Comment -Impossible WHERE noticed after reading const tables +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result index 2ca36425841..c218379110f 100644 --- a/mysql-test/r/keywords.result +++ b/mysql-test/r/keywords.result @@ -3,7 +3,7 @@ create table t1 (time time, date date, timestamp timestamp); insert into t1 values ("12:22:22","97:02:03","1997-01-02"); select * from t1; time date timestamp -12:22:22 1997-02-03 19970102000000 +12:22:22 1997-02-03 1997-01-02 00:00:00 select t1.time+0,t1.date+0,t1.timestamp+0,concat(date," ",time) from t1; t1.time+0 t1.date+0 t1.timestamp+0 concat(date," ",time) 122222 19970203 19970102000000 1997-02-03 12:22:22 diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 1730d7b5c25..c0baabcc507 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -1,6 +1,13 @@ drop table if exists t1; create table t1 (a date, b date, c date not null, d date); load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; SELECT * from t1; a b c d @@ -10,6 +17,11 @@ a b c d 2003-03-03 2003-03-03 2003-03-03 NULL truncate table t1; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 SELECT * from t1; a b c d NULL NULL 0000-00-00 0000-00-00 @@ -18,6 +30,8 @@ NULL 2003-03-03 2003-03-03 NULL drop table t1; create table t1 (a text, b text); load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +Warnings: +Warning 1261 Row 3 doesn't contain data for all columns select concat('|',a,'|'), concat('|',b,'|') from t1; concat('|',a,'|') concat('|',b,'|') |Field A| |Field B| @@ -28,6 +42,11 @@ Field 3,'Field 4| drop table t1; create table t1 (a int, b char(10)); load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1262 Row 5 was truncated; it contained more data than there were input columns select * from t1; a b 1 row 1 @@ -37,6 +56,9 @@ a b 0 1234567890 truncate table t1; load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +Warnings: +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1261 Row 4 doesn't contain data for all columns select * from t1; a b 1 row 1 diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 31a18fe6cec..429bc5ed352 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -1,5 +1,5 @@ drop table if exists t1,t2; -CREATE TABLE t1 ( `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY (`id`,`id2`), KEY `index_id3` (`id3`)) TYPE=MyISAM; +CREATE TABLE t1 ( `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY (`id`,`id2`), KEY `index_id3` (`id3`)) ENGINE=MyISAM; insert into t1 (id,id2) values (1,1),(1,2),(1,3); LOCK TABLE t1 WRITE; select dummy1,count(distinct id) from t1 group by dummy1; @@ -8,9 +8,9 @@ NULL 1 update t1 set id=-1 where id=1; LOCK TABLE t1 READ; update t1 set id=1 where id=1; -Table 't1' was locked with a READ lock and can't be updated +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated create table t2 SELECT * from t1; -Table 't2' was not locked with LOCK TABLES +ERROR HY000: Table 't2' was not locked with LOCK TABLES create temporary table t2 SELECT * from t1; drop table if exists t2; unlock tables; @@ -23,11 +23,11 @@ CREATE TABLE t1 ( index1 smallint(6) default NULL, nr smallint(6) default NULL, KEY index1(index1) -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( nr smallint(6) default NULL, name varchar(20) default NULL -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'item1'); INSERT INTO t2 VALUES (2,'item2'); lock tables t1 write, t2 read; @@ -42,7 +42,7 @@ check table t2; Table Op Msg_type Msg_text test.t2 check error Table 't2' was not locked with LOCK TABLES insert into t1 select nr from t1; -Table 't1' was not locked with LOCK TABLES +ERROR HY000: Table 't1' was not locked with LOCK TABLES unlock tables; lock tables t1 write, t1 as t1_alias read; insert into t1 select index1,nr from t1 as t1_alias; diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index b808fca0acf..a0efce727d3 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -22,5 +22,5 @@ create table t2 (a int); lock table t1 write, t2 write; insert t1 select * from t2; drop table t2; -Table 'test.t2' doesn't exist +ERROR 42S02: Table 'test.t2' doesn't exist drop table t1; diff --git a/mysql-test/r/lock_tables_lost_commit.result b/mysql-test/r/lock_tables_lost_commit.result index ccf56793f45..22885d93d40 100644 --- a/mysql-test/r/lock_tables_lost_commit.result +++ b/mysql-test/r/lock_tables_lost_commit.result @@ -1,5 +1,5 @@ drop table if exists t1; -create table t1(a int) type=innodb; +create table t1(a int) engine=innodb; lock tables t1 write; insert into t1 values(10); select * from t1; diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result index 43d24b1ab17..a30ec0f160c 100644 --- a/mysql-test/r/lowercase_table.result +++ b/mysql-test/r/lowercase_table.result @@ -1,4 +1,5 @@ -drop table if exists t1,t2,t3,t4,T1; +drop table if exists t1,t2,t3,t4; +drop table if exists t0,t5,t6,t7,t8,t9; drop database if exists mysqltest; create table T1 (id int primary key, Word varchar(40) not null, Index(Word)); create table t4 (id int primary key, Word varchar(40) not null); @@ -19,7 +20,8 @@ SELECT * from t1 left join t4 on (test.t1.id= TEST.t4.id) where TEST.t1.id >= te id Word id Word 1 a 1 match SELECT T2.id from t1 as t2 LIMIT 1; -Unknown table 'T2' in field list +id +1 RENAME TABLE T1 TO T2; ALTER TABLE T2 ADD new_col int not null; ALTER TABLE T2 RENAME T3; @@ -36,9 +38,11 @@ select count(*) from t1; count(*) 0 select count(T1.a) from t1; -Unknown table 'T1' in field list +count(T1.a) +0 select count(bags.a) from t1 as Bags; -Unknown table 'bags' in field list +count(bags.a) +0 drop table t1; create database mysqltest; use MYSQLTEST; @@ -46,7 +50,7 @@ create table t1 (a int); select T1.a from MYSQLTEST.T1; a select t1.a from MYSQLTEST.T1; -Unknown table 't1' in field list +a select mysqltest.t1.* from MYSQLTEST.t1; a select MYSQLTEST.t1.* from MYSQLTEST.t1; @@ -59,3 +63,20 @@ alter table t1 rename to T1; select MYSQLTEST.t1.* from MYSQLTEST.t1; a drop database mysqltest; +use test; +create table t1 (a int); +create table t2 (a int); +delete p1.*,P2.* from t1 as p1, t2 as p2 where p1.a=P2.a; +delete P1.*,p2.* from t1 as P1, t2 as P2 where P1.a=p2.a; +update t1 as p1, t2 as p2 SET p1.a=1,P2.a=1 where p1.a=P2.a; +update t1 as P1, t2 as P2 SET P1.a=1,p2.a=1 where P1.a=p2.a; +drop table t1,t2; +create table t1 (a int); +create table t2 (a int); +select * from t1 c, t2 C; +ERROR 42000: Not unique table/alias: 'C' +select C.a, c.a from t1 c, t2 C; +ERROR 42000: Not unique table/alias: 'C' +drop table t1, t2; +show tables; +Tables_in_test diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index 929cedb2ee3..3be73f6cc6a 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -13,7 +13,7 @@ SHOW CREATE TABLE T1; Table Create Table T1 CREATE TABLE `T1` ( `a` int(11) default NULL -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 RENAME TABLE T1 TO T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) @@ -68,7 +68,7 @@ SHOW CREATE TABLE T1; Table Create Table T1 CREATE TABLE `T1` ( `a` int(11) default NULL -) TYPE=InnoDB +) ENGINE=InnoDB DEFAULT CHARSET=latin1 RENAME TABLE T1 TO T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index 362d17e0461..a645e46be9e 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -4,7 +4,7 @@ SELECT * from T1; a drop table t1; flush tables; -CREATE TABLE t1 (a int) type=INNODB; +CREATE TABLE t1 (a int) ENGINE=INNODB; SELECT * from T1; -Can't open file: 'T1.InnoDB'. (errno: 1) +ERROR HY000: Can't open file: 'T1.InnoDB' (errno: 1) drop table t1; diff --git a/mysql-test/r/lowercase_table_qcache.result b/mysql-test/r/lowercase_table_qcache.result new file mode 100644 index 00000000000..f8d34e0f592 --- /dev/null +++ b/mysql-test/r/lowercase_table_qcache.result @@ -0,0 +1,24 @@ +set GLOBAL query_cache_size=1355776; +drop database if exists MySQLtesT; +create database MySQLtesT; +create table MySQLtesT.t1 (a int); +select * from MySQLtesT.t1; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +drop database mysqltest; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +use MySQL; +select * from db; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +use test; +select * from MySQL.db; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +set GLOBAL query_cache_size=0; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 3585b8b0018..2f4f0071fa7 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -1,9 +1,10 @@ drop table if exists t1,t2,t3,t4,t5,t6; +drop database if exists mysqltest; create table t1 (a int not null primary key auto_increment, message char(20)); create table t2 (a int not null primary key auto_increment, message char(20)); INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1"); INSERT INTO t2 (message) VALUES ("Testing"),("table"),("t2"); -create table t3 (a int not null, b char(20), key(a)) type=MERGE UNION=(t1,t2); +create table t3 (a int not null, b char(20), key(a)) engine=MERGE UNION=(t1,t2); select * from t3; a b 1 Testing @@ -32,13 +33,13 @@ insert into t2 select NULL,message from t1; insert into t1 select NULL,message from t2; insert into t2 select NULL,message from t1; insert into t1 select NULL,message from t2; -create table t3 (a int not null, b char(20), key(a)) type=MERGE UNION=(test.t1,test.t2); +create table t3 (a int not null, b char(20), key(a)) engine=MERGE UNION=(test.t1,test.t2); explain select * from t3 where a < 10; -table type possible_keys key key_len ref rows Extra -t3 range a a 4 NULL 18 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range a a 4 NULL 18 Using where explain select * from t3 where a > 10 and a < 20; -table type possible_keys key key_len ref rows Extra -t3 range a a 4 NULL 16 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 range a a 4 NULL 16 Using where select * from t3 where a = 10; a b 10 Testing @@ -84,8 +85,8 @@ a b 19 Testing 19 Testing explain select a from t3 order by a desc limit 10; -table type possible_keys key key_len ref rows Extra -t3 index NULL a 4 NULL 1131 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index NULL a 4 NULL 1131 Using index select a from t3 order by a desc limit 10; a 699 @@ -174,16 +175,29 @@ t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL default '0', `b` char(20) default NULL, KEY `a` (`a`) -) TYPE=MRG_MyISAM UNION=(t1,t2) -create table t4 (a int not null, b char(10), key(a)) type=MERGE UNION=(t1,t2); +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) +create table t4 (a int not null, b char(10), key(a)) engine=MERGE UNION=(t1,t2); select * from t4; -Can't open file: 't4.MRG'. (errno: 143) -create table t5 (a int not null, b char(10), key(a)) type=MERGE UNION=(test.t1,test_2.t2); -Incorrect table definition; All MERGE tables must be in the same database -drop table if exists t5,t4,t3,t1,t2; -create table t1 (c char(10)) type=myisam; -create table t2 (c char(10)) type=myisam; -create table t3 (c char(10)) union=(t1,t2) type=merge; +ERROR HY000: Can't open file: 't4.MRG' (errno: 143) +alter table t4 add column c int; +ERROR HY000: Can't open file: 't4.MRG' (errno: 143) +create database mysqltest; +create table mysqltest.t6 (a int not null primary key auto_increment, message char(20)); +create table t5 (a int not null, b char(20), key(a)) engine=MERGE UNION=(test.t1,mysqltest.t6); +show create table t5; +Table Create Table +t5 CREATE TABLE `t5` ( + `a` int(11) NOT NULL default '0', + `b` char(20) default NULL, + KEY `a` (`a`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`mysqltest`.`t6`) +alter table t5 engine=myisam; +drop table t5, mysqltest.t6; +drop database mysqltest; +drop table t4,t3,t1,t2; +create table t1 (c char(10)) engine=myisam; +create table t2 (c char(10)) engine=myisam; +create table t3 (c char(10)) union=(t1,t2) engine=merge; insert into t1 (c) values ('test1'); insert into t1 (c) values ('test1'); insert into t1 (c) values ('test1'); @@ -215,7 +229,7 @@ drop table t3,t2,t1; CREATE TABLE t1 (incr int not null, othr int not null, primary key(incr)); CREATE TABLE t2 (incr int not null, othr int not null, primary key(incr)); CREATE TABLE t3 (incr int not null, othr int not null, primary key(incr)) -TYPE=MERGE UNION=(t1,t2); +ENGINE=MERGE UNION=(t1,t2); SELECT * from t3; incr othr INSERT INTO t1 VALUES ( 1,10),( 3,53),( 5,21),( 7,12),( 9,17); @@ -236,36 +250,35 @@ alter table t3 UNION=(t1,t2); select count(*) from t3; count(*) 20 -alter table t3 TYPE=MYISAM; +alter table t3 ENGINE=MYISAM; select count(*) from t3; count(*) 20 drop table t3; CREATE TABLE t3 (incr int not null, othr int not null, primary key(incr)) -TYPE=MERGE UNION=(t1,t2); +ENGINE=MERGE UNION=(t1,t2); show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `incr` int(11) NOT NULL default '0', `othr` int(11) NOT NULL default '0', PRIMARY KEY (`incr`) -) TYPE=MRG_MyISAM UNION=(t1,t2) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) alter table t3 drop primary key; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `incr` int(11) NOT NULL default '0', `othr` int(11) NOT NULL default '0' -) TYPE=MRG_MyISAM UNION=(t1,t2) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) drop table t3,t2,t1; -create table t1 (a int not null, key(a)) type=merge; +create table t1 (a int not null, key(a)) engine=merge; select * from t1; a drop table t1; -drop table if exists t3, t2, t1; create table t1 (a int not null, b int not null, key(a,b)); create table t2 (a int not null, b int not null, key(a,b)); -create table t3 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2); +create table t3 (a int not null, b int not null, key(a,b)) ENGINE=MERGE UNION=(t1,t2); insert into t1 values (1,2),(2,1),(0,0),(4,4),(5,5),(6,6); insert into t2 values (1,1),(2,2),(0,0),(4,4),(5,5),(6,6); flush tables; @@ -274,41 +287,40 @@ a b 1 1 1 2 drop table t3,t1,t2; -drop table if exists t6, t5, t4, t3, t2, t1; create table t1 (a int not null, b int not null auto_increment, primary key(a,b)); create table t2 (a int not null, b int not null auto_increment, primary key(a,b)); create table t3 (a int not null, b int not null, key(a,b)) UNION=(t1,t2) INSERT_METHOD=NO; -create table t4 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=NO; -create table t5 (a int not null, b int not null auto_increment, primary key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST; -create table t6 (a int not null, b int not null auto_increment, primary key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST; +create table t4 (a int not null, b int not null, key(a,b)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=NO; +create table t5 (a int not null, b int not null auto_increment, primary key(a,b)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST; +create table t6 (a int not null, b int not null auto_increment, primary key(a,b)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table t4; Table Create Table t4 CREATE TABLE `t4` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MRG_MyISAM UNION=(t1,t2) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) show create table t5; Table Create Table t5 CREATE TABLE `t5` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL auto_increment, PRIMARY KEY (`a`,`b`) -) TYPE=MRG_MyISAM INSERT_METHOD=FIRST UNION=(t1,t2) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`,`t2`) show create table t6; Table Create Table t6 CREATE TABLE `t6` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL auto_increment, PRIMARY KEY (`a`,`b`) -) TYPE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1,t2) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) insert into t1 values (1,NULL),(1,NULL),(1,NULL),(1,NULL); insert into t2 values (2,NULL),(2,NULL),(2,NULL),(2,NULL); select * from t3 order by b,a limit 3; @@ -373,7 +385,7 @@ t4 CREATE TABLE `t4` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MRG_MyISAM UNION=(t1,t2,t3) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`,`t3`) select * from t4 order by a,b; a b 1 1 @@ -399,7 +411,7 @@ t4 CREATE TABLE `t4` ( `a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', KEY `a` (`a`,`b`) -) TYPE=MRG_MyISAM INSERT_METHOD=FIRST UNION=(t1,t2,t3) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`,`t2`,`t3`) insert into t4 values (4,1),(4,2); select * from t1 order by a,b; a b @@ -528,25 +540,46 @@ a b 6 1 6 2 6 3 -drop table if exists t6, t5, t4, t3, t2, t1; -CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM; +insert into t1 values (99,NULL); +select * from t4 where a+0 > 90; +a b +99 1 +insert t5 values (1,1); +ERROR 23000: Duplicate entry '1-1' for key 1 +insert t6 values (2,1); +ERROR 23000: Duplicate entry '2-1' for key 1 +insert t5 values (1,1) on duplicate key update b=b+10; +insert t6 values (2,1) on duplicate key update b=b+20; +select * from t5 where a < 3; +a b +1 2 +1 3 +1 4 +1 5 +1 11 +2 2 +2 3 +2 4 +2 5 +2 21 +drop table t6, t5, t4, t3, t2, t1; +CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1), (2,1); -CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM; +CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,2), (2,2); -CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2); -select max(b) from t where a = 2; +CREATE TABLE t3 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) ENGINE=MRG_MyISAM UNION=(t1,t2); +select max(b) from t3 where a = 2; max(b) 2 select max(b) from t1 where a = 2; max(b) 1 -drop table if exists t,t1,t2; -drop table if exists t1, t2, t3, t4, t5, t6; +drop table t3,t1,t2; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); insert into t2 values (2); -create temporary table t3 (a int not null) TYPE=MERGE UNION=(t1,t2); +create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); select * from t3; a 1 @@ -555,20 +588,19 @@ create temporary table t4 (a int not null); create temporary table t5 (a int not null); insert into t4 values (1); insert into t5 values (2); -create temporary table t6 (a int not null) TYPE=MERGE UNION=(t4,t5); +create temporary table t6 (a int not null) ENGINE=MERGE UNION=(t4,t5); select * from t6; a 1 2 -drop table if exists t6, t5, t4, t3, t2, t1; -DROP TABLE IF EXISTS t1, t2; +drop table t6, t3, t1, t2, t4, t5; CREATE TABLE t1 ( fileset_id tinyint(3) unsigned NOT NULL default '0', file_code varchar(32) NOT NULL default '', fileset_root_id tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (fileset_id,file_code), KEY files (fileset_id,fileset_root_id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (2, '0000000111', 1), (2, '0000000112', 1), (2, '0000000113', 1), (2, '0000000114', 1), (2, '0000000115', 1), (2, '0000000116', 1), (2, '0000000117', 1), (2, '0000000118', 1), (2, '0000000119', 1), (2, '0000000120', 1); @@ -578,27 +610,27 @@ file_code varchar(32) NOT NULL default '', fileset_root_id tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (fileset_id,file_code), KEY files (fileset_id,fileset_root_id) -) TYPE=MRG_MyISAM UNION=(t1); +) ENGINE=MRG_MyISAM UNION=(t1); EXPLAIN SELECT * FROM t2 IGNORE INDEX (files) WHERE fileset_id = 2 AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; -table type possible_keys key key_len ref rows Extra -t2 range PRIMARY PRIMARY 33 NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range PRIMARY PRIMARY 33 NULL 5 Using where EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; -table type possible_keys key key_len ref rows Extra -t2 range PRIMARY,files PRIMARY 33 NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range PRIMARY,files PRIMARY 33 NULL 5 Using where EXPLAIN SELECT * FROM t1 WHERE fileset_id = 2 AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; -table type possible_keys key key_len ref rows Extra -t1 range PRIMARY,files PRIMARY 33 NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,files PRIMARY 33 NULL 5 Using where EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 AND file_code = '0000000115' LIMIT 1; -table type possible_keys key key_len ref rows Extra -t2 const PRIMARY,files PRIMARY 33 const,const 1 -DROP TABLE IF EXISTS t1, t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const PRIMARY,files PRIMARY 33 const,const 1 +DROP TABLE t2, t1; create table t1 (x int, y int, index xy(x, y)); create table t2 (x int, y int, index xy(x, y)); -create table t3 (x int, y int, index xy(x, y)) type=merge union=(t1,t2); +create table t3 (x int, y int, index xy(x, y)) engine=merge union=(t1,t2); insert into t1 values(1, 2); insert into t2 values(1, 3); select * from t3 where x = 1 and y < 5 order by y; diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result new file mode 100644 index 00000000000..ced3ca61f80 --- /dev/null +++ b/mysql-test/r/metadata.result @@ -0,0 +1,62 @@ +drop table if exists t1,t2; +select 1, 1.0, -1, "hello", NULL; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def 1 8 1 1 N 32769 0 8 +def 1.0 5 3 3 N 32769 1 8 +def -1 8 1 2 N 32769 0 8 +def hello 254 5 5 N 1 31 8 +def NULL 6 0 0 Y 32768 0 8 +1 1.0 -1 hello NULL +1 1.0 -1 hello NULL +create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10)); +select * from t1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 a a 1 4 0 Y 32768 0 63 +def test t1 t1 b b 2 6 0 Y 32768 0 63 +def test t1 t1 c c 9 9 0 Y 32768 0 63 +def test t1 t1 d d 3 11 0 Y 32768 0 63 +def test t1 t1 e e 8 20 0 Y 32768 0 63 +def test t1 t1 f f 4 3 0 Y 32768 2 63 +def test t1 t1 g g 5 4 0 Y 32768 3 63 +def test t1 t1 h h 0 7 0 Y 32768 4 63 +def test t1 t1 i i 13 4 0 Y 32864 0 63 +def test t1 t1 j j 10 10 0 Y 128 0 63 +def test t1 t1 k k 7 19 0 N 1249 0 63 +def test t1 t1 l l 12 19 0 Y 128 0 63 +def test t1 t1 m m 254 1 0 Y 256 0 8 +def test t1 t1 n n 254 3 0 Y 2048 0 8 +def test t1 t1 o o 254 10 0 Y 0 0 8 +a b c d e f g h i j k l m n o +select a b, b c from t1 as t2; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t2 a b 1 4 0 Y 32768 0 63 +def test t1 t2 b c 2 6 0 Y 32768 0 63 +b c +drop table t1; +CREATE TABLE t1 (id tinyint(3) default NULL, data varchar(255) default NULL); +INSERT INTO t1 VALUES (1,'male'),(2,'female'); +CREATE TABLE t2 (id tinyint(3) unsigned default NULL, data char(3) default '0'); +INSERT INTO t2 VALUES (1,'yes'),(2,'no'); +select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 id id 1 3 1 Y 32768 0 63 +def test t1 t1 data data 253 255 6 Y 0 0 8 +def test t2 t2 data data 254 3 3 Y 0 0 8 +id data data +1 male yes +2 female no +select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 id id 1 3 1 Y 32768 0 63 +def test t1 t1 data data 253 255 6 Y 0 0 8 +def test t2 t2 data data 254 3 3 Y 0 0 8 +id data data +1 male yes +2 female no +select t1.id from t1 union select t2.id from t2; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 id id 1 3 1 Y 32768 0 63 +id +1 +2 +drop table t1,t2; diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result index 7b266544c92..54d99d5609e 100644 --- a/mysql-test/r/mix_innodb_myisam_binlog.result +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -1,6 +1,6 @@ drop table if exists t1, t2; -create table t1 (a int) type=innodb; -create table t2 (a int) type=myisam; +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=myisam; reset master; begin; insert into t1 values(1); @@ -8,10 +8,10 @@ insert into t2 select * from t1; commit; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(1) -master-bin.001 178 Query 1 79 use `test`; insert into t2 select * from t1 -master-bin.001 244 Query 1 244 use `test`; COMMIT +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(1) +master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 244 Query 1 244 use `test`; COMMIT delete from t1; delete from t2; reset master; @@ -19,13 +19,14 @@ begin; insert into t1 values(2); insert into t2 select * from t1; rollback; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(2) -master-bin.001 178 Query 1 79 use `test`; insert into t2 select * from t1 -master-bin.001 244 Query 1 244 use `test`; ROLLBACK +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(2) +master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 244 Query 1 244 use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -35,17 +36,18 @@ savepoint my_savepoint; insert into t1 values(4); insert into t2 select * from t1; rollback to savepoint my_savepoint; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(3) -master-bin.001 178 Query 1 79 use `test`; savepoint my_savepoint -master-bin.001 235 Query 1 79 use `test`; insert into t1 values(4) -master-bin.001 294 Query 1 79 use `test`; insert into t2 select * from t1 -master-bin.001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint -master-bin.001 429 Query 1 429 use `test`; COMMIT +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(3) +master-bin.000001 178 Query 1 79 use `test`; savepoint my_savepoint +master-bin.000001 235 Query 1 79 use `test`; insert into t1 values(4) +master-bin.000001 294 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint +master-bin.000001 429 Query 1 429 use `test`; COMMIT delete from t1; delete from t2; reset master; @@ -55,7 +57,8 @@ savepoint my_savepoint; insert into t1 values(6); insert into t2 select * from t1; rollback to savepoint my_savepoint; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back insert into t1 values(7); commit; select a from t1 order by a; @@ -64,14 +67,14 @@ a 7 show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(5) -master-bin.001 178 Query 1 79 use `test`; savepoint my_savepoint -master-bin.001 235 Query 1 79 use `test`; insert into t1 values(6) -master-bin.001 294 Query 1 79 use `test`; insert into t2 select * from t1 -master-bin.001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint -master-bin.001 429 Query 1 79 use `test`; insert into t1 values(7) -master-bin.001 488 Query 1 488 use `test`; COMMIT +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(5) +master-bin.000001 178 Query 1 79 use `test`; savepoint my_savepoint +master-bin.000001 235 Query 1 79 use `test`; insert into t1 values(6) +master-bin.000001 294 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint +master-bin.000001 429 Query 1 79 use `test`; insert into t1 values(7) +master-bin.000001 488 Query 1 488 use `test`; COMMIT delete from t1; delete from t2; reset master; @@ -86,10 +89,10 @@ get_lock("a",10) 1 show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(8) -master-bin.001 178 Query 1 79 use `test`; insert into t2 select * from t1 -master-bin.001 244 Query 1 244 use `test`; ROLLBACK +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(8) +master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 244 Query 1 244 use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -97,8 +100,8 @@ insert into t1 values(9); insert into t2 select * from t1; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; insert into t1 values(9) -master-bin.001 138 Query 1 138 use `test`; insert into t2 select * from t1 +master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(9) +master-bin.000001 138 Query 1 138 use `test`; insert into t2 select * from t1 delete from t1; delete from t2; reset master; @@ -107,18 +110,18 @@ begin; insert into t2 select * from t1; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; insert into t1 values(10) -master-bin.001 139 Query 1 139 use `test`; insert into t2 select * from t1 +master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(10) +master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1 insert into t1 values(11); commit; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; insert into t1 values(10) -master-bin.001 139 Query 1 139 use `test`; insert into t2 select * from t1 -master-bin.001 205 Query 1 205 use `test`; BEGIN -master-bin.001 245 Query 1 205 use `test`; insert into t1 values(11) -master-bin.001 305 Query 1 305 use `test`; COMMIT -alter table t2 type=INNODB; +master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(10) +master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1 +master-bin.000001 205 Query 1 205 use `test`; BEGIN +master-bin.000001 245 Query 1 205 use `test`; insert into t1 values(11) +master-bin.000001 305 Query 1 305 use `test`; COMMIT +alter table t2 engine=INNODB; delete from t1; delete from t2; reset master; @@ -128,10 +131,10 @@ insert into t2 select * from t1; commit; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(12) -master-bin.001 179 Query 1 79 use `test`; insert into t2 select * from t1 -master-bin.001 245 Query 1 245 use `test`; COMMIT +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(12) +master-bin.000001 179 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 245 Query 1 245 use `test`; COMMIT delete from t1; delete from t2; reset master; @@ -153,9 +156,9 @@ rollback to savepoint my_savepoint; commit; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(14) -master-bin.001 179 Query 1 179 use `test`; COMMIT +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(14) +master-bin.000001 179 Query 1 179 use `test`; COMMIT delete from t1; delete from t2; reset master; @@ -173,8 +176,8 @@ a 18 show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; BEGIN -master-bin.001 119 Query 1 79 use `test`; insert into t1 values(16) -master-bin.001 179 Query 1 79 use `test`; insert into t1 values(18) -master-bin.001 239 Query 1 239 use `test`; COMMIT +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(16) +master-bin.000001 179 Query 1 79 use `test`; insert into t1 values(18) +master-bin.000001 239 Query 1 239 use `test`; COMMIT drop table t1,t2; diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result new file mode 100644 index 00000000000..4451b0a355e --- /dev/null +++ b/mysql-test/r/multi_statement.result @@ -0,0 +1,33 @@ +select 1; +1 +1 +select 2; +select 3; +select 4|||| +2 +2 +3 +3 +4 +4 +select 5; +select 6; +select 50, 'abc';'abcd' +5 +5 +6 +6 +50 abc +50 abc +select "abcd'";'abcd' +abcd' +abcd' +select "'abcd";'abcd' +'abcd +'abcd +select 5'abcd' +5 +5 +select 'finish'; +finish +finish diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 12cb965f045..39ec9ff4eb9 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3; +drop database if exists mysqltest; create table t1(id1 int not null auto_increment primary key, t char(12)); create table t2(id2 int not null, t char(12)); create table t3(id3 int not null, t char(12), index(id3)); @@ -74,19 +75,19 @@ CREATE TABLE t1 ( id int(11) NOT NULL default '0', name varchar(10) default NULL, PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'aaa'),(2,'aaa'),(3,'aaa'); CREATE TABLE t2 ( id int(11) NOT NULL default '0', name varchar(10) default NULL, PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES (2,'bbb'),(3,'bbb'),(4,'bbb'); CREATE TABLE t3 ( id int(11) NOT NULL default '0', mydate datetime default NULL, PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t3 VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22 00:00:00'),(7,'2002-07-22 00:00:00'); delete t1,t2,t3 from t1,t2,t3 where to_days(now())-to_days(t3.mydate)>=30 and t3.id=t1.id and t3.id=t2.id; @@ -96,13 +97,13 @@ id mydate 5 2002-05-12 00:00:00 6 2002-06-22 00:00:00 7 2002-07-22 00:00:00 -DROP TABLE IF EXISTS t1,t2,t3; +DROP TABLE t1,t2,t3; CREATE TABLE IF NOT EXISTS `t1` ( `id` int(11) NOT NULL auto_increment, `tst` text, `tst1` text, PRIMARY KEY (`id`) -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `t2` ( `ID` int(11) NOT NULL auto_increment, `ParId` int(11) default NULL, @@ -111,7 +112,7 @@ CREATE TABLE IF NOT EXISTS `t2` ( PRIMARY KEY (`ID`), KEY `IX_ParId_t2` (`ParId`), FOREIGN KEY (`ParId`) REFERENCES `t1` (`id`) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1(tst,tst1) VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE"); INSERT INTO t2(ParId) VALUES(1), (2), (3); select * from t2; @@ -125,7 +126,7 @@ ID ParId tst tst1 1 1 MySQL MySQL AB 2 2 MSSQL Microsoft 3 3 ORACLE ORACLE -drop table if exists t1, t2 ; +drop table t1, t2 ; create table t1 (n numeric(10)); create table t2 (n numeric(10)); insert into t2 values (1),(2),(4),(8),(16),(32); @@ -147,11 +148,11 @@ insert into t1 values(1,1); insert into t2 values(1,10),(2,20); LOCK TABLES t1 write, t2 read; DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n; -Table 't2' was locked with a READ lock and can't be updated +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; -Table 't2' was locked with a READ lock and can't be updated +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; -Table 't2' was locked with a READ lock and can't be updated +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated unlock tables; LOCK TABLES t1 write, t2 write; UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; @@ -172,7 +173,7 @@ create table t2 (n int(10), d int(10)); insert into t1 values(1,1); insert into t2 values(1,10),(2,20); UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column set sql_safe_updates=0; drop table t1,t2; set timestamp=1038401397; @@ -190,7 +191,7 @@ n d unix_timestamp(t) 1 10 1038401397 2 20 1038401397 UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n; -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 '1=2 WHERE t1.n=t2.n' at line 1 +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 '1=2 WHERE t1.n=t2.n' at line 1 drop table t1,t2; set timestamp=0; set sql_safe_updates=0; @@ -235,17 +236,31 @@ select * from t2; n d 1 30 1 30 +UPDATE t1 a ,t2 b SET a.d=b.d,b.d=30 WHERE a.n=b.n; +select * from t1; +n d +1 30 +3 2 +select * from t2; +n d +1 30 +1 30 +DELETE a, b FROM t1 a,t2 b where a.n=b.n; +select * from t1; +n d +3 2 +select * from t2; +n d drop table t1,t2; -drop table if exists t1,t2,t3; -CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM; +CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'),(10,''),(11,''),(12,''),(13,''); -CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM; +CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'); -CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM; +CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=MyISAM; INSERT INTO t3 VALUES (1,'jedan'),(2,'dva'); update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj; update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj; -drop table if exists t1,t2,t3; +drop table t1,t2,t3; CREATE TABLE t1 (a int not null primary key, b int not null, key (b)); CREATE TABLE t2 (a int not null primary key, b int not null, key (b)); INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); @@ -309,8 +324,9 @@ a b 7 7 8 8 9 9 +update t1,t2 set t1.b=t2.b, t1.a=t2.a where t1.a=t2.a and not exists (select * from t2 where t2.a > 10); drop table t1,t2; -CREATE TABLE t3 ( KEY1 varchar(50) NOT NULL default '', PARAM_CORR_DISTANCE_RUSH double default NULL, PARAM_CORR_DISTANCE_GEM double default NULL, PARAM_AVG_TARE double default NULL, PARAM_AVG_NB_DAYS double default NULL, PARAM_DEFAULT_PROP_GEM_SRVC varchar(50) default NULL, PARAM_DEFAULT_PROP_GEM_NO_ETIK varchar(50) default NULL, PARAM_SCENARIO_COSTS varchar(50) default NULL, PARAM_DEFAULT_WAGON_COST double default NULL, tmp int(11) default NULL, PRIMARY KEY (KEY1)) TYPE=MyISAM; +CREATE TABLE t3 ( KEY1 varchar(50) NOT NULL default '', PARAM_CORR_DISTANCE_RUSH double default NULL, PARAM_CORR_DISTANCE_GEM double default NULL, PARAM_AVG_TARE double default NULL, PARAM_AVG_NB_DAYS double default NULL, PARAM_DEFAULT_PROP_GEM_SRVC varchar(50) default NULL, PARAM_DEFAULT_PROP_GEM_NO_ETIK varchar(50) default NULL, PARAM_SCENARIO_COSTS varchar(50) default NULL, PARAM_DEFAULT_WAGON_COST double default NULL, tmp int(11) default NULL, PRIMARY KEY (KEY1)) ENGINE=MyISAM; INSERT INTO t3 VALUES ('A',1,1,22,3.2,'R','R','BASE2',0.24,NULL); create table t1 (A varchar(1)); insert into t1 values ("A") ,("B"),("C"),("D"); @@ -337,7 +353,6 @@ a b 3 4 4 5 drop table t1; -drop table if exists t1, t2; create table t1(id1 smallint(5), field char(5)); create table t2(id2 smallint(5), field char(5)); insert into t1 values (1, 'a'), (2, 'aa'); @@ -360,31 +375,53 @@ where 0=1; delete t1, t2 from t2,t1 where t1.id1=t2.id2 and 0=1; drop table t1,t2; +create table t1 ( a int not null, b int not null) ; +alter table t1 add index i1(a); +delete from t1 where a > 2000000; +create table t2 like t1; +insert into t2 select * from t1; +select 't2 rows before small delete', count(*) from t1; +t2 rows before small delete count(*) +t2 rows before small delete 2000000 +delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2; +select 't2 rows after small delete', count(*) from t2; +t2 rows after small delete count(*) +t2 rows after small delete 1999999 +select 't1 rows after small delete', count(*) from t1; +t1 rows after small delete count(*) +t1 rows after small delete 1999999 +delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000; +select 't2 rows after big delete', count(*) from t2; +t2 rows after big delete count(*) +t2 rows after big delete 1900001 +select 't1 rows after big delete', count(*) from t1; +t1 rows after big delete count(*) +t1 rows after big delete 1900001 +drop table t1,t2; CREATE TABLE t1 ( a int ); CREATE TABLE t2 ( a int ); DELETE t1 FROM t1, t2 AS t3; DELETE t4 FROM t1, t1 AS t4; -Not unique table/alias: 't4' DELETE t3 FROM t1 AS t3, t1 AS t4; -Not unique table/alias: 't3' DELETE t1 FROM t1 AS t3, t2 AS t4; +ERROR 42S02: Unknown table 't1' in MULTI DELETE INSERT INTO t1 values (1),(2); INSERT INTO t2 values (1),(2); DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1; SELECT * from t1; a +1 2 SELECT * from t2; a -1 2 DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2; SELECT * from t1; a -2 +1 SELECT * from t2; a -1 +2 DROP TABLE t1,t2; create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); @@ -400,3 +437,21 @@ select * from t2; c2_id c2_p_id c2_note c2_active 1 1 A Note 1 drop table t1, t2; +create database mysqltest; +create table mysqltest.t1 (a int, b int, primary key (a)); +create table mysqltest.t2 (a int, b int, primary key (a)); +create table mysqltest.t3 (a int, b int, primary key (a)); +grant select on mysqltest.* to mysqltest_1@localhost; +grant update on mysqltest.t1 to mysqltest_1@localhost; +update t1, t2 set t1.b=1 where t1.a=t2.a; +update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a; +revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +delete from mysql.user where user=_binary'mysqltest_1'; +drop database mysqltest; +create table t1 (a int, primary key (a)); +create table t2 (a int, primary key (a)); +create table t3 (a int, primary key (a)); +delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a); +ERROR 42S02: Unknown table 't3' in MULTI DELETE +drop table t1, t2, t3; diff --git a/mysql-test/r/myisam-blob.result b/mysql-test/r/myisam-blob.result index 743d4dac254..43db7c8badd 100644 --- a/mysql-test/r/myisam-blob.result +++ b/mysql-test/r/myisam-blob.result @@ -24,4 +24,21 @@ delete from t1 where left(data,1)='c'; check table t1; Table Op Msg_type Msg_text test.t1 check status OK +INSERT INTO t1 set data=repeat('a',18*1024*1024); +select length(data) from t1; +length(data) +18874368 +alter table t1 modify data blob; +select length(data) from t1; +length(data) +0 +drop table t1; +CREATE TABLE t1 (data BLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1265 Data truncated for column 'data' at row 1 +select length(data) from t1; +length(data) +65535 drop table t1; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index c55bacdd371..26dcce43d08 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1,8 +1,9 @@ drop table if exists t1,t2; +SET SQL_WARNINGS=1; CREATE TABLE t1 ( STRING_DATA char(255) default NULL, -KEY STRING_DATA (STRING_DATA) -) TYPE=MyISAM; +KEY string_data (STRING_DATA) +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); INSERT INTO t1 VALUES ('DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD'); INSERT INTO t1 VALUES ('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'); @@ -48,32 +49,32 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par t1 0 PRIMARY 1 a A 5 NULL NULL BTREE t1 1 b 1 b A 1 NULL NULL BTREE drop table t1; -create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) type=myisam; +create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam; insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4); explain select * from t1 order by a; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort explain select * from t1 order by b; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort explain select * from t1 order by c; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort explain select a from t1 order by a; -table type possible_keys key key_len ref rows Extra -t1 index NULL PRIMARY 4 NULL 4 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index explain select b from t1 order by b; -table type possible_keys key key_len ref rows Extra -t1 index NULL b 4 NULL 4 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL 4 Using index explain select a,b from t1 order by b; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort explain select a,b from t1; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 explain select a,b,c from t1; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 drop table t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (2), (3); @@ -289,6 +290,12 @@ update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0; check table t1; Table Op Msg_type Msg_text test.t1 check status OK +delete from t1 where i8=1; +select i1,i2 from t1; +i1 i2 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK drop table t1; CREATE TABLE `t1` ( `post_id` mediumint(8) unsigned NOT NULL auto_increment, @@ -306,7 +313,7 @@ KEY `ip` (`ip`), KEY `poster_login` (`poster_login`), KEY `topic_id` (`topic_id`), FULLTEXT KEY `post_text` (`post_text`) -) TYPE=MyISAM; +) ENGINE=MyISAM; 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'); REPAIR TABLE t1; Table Op Msg_type Msg_text @@ -315,11 +322,11 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), KEY t1 (a, b, c)); -Specified key was too long. Max key length is 500 -CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255)); -ALTER TABLE t1 ADD INDEX t1 (a, b, c); -Specified key was too long. Max key length is 500 +CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e)); +ERROR 42000: Specified key was too long; max key length is 1000 bytes +CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255)); +ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e); +ERROR 42000: Specified key was too long; max key length is 1000 bytes DROP TABLE t1; CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)); INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4); @@ -337,31 +344,37 @@ t1 1 a 2 b A 5 NULL NULL YES BTREE t1 1 c_2 1 c A 5 NULL NULL YES BTREE t1 1 c_2 2 a A 5 NULL NULL BTREE explain select * from t1,t2 where t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t2 ALL a NULL NULL NULL 2 -t1 ALL a NULL NULL NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL a NULL NULL NULL 2 +1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where explain select * from t1,t2 force index(a) where t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t2 ALL a NULL NULL NULL 2 -t1 ALL a NULL NULL NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL a NULL NULL NULL 2 +1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t2 ALL a NULL NULL NULL 2 -t1 ref a a 4 t2.a 3 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL a NULL NULL NULL 2 +1 SIMPLE t1 ref a a 4 test.t2.a 3 explain select * from t1,t2 where t1.b=t2.b; -table type possible_keys key key_len ref rows Extra -t2 ALL b NULL NULL NULL 2 -t1 ref b b 5 t2.b 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL b NULL NULL NULL 2 +1 SIMPLE t1 ref b b 5 test.t2.b 1 Using where explain select * from t1,t2 force index(c) where t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 2 -t1 ALL a NULL NULL NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where explain select * from t1 where a=0 or a=2; -table type possible_keys key key_len ref rows Extra -t1 ALL a NULL NULL NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where explain select * from t1 force index (a) where a=0 or a=2; -table type possible_keys key key_len ref rows Extra -t1 range a a 4 NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 4 NULL 4 Using where +explain select * from t1 where c=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref c,c_2 c 5 const 1 Using where +explain select * from t1 use index() where c=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where drop table t1,t2; create table t1 (a int not null auto_increment primary key, b varchar(255)); insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100)); @@ -415,6 +428,38 @@ select * from t1 where a='807780' and b='477' and c='165'; a b c 807780 477 165 drop table t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)); +INSERT t1 VALUES ("can \tcan"); +INSERT t1 VALUES ("can can"); +INSERT t1 VALUES ("can"); +SELECT * FROM t1; +a +can can +can +can can +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +create table t1 (a blob); +insert into t1 values('a '),('a'); +select concat(a,'.') from t1 where a='a'; +concat(a,'.') +a. +select concat(a,'.') from t1 where a='a '; +concat(a,'.') +a . +alter table t1 add key(a(2)); +select concat(a,'.') from t1 where a='a'; +concat(a,'.') +a. +select concat(a,'.') from t1 where a='a '; +concat(a,'.') +a . +drop table t1; create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20))); insert into t1 (b) values ('a'),('a '),('a '); select concat(b,'.') from t1; @@ -424,7 +469,7 @@ a . a . update t1 set b='b ' where a=2; update t1 set b='b ' where a > 1; -Duplicate entry 'b ' for key 2 +ERROR 23000: Duplicate entry 'b ' for key 2 delete from t1 where b='b'; select a,concat(b,'.') from t1; a concat(b,'.') @@ -445,19 +490,66 @@ select sql_big_result distinct t1.a from t1,t2; a 1 explain select sql_big_result distinct t1.a from t1,t2 order by t2.a; -table type possible_keys key key_len ref rows Extra -t1 system NULL NULL NULL NULL 1 Using temporary -t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary +1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct explain select distinct t1.a from t1,t2 order by t2.a; -table type possible_keys key key_len ref rows Extra -t1 system NULL NULL NULL NULL 1 Using temporary -t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary +1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct +drop table t1,t2; +CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; +ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX' +create table t1 (a int, b varchar(200), c text not null) checksum=1; +create table t2 (a int, b varchar(200), c text not null) checksum=0; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +checksum table t1, t2, t3 quick; +Table Checksum +test.t1 968604391 +test.t2 NULL +test.t3 NULL +checksum table t1, t2, t3; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 NULL +checksum table t1, t2, t3 extended; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 NULL +drop table t1,t2; +create table t1 (a int, key (a)); +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A NULL NULL NULL YES BTREE +alter table t1 disable keys; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A NULL NULL NULL YES BTREE disabled +create table t2 (a int); +insert t1 select * from t2; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A NULL NULL NULL YES BTREE disabled +alter table t1 enable keys; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 1000 NULL NULL YES BTREE +alter table t1 engine=heap; +alter table t1 disable keys; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a NULL NULL NULL NULL YES HASH drop table t1,t2; create table t1 ( a tinytext, b char(1), index idx (a(1),b) ); insert into t1 values (null,''), (null,''); explain select count(*) from t1 where a is null; -table type possible_keys key key_len ref rows Extra -t1 ref idx idx 4 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref idx idx 4 const 1 Using where select count(*) from t1 where a is null; count(*) 2 diff --git a/mysql-test/r/mysql_protocols.result b/mysql-test/r/mysql_protocols.result new file mode 100644 index 00000000000..272e3bda6f0 --- /dev/null +++ b/mysql-test/r/mysql_protocols.result @@ -0,0 +1,9 @@ +<default> + ok +TCP + ok +SOCKET + ok +ERROR 2047: Wrong or unknown protocol +ERROR 2047: Wrong or unknown protocol +Unknown option to protocol: NullS diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 79bf46280dd..e88ece6b361 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -1,5 +1,5 @@ -drop table if exists t1,t2; set timestamp=1000000000; +drop table if exists t1,t2; create table t1 (word varchar(20)); create table t2 (id int auto_increment not null primary key); insert into t1 values ("abirvalg"); @@ -17,6 +17,8 @@ flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; +drop table if exists t1,t2; +SET TIMESTAMP=1000000000; create table t1 (word varchar(20)); SET TIMESTAMP=1000000000; create table t2 (id int auto_increment not null primary key); @@ -51,6 +53,8 @@ insert into t1 values ("Alas"); /*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; +drop table if exists t1,t2; +SET TIMESTAMP=1000000000; create table t1 (word varchar(20)); SET TIMESTAMP=1000000000; create table t2 (id int auto_increment not null primary key); @@ -64,9 +68,6 @@ LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-1' INTO TABLE `t1` FI LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); -LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-6-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); -SET TIMESTAMP=1000000000; -insert into t1 values ("Alas"); --- Broken LOAD DATA -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -83,4 +84,4 @@ SET INSERT_ID=1; use test; SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); -drop table t1; +drop table t1, t2; diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result new file mode 100644 index 00000000000..3c1b85e05a1 --- /dev/null +++ b/mysql-test/r/mysqlbinlog2.result @@ -0,0 +1,446 @@ +drop table if exists t1; +reset master; +set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22"); +set timestamp=@a; +create table t1 (a int auto_increment not null primary key, b char(3)); +insert into t1 values(null, "a"); +insert into t1 values(null, "b"); +set timestamp=@a+2; +insert into t1 values(null, "c"); +set timestamp=@a+4; +insert into t1 values(null, "d"); +insert into t1 values(null, "e"); +flush logs; +set timestamp=@a+1; +insert into t1 values(null, "f"); + +--- Local -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- offset -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=1; +use test; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- start-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- stop-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; + +--- start-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=3; +use test; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- stop-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); + +--- Local with 2 binlogs on command line -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- offset -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=1; +use test; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- start-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- stop-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; + +--- start-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=3; +use test; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- stop-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); + +--- Remote -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- offset -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=1; +use test; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- start-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- stop-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; + +--- start-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=3; +use test; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); + +--- stop-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); + +--- Remote with 2 binlogs on command line -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- offset -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=1; +use test; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- start-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- stop-position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; + +--- start-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET INSERT_ID=3; +use test; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +use test; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- stop-datetime -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); + +--- to-last-log -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +use test; +SET TIMESTAMP=1579609942; +create table t1 (a int auto_increment not null primary key, b char(3)); +SET INSERT_ID=1; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "a"); +SET INSERT_ID=2; +SET TIMESTAMP=1579609942; +insert into t1 values(null, "b"); +SET INSERT_ID=3; +SET TIMESTAMP=1579609944; +insert into t1 values(null, "c"); +SET INSERT_ID=4; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "d"); +SET INSERT_ID=5; +SET TIMESTAMP=1579609946; +insert into t1 values(null, "e"); +SET INSERT_ID=6; +SET TIMESTAMP=1579609943; +insert into t1 values(null, "f"); + +--- end of test -- +drop table t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 714cb42af5e..7e69620394b 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1,51 +1,334 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, `"t"1`; CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); <?xml version="1.0"?> <mysqldump> <database name="test"> - <table name="t1"> + <table_structure name="t1"> + <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" /> + </table_structure> + <table_data name="t1"> <row> <field name="a">1</field> </row> <row> <field name="a">2</field> </row> - </table> + </table_data> </database> </mysqldump> DROP TABLE t1; CREATE TABLE t1 (a decimal(240, 20)); INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), ("0987654321098765432109876543210987654321"); -CREATE TABLE t1 ( - a decimal(240,20) default NULL -) TYPE=MyISAM; - -INSERT INTO t1 VALUES ('1234567890123456789012345678901234567890.00000000000000000000'); -INSERT INTO t1 VALUES ('0987654321098765432109876543210987654321.00000000000000000000'); - +CREATE TABLE `t1` ( + `a` decimal(240,20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('0987654321098765432109876543210987654321.00000000000000000000'); DROP TABLE t1; CREATE TABLE t1 (a double); INSERT INTO t1 VALUES (-9e999999); -CREATE TABLE t1 ( - a double default NULL -) TYPE=MyISAM; - -INSERT INTO t1 VALUES (RES); - +CREATE TABLE `t1` ( + `a` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (RES); DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT); INSERT INTO t1 VALUES (1.2345, 2.3456); INSERT INTO t1 VALUES ('1.2345', 2.3456); INSERT INTO t1 VALUES ("1.2345", 2.3456); -CREATE TABLE t1 ( - a decimal(10,5) default NULL, - b float default NULL +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES'; +INSERT INTO t1 VALUES (1.2345, 2.3456); +INSERT INTO t1 VALUES ('1.2345', 2.3456); +INSERT INTO t1 VALUES ("1.2345", 2.3456); +ERROR 42S22: Unknown column '1.2345' in 'field list' +SET SQL_MODE=@OLD_SQL_MODE; +CREATE TABLE `t1` ( + `a` decimal(10,5) default NULL, + `b` float default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); +CREATE TABLE `t1` ( + `a` decimal(10,5) default NULL, + `b` float default NULL +); +INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` decimal(10,5) default NULL, + `b` float default NULL +); + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +CREATE TABLE `t1` ( + `a` decimal(10,5) default NULL, + `b` float default NULL +); + +INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +DROP TABLE t1; +CREATE TABLE t1(a int, b text, c varchar(3)); +INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); +<?xml version="1.0"?> +<mysqldump> +<database name="test"> + <table_structure name="t1"> + <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" /> + <field Field="b" Type="text" Null="YES" Key="" Extra="" /> + <field Field="c" Type="char(3)" Null="YES" Key="" Extra="" /> + </table_structure> + <table_data name="t1"> + <row> + <field name="a">1</field> + <field name="b">test</field> + <field name="c">tes</field> + </row> + <row> + <field name="a">2</field> + <field name="b">TEST</field> + <field name="c">TES</field> + </row> + </table_data> +</database> +</mysqldump> +DROP TABLE t1; +CREATE TABLE t1 (`a"b"` char(2)); +INSERT INTO t1 VALUES ("1\""), ("\"2"); +<?xml version="1.0"?> +<mysqldump> +<database name="test"> + <table_structure name="t1"> + <field Field="a"b"" Type="char(2)" Null="YES" Key="" Extra="" /> + </table_structure> + <table_data name="t1"> + <row> + <field name="a"b"">1"</field> + </row> + <row> + <field name="a"b"">"2</field> + </row> + </table_data> +</database> +</mysqldump> +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; +INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` varchar(255) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=koi8r; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('абÑЎе'); +INSERT INTO `t1` VALUES (NULL); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +DROP TABLE t1; +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1), (2); +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL40" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL ) TYPE=MyISAM; -INSERT INTO t1 VALUES ('1.23450',2.3456); -INSERT INTO t1 VALUES ('1.23450',2.3456); -INSERT INTO t1 VALUES ('1.23450',2.3456); + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES (1),(2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES (1),(2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; DROP TABLE t1; +create table ```a` (i int); +CREATE TABLE ```a` ( + `i` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +drop table ```a`; +create table t1(a int); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */; +DROP TABLE IF EXISTS "t1"; +CREATE TABLE "t1" ( + "a" int(11) default NULL +); + + +/*!40000 ALTER TABLE "t1" DISABLE KEYS */; +LOCK TABLES "t1" WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE "t1" ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +set global sql_mode='ANSI_QUOTES'; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */; +DROP TABLE IF EXISTS "t1"; +CREATE TABLE "t1" ( + "a" int(11) default NULL +); + + +/*!40000 ALTER TABLE "t1" DISABLE KEYS */; +LOCK TABLES "t1" WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE "t1" ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +set global sql_mode=''; +drop table t1; +create table t1(a int); +insert into t1 values (1),(2),(3); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +1 +2 +3 +drop table t1; diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result new file mode 100644 index 00000000000..4e7f4b2a72b --- /dev/null +++ b/mysql-test/r/ndb_alter_table.result @@ -0,0 +1,74 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +a INT NOT NULL, +b INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (9410,9412); +ALTER TABLE t1 ADD COLUMN c int not null; +SELECT * FROM t1; +a b c +9410 9412 0 +DROP TABLE t1; +create table t1 ( +col1 int not null auto_increment primary key, +col2 varchar(30) not null, +col3 varchar (20) not null, +col4 varchar(4) not null, +col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, +col6 int not null, to_be_deleted int) ENGINE=ndbcluster; +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 0 NULL NULL NULL latin1_swedish_ci NULL +insert into t1 values +(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 102 NULL NULL NULL latin1_swedish_ci NULL +select * from t1 order by col1; +col1 col2 col3 col4 col5 col6 to_be_deleted +0 4 3 5 PENDING 1 7 +1 4 3 5 PENDING 1 7 +7 4 3 5 PENDING 1 7 +8 4 3 5 PENDING 1 7 +31 4 3 5 PENDING 1 7 +32 4 3 5 PENDING 1 7 +99 4 3 5 PENDING 1 7 +100 4 3 5 PENDING 1 7 +101 4 3 5 PENDING 1 7 +alter table t1 +add column col4_5 varchar(20) not null after col4, +add column col7 varchar(30) not null after col5, +add column col8 datetime not null, drop column to_be_deleted, +change column col2 fourth varchar(30) not null after col3, +modify column col6 int not null first; +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 102 NULL NULL NULL latin1_swedish_ci NULL +select * from t1 order by col1; +col6 col1 col3 fourth col4 col4_5 col5 col7 col8 +1 0 3 4 5 PENDING 0000-00-00 00:00:00 +1 1 3 4 5 PENDING 0000-00-00 00:00:00 +1 7 3 4 5 PENDING 0000-00-00 00:00:00 +1 8 3 4 5 PENDING 0000-00-00 00:00:00 +1 31 3 4 5 PENDING 0000-00-00 00:00:00 +1 32 3 4 5 PENDING 0000-00-00 00:00:00 +1 99 3 4 5 PENDING 0000-00-00 00:00:00 +1 100 3 4 5 PENDING 0000-00-00 00:00:00 +1 101 3 4 5 PENDING 0000-00-00 00:00:00 +insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 103 NULL NULL NULL latin1_swedish_ci NULL +select * from t1 order by col1; +col6 col1 col3 fourth col4 col4_5 col5 col7 col8 +1 0 3 4 5 PENDING 0000-00-00 00:00:00 +1 1 3 4 5 PENDING 0000-00-00 00:00:00 +1 7 3 4 5 PENDING 0000-00-00 00:00:00 +1 8 3 4 5 PENDING 0000-00-00 00:00:00 +1 31 3 4 5 PENDING 0000-00-00 00:00:00 +1 32 3 4 5 PENDING 0000-00-00 00:00:00 +1 99 3 4 5 PENDING 0000-00-00 00:00:00 +1 100 3 4 5 PENDING 0000-00-00 00:00:00 +1 101 3 4 5 PENDING 0000-00-00 00:00:00 +2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 +drop table t1; diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result new file mode 100644 index 00000000000..f5b908c39e2 --- /dev/null +++ b/mysql-test/r/ndb_autodiscover.result @@ -0,0 +1,183 @@ +drop table if exists t1,t2,t3,t4,t5,t6,t9; +flush status; +create table t1( +id int not null primary key, +name char(20) +) engine=ndb; +insert into t1 values(1, "Autodiscover"); +flush tables; +select * from t1; +id name +1 Autodiscover +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 1 +flush tables; +insert into t1 values (2, "Auto 2"); +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +insert into t1 values (3, "Discover 3"); +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +flush tables; +select * from t1 order by id; +id name +1 Autodiscover +2 Auto 2 +3 Discover 3 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 3 +flush tables; +update t1 set name="Autodiscover" where id = 2; +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 4 +select * from t1 order by id; +id name +1 Autodiscover +2 Autodiscover +3 Discover 3 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 4 +flush tables; +delete from t1 where id = 3; +select * from t1 order by id; +id name +1 Autodiscover +2 Autodiscover +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 5 +drop table t1; +flush status; +create table t2( +id int not null primary key, +name char(22) +) engine=ndb; +insert into t2 values (1, "Discoverer"); +select * from t2; +id name +1 Discoverer +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +flush tables; +select * from t2; +id name +1 Discoverer +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 1 +drop table t2; +flush status; +create table t3( +id int not null primary key, +name char(255) +) engine=ndb; +insert into t3 values (1, "Explorer"); +select * from t3; +id name +1 Explorer +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +flush tables; +create table t3( +id int not null primary key, +name char(20), a int, b float, c char(24) +) engine=ndb; +ERROR 42S01: Table 't3' already exists +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 1 +SHOW TABLES FROM test; +Tables_in_test +create table IF NOT EXISTS t3( +id int not null primary key, +id2 int not null, +name char(20) +) engine=ndb; +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `id` int(11) NOT NULL default '0', + `name` char(255) default NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +select * from t3; +id name +1 Explorer +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +drop table t3; +flush status; +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +create table t5( +id int not null primary key, +name char(200) +) engine=ndb; +insert into t5 values (1, "Magnus"); +select * from t5; +id name +1 Magnus +ALTER TABLE t5 ADD COLUMN adress char(255) FIRST; +select * from t5; +adress id name +NULL 1 Magnus +insert into t5 values +("Adress for record 2", 2, "Carl-Gustav"), +("Adress for record 3", 3, "Karl-Emil"); +update t5 set name="Bertil" where id = 2; +select * from t5 order by id; +adress id name +NULL 1 Magnus +Adress for record 2 2 Bertil +Adress for record 3 3 Karl-Emil +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +drop table t5; +flush status; +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +create table t6( +id int not null primary key, +name char(20) +) engine=ndb; +insert into t6 values (1, "Magnus"); +select * from t6; +id name +1 Magnus +ALTER TABLE t6 ADD COLUMN adress char(255) FIRST; +select * from t6; +adress id name +NULL 1 Magnus +insert into t6 values +("Adress for record 2", 2, "Carl-Gustav"), +("Adress for record 3", 3, "Karl-Emil"); +update t6 set name="Bertil" where id = 2; +select * from t6 order by id; +adress id name +NULL 1 Magnus +Adress for record 2 2 Bertil +Adress for record 3 3 Karl-Emil +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +drop table t6; +CREATE TABLE t9 ( +a int NOT NULL PRIMARY KEY, +b int +) engine=ndb; +insert t9 values(1, 2), (2,3), (3, 4), (4, 5); diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/r/ndb_autodiscover2.result new file mode 100644 index 00000000000..08803d997a5 --- /dev/null +++ b/mysql-test/r/ndb_autodiscover2.result @@ -0,0 +1,10 @@ +select * from t9 order by a; +a b +1 2 +2 3 +3 4 +4 5 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 1 +drop table t9; diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result new file mode 100644 index 00000000000..80e1aa7939a --- /dev/null +++ b/mysql-test/r/ndb_basic.result @@ -0,0 +1,391 @@ +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; +drop database if exists mysqltest; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL, +attr2 INT, +attr3 VARCHAR(10) +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); +SELECT pk1 FROM t1 ORDER BY pk1; +pk1 +9410 +9411 +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +9410 9412 NULL 9412 +9411 9413 17 9413 +SELECT t1.* FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +9410 9412 NULL 9412 +9411 9413 17 9413 +UPDATE t1 SET attr1=1 WHERE pk1=9410; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +9410 1 NULL 9412 +9411 9413 17 9413 +UPDATE t1 SET pk1=2 WHERE attr1=1; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +2 1 NULL 9412 +9411 9413 17 9413 +UPDATE t1 SET pk1=pk1 + 1; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +3 1 NULL 9412 +9412 9413 17 9413 +DELETE FROM t1; +SELECT * FROM t1; +pk1 attr1 attr2 attr3 +INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9408, 8765, NULL, '8765'), +(7,8, NULL, NULL), (8,9, NULL, NULL), (9,10, NULL, NULL), (10,11, NULL, NULL), (11,12, NULL, NULL), (12,13, NULL, NULL), (13,14, NULL, NULL); +UPDATE t1 SET attr1 = 9999; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +7 9999 NULL NULL +8 9999 NULL NULL +9 9999 NULL NULL +10 9999 NULL NULL +11 9999 NULL NULL +12 9999 NULL NULL +13 9999 NULL NULL +9408 9999 NULL 8765 +9410 9999 NULL 9412 +UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +7 9998 NULL NULL +8 9998 NULL NULL +9 9998 NULL NULL +10 9998 NULL NULL +11 9998 NULL NULL +12 9998 NULL NULL +13 9998 NULL NULL +9408 9999 NULL 8765 +9410 9999 NULL 9412 +UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +7 9998 NULL NULL +8 9998 NULL NULL +9 9998 NULL NULL +10 9998 NULL NULL +11 9998 NULL NULL +12 9998 NULL NULL +13 9998 NULL NULL +9408 9997 NULL 8765 +9410 9997 NULL 9412 +DELETE FROM t1 WHERE pk1 = 9410; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +7 9998 NULL NULL +8 9998 NULL NULL +9 9998 NULL NULL +10 9998 NULL NULL +11 9998 NULL NULL +12 9998 NULL NULL +13 9998 NULL NULL +9408 9997 NULL 8765 +DELETE FROM t1; +SELECT * FROM t1; +pk1 attr1 attr2 attr3 +INSERT INTO t1 values (1, 4, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL), (4, 4, NULL, NULL), (5, 5, NULL, NULL); +DELETE FROM t1 WHERE attr1=4; +SELECT * FROM t1 order by pk1; +pk1 attr1 attr2 attr3 +3 5 NULL NULL +5 5 NULL NULL +DELETE FROM t1; +INSERT INTO t1 VALUES (9410,9412, NULL, NULL), (9411, 9413, NULL, NULL); +DELETE FROM t1 WHERE pk1 = 9410; +SELECT * FROM t1; +pk1 attr1 attr2 attr3 +9411 9413 NULL NULL +DROP TABLE t1; +CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster; +INSERT INTO t1 values(3456, 7890); +SELECT * FROM t1; +id id2 +3456 7890 +UPDATE t1 SET id=2 WHERE id2=12; +SELECT * FROM t1; +id id2 +3456 7890 +UPDATE t1 SET id=1234 WHERE id2=7890; +SELECT * FROM t1; +id id2 +1234 7890 +DELETE FROM t1; +INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890); +SELECT * FROM t1 ORDER BY id; +id id2 +3454 7890 +3456 7890 +3456 7890 +3456 7890 +DELETE FROM t1 WHERE id = 3456; +SELECT * FROM t1 ORDER BY id; +id id2 +3454 7890 +DROP TABLE t1; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL +) ENGINE=NDBCLUSTER; +INSERT INTO t1 values(1, 9999); +DROP TABLE t1; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL +) ENGINE=NDB; +INSERT INTO t1 values(1, 9999); +DROP TABLE t1; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +CREATE TABLE t3 ( +a bigint unsigned NOT NULL, +b bigint unsigned not null, +c bigint unsigned, +PRIMARY KEY(a) +) engine=ndbcluster; +CREATE TABLE t4 ( +a bigint unsigned NOT NULL, +b bigint unsigned not null, +c bigint unsigned NOT NULL, +d int unsigned, +PRIMARY KEY(a, b, c) +) engine=ndbcluster; +select * from t2 where a = 7 order by b; +a b c +7 16 5 +select * from t2 where a = 7 order by a; +a b c +7 16 5 +select * from t2 where a = 7 order by 2; +a b c +7 16 5 +select * from t2 where a = 7 order by c; +a b c +7 16 5 +select * from t2 where a = 7 and b = 16 order by b; +a b c +7 16 5 +select * from t2 where a = 7 and b = 16 order by a; +a b c +7 16 5 +select * from t2 where a = 7 and b = 17 order by a; +a b c +select * from t2 where a = 7 and b != 16 order by b; +a b c +select * from t2 where a = 7 and b = 16 and c = 5 order by b; +a b c +7 16 5 +select * from t2 where a = 7 and b = 16 and c = 5 order by a; +a b c +7 16 5 +select * from t2 where a = 7 and b = 16 and c = 6 order by a; +a b c +select * from t2 where a = 7 and b != 16 and c = 5 order by b; +a b c +select * from t3 where a = 7 order by b; +a b c +7 16 5 +select * from t3 where a = 7 order by a; +a b c +7 16 5 +select * from t3 where a = 7 order by 2; +a b c +7 16 5 +select * from t3 where a = 7 order by c; +a b c +7 16 5 +select * from t3 where a = 7 and b = 16 order by b; +a b c +7 16 5 +select * from t3 where a = 7 and b = 16 order by a; +a b c +7 16 5 +select * from t3 where a = 7 and b = 17 order by a; +a b c +select * from t3 where a = 7 and b != 16 order by b; +a b c +select * from t4 where a = 7 order by b; +a b c d +7 16 5 26007 +select * from t4 where a = 7 order by a; +a b c d +7 16 5 26007 +select * from t4 where a = 7 order by 2; +a b c d +7 16 5 26007 +select * from t4 where a = 7 order by c; +a b c d +7 16 5 26007 +select * from t4 where a = 7 and b = 16 order by b; +a b c d +7 16 5 26007 +select * from t4 where a = 7 and b = 16 order by a; +a b c d +7 16 5 26007 +select * from t4 where a = 7 and b = 17 order by a; +a b c d +select * from t4 where a = 7 and b != 16 order by b; +a b c d +delete from t2 where a > 5; +select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a; +a b +1 10 +3 12 +5 14 +select a, b FROM t2 outer_table where +a = (select a from t2 where b = outer_table.b ) order by a; +a b +1 10 +3 12 +5 14 +delete from t2; +delete from t3; +delete from t4; +drop table t2; +drop table t3; +drop table t4; +CREATE TABLE t5 ( +a bigint unsigned NOT NULL, +b bigint unsigned not null, +c bigint unsigned NOT NULL, +d int unsigned, +PRIMARY KEY(a, b, c) +) engine=ndbcluster; +insert into t5 values(10, 19, 5, 26010); +delete from t5 where a=10 and b=19 and c=5; +select * from t5; +a b c d +insert into t5 values(10, 19, 5, 26010); +update t5 set d=21997 where a=10 and b=19 and c=5; +select * from t5; +a b c d +10 19 5 21997 +delete from t5; +drop table t5; +CREATE TABLE t6 ( +adress char(255), +a int NOT NULL PRIMARY KEY, +b int +) engine = NDB; +insert into t6 values +("Nice road 3456", 1, 23), +("Street Road 78", 3, 92), +("Road street 89C", 5, 71), +(NULL, 7, NULL); +select * from t6 order by a; +adress a b +Nice road 3456 1 23 +Street Road 78 3 92 +Road street 89C 5 71 +NULL 7 NULL +select a, b from t6 order by a; +a b +1 23 +3 92 +5 71 +7 NULL +update t6 set adress="End of road 09" where a=3; +update t6 set b=181, adress="Street 76" where a=7; +select * from t6 order by a; +adress a b +Nice road 3456 1 23 +End of road 09 3 92 +Road street 89C 5 71 +Street 76 7 181 +select * from t6 where a=1; +adress a b +Nice road 3456 1 23 +delete from t6 where a=1; +select * from t6 order by a; +adress a b +End of road 09 3 92 +Road street 89C 5 71 +Street 76 7 181 +delete from t6 where b=71; +select * from t6 order by a; +adress a b +End of road 09 3 92 +Street 76 7 181 +drop table t6; +CREATE TABLE t7 ( +adress char(255), +a int NOT NULL, +b int, +c int NOT NULL, +PRIMARY KEY(a, c) +) engine = NDB; +insert into t7 values +("Highway 3456", 1, 23, 2), +("Street Road 78", 3, 92, 3), +("Main street 89C", 5, 71, 4), +(NULL, 8, NULL, 12); +select * from t7 order by a; +adress a b c +Highway 3456 1 23 2 +Street Road 78 3 92 3 +Main street 89C 5 71 4 +NULL 8 NULL 12 +select a, b from t7 order by a; +a b +1 23 +3 92 +5 71 +8 NULL +update t7 set adress="End of road 09" where a=3; +update t7 set adress="GatuvÀgen 90C" where a=5 and c=4; +update t7 set adress="No adress" where adress is NULL; +select * from t7 order by a; +adress a b c +Highway 3456 1 23 2 +End of road 09 3 92 3 +GatuvÀgen 90C 5 71 4 +No adress 8 NULL 12 +select * from t7 where a=1 and c=2; +adress a b c +Highway 3456 1 23 2 +delete from t7 where a=1; +delete from t7 where a=3 and c=3; +delete from t7 where a=5 and c=4; +select * from t7; +adress a b c +No adress 8 NULL 12 +delete from t7 where b=23; +select * from t7; +adress a b c +No adress 8 NULL 12 +drop table t7; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL, +attr2 INT, +attr3 VARCHAR(10) +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); +create database mysqltest; +use mysqltest; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +insert into t2 select pk1,attr1,attr2 from test.t1; +select * from t2 order by a; +a b c +9410 9412 NULL +9411 9413 17 +select b from test.t1, t2 where c = test.t1.attr2; +b +9413 +select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a; +b attr1 +9413 9412 +drop table test.t1, t2; +drop database mysqltest; diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result new file mode 100644 index 00000000000..c590815b233 --- /dev/null +++ b/mysql-test/r/ndb_blob.result @@ -0,0 +1,324 @@ +drop table if exists t1; +drop database if exists mysqltest; +set autocommit=0; +create table t1 ( +a int not null primary key, +b text not null, +c int not null, +d longblob, +key (c) +) engine=ndbcluster; +set @x0 = '01234567012345670123456701234567'; +set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0); +set @b1 = 'b1'; +set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); +set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); +set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); +set @b1 = concat(@b1,@x0); +set @d1 = 'dd1'; +set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1); +set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1); +set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1); +set @b2 = 'b2'; +set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); +set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); +set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); +set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); +set @d2 = 'dd2'; +set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2); +set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2); +set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2); +set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2); +select length(@x0),length(@b1),length(@d1) from dual; +length(@x0) length(@b1) length(@d1) +256 2256 3000 +select length(@x0),length(@b2),length(@d2) from dual; +length(@x0) length(@b2) length(@d2) +256 20000 30000 +insert into t1 values(1,@b1,111,@d1); +insert into t1 values(2,@b2,222,@d2); +commit; +explain select * from t1 where a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=1; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=2; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +2 20000 b2 30000 dd2 +update t1 set b=@b2,d=@d2 where a=1; +update t1 set b=@b1,d=@d1 where a=2; +commit; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=1; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +1 20000 b2 30000 dd2 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=2; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +2 2256 b1 3000 dd1 +update t1 set b=concat(b,b),d=concat(d,d) where a=1; +update t1 set b=concat(b,b),d=concat(d,d) where a=2; +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 where a=1; +a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3) +1 40000 b2 60000 dd2 +select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3) +from t1 where a=2; +a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3) +2 4512 b1 6000 dd1 +update t1 set d=null where a=1; +commit; +select a from t1 where d is null; +a +1 +delete from t1 where a=1; +delete from t1 where a=2; +commit; +select count(*) from t1; +count(*) +0 +insert into t1 values(1,@b1,111,@d1); +insert into t1 values(2,@b2,222,@d2); +commit; +explain select * from t1 where c = 111; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref c c 4 const 10 Using where +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where c=111; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where c=222; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +2 20000 b2 30000 dd2 +update t1 set b=@b2,d=@d2 where c=111; +update t1 set b=@b1,d=@d1 where c=222; +commit; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where c=111; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +1 20000 b2 30000 dd2 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where c=222; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +2 2256 b1 3000 dd1 +update t1 set d=null where c=111; +commit; +select a from t1 where d is null; +a +1 +delete from t1 where c=111; +delete from t1 where c=222; +commit; +select count(*) from t1; +count(*) +0 +insert into t1 values(1,'b1',111,'dd1'); +insert into t1 values(2,'b2',222,'dd2'); +insert into t1 values(3,'b3',333,'dd3'); +insert into t1 values(4,'b4',444,'dd4'); +insert into t1 values(5,'b5',555,'dd5'); +insert into t1 values(6,'b6',666,'dd6'); +insert into t1 values(7,'b7',777,'dd7'); +insert into t1 values(8,'b8',888,'dd8'); +insert into t1 values(9,'b9',999,'dd9'); +commit; +explain select * from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +update t1 set b=concat(a,'x',b),d=concat(a,'x',d); +commit; +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 +delete from t1; +commit; +select count(*) from t1; +count(*) +0 +insert into t1 values(1,@b1,111,@d1); +insert into t1 values(2,@b2,222,@d2); +commit; +explain select * from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 order by a; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +2 20000 b2 30000 dd2 +update t1 set b=concat(b,b),d=concat(d,d); +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 order by a; +a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3) +1 4512 6000 +2 40000 b2 60000 dd2 +delete from t1; +commit; +select count(*) from t1; +count(*) +0 +insert into t1 values(1,'b1',111,'dd1'); +insert into t1 values(2,'b2',222,'dd2'); +insert into t1 values(3,'b3',333,'dd3'); +insert into t1 values(4,'b4',444,'dd4'); +insert into t1 values(5,'b5',555,'dd5'); +insert into t1 values(6,'b6',666,'dd6'); +insert into t1 values(7,'b7',777,'dd7'); +insert into t1 values(8,'b8',888,'dd8'); +insert into t1 values(9,'b9',999,'dd9'); +commit; +explain select * from t1 where c >= 100 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL 10 Using where; Using filesort +select * from t1 where c >= 100 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +update t1 set b=concat(a,'x',b),d=concat(a,'x',d) +where c >= 100; +commit; +select * from t1 where c >= 100 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 1xb1 111 1xdd1 NULL +2 2xb2 222 2xdd2 NULL +3 3xb3 333 3xdd3 NULL +4 4xb4 444 4xdd4 NULL +5 5xb5 555 5xdd5 NULL +6 6xb6 666 6xdd6 NULL +7 7xb7 777 7xdd7 NULL +8 8xb8 888 8xdd8 NULL +9 9xb9 999 9xdd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 +create database mysqltest; +use mysqltest; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +insert into t2 values (1,1,1),(2,2,2); +select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; +a b c d a b c +1 1xb1 111 1xdd1 1 1 1 +2 2xb2 222 2xdd2 2 2 2 +drop table t2; +use test; +delete from t1 where c >= 100; +commit; +select count(*) from t1; +count(*) +0 +insert into t1 values(1,@b1,111,@d1); +insert into t1 values(2,@b2,222,@d2); +commit; +explain select * from t1 where c >= 100 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 4 NULL 10 Using where; Using filesort +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where c >= 100 order by a; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +2 20000 b2 30000 dd2 +update t1 set b=concat(b,b),d=concat(d,d); +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 where c >= 100 order by a; +a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3) +1 4512 6000 +2 40000 b2 60000 dd2 +delete from t1 where c >= 100; +commit; +select count(*) from t1; +count(*) +0 +insert into t1 values(1,@b1,111,@d1); +insert into t1 values(2,@b2,222,@d2); +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a = 0; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a = 1; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a = 2; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +2 20000 b2 30000 dd2 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 order by a; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +2 20000 b2 30000 dd2 +rollback; +select count(*) from t1; +count(*) +0 +drop table t1; +drop database mysqltest; diff --git a/mysql-test/r/ndb_cache.result b/mysql-test/r/ndb_cache.result new file mode 100644 index 00000000000..714e1831267 --- /dev/null +++ b/mysql-test/r/ndb_cache.result @@ -0,0 +1,43 @@ +set GLOBAL query_cache_size=1355776; +reset query cache; +flush status; +drop table if exists t1,t2; +CREATE TABLE t1 (a int) ENGINE=ndbcluster; +CREATE TABLE t2 (a int); +select * from t1; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +select * from t2; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +select * from t1; +a +select * from t2; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +drop table t1, t2; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/r/ndb_index.result b/mysql-test/r/ndb_index.result new file mode 100644 index 00000000000..dd92c237ace --- /dev/null +++ b/mysql-test/r/ndb_index.result @@ -0,0 +1,154 @@ +drop table if exists t1; +CREATE TABLE t1 ( +PORT varchar(16) NOT NULL, +ACCESSNODE varchar(16) NOT NULL, +POP varchar(48) NOT NULL, +ACCESSTYPE int unsigned NOT NULL, +CUSTOMER_ID varchar(20) NOT NULL, +PROVIDER varchar(16), +TEXPIRE int unsigned, +NUM_IP int unsigned, +LEASED_NUM_IP int unsigned, +LOCKED_IP int unsigned, +STATIC_DNS int unsigned, +SUSPENDED_SERVICE int unsigned, +SUSPENDED_REASON int unsigned, +BGP_COMMUNITY int unsigned, +INDEX CUSTOMER_ID_INDEX(CUSTOMER_ID), +INDEX FQPN_INDEX(POP,ACCESSNODE,PORT), +PRIMARY KEY(POP,ACCESSNODE,PORT,ACCESSTYPE) +) engine=ndbcluster; +INSERT INTO t1 VALUES ('port67', 'node78', 'pop98', 1, 'kllopmn', 'pr_43', 121212, 1, 2, 3, 8, NULL, NULL, NULL); +INSERT INTO t1 VALUES ('port67', 'node78', 'pop99', 2, 'klkighh', 'pr_44', 121213, 3, 3, 6, 7, NULL, NULL, NULL); +INSERT INTO t1 VALUES ('port79', 'node79', 'pop79', 2, 'kpongfaa', 'pr_44', 981213, 2, 4, 10, 11, 2, 99, 1278); +select port, accessnode, pop, accesstype from t1 where port='port67' order by accesstype; +port accessnode pop accesstype +port67 node78 pop98 1 +port67 node78 pop99 2 +select port, accessnode, pop, accesstype from t1 where port='foo'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where accessnode='node78' order by accesstype; +port accessnode pop accesstype +port67 node78 pop98 1 +port67 node78 pop99 2 +select port, accessnode, pop, accesstype from t1 where accessnode='foo'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where pop='pop98'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='pop98'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='pop98'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='pop98' order by accesstype; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='foo'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where accesstype=1; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where accesstype=2 order by port; +port accessnode pop accesstype +port67 node78 pop99 2 +port79 node79 pop79 2 +select port, accessnode, pop, accesstype from t1 where accesstype=98 order by port; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where customer_id='KLLOPMN'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where customer_id='kLLoPMn'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where customer_id='foo'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where provider='pr_43'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where provider='foo'; +port accessnode pop accesstype +select port, accessnode from t1 where texpire=121212; +port accessnode +port67 node78 +select port, accessnode from t1 where texpire=2323; +port accessnode +select port, accessnode, pop, accesstype from t1 where num_ip=1; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where num_ip=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where leased_num_ip=2; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where leased_num_ip=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where locked_ip=3; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where locked_ip=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where static_dns=8; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where static_dns=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where suspended_service=8; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where suspended_service=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where suspended_reason=NULL; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where suspended_reason=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where suspended_reason=0; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where bgp_community=NULL; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where bgp_community=89; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where bgp_community=0; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where port='port67' and accessnode='node78' and pop='pop98' and accesstype=1; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78' and pop='pop98'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='pop98' and port='port67' and accesstype=1 and accessnode='node78'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo' and accesstype=99; +port accessnode +select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accesstype=1; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where accesstype=1 and accessnode='node78' and pop='pop98'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo'; +port accessnode +select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=1; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=2; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where accesstype=2 and customer_id='kllopmn'; +port accessnode pop accesstype +select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn'; +port accessnode pop accesstype +port67 node78 pop98 1 +select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo'; +port accessnode pop accesstype +drop table t1; diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result new file mode 100644 index 00000000000..2f1ad251e40 --- /dev/null +++ b/mysql-test/r/ndb_index_ordered.result @@ -0,0 +1,259 @@ +drop table if exists t1; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned, +KEY(b) +) engine=ndbcluster; +insert t1 values(1, 2, 3), (2,3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2); +select * from t1 order by b; +a b c +1 2 3 +2 3 5 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +select * from t1 where b >= 4 order by b; +a b c +3 4 6 +4 5 8 +5 6 2 +6 7 2 +select * from t1 where b = 4 order by b; +a b c +3 4 6 +select * from t1 where b > 4 order by b; +a b c +4 5 8 +5 6 2 +6 7 2 +select * from t1 where b < 4 order by b; +a b c +1 2 3 +2 3 5 +select * from t1 where b <= 4 order by b; +a b c +1 2 3 +2 3 5 +3 4 6 +update t1 set c = 3 where b = 3; +select * from t1 order by a; +a b c +1 2 3 +2 3 3 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +update t1 set c = 10 where b >= 6; +select * from t1 order by a; +a b c +1 2 3 +2 3 3 +3 4 6 +4 5 8 +5 6 10 +6 7 10 +update t1 set c = 11 where b < 5; +select * from t1 order by a; +a b c +1 2 11 +2 3 11 +3 4 11 +4 5 8 +5 6 10 +6 7 10 +update t1 set c = 12 where b > 0; +select * from t1 order by a; +a b c +1 2 12 +2 3 12 +3 4 12 +4 5 12 +5 6 12 +6 7 12 +update t1 set c = 13 where b <= 3; +select * from t1 order by a; +a b c +1 2 13 +2 3 13 +3 4 12 +4 5 12 +5 6 12 +6 7 12 +update t1 set b = b + 1 where b > 4 and b < 7; +select * from t1 order by a; +a b c +1 2 13 +2 3 13 +3 4 12 +4 6 12 +5 7 12 +6 7 12 +update t1 set a = a + 10 where b > 1 and b < 7; +select * from t1 order by a; +a b c +5 7 12 +6 7 12 +11 2 13 +12 3 13 +13 4 12 +14 6 12 +drop table t1; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned, +KEY(b) +) engine=ndbcluster; +insert t1 values(1, 2, 13), (2,3, 13), (3, 4, 12), (4, 5, 12), (5,6, 12), (6,7, 12); +delete from t1 where b = 3; +select * from t1 order by a; +a b c +1 2 13 +3 4 12 +4 5 12 +5 6 12 +6 7 12 +delete from t1 where b >= 6; +select * from t1 order by a; +a b c +1 2 13 +3 4 12 +4 5 12 +delete from t1 where b < 4; +select * from t1 order by a; +a b c +3 4 12 +4 5 12 +delete from t1 where b > 5; +select * from t1 order by a; +a b c +3 4 12 +4 5 12 +delete from t1 where b <= 4; +select * from t1 order by a; +a b c +4 5 12 +drop table t1; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned not null +) engine = ndb; +create index a1 on t1 (b, c); +insert into t1 values (1, 2, 13); +insert into t1 values (2,3, 13); +insert into t1 values (3, 4, 12); +insert into t1 values (4, 5, 12); +insert into t1 values (5,6, 12); +insert into t1 values (6,7, 12); +insert into t1 values (7, 2, 1); +insert into t1 values (8,3, 6); +insert into t1 values (9, 4, 12); +insert into t1 values (14, 5, 4); +insert into t1 values (15,5,5); +insert into t1 values (16,5, 6); +insert into t1 values (17,4,4); +insert into t1 values (18,1, 7); +select * from t1 order by a; +a b c +1 2 13 +2 3 13 +3 4 12 +4 5 12 +5 6 12 +6 7 12 +7 2 1 +8 3 6 +9 4 12 +14 5 4 +15 5 5 +16 5 6 +17 4 4 +18 1 7 +select * from t1 where b<=5 order by a; +a b c +1 2 13 +2 3 13 +3 4 12 +4 5 12 +7 2 1 +8 3 6 +9 4 12 +14 5 4 +15 5 5 +16 5 6 +17 4 4 +18 1 7 +select * from t1 where b<=5 and c=0; +a b c +insert into t1 values (19,4, 0); +select * from t1 where b<=5 and c=0; +a b c +19 4 0 +select * from t1 where b=4 and c<=5 order by a; +a b c +17 4 4 +19 4 0 +select * from t1 where b<=4 and c<=5 order by a; +a b c +7 2 1 +17 4 4 +19 4 0 +select * from t1 where b<=5 and c=0 or b<=5 and c=2; +a b c +19 4 0 +select count(*) from t1 where b = 0; +count(*) +0 +select count(*) from t1 where b = 1; +count(*) +1 +drop table t1; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned, +c int unsigned, +KEY bc(b,c) +) engine = ndb; +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 use index (bc) where b IS NULL; +a b c +3 NULL NULL +2 NULL 2 +select * from t1 use index (bc)order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 use index (bc) order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 use index (PRIMARY) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; +a b c +3 NULL NULL +select * from t1 use index (bc) where b IS NULL and c = 2 order by a; +a b c +2 NULL 2 +select * from t1 use index (bc) where b < 4 order by a; +a b c +1 1 1 +select * from t1 use index (bc) where b IS NOT NULL order by a; +a b c +1 1 1 +4 4 NULL +drop table t1; diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result new file mode 100644 index 00000000000..4362de94b48 --- /dev/null +++ b/mysql-test/r/ndb_index_unique.result @@ -0,0 +1,524 @@ +drop table if exists t1, t2, t3, t4, t5, t6, t7; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned, +UNIQUE(b) +) engine=ndbcluster; +insert t1 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2); +select * from t1 order by b; +a b c +1 2 3 +2 3 5 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +select * from t1 where b = 4 order by b; +a b c +3 4 6 +insert into t1 values(7,8,3); +select * from t1 where b = 4 order by a; +a b c +3 4 6 +insert into t1 values(8, 2, 3); +ERROR 23000: Can't write, because of unique constraint, to table 't1' +select * from t1 order by a; +a b c +1 2 3 +2 3 5 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +7 8 3 +delete from t1 where a = 1; +insert into t1 values(8, 2, 3); +select * from t1 order by a; +a b c +2 3 5 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +7 8 3 +8 2 3 +drop table t1; +CREATE TABLE t2 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned not null, +UNIQUE USING HASH (b, c) +) engine=ndbcluster; +insert t2 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2); +select * from t2 where a = 3; +a b c +3 4 6 +select * from t2 where b = 4; +a b c +3 4 6 +select * from t2 where c = 6; +a b c +3 4 6 +insert into t2 values(7,8,3); +select * from t2 where b = 4 order by a; +a b c +3 4 6 +insert into t2 values(8, 2, 3); +ERROR 23000: Can't write, because of unique constraint, to table 't2' +select * from t2 order by a; +a b c +1 2 3 +2 3 5 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +7 8 3 +delete from t2 where a = 1; +insert into t2 values(8, 2, 3); +select * from t2 order by a; +a b c +2 3 5 +3 4 6 +4 5 8 +5 6 2 +6 7 2 +7 8 3 +8 2 3 +drop table t2; +CREATE TABLE t3 ( +a int unsigned NOT NULL, +b int unsigned not null, +c int unsigned, +PRIMARY KEY USING HASH (a, b) +) engine=ndbcluster; +insert t3 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2); +select * from t3 where a = 3; +a b c +3 4 6 +select * from t3 where b = 4; +a b c +3 4 6 +select * from t3 where c = 6; +a b c +3 4 6 +insert into t3 values(7,8,3); +select * from t3 where b = 4 order by a; +a b c +3 4 6 +drop table t3; +CREATE TABLE t1 ( +pk int NOT NULL PRIMARY KEY, +a int unsigned, +UNIQUE KEY (a) +) engine=ndbcluster; +insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); +select * from t1 order by pk; +pk a +-1 NULL +0 0 +1 NULL +2 2 +3 NULL +4 4 +insert into t1 values (5,0); +ERROR 23000: Can't write, because of unique constraint, to table 't1' +select * from t1 order by pk; +pk a +-1 NULL +0 0 +1 NULL +2 2 +3 NULL +4 4 +delete from t1 where a = 0; +insert into t1 values (5,0); +select * from t1 order by pk; +pk a +-1 NULL +1 NULL +2 2 +3 NULL +4 4 +5 0 +CREATE TABLE t2 ( +pk int NOT NULL PRIMARY KEY, +a int unsigned, +b tinyint NOT NULL, +c VARCHAR(10), +UNIQUE KEY si(a, c) +) engine=ndbcluster; +insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); +select * from t2 order by pk; +pk a b c +-1 1 17 NULL +0 NULL 18 NULL +1 3 19 abc +insert into t2 values(2,3,19,'abc'); +ERROR 23000: Can't write, because of unique constraint, to table 't2' +select * from t2 order by pk; +pk a b c +-1 1 17 NULL +0 NULL 18 NULL +1 3 19 abc +delete from t2 where c IS NOT NULL; +insert into t2 values(2,3,19,'abc'); +select * from t2 order by pk; +pk a b c +-1 1 17 NULL +0 NULL 18 NULL +2 3 19 abc +drop table t1, t2; +CREATE TABLE t1 ( +cid smallint(5) unsigned NOT NULL default '0', +cv varchar(250) NOT NULL default '', +PRIMARY KEY (cid), +UNIQUE KEY cv (cv) +) engine=ndbcluster; +INSERT INTO t1 VALUES (8,'dummy'); +CREATE TABLE t2 ( +cid bigint(20) unsigned NOT NULL auto_increment, +cap varchar(255) NOT NULL default '', +PRIMARY KEY (cid), +UNIQUE KEY (cid, cap) +) engine=ndbcluster; +INSERT INTO t2 VALUES (NULL,'another dummy'); +CREATE TABLE t3 ( +gid bigint(20) unsigned NOT NULL auto_increment, +gn varchar(255) NOT NULL default '', +must tinyint(4) default NULL, +PRIMARY KEY (gid) +) engine=ndbcluster; +INSERT INTO t3 VALUES (1,'V1',NULL); +CREATE TABLE t4 ( +uid bigint(20) unsigned NOT NULL default '0', +gid bigint(20) unsigned NOT NULL, +rid bigint(20) unsigned NOT NULL default '-1', +cid bigint(20) unsigned NOT NULL default '-1', +UNIQUE KEY m (uid,gid,rid,cid) +) engine=ndbcluster; +INSERT INTO t4 VALUES (1,1,2,4); +INSERT INTO t4 VALUES (1,1,2,3); +INSERT INTO t4 VALUES (1,1,5,7); +INSERT INTO t4 VALUES (1,1,10,8); +CREATE TABLE t5 ( +rid bigint(20) unsigned NOT NULL auto_increment, +rl varchar(255) NOT NULL default '', +PRIMARY KEY (rid) +) engine=ndbcluster; +CREATE TABLE t6 ( +uid bigint(20) unsigned NOT NULL auto_increment, +un varchar(250) NOT NULL default '', +uc smallint(5) unsigned NOT NULL default '0', +PRIMARY KEY (uid), +UNIQUE KEY nc (un,uc) +) engine=ndbcluster; +INSERT INTO t6 VALUES (1,'test',8); +INSERT INTO t6 VALUES (2,'test2',9); +INSERT INTO t6 VALUES (3,'tre',3); +CREATE TABLE t7 ( +mid bigint(20) unsigned NOT NULL PRIMARY KEY, +uid bigint(20) unsigned NOT NULL default '0', +gid bigint(20) unsigned NOT NULL, +rid bigint(20) unsigned NOT NULL default '-1', +cid bigint(20) unsigned NOT NULL default '-1', +UNIQUE KEY m (uid,gid,rid,cid) +) engine=ndbcluster; +INSERT INTO t7 VALUES(1, 1, 1, 1, 1); +INSERT INTO t7 VALUES(2, 2, 1, 1, 1); +INSERT INTO t7 VALUES(3, 3, 1, 1, 1); +INSERT INTO t7 VALUES(4, 4, 1, 1, 1); +INSERT INTO t7 VALUES(5, 5, 1, 1, 1); +INSERT INTO t7 VALUES(6, 1, 1, 1, 6); +INSERT INTO t7 VALUES(7, 2, 1, 1, 7); +INSERT INTO t7 VALUES(8, 3, 1, 1, 8); +INSERT INTO t7 VALUES(9, 4, 1, 1, 9); +INSERT INTO t7 VALUES(10, 5, 1, 1, 10); +select * from t1 where cv = 'dummy'; +cid cv +8 dummy +select * from t1 where cv = 'test'; +cid cv +select * from t2 where cap = 'another dummy'; +cid cap +0 another dummy +select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4; +uid gid rid cid +1 1 2 4 +select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4; +uid gid rid cid +select * from t4 where uid = 1 order by cid; +uid gid rid cid +1 1 2 3 +1 1 2 4 +1 1 5 7 +1 1 10 8 +select * from t4 where rid = 2 order by cid; +uid gid rid cid +1 1 2 3 +1 1 2 4 +select * from t6 where un='test' and uc=8; +uid un uc +1 test 8 +select * from t6 where un='test' and uc=7; +uid un uc +select * from t6 where un='test'; +uid un uc +1 test 8 +select * from t7 where mid = 8; +mid uid gid rid cid +8 3 1 1 8 +select * from t7 where uid = 8; +mid uid gid rid cid +select * from t7 where uid = 1 order by mid; +mid uid gid rid cid +1 1 1 1 1 +6 1 1 1 6 +select * from t7 where uid = 4 order by mid; +mid uid gid rid cid +4 4 1 1 1 +9 4 1 1 9 +select * from t7 where gid = 4; +mid uid gid rid cid +select * from t7 where gid = 1 order by mid; +mid uid gid rid cid +1 1 1 1 1 +2 2 1 1 1 +3 3 1 1 1 +4 4 1 1 1 +5 5 1 1 1 +6 1 1 1 6 +7 2 1 1 7 +8 3 1 1 8 +9 4 1 1 9 +10 5 1 1 10 +select * from t7 where cid = 4; +mid uid gid rid cid +select * from t7 where cid = 8; +mid uid gid rid cid +8 3 1 1 8 +select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4; +uid gid rid cid +1 1 2 4 +select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4; +uid gid rid cid +select * from t4 where uid = 1 order by gid,cid; +uid gid rid cid +1 1 2 3 +1 1 2 4 +1 1 5 7 +1 1 10 8 +1 1 5 12 +1 2 5 12 +1 3 9 11 +1 3 5 12 +1 4 5 12 +1 5 5 12 +1 6 5 12 +1 7 5 12 +1 8 5 12 +1 9 5 12 +1 10 5 12 +1 11 5 12 +1 12 5 12 +1 13 5 12 +1 14 5 12 +1 15 5 12 +1 16 5 12 +1 17 5 12 +1 18 5 12 +1 19 5 12 +1 20 5 12 +1 21 5 12 +1 22 5 12 +1 23 5 12 +1 24 5 12 +1 25 5 12 +1 26 5 12 +1 27 5 12 +1 28 5 12 +1 29 5 12 +1 30 5 12 +1 31 5 12 +1 32 5 12 +1 33 5 12 +1 34 5 12 +1 35 5 12 +1 36 5 12 +1 37 5 12 +1 38 5 12 +1 39 5 12 +1 40 5 12 +1 41 5 12 +1 42 5 12 +1 43 5 12 +1 44 5 12 +1 45 5 12 +1 46 5 12 +1 47 5 12 +1 48 5 12 +1 49 5 12 +1 50 5 12 +1 51 5 12 +1 52 5 12 +1 53 5 12 +1 54 5 12 +1 55 5 12 +1 56 5 12 +1 57 5 12 +1 58 5 12 +1 59 5 12 +1 60 5 12 +1 61 5 12 +1 62 5 12 +1 63 5 12 +1 64 5 12 +1 65 5 12 +1 66 5 12 +1 67 5 12 +1 68 5 12 +1 69 5 12 +1 70 5 12 +1 71 5 12 +1 72 5 12 +1 73 5 12 +1 74 5 12 +1 75 5 12 +1 76 5 12 +1 77 5 12 +1 78 5 12 +1 79 5 12 +1 80 5 12 +1 81 5 12 +1 82 5 12 +1 83 5 12 +1 84 5 12 +1 85 5 12 +1 86 5 12 +1 87 5 12 +1 88 5 12 +1 89 5 12 +1 90 5 12 +1 91 5 12 +1 92 5 12 +1 93 5 12 +1 94 5 12 +1 95 5 12 +1 96 5 12 +1 97 5 12 +1 98 5 12 +1 99 5 12 +1 100 5 12 +select * from t4 where uid = 1 order by gid,cid; +uid gid rid cid +1 1 2 3 +1 1 2 4 +1 1 5 7 +1 1 10 8 +1 1 5 12 +1 2 5 12 +1 3 9 11 +1 3 5 12 +1 4 5 12 +1 5 5 12 +1 6 5 12 +1 7 5 12 +1 8 5 12 +1 9 5 12 +1 10 5 12 +1 11 5 12 +1 12 5 12 +1 13 5 12 +1 14 5 12 +1 15 5 12 +1 16 5 12 +1 17 5 12 +1 18 5 12 +1 19 5 12 +1 20 5 12 +1 21 5 12 +1 22 5 12 +1 23 5 12 +1 24 5 12 +1 25 5 12 +1 26 5 12 +1 27 5 12 +1 28 5 12 +1 29 5 12 +1 30 5 12 +1 31 5 12 +1 32 5 12 +1 33 5 12 +1 34 5 12 +1 35 5 12 +1 36 5 12 +1 37 5 12 +1 38 5 12 +1 39 5 12 +1 40 5 12 +1 41 5 12 +1 42 5 12 +1 43 5 12 +1 44 5 12 +1 45 5 12 +1 46 5 12 +1 47 5 12 +1 48 5 12 +1 49 5 12 +1 50 5 12 +1 51 5 12 +1 52 5 12 +1 53 5 12 +1 54 5 12 +1 55 5 12 +1 56 5 12 +1 57 5 12 +1 58 5 12 +1 59 5 12 +1 60 5 12 +1 61 5 12 +1 62 5 12 +1 63 5 12 +1 64 5 12 +1 65 5 12 +1 66 5 12 +1 67 5 12 +1 68 5 12 +1 69 5 12 +1 70 5 12 +1 71 5 12 +1 72 5 12 +1 73 5 12 +1 74 5 12 +1 75 5 12 +1 76 5 12 +1 77 5 12 +1 78 5 12 +1 79 5 12 +1 80 5 12 +1 81 5 12 +1 82 5 12 +1 83 5 12 +1 84 5 12 +1 85 5 12 +1 86 5 12 +1 87 5 12 +1 88 5 12 +1 89 5 12 +1 90 5 12 +1 91 5 12 +1 92 5 12 +1 93 5 12 +1 94 5 12 +1 95 5 12 +1 96 5 12 +1 97 5 12 +1 98 5 12 +1 99 5 12 +1 100 5 12 +select * from t4 where rid = 2 order by cid; +uid gid rid cid +1 1 2 3 +1 1 2 4 +drop table t1,t2,t3,t4,t5,t6,t7; diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result new file mode 100644 index 00000000000..93f46c85499 --- /dev/null +++ b/mysql-test/r/ndb_insert.result @@ -0,0 +1,419 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +b INT NOT NULL, +c INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (0, 0, 0); +SELECT * FROM t1; +pk1 b c +0 0 0 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10), +(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15), +(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20), +(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25), +(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30), +(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35), +(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40), +(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45), +(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50), +(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55), +(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60), +(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65), +(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70), +(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75), +(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80), +(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85), +(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90), +(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95), +(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100), +(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105), +(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110), +(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115), +(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120), +(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125), +(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130), +(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135), +(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140), +(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145), +(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150), +(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155), +(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160), +(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165), +(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170), +(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175), +(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180), +(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185), +(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190), +(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195), +(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200), +(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205), +(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210), +(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215), +(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220), +(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225), +(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230), +(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235), +(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240), +(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245), +(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250), +(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255), +(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260), +(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265), +(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270), +(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275), +(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280), +(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285), +(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290), +(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295), +(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300), +(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305), +(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310), +(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315), +(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320), +(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325), +(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330), +(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335), +(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340), +(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345), +(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350), +(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355), +(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360), +(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365), +(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370), +(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375), +(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380), +(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385), +(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390), +(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395), +(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400), +(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405), +(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410), +(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415), +(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420), +(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425), +(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430), +(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435), +(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440), +(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445), +(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450), +(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455), +(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460), +(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465), +(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470), +(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475), +(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480), +(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485), +(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490), +(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495), +(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500); +SELECT COUNT(*) FROM t1; +COUNT(*) +501 +INSERT INTO t1 VALUES +(501,501,501),(502,502,502),(503,503,503),(504,504,504),(505,505,505), +(506,506,506),(507,507,507),(508,508,508),(509,509,509),(510,510,510), +(511,511,511),(512,512,512),(513,513,513),(514,514,514),(515,515,515), +(516,516,516),(517,517,517),(518,518,518),(519,519,519),(520,520,520), +(521,521,521),(522,522,522),(523,523,523),(524,524,524),(525,525,525), +(526,526,526),(527,527,527),(528,528,528),(529,529,529),(530,530,530), +(531,531,531),(532,532,532),(533,533,533),(534,534,534),(535,535,535), +(536,536,536),(537,537,537),(538,538,538),(539,539,539),(540,540,540), +(541,541,541),(542,542,542),(543,543,543),(544,544,544),(545,545,545), +(546,546,546),(547,547,547),(548,548,548),(549,549,549),(550,550,550), +(551,551,551),(552,552,552),(553,553,553),(554,554,554),(555,555,555), +(556,556,556),(557,557,557),(558,558,558),(559,559,559),(560,560,560), +(561,561,561),(562,562,562),(563,563,563),(564,564,564),(565,565,565), +(566,566,566),(567,567,567),(568,568,568),(569,569,569),(570,570,570), +(571,571,571),(572,572,572),(573,573,573),(574,574,574),(575,575,575), +(576,576,576),(577,577,577),(578,578,578),(579,579,579),(580,580,580), +(581,581,581),(582,582,582),(583,583,583),(584,584,584),(585,585,585), +(586,586,586),(587,587,587),(588,588,588),(589,589,589),(590,590,590), +(591,591,591),(592,592,592),(593,593,593),(594,594,594),(595,595,595), +(596,596,596),(597,597,597),(598,598,598),(599,599,599),(600,600,600), +(601,601,601),(602,602,602),(603,603,603),(604,604,604),(605,605,605), +(606,606,606),(607,607,607),(608,608,608),(609,609,609),(610,610,610), +(611,611,611),(612,612,612),(613,613,613),(614,614,614),(615,615,615), +(616,616,616),(617,617,617),(618,618,618),(619,619,619),(620,620,620), +(621,621,621),(622,622,622),(623,623,623),(624,624,624),(625,625,625), +(626,626,626),(627,627,627),(628,628,628),(629,629,629),(630,630,630), +(631,631,631),(632,632,632),(633,633,633),(634,634,634),(635,635,635), +(636,636,636),(637,637,637),(638,638,638),(639,639,639),(640,640,640), +(641,641,641),(642,642,642),(643,643,643),(644,644,644),(645,645,645), +(646,646,646),(647,647,647),(648,648,648),(649,649,649),(650,650,650), +(651,651,651),(652,652,652),(653,653,653),(654,654,654),(655,655,655), +(656,656,656),(657,657,657),(658,658,658),(659,659,659),(660,660,660), +(661,661,661),(662,662,662),(663,663,663),(664,664,664),(665,665,665), +(666,666,666),(667,667,667),(668,668,668),(669,669,669),(670,670,670), +(671,671,671),(672,672,672),(673,673,673),(674,674,674),(675,675,675), +(676,676,676),(677,677,677),(678,678,678),(679,679,679),(680,680,680), +(681,681,681),(682,682,682),(683,683,683),(684,684,684),(685,685,685), +(686,686,686),(687,687,687),(688,688,688),(689,689,689),(690,690,690), +(691,691,691),(692,692,692),(693,693,693),(694,694,694),(695,695,695), +(696,696,696),(697,697,697),(698,698,698),(699,699,699),(700,700,700), +(701,701,701),(702,702,702),(703,703,703),(704,704,704),(705,705,705), +(706,706,706),(707,707,707),(708,708,708),(709,709,709),(710,710,710), +(711,711,711),(712,712,712),(713,713,713),(714,714,714),(715,715,715), +(716,716,716),(717,717,717),(718,718,718),(719,719,719),(720,720,720), +(721,721,721),(722,722,722),(723,723,723),(724,724,724),(725,725,725), +(726,726,726),(727,727,727),(728,728,728),(729,729,729),(730,730,730), +(731,731,731),(732,732,732),(733,733,733),(734,734,734),(735,735,735), +(736,736,736),(737,737,737),(738,738,738),(739,739,739),(740,740,740), +(741,741,741),(742,742,742),(743,743,743),(744,744,744),(745,745,745), +(746,746,746),(747,747,747),(748,748,748),(749,749,749),(750,750,750), +(751,751,751),(752,752,752),(753,753,753),(754,754,754),(755,755,755), +(756,756,756),(757,757,757),(758,758,758),(759,759,759),(760,760,760), +(761,761,761),(762,762,762),(763,763,763),(764,764,764),(765,765,765), +(766,766,766),(767,767,767),(768,768,768),(769,769,769),(770,770,770), +(771,771,771),(772,772,772),(773,773,773),(774,774,774),(775,775,775), +(776,776,776),(777,777,777),(778,778,778),(779,779,779),(780,780,780), +(781,781,781),(782,782,782),(783,783,783),(784,784,784),(785,785,785), +(786,786,786),(787,787,787),(788,788,788),(789,789,789),(790,790,790), +(791,791,791),(792,792,792),(793,793,793),(794,794,794),(795,795,795), +(796,796,796),(797,797,797),(798,798,798),(799,799,799),(800,800,800), +(801,801,801),(802,802,802),(803,803,803),(804,804,804),(805,805,805), +(806,806,806),(807,807,807),(808,808,808),(809,809,809),(810,810,810), +(811,811,811),(812,812,812),(813,813,813),(814,814,814),(815,815,815), +(816,816,816),(817,817,817),(818,818,818),(819,819,819),(820,820,820), +(821,821,821),(822,822,822),(823,823,823),(824,824,824),(825,825,825), +(826,826,826),(827,827,827),(828,828,828),(829,829,829),(830,830,830), +(831,831,831),(832,832,832),(833,833,833),(834,834,834),(835,835,835), +(836,836,836),(837,837,837),(838,838,838),(839,839,839),(840,840,840), +(841,841,841),(842,842,842),(843,843,843),(844,844,844),(845,845,845), +(846,846,846),(847,847,847),(848,848,848),(849,849,849),(850,850,850), +(851,851,851),(852,852,852),(853,853,853),(854,854,854),(855,855,855), +(856,856,856),(857,857,857),(858,858,858),(859,859,859),(860,860,860), +(861,861,861),(862,862,862),(863,863,863),(864,864,864),(865,865,865), +(866,866,866),(867,867,867),(868,868,868),(869,869,869),(870,870,870), +(871,871,871),(872,872,872),(873,873,873),(874,874,874),(875,875,875), +(876,876,876),(877,877,877),(878,878,878),(879,879,879),(880,880,880), +(881,881,881),(882,882,882),(883,883,883),(884,884,884),(885,885,885), +(886,886,886),(887,887,887),(888,888,888),(889,889,889),(890,890,890), +(891,891,891),(892,892,892),(893,893,893),(894,894,894),(895,895,895), +(896,896,896),(897,897,897),(898,898,898),(899,899,899),(900,900,900), +(901,901,901),(902,902,902),(903,903,903),(904,904,904),(905,905,905), +(906,906,906),(907,907,907),(908,908,908),(909,909,909),(910,910,910), +(911,911,911),(912,912,912),(913,913,913),(914,914,914),(915,915,915), +(916,916,916),(917,917,917),(918,918,918),(919,919,919),(920,920,920), +(921,921,921),(922,922,922),(923,923,923),(924,924,924),(925,925,925), +(926,926,926),(927,927,927),(928,928,928),(929,929,929),(930,930,930), +(931,931,931),(932,932,932),(933,933,933),(934,934,934),(935,935,935), +(936,936,936),(937,937,937),(938,938,938),(939,939,939),(940,940,940), +(941,941,941),(942,942,942),(943,943,943),(944,944,944),(945,945,945), +(946,946,946),(947,947,947),(948,948,948),(949,949,949),(950,950,950), +(951,951,951),(952,952,952),(953,953,953),(954,954,954),(955,955,955), +(956,956,956),(957,957,957),(958,958,958),(959,959,959),(960,960,960), +(961,961,961),(962,962,962),(963,963,963),(964,964,964),(965,965,965), +(966,966,966),(967,967,967),(968,968,968),(969,969,969),(970,970,970), +(971,971,971),(972,972,972),(973,973,973),(974,974,974),(975,975,975), +(976,976,976),(977,977,977),(978,978,978),(979,979,979),(980,980,980), +(981,981,981),(982,982,982),(983,983,983),(984,984,984),(985,985,985), +(986,986,986),(987,987,987),(988,988,988),(989,989,989),(990,990,990), +(991,991,991),(992,992,992),(993,993,993),(994,994,994),(995,995,995), +(996,996,996),(997,997,997),(998,998,998),(999,999,999),(1000,1000,1000), +(1001,1001,1001),(1002,1002,1002),(1003,1003,1003),(1004,1004,1004),(1005,1005,1005), +(1006,1006,1006),(1007,1007,1007),(1008,1008,1008),(1009,1009,1009),(1010,1010,1010), +(1011,1011,1011),(1012,1012,1012),(1013,1013,1013),(1014,1014,1014),(1015,1015,1015), +(1016,1016,1016),(1017,1017,1017),(1018,1018,1018),(1019,1019,1019),(1020,1020,1020), +(1021,1021,1021),(1022,1022,1022),(1023,1023,1023),(1024,1024,1024),(1025,1025,1025), +(1026,1026,1026),(1027,1027,1027),(1028,1028,1028),(1029,1029,1029),(1030,1030,1030), +(1031,1031,1031),(1032,1032,1032),(1033,1033,1033),(1034,1034,1034),(1035,1035,1035), +(1036,1036,1036),(1037,1037,1037),(1038,1038,1038),(1039,1039,1039),(1040,1040,1040), +(1041,1041,1041),(1042,1042,1042),(1043,1043,1043),(1044,1044,1044),(1045,1045,1045), +(1046,1046,1046),(1047,1047,1047),(1048,1048,1048),(1049,1049,1049),(1050,1050,1050), +(1051,1051,1051),(1052,1052,1052),(1053,1053,1053),(1054,1054,1054),(1055,1055,1055), +(1056,1056,1056),(1057,1057,1057),(1058,1058,1058),(1059,1059,1059),(1060,1060,1060), +(1061,1061,1061),(1062,1062,1062),(1063,1063,1063),(1064,1064,1064),(1065,1065,1065), +(1066,1066,1066),(1067,1067,1067),(1068,1068,1068),(1069,1069,1069),(1070,1070,1070), +(1071,1071,1071),(1072,1072,1072),(1073,1073,1073),(1074,1074,1074),(1075,1075,1075), +(1076,1076,1076),(1077,1077,1077),(1078,1078,1078),(1079,1079,1079),(1080,1080,1080), +(1081,1081,1081),(1082,1082,1082),(1083,1083,1083),(1084,1084,1084),(1085,1085,1085), +(1086,1086,1086),(1087,1087,1087),(1088,1088,1088),(1089,1089,1089),(1090,1090,1090), +(1091,1091,1091),(1092,1092,1092),(1093,1093,1093),(1094,1094,1094),(1095,1095,1095), +(1096,1096,1096),(1097,1097,1097),(1098,1098,1098),(1099,1099,1099),(1100,1100,1100), +(1101,1101,1101),(1102,1102,1102),(1103,1103,1103),(1104,1104,1104),(1105,1105,1105), +(1106,1106,1106),(1107,1107,1107),(1108,1108,1108),(1109,1109,1109),(1110,1110,1110), +(1111,1111,1111),(1112,1112,1112),(1113,1113,1113),(1114,1114,1114),(1115,1115,1115), +(1116,1116,1116),(1117,1117,1117),(1118,1118,1118),(1119,1119,1119),(1120,1120,1120), +(1121,1121,1121),(1122,1122,1122),(1123,1123,1123),(1124,1124,1124),(1125,1125,1125), +(1126,1126,1126),(1127,1127,1127),(1128,1128,1128),(1129,1129,1129),(1130,1130,1130), +(1131,1131,1131),(1132,1132,1132),(1133,1133,1133),(1134,1134,1134),(1135,1135,1135), +(1136,1136,1136),(1137,1137,1137),(1138,1138,1138),(1139,1139,1139),(1140,1140,1140), +(1141,1141,1141),(1142,1142,1142),(1143,1143,1143),(1144,1144,1144),(1145,1145,1145), +(1146,1146,1146),(1147,1147,1147),(1148,1148,1148),(1149,1149,1149),(1150,1150,1150), +(1151,1151,1151),(1152,1152,1152),(1153,1153,1153),(1154,1154,1154),(1155,1155,1155), +(1156,1156,1156),(1157,1157,1157),(1158,1158,1158),(1159,1159,1159),(1160,1160,1160), +(1161,1161,1161),(1162,1162,1162),(1163,1163,1163),(1164,1164,1164),(1165,1165,1165), +(1166,1166,1166),(1167,1167,1167),(1168,1168,1168),(1169,1169,1169),(1170,1170,1170), +(1171,1171,1171),(1172,1172,1172),(1173,1173,1173),(1174,1174,1174),(1175,1175,1175), +(1176,1176,1176),(1177,1177,1177),(1178,1178,1178),(1179,1179,1179),(1180,1180,1180), +(1181,1181,1181),(1182,1182,1182),(1183,1183,1183),(1184,1184,1184),(1185,1185,1185), +(1186,1186,1186),(1187,1187,1187),(1188,1188,1188),(1189,1189,1189),(1190,1190,1190), +(1191,1191,1191),(1192,1192,1192),(1193,1193,1193),(1194,1194,1194),(1195,1195,1195), +(1196,1196,1196),(1197,1197,1197),(1198,1198,1198),(1199,1199,1199),(1200,1200,1200), +(1201,1201,1201),(1202,1202,1202),(1203,1203,1203),(1204,1204,1204),(1205,1205,1205), +(1206,1206,1206),(1207,1207,1207),(1208,1208,1208),(1209,1209,1209),(1210,1210,1210), +(1211,1211,1211),(1212,1212,1212),(1213,1213,1213),(1214,1214,1214),(1215,1215,1215), +(1216,1216,1216),(1217,1217,1217),(1218,1218,1218),(1219,1219,1219),(1220,1220,1220), +(1221,1221,1221),(1222,1222,1222),(1223,1223,1223),(1224,1224,1224),(1225,1225,1225), +(1226,1226,1226),(1227,1227,1227),(1228,1228,1228),(1229,1229,1229),(1230,1230,1230), +(1231,1231,1231),(1232,1232,1232),(1233,1233,1233),(1234,1234,1234),(1235,1235,1235), +(1236,1236,1236),(1237,1237,1237),(1238,1238,1238),(1239,1239,1239),(1240,1240,1240), +(1241,1241,1241),(1242,1242,1242),(1243,1243,1243),(1244,1244,1244),(1245,1245,1245), +(1246,1246,1246),(1247,1247,1247),(1248,1248,1248),(1249,1249,1249),(1250,1250,1250), +(1251,1251,1251),(1252,1252,1252),(1253,1253,1253),(1254,1254,1254),(1255,1255,1255), +(1256,1256,1256),(1257,1257,1257),(1258,1258,1258),(1259,1259,1259),(1260,1260,1260), +(1261,1261,1261),(1262,1262,1262),(1263,1263,1263),(1264,1264,1264),(1265,1265,1265), +(1266,1266,1266),(1267,1267,1267),(1268,1268,1268),(1269,1269,1269),(1270,1270,1270), +(1271,1271,1271),(1272,1272,1272),(1273,1273,1273),(1274,1274,1274),(1275,1275,1275), +(1276,1276,1276),(1277,1277,1277),(1278,1278,1278),(1279,1279,1279),(1280,1280,1280), +(1281,1281,1281),(1282,1282,1282),(1283,1283,1283),(1284,1284,1284),(1285,1285,1285), +(1286,1286,1286),(1287,1287,1287),(1288,1288,1288),(1289,1289,1289),(1290,1290,1290), +(1291,1291,1291),(1292,1292,1292),(1293,1293,1293),(1294,1294,1294),(1295,1295,1295), +(1296,1296,1296),(1297,1297,1297),(1298,1298,1298),(1299,1299,1299),(1300,1300,1300), +(1301,1301,1301),(1302,1302,1302),(1303,1303,1303),(1304,1304,1304),(1305,1305,1305), +(1306,1306,1306),(1307,1307,1307),(1308,1308,1308),(1309,1309,1309),(1310,1310,1310), +(1311,1311,1311),(1312,1312,1312),(1313,1313,1313),(1314,1314,1314),(1315,1315,1315), +(1316,1316,1316),(1317,1317,1317),(1318,1318,1318),(1319,1319,1319),(1320,1320,1320), +(1321,1321,1321),(1322,1322,1322),(1323,1323,1323),(1324,1324,1324),(1325,1325,1325), +(1326,1326,1326),(1327,1327,1327),(1328,1328,1328),(1329,1329,1329),(1330,1330,1330), +(1331,1331,1331),(1332,1332,1332),(1333,1333,1333),(1334,1334,1334),(1335,1335,1335), +(1336,1336,1336),(1337,1337,1337),(1338,1338,1338),(1339,1339,1339),(1340,1340,1340), +(1341,1341,1341),(1342,1342,1342),(1343,1343,1343),(1344,1344,1344),(1345,1345,1345), +(1346,1346,1346),(1347,1347,1347),(1348,1348,1348),(1349,1349,1349),(1350,1350,1350), +(1351,1351,1351),(1352,1352,1352),(1353,1353,1353),(1354,1354,1354),(1355,1355,1355), +(1356,1356,1356),(1357,1357,1357),(1358,1358,1358),(1359,1359,1359),(1360,1360,1360), +(1361,1361,1361),(1362,1362,1362),(1363,1363,1363),(1364,1364,1364),(1365,1365,1365), +(1366,1366,1366),(1367,1367,1367),(1368,1368,1368),(1369,1369,1369),(1370,1370,1370), +(1371,1371,1371),(1372,1372,1372),(1373,1373,1373),(1374,1374,1374),(1375,1375,1375), +(1376,1376,1376),(1377,1377,1377),(1378,1378,1378),(1379,1379,1379),(1380,1380,1380), +(1381,1381,1381),(1382,1382,1382),(1383,1383,1383),(1384,1384,1384),(1385,1385,1385), +(1386,1386,1386),(1387,1387,1387),(1388,1388,1388),(1389,1389,1389),(1390,1390,1390), +(1391,1391,1391),(1392,1392,1392),(1393,1393,1393),(1394,1394,1394),(1395,1395,1395), +(1396,1396,1396),(1397,1397,1397),(1398,1398,1398),(1399,1399,1399),(1400,1400,1400), +(1401,1401,1401),(1402,1402,1402),(1403,1403,1403),(1404,1404,1404),(1405,1405,1405), +(1406,1406,1406),(1407,1407,1407),(1408,1408,1408),(1409,1409,1409),(1410,1410,1410), +(1411,1411,1411),(1412,1412,1412),(1413,1413,1413),(1414,1414,1414),(1415,1415,1415), +(1416,1416,1416),(1417,1417,1417),(1418,1418,1418),(1419,1419,1419),(1420,1420,1420), +(1421,1421,1421),(1422,1422,1422),(1423,1423,1423),(1424,1424,1424),(1425,1425,1425), +(1426,1426,1426),(1427,1427,1427),(1428,1428,1428),(1429,1429,1429),(1430,1430,1430), +(1431,1431,1431),(1432,1432,1432),(1433,1433,1433),(1434,1434,1434),(1435,1435,1435), +(1436,1436,1436),(1437,1437,1437),(1438,1438,1438),(1439,1439,1439),(1440,1440,1440), +(1441,1441,1441),(1442,1442,1442),(1443,1443,1443),(1444,1444,1444),(1445,1445,1445), +(1446,1446,1446),(1447,1447,1447),(1448,1448,1448),(1449,1449,1449),(1450,1450,1450), +(1451,1451,1451),(1452,1452,1452),(1453,1453,1453),(1454,1454,1454),(1455,1455,1455), +(1456,1456,1456),(1457,1457,1457),(1458,1458,1458),(1459,1459,1459),(1460,1460,1460), +(1461,1461,1461),(1462,1462,1462),(1463,1463,1463),(1464,1464,1464),(1465,1465,1465), +(1466,1466,1466),(1467,1467,1467),(1468,1468,1468),(1469,1469,1469),(1470,1470,1470), +(1471,1471,1471),(1472,1472,1472),(1473,1473,1473),(1474,1474,1474),(1475,1475,1475), +(1476,1476,1476),(1477,1477,1477),(1478,1478,1478),(1479,1479,1479),(1480,1480,1480), +(1481,1481,1481),(1482,1482,1482),(1483,1483,1483),(1484,1484,1484),(1485,1485,1485), +(1486,1486,1486),(1487,1487,1487),(1488,1488,1488),(1489,1489,1489),(1490,1490,1490), +(1491,1491,1491),(1492,1492,1492),(1493,1493,1493),(1494,1494,1494),(1495,1495,1495), +(1496,1496,1496),(1497,1497,1497),(1498,1498,1498),(1499,1499,1499),(1500,1500,1500), +(1501,1501,1501),(1502,1502,1502),(1503,1503,1503),(1504,1504,1504),(1505,1505,1505), +(1506,1506,1506),(1507,1507,1507),(1508,1508,1508),(1509,1509,1509),(1510,1510,1510), +(1511,1511,1511),(1512,1512,1512),(1513,1513,1513),(1514,1514,1514),(1515,1515,1515), +(1516,1516,1516),(1517,1517,1517),(1518,1518,1518),(1519,1519,1519),(1520,1520,1520), +(1521,1521,1521),(1522,1522,1522),(1523,1523,1523),(1524,1524,1524),(1525,1525,1525), +(1526,1526,1526),(1527,1527,1527),(1528,1528,1528),(1529,1529,1529),(1530,1530,1530), +(1531,1531,1531),(1532,1532,1532),(1533,1533,1533),(1534,1534,1534),(1535,1535,1535), +(1536,1536,1536),(1537,1537,1537),(1538,1538,1538),(1539,1539,1539),(1540,1540,1540), +(1541,1541,1541),(1542,1542,1542),(1543,1543,1543),(1544,1544,1544),(1545,1545,1545), +(1546,1546,1546),(1547,1547,1547),(1548,1548,1548),(1549,1549,1549),(1550,1550,1550), +(1551,1551,1551),(1552,1552,1552),(1553,1553,1553),(1554,1554,1554),(1555,1555,1555), +(1556,1556,1556),(1557,1557,1557),(1558,1558,1558),(1559,1559,1559),(1560,1560,1560), +(1561,1561,1561),(1562,1562,1562),(1563,1563,1563),(1564,1564,1564),(1565,1565,1565), +(1566,1566,1566),(1567,1567,1567),(1568,1568,1568),(1569,1569,1569),(1570,1570,1570), +(1571,1571,1571),(1572,1572,1572),(1573,1573,1573),(1574,1574,1574),(1575,1575,1575), +(1576,1576,1576),(1577,1577,1577),(1578,1578,1578),(1579,1579,1579),(1580,1580,1580), +(1581,1581,1581),(1582,1582,1582),(1583,1583,1583),(1584,1584,1584),(1585,1585,1585), +(1586,1586,1586),(1587,1587,1587),(1588,1588,1588),(1589,1589,1589),(1590,1590,1590), +(1591,1591,1591),(1592,1592,1592),(1593,1593,1593),(1594,1594,1594),(1595,1595,1595), +(1596,1596,1596),(1597,1597,1597),(1598,1598,1598),(1599,1599,1599),(1600,1600,1600), +(1601,1601,1601),(1602,1602,1602),(1603,1603,1603),(1604,1604,1604),(1605,1605,1605), +(1606,1606,1606),(1607,1607,1607),(1608,1608,1608),(1609,1609,1609),(1610,1610,1610), +(1611,1611,1611),(1612,1612,1612),(1613,1613,1613),(1614,1614,1614),(1615,1615,1615), +(1616,1616,1616),(1617,1617,1617),(1618,1618,1618),(1619,1619,1619),(1620,1620,1620), +(1621,1621,1621),(1622,1622,1622),(1623,1623,1623),(1624,1624,1624),(1625,1625,1625), +(1626,1626,1626),(1627,1627,1627),(1628,1628,1628),(1629,1629,1629),(1630,1630,1630), +(1631,1631,1631),(1632,1632,1632),(1633,1633,1633),(1634,1634,1634),(1635,1635,1635), +(1636,1636,1636),(1637,1637,1637),(1638,1638,1638),(1639,1639,1639),(1640,1640,1640), +(1641,1641,1641),(1642,1642,1642),(1643,1643,1643),(1644,1644,1644),(1645,1645,1645), +(1646,1646,1646),(1647,1647,1647),(1648,1648,1648),(1649,1649,1649),(1650,1650,1650), +(1651,1651,1651),(1652,1652,1652),(1653,1653,1653),(1654,1654,1654),(1655,1655,1655), +(1656,1656,1656),(1657,1657,1657),(1658,1658,1658),(1659,1659,1659),(1660,1660,1660), +(1661,1661,1661),(1662,1662,1662),(1663,1663,1663),(1664,1664,1664),(1665,1665,1665), +(1666,1666,1666),(1667,1667,1667),(1668,1668,1668),(1669,1669,1669),(1670,1670,1670), +(1671,1671,1671),(1672,1672,1672),(1673,1673,1673),(1674,1674,1674),(1675,1675,1675), +(1676,1676,1676),(1677,1677,1677),(1678,1678,1678),(1679,1679,1679),(1680,1680,1680), +(1681,1681,1681),(1682,1682,1682),(1683,1683,1683),(1684,1684,1684),(1685,1685,1685), +(1686,1686,1686),(1687,1687,1687),(1688,1688,1688),(1689,1689,1689),(1690,1690,1690), +(1691,1691,1691),(1692,1692,1692),(1693,1693,1693),(1694,1694,1694),(1695,1695,1695), +(1696,1696,1696),(1697,1697,1697),(1698,1698,1698),(1699,1699,1699),(1700,1700,1700), +(1701,1701,1701),(1702,1702,1702),(1703,1703,1703),(1704,1704,1704),(1705,1705,1705), +(1706,1706,1706),(1707,1707,1707),(1708,1708,1708),(1709,1709,1709),(1710,1710,1710), +(1711,1711,1711),(1712,1712,1712),(1713,1713,1713),(1714,1714,1714),(1715,1715,1715), +(1716,1716,1716),(1717,1717,1717),(1718,1718,1718),(1719,1719,1719),(1720,1720,1720), +(1721,1721,1721),(1722,1722,1722),(1723,1723,1723),(1724,1724,1724),(1725,1725,1725), +(1726,1726,1726),(1727,1727,1727),(1728,1728,1728),(1729,1729,1729),(1730,1730,1730), +(1731,1731,1731),(1732,1732,1732),(1733,1733,1733),(1734,1734,1734),(1735,1735,1735), +(1736,1736,1736),(1737,1737,1737),(1738,1738,1738),(1739,1739,1739),(1740,1740,1740), +(1741,1741,1741),(1742,1742,1742),(1743,1743,1743),(1744,1744,1744),(1745,1745,1745), +(1746,1746,1746),(1747,1747,1747),(1748,1748,1748),(1749,1749,1749),(1750,1750,1750), +(1751,1751,1751),(1752,1752,1752),(1753,1753,1753),(1754,1754,1754),(1755,1755,1755), +(1756,1756,1756),(1757,1757,1757),(1758,1758,1758),(1759,1759,1759),(1760,1760,1760), +(1761,1761,1761),(1762,1762,1762),(1763,1763,1763),(1764,1764,1764),(1765,1765,1765), +(1766,1766,1766),(1767,1767,1767),(1768,1768,1768),(1769,1769,1769),(1770,1770,1770), +(1771,1771,1771),(1772,1772,1772),(1773,1773,1773),(1774,1774,1774),(1775,1775,1775), +(1776,1776,1776),(1777,1777,1777),(1778,1778,1778),(1779,1779,1779),(1780,1780,1780), +(1781,1781,1781),(1782,1782,1782),(1783,1783,1783),(1784,1784,1784),(1785,1785,1785), +(1786,1786,1786),(1787,1787,1787),(1788,1788,1788),(1789,1789,1789),(1790,1790,1790), +(1791,1791,1791),(1792,1792,1792),(1793,1793,1793),(1794,1794,1794),(1795,1795,1795), +(1796,1796,1796),(1797,1797,1797),(1798,1798,1798),(1799,1799,1799),(1800,1800,1800), +(1801,1801,1801),(1802,1802,1802),(1803,1803,1803),(1804,1804,1804),(1805,1805,1805), +(1806,1806,1806),(1807,1807,1807),(1808,1808,1808),(1809,1809,1809),(1810,1810,1810), +(1811,1811,1811),(1812,1812,1812),(1813,1813,1813),(1814,1814,1814),(1815,1815,1815), +(1816,1816,1816),(1817,1817,1817),(1818,1818,1818),(1819,1819,1819),(1820,1820,1820), +(1821,1821,1821),(1822,1822,1822),(1823,1823,1823),(1824,1824,1824),(1825,1825,1825), +(1826,1826,1826),(1827,1827,1827),(1828,1828,1828),(1829,1829,1829),(1830,1830,1830), +(1831,1831,1831),(1832,1832,1832),(1833,1833,1833),(1834,1834,1834),(1835,1835,1835), +(1836,1836,1836),(1837,1837,1837),(1838,1838,1838),(1839,1839,1839),(1840,1840,1840), +(1841,1841,1841),(1842,1842,1842),(1843,1843,1843),(1844,1844,1844),(1845,1845,1845), +(1846,1846,1846),(1847,1847,1847),(1848,1848,1848),(1849,1849,1849),(1850,1850,1850), +(1851,1851,1851),(1852,1852,1852),(1853,1853,1853),(1854,1854,1854),(1855,1855,1855), +(1856,1856,1856),(1857,1857,1857),(1858,1858,1858),(1859,1859,1859),(1860,1860,1860), +(1861,1861,1861),(1862,1862,1862),(1863,1863,1863),(1864,1864,1864),(1865,1865,1865), +(1866,1866,1866),(1867,1867,1867),(1868,1868,1868),(1869,1869,1869),(1870,1870,1870), +(1871,1871,1871),(1872,1872,1872),(1873,1873,1873),(1874,1874,1874),(1875,1875,1875), +(1876,1876,1876),(1877,1877,1877),(1878,1878,1878),(1879,1879,1879),(1880,1880,1880), +(1881,1881,1881),(1882,1882,1882),(1883,1883,1883),(1884,1884,1884),(1885,1885,1885), +(1886,1886,1886),(1887,1887,1887),(1888,1888,1888),(1889,1889,1889),(1890,1890,1890), +(1891,1891,1891),(1892,1892,1892),(1893,1893,1893),(1894,1894,1894),(1895,1895,1895), +(1896,1896,1896),(1897,1897,1897),(1898,1898,1898),(1899,1899,1899),(1900,1900,1900), +(1901,1901,1901),(1902,1902,1902),(1903,1903,1903),(1904,1904,1904),(1905,1905,1905), +(1906,1906,1906),(1907,1907,1907),(1908,1908,1908),(1909,1909,1909),(1910,1910,1910), +(1911,1911,1911),(1912,1912,1912),(1913,1913,1913),(1914,1914,1914),(1915,1915,1915), +(1916,1916,1916),(1917,1917,1917),(1918,1918,1918),(1919,1919,1919),(1920,1920,1920), +(1921,1921,1921),(1922,1922,1922),(1923,1923,1923),(1924,1924,1924),(1925,1925,1925), +(1926,1926,1926),(1927,1927,1927),(1928,1928,1928),(1929,1929,1929),(1930,1930,1930), +(1931,1931,1931),(1932,1932,1932),(1933,1933,1933),(1934,1934,1934),(1935,1935,1935), +(1936,1936,1936),(1937,1937,1937),(1938,1938,1938),(1939,1939,1939),(1940,1940,1940), +(1941,1941,1941),(1942,1942,1942),(1943,1943,1943),(1944,1944,1944),(1945,1945,1945), +(1946,1946,1946),(1947,1947,1947),(1948,1948,1948),(1949,1949,1949),(1950,1950,1950), +(1951,1951,1951),(1952,1952,1952),(1953,1953,1953),(1954,1954,1954),(1955,1955,1955), +(1956,1956,1956),(1957,1957,1957),(1958,1958,1958),(1959,1959,1959),(1960,1960,1960), +(1961,1961,1961),(1962,1962,1962),(1963,1963,1963),(1964,1964,1964),(1965,1965,1965), +(1966,1966,1966),(1967,1967,1967),(1968,1968,1968),(1969,1969,1969),(1970,1970,1970), +(1971,1971,1971),(1972,1972,1972),(1973,1973,1973),(1974,1974,1974),(1975,1975,1975), +(1976,1976,1976),(1977,1977,1977),(1978,1978,1978),(1979,1979,1979),(1980,1980,1980), +(1981,1981,1981),(1982,1982,1982),(1983,1983,1983),(1984,1984,1984),(1985,1985,1985), +(1986,1986,1986),(1987,1987,1987),(1988,1988,1988),(1989,1989,1989),(1990,1990,1990), +(1991,1991,1991),(1992,1992,1992),(1993,1993,1993),(1994,1994,1994),(1995,1995,1995), +(1996,1996,1996),(1997,1997,1997),(1998,1998,1998),(1999,1999,1999); +SELECT COUNT(*) FROM t1; +COUNT(*) +2000 +DROP TABLE t1; diff --git a/mysql-test/r/ndb_limit.result b/mysql-test/r/ndb_limit.result new file mode 100644 index 00000000000..6574aa0bb1a --- /dev/null +++ b/mysql-test/r/ndb_limit.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS t2; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +select count(*) from t2; +count(*) +10000 +delete from t2 limit 1; +select count(*) from t2; +count(*) +9999 +delete from t2 limit 100; +select count(*) from t2; +count(*) +9899 +delete from t2 limit 1000; +select count(*) from t2; +count(*) +8899 +update t2 set c=12345678 limit 100; +select count(*) from t2 where c=12345678; +count(*) +100 +select count(*) from t2 where c=12345678 limit 1000; +count(*) +100 +select * from t2 limit 0; +a b c +drop table t2; diff --git a/mysql-test/r/ndb_lock.result b/mysql-test/r/ndb_lock.result new file mode 100644 index 00000000000..56661913e22 --- /dev/null +++ b/mysql-test/r/ndb_lock.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; +create table t1 (x integer not null primary key, y varchar(32)) engine = ndb; +insert into t1 values (1,'one'), (2,'two'); +select * from t1 order by x; +x y +1 one +2 two +select * from t1 order by x; +x y +1 one +2 two +start transaction; +insert into t1 values (3,'three'); +select * from t1 order by x; +x y +1 one +2 two +3 three +start transaction; +select * from t1 order by x; +x y +1 one +2 two +commit; +select * from t1 order by x; +x y +1 one +2 two +3 three +commit; diff --git a/mysql-test/r/ndb_minmax.result b/mysql-test/r/ndb_minmax.result new file mode 100644 index 00000000000..cc0c238ac6e --- /dev/null +++ b/mysql-test/r/ndb_minmax.result @@ -0,0 +1,120 @@ +drop table if exists t1, t2; +CREATE TABLE t1 ( +a int PRIMARY KEY +) engine = ndb; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +INSERT INTO t1 VALUES (6); +select MAX(a) from t1; +MAX(a) +6 +select MAX(a) from t1; +MAX(a) +6 +select MAX(a) from t1; +MAX(a) +6 +select MAX(a) from t1; +MAX(a) +6 +select MIN(a) from t1; +MIN(a) +1 +select MIN(a) from t1; +MIN(a) +1 +select MIN(a) from t1; +MIN(a) +1 +select * from t1 order by a; +a +1 +2 +3 +4 +5 +6 +select MIN(a) from t1; +MIN(a) +1 +select MAX(a) from t1; +MAX(a) +6 +select MAX(a) from t1; +MAX(a) +6 +select * from t1 order by a; +a +1 +2 +3 +4 +5 +6 +drop table t1; +CREATE TABLE t2 ( +a int PRIMARY KEY, +b int not null, +c int not null, +KEY(b), +UNIQUE(c) +) engine = ndb; +INSERT INTO t2 VALUES (1, 5, 1); +INSERT INTO t2 VALUES (2, 2, 7); +INSERT INTO t2 VALUES (3, 3, 3); +INSERT INTO t2 VALUES (4, 4, 4); +INSERT INTO t2 VALUES (5, 5, 5); +INSERT INTO t2 VALUES (6, 6, 6); +INSERT INTO t2 VALUES (7, 2, 10); +INSERT INTO t2 VALUES (8, 10, 2); +select MAX(a) from t2; +MAX(a) +8 +select MAX(b) from t2; +MAX(b) +10 +select MAX(c) from t2; +MAX(c) +10 +select MIN(a) from t2; +MIN(a) +1 +select MIN(b) from t2; +MIN(b) +2 +select MIN(c) from t2; +MIN(c) +1 +select * from t2 order by a; +a b c +1 5 1 +2 2 7 +3 3 3 +4 4 4 +5 5 5 +6 6 6 +7 2 10 +8 10 2 +select MIN(b) from t2; +MIN(b) +2 +select MAX(a) from t2; +MAX(a) +8 +select MAX(c) from t2; +MAX(c) +10 +select * from t2 order by a; +a b c +1 5 1 +2 2 7 +3 3 3 +4 4 4 +5 5 5 +6 6 6 +7 2 10 +8 10 2 +drop table t2; diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/r/ndb_replace.result new file mode 100644 index 00000000000..63fd8b55c8e --- /dev/null +++ b/mysql-test/r/ndb_replace.result @@ -0,0 +1,21 @@ +drop table if exists t1; +CREATE TABLE t1 ( +gesuchnr int(11) DEFAULT '0' NOT NULL, +benutzer_id int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (gesuchnr,benutzer_id) +) engine=ndbcluster; +replace into t1 (gesuchnr,benutzer_id) values (2,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +insert into t1 (gesuchnr, benutzer_id) value (3,2); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +insert into t1 (gesuchnr,benutzer_id) values (1,1); +ERROR 23000: Duplicate entry '1-1' for key 1 +replace into t1 (gesuchnr,benutzer_id) values (1,1); +select * from t1 order by gesuchnr; +gesuchnr benutzer_id +1 1 +2 1 +3 2 +drop table t1; diff --git a/mysql-test/r/ndb_transaction.result b/mysql-test/r/ndb_transaction.result new file mode 100644 index 00000000000..691b91b1d36 --- /dev/null +++ b/mysql-test/r/ndb_transaction.result @@ -0,0 +1,257 @@ +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; +drop database if exists mysqltest; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL +) ENGINE=ndbcluster; +begin; +insert into t1 values(1,1); +insert into t1 values(2,2); +select count(*) from t1; +count(*) +2 +select * from t1 where pk1 = 1; +pk1 attr1 +1 1 +select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1; +attr1 +2 +rollback; +select count(*) from t1; +count(*) +0 +select * from t1 where pk1 = 1; +pk1 attr1 +select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1; +attr1 +begin; +insert into t1 values(1,1); +insert into t1 values(2,2); +commit; +select count(*) from t1; +count(*) +2 +select * from t1 where pk1 = 1; +pk1 attr1 +1 1 +select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1; +attr1 +2 +begin; +update t1 set attr1 = attr1 * 2; +select count(*) from t1; +count(*) +2 +select * from t1 where pk1 = 1; +pk1 attr1 +1 2 +select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2; +pk1 attr1 pk1 attr1 +2 4 1 2 +rollback; +select count(*) from t1; +count(*) +2 +select * from t1 where pk1 = 1; +pk1 attr1 +1 1 +select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2; +pk1 attr1 pk1 attr1 +begin; +update t1 set attr1 = attr1 * 2; +commit; +select count(*) from t1; +count(*) +2 +select * from t1 where pk1 = 1; +pk1 attr1 +1 2 +select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2; +pk1 attr1 pk1 attr1 +2 4 1 2 +begin; +delete from t1 where attr1 = 2; +select count(*) from t1; +count(*) +1 +select * from t1 where pk1 = 1; +pk1 attr1 +select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2; +pk1 attr1 pk1 attr1 +rollback; +select count(*) from t1; +count(*) +2 +select * from t1 where pk1 = 1; +pk1 attr1 +1 2 +select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2; +pk1 attr1 pk1 attr1 +2 4 1 2 +begin; +delete from t1 where attr1 = 2; +commit; +select count(*) from t1; +count(*) +1 +select * from t1 where pk1 = 1; +pk1 attr1 +select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2; +pk1 attr1 pk1 attr1 +DROP TABLE t1; +CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster; +begin; +insert into t1 values(1,1); +insert into t1 values(2,2); +select sum(id) from t1; +sum(id) +3 +select * from t1 where id = 1; +id id2 +1 1 +select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1; +id +2 +rollback; +select sum(id) from t1; +sum(id) +NULL +select * from t1 where id = 1; +id id2 +select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1; +id +begin; +insert into t1 values(1,1); +insert into t1 values(2,2); +commit; +select sum(id) from t1; +sum(id) +3 +select * from t1 where id = 1; +id id2 +1 1 +select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1; +id +2 +begin; +update t1 set id = id * 2; +select sum(id) from t1; +sum(id) +6 +select * from t1 where id = 2; +id id2 +2 1 +select * from t1, t1 as t1x where t1x.id = t1.id - 2; +id id2 id id2 +4 2 2 1 +rollback; +select sum(id) from t1; +sum(id) +3 +select * from t1 where id = 2; +id id2 +2 2 +select * from t1, t1 as t1x where t1x.id = t1.id - 2; +id id2 id id2 +begin; +update t1 set id = id * 2; +commit; +select sum(id) from t1; +sum(id) +6 +select * from t1 where id = 2; +id id2 +2 1 +select * from t1, t1 as t1x where t1x.id = t1.id - 2; +id id2 id id2 +4 2 2 1 +DROP TABLE t1; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +CREATE TABLE t3 ( +a bigint unsigned NOT NULL, +b bigint unsigned not null, +c bigint unsigned, +PRIMARY KEY(a) +) engine=ndbcluster; +CREATE TABLE t4 ( +a bigint unsigned NOT NULL, +b bigint unsigned not null, +c bigint unsigned NOT NULL, +d int unsigned, +PRIMARY KEY(a, b, c) +) engine=ndbcluster; +select count(*) from t2; +count(*) +0 +select count(*) from t3; +count(*) +0 +select count(*) from t4; +count(*) +0 +select count(*) from t2; +count(*) +100 +select count(*) from t3; +count(*) +100 +select count(*) from t4; +count(*) +100 +begin; +begin; +drop table t2; +drop table t3; +drop table t4; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +attr1 INT NOT NULL +) ENGINE=ndbcluster; +create database mysqltest; +use mysqltest; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +begin; +insert into test.t1 values(1,1); +insert into t2 values(1,1,1); +insert into test.t1 values(2,2); +insert into t2 values(2,2,2); +select count(*) from test.t1; +count(*) +2 +select count(*) from t2; +count(*) +2 +select * from test.t1 where pk1 = 1; +pk1 attr1 +1 1 +select * from t2 where a = 1; +a b c +1 1 1 +select test.t1.attr1 +from test.t1, test.t1 as t1x where test.t1.pk1 = t1x.pk1 + 1; +attr1 +2 +select t2.a +from t2, t2 as t2x where t2.a = t2x.a + 1; +a +2 +select test.t1.pk1, a from test.t1,t2 where b > test.t1.attr1; +pk1 a +1 2 +rollback; +select count(*) from test.t1; +count(*) +0 +select count(*) from t2; +count(*) +0 +drop table test.t1, t2; +drop database mysqltest; diff --git a/mysql-test/r/ndb_truncate.result b/mysql-test/r/ndb_truncate.result new file mode 100644 index 00000000000..38f3a78029c --- /dev/null +++ b/mysql-test/r/ndb_truncate.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS t2; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +select count(*) from t2; +count(*) +5000 +truncate table t2; +select count(*) from t2; +count(*) +0 +drop table t2; diff --git a/mysql-test/r/ndb_types.result b/mysql-test/r/ndb_types.result new file mode 100644 index 00000000000..9a45b77149b --- /dev/null +++ b/mysql-test/r/ndb_types.result @@ -0,0 +1,36 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +auto int(5) unsigned NOT NULL auto_increment, +string char(10) default "hello", +tiny tinyint(4) DEFAULT '0' NOT NULL , +short smallint(6) DEFAULT '1' NOT NULL , +medium mediumint(8) DEFAULT '0' NOT NULL, +long_int int(11) DEFAULT '0' NOT NULL, +longlong bigint(13) DEFAULT '0' NOT NULL, +real_float float(13,1) DEFAULT 0.0 NOT NULL, +real_double double(16,4), +utiny tinyint(3) unsigned DEFAULT '0' NOT NULL, +ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL, +umedium mediumint(8) unsigned DEFAULT '0' NOT NULL, +ulong int(11) unsigned DEFAULT '0' NOT NULL, +ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL, +time_stamp timestamp, +date_field date, +time_field time, +date_time datetime, +options enum('one','two','tree') not null, +flags set('one','two','tree') not null, +PRIMARY KEY (auto), +KEY (utiny), +KEY (tiny), +KEY (short), +KEY any_name (medium), +KEY (longlong), +KEY (real_float), +KEY (ushort), +KEY (umedium), +KEY (ulong), +KEY (ulonglong,ulong), +KEY (options,flags) +); +drop table t1; diff --git a/mysql-test/r/negation_elimination.result b/mysql-test/r/negation_elimination.result new file mode 100644 index 00000000000..9193a125cd1 --- /dev/null +++ b/mysql-test/r/negation_elimination.result @@ -0,0 +1,391 @@ +drop table if exists t1; +create table t1 (a int, key (a)); +insert into t1 values (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(10), (11), (12), (13), (14), (15), (16), (17), (18), (19); +explain select * from t1 where not(not(a)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL 21 Using where; Using index +select * from t1 where not(not(a)); +a +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where not(not(not(a > 10))); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using where; Using index +select * from t1 where not(not(not(a > 10))); +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +explain select * from t1 where not(not(not(a < 5) and not(a > 10))); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 5 Using where; Using index +select * from t1 where not(not(not(a < 5) and not(a > 10))); +a +5 +6 +7 +8 +9 +10 +explain select * from t1 where not(a = 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 19 Using where; Using index +select * from t1 where not(a = 10); +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where not(a != 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index +select * from t1 where not(a != 1); +a +1 +explain select * from t1 where not(a < 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 11 Using where; Using index +select * from t1 where not(a < 10); +a +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where not(a >= 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 9 Using where; Using index +select * from t1 where not(a >= 10); +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +explain select * from t1 where not(a > 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using where; Using index +select * from t1 where not(a > 10); +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +explain select * from t1 where not(a <= 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using where; Using index +select * from t1 where not(a <= 10); +a +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where not(a is null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 20 Using where; Using index +select * from t1 where not(a is null); +a +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where not(a is not null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index +select * from t1 where not(a is not null); +a +NULL +explain select * from t1 where not(a < 5 or a > 15); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using where; Using index +select * from t1 where not(a < 5 or a > 15); +a +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +explain select * from t1 where not(a < 15 and a > 5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 12 Using where; Using index +select * from t1 where not(a < 15 and a > 5); +a +0 +1 +2 +3 +4 +5 +15 +16 +17 +18 +19 +explain select * from t1 where a = 2 or not(a < 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 12 Using where; Using index +select * from t1 where a = 2 or not(a < 10); +a +2 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where a > 5 and not(a > 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index +select * from t1 where a > 5 and not(a > 10); +a +6 +7 +8 +9 +10 +explain select * from t1 where a > 5 xor a < 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL 21 Using where; Using index +select * from t1 where a > 5 xor a < 10; +a +0 +1 +2 +3 +4 +5 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where a = 2 or not(a < 5 or a > 15); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 11 Using where; Using index +select * from t1 where a = 2 or not(a < 5 or a > 15); +a +2 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +explain select * from t1 where a = 7 or not(a < 15 and a > 5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 13 Using where; Using index +select * from t1 where a = 7 or not(a < 15 and a > 5); +a +0 +1 +2 +3 +4 +5 +7 +15 +16 +17 +18 +19 +explain select * from t1 where NULL or not(a < 15 and a > 5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 12 Using where; Using index +select * from t1 where NULL or not(a < 15 and a > 5); +a +0 +1 +2 +3 +4 +5 +15 +16 +17 +18 +19 +explain select * from t1 where not(NULL and a > 5); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 6 Using where; Using index +select * from t1 where not(NULL and a > 5); +a +0 +1 +2 +3 +4 +5 +explain select * from t1 where not(NULL or a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +select * from t1 where not(NULL or a); +a +explain select * from t1 where not(NULL and a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL 21 Using where; Using index +select * from t1 where not(NULL and a); +a +0 +explain select * from t1 where not((a < 5 or a < 10) and (not(a > 16) or a > 17)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 11 Using where; Using index +select * from t1 where not((a < 5 or a < 10) and (not(a > 16) or a > 17)); +a +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 15 Using where; Using index +select * from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17)); +a +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +explain select * from t1 where ((a between 5 and 15) and (not(a like 10))); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 10 Using where; Using index +select * from t1 where ((a between 5 and 15) and (not(a like 10))); +a +5 +6 +7 +8 +9 +11 +12 +13 +14 +15 +delete from t1 where a > 3; +select a, not(not(a)) from t1; +a not(not(a)) +NULL NULL +0 0 +1 1 +2 1 +3 1 +explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL 5 Using where; Using index +Warnings: +Note 1003 select test.t1.a AS `a`,(test.t1.a <> 0) AS `not(not(a))`,((test.t1.a > 2) or test.t1.a) AS `not(a <= 2 and not(a))`,(test.t1.a like _latin1'1') AS `not(a not like "1")`,(test.t1.a in (1,2)) AS `not (a not in (1,2))`,(test.t1.a = 2) AS `not(a != 2)` from test.t1 where test.t1.a having test.t1.a +drop table t1; diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 41a1a06aebe..bd90b3fe3f3 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -1,12 +1,18 @@ +drop table if exists t1; select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null; NULL NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null NULL NULL 1 1 1 1 TRUE TRUE 1 1 +explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null` select 1 | NULL,1 & NULL,1+NULL,1-NULL; 1 | NULL 1 & NULL 1+NULL 1-NULL NULL NULL NULL NULL select NULL=NULL,NULL<>NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0; NULL=NULL NULL<>NULL IFNULL(NULL,1.1)+0 IFNULL(NULL,1) | 0 -NULL NULL 1 1 +NULL NULL 1.1 1 select strcmp("a",NULL),(1<NULL)+0.0,NULL regexp "a",null like "a%","a%" like null; strcmp("a",NULL) (1<NULL)+0.0 NULL regexp "a" null like "a%" "a%" like null NULL NULL NULL NULL NULL @@ -22,6 +28,11 @@ field(NULL,"a","b","c") select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null; 2 between null and 1 2 between 3 AND NULL NULL between 1 and 2 2 between NULL and 3 2 between 1 AND null 0 0 NULL NULL NULL +explain extended select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null` SELECT NULL AND NULL, 1 AND NULL, NULL AND 1, NULL OR NULL, 0 OR NULL, NULL OR 0; NULL AND NULL 1 AND NULL NULL AND 1 NULL OR NULL 0 OR NULL NULL OR 0 NULL NULL NULL NULL NULL NULL @@ -34,7 +45,11 @@ NULL AND 0 0 and NULL select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton(""); inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("") NULL NULL NULL NULL NULL -drop table if exists t1; +explain extended select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton(""); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")` create table t1 (x int); insert into t1 values (null); select * from t1 where x != 0; @@ -56,7 +71,7 @@ indexed_field NULL NULL DROP TABLE t1; -create table t1 (a int, b int) type=myisam; +create table t1 (a int, b int) engine=myisam; insert into t1 values(20,null); select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on t2.b=t3.a; @@ -75,28 +90,46 @@ NULL this is null drop table t1; CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL); INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55"; +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 UPDATE t1 SET d=1/NULL; +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 UPDATE t1 SET d=NULL; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1 INSERT INTO t1 (a) values (null); -Column 'a' cannot be null +ERROR 23000: Column 'a' cannot be null INSERT INTO t1 (a) values (1/null); -Column 'a' cannot be null +ERROR 23000: Column 'a' cannot be null INSERT INTO t1 (a) values (null),(null); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2 INSERT INTO t1 (b) values (null); -Column 'b' cannot be null +ERROR 23000: Column 'b' cannot be null INSERT INTO t1 (b) values (1/null); -Column 'b' cannot be null +ERROR 23000: Column 'b' cannot be null INSERT INTO t1 (b) values (null),(null); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 INSERT INTO t1 (c) values (null); -Column 'c' cannot be null +ERROR 23000: Column 'c' cannot be null INSERT INTO t1 (c) values (1/null); -Column 'c' cannot be null +ERROR 23000: Column 'c' cannot be null INSERT INTO t1 (c) values (null),(null); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2 INSERT INTO t1 (d) values (null); -Column 'd' cannot be null +ERROR 23000: Column 'd' cannot be null INSERT INTO t1 (d) values (1/null); -Column 'd' cannot be null +ERROR 23000: Column 'd' cannot be null INSERT INTO t1 (d) values (null),(null); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 2 select * from t1; a b c d 0 0000-00-00 00:00:00 0 @@ -109,22 +142,36 @@ a b c d 0 0000-00-00 00:00:00 0 0 0000-00-00 00:00:00 0 drop table t1; -CREATE TABLE t1(i int, KEY(i)); -INSERT INTO t1 VALUES(1); -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -INSERT INTO t1 SELECT i*2 FROM t1; -EXPLAIN SELECT * FROM t1 WHERE i=2 OR i IS NULL; -table type possible_keys key key_len ref rows Extra -t1 range i i 5 NULL 10 Using where; Using index -ALTER TABLE t1 CHANGE i i int NOT NULL; -EXPLAIN SELECT * FROM t1 WHERE i=2 OR i IS NULL; -table type possible_keys key key_len ref rows Extra -t1 range i i 4 NULL 7 Using where; Using index -DROP TABLE t1; +create table t1 (a int not null, b int not null, index idx(a)); +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); +explain select * from t1 where a between 2 and 3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx idx 4 NULL 2 Using where +explain select * from t1 where a between 2 and 3 or b is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx idx 4 NULL 2 Using where +drop table t1; +select cast(NULL as signed); +cast(NULL as signed) +NULL +create table t1(i int, key(i)); +insert into t1 values(1); +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +insert into t1 select i*2 from t1; +explain select * from t1 where i=2 or i is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null i i 5 const 10 Using where; Using index +alter table t1 change i i int not null; +explain select * from t1 where i=2 or i is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i i 4 const 7 Using where; Using index +drop table t1; diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 009a3e06eb2..4b7400e5e60 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -1,39 +1,42 @@ -drop table if exists t1; -create table t1 (a int, b int not null,unique key (a,b),index(b)) type=myisam; +drop table if exists t1,t2; +create table t1 (a int, b int not null,unique key (a,b),index(b)) engine=myisam; insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6); explain select * from t1 where a is null; -table type possible_keys key key_len ref rows Extra -t1 ref a a 5 const 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 3 Using where; Using index explain select * from t1 where a is null and b = 2; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 9 const,const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 9 const,const 1 Using where; Using index explain select * from t1 where a is null and b = 7; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 9 const,const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 9 const,const 1 Using where; Using index explain select * from t1 where a=2 and b = 2; -table type possible_keys key key_len ref rows Extra -t1 const a,b a 9 const,const 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const a,b a 9 const,const 1 Using index explain select * from t1 where a<=>b limit 2; -table type possible_keys key key_len ref rows Extra -t1 index NULL a 9 NULL 12 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 9 NULL 12 Using where; Using index explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 limit 3; -table type possible_keys key key_len ref rows Extra -t1 range a,b a 9 NULL 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a,b a 9 NULL 3 Using where; Using index explain select * from t1 where (a is null or a = 7) and b=7; -table type possible_keys key key_len ref rows Extra -t1 ref a,b b 4 const 2 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null a,b a 9 const,const 2 Using where; Using index +explain select * from t1 where (a is null or a = 7) and b=7 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null a,b a 9 const,const 2 Using where; Using index; Using filesort explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 3 Using where; Using index explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3; -table type possible_keys key key_len ref rows Extra -t1 range a,b a 9 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a,b a 9 NULL 2 Using where; Using index explain select * from t1 where a > 1 and a < 3 limit 1; -table type possible_keys key key_len ref rows Extra -t1 range a a 5 NULL 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index explain select * from t1 where a > 8 and a < 9; -table type possible_keys key key_len ref rows Extra -t1 range a a 5 NULL 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index select * from t1 where a is null; a b NULL 7 @@ -56,53 +59,55 @@ NULL 9 NULL 9 select * from t1 where (a is null or a = 7) and b=7; a b -NULL 7 7 7 +NULL 7 select * from t1 where a is null and b=9 or a is null and b=7 limit 3; a b NULL 7 NULL 9 NULL 9 +create table t2 like t1; +insert into t2 select * from t1; alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10)); explain select * from t1 where a is null and b = 2; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a is null and b = 2 and c=0; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a is null and b = 7 and c=0; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a=2 and b = 2; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 1 Using where explain select * from t1 where a<=>b limit 2; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 12 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 and c=0 limit 3; -table type possible_keys key key_len ref rows Extra -t1 range a,b a 5 NULL 5 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a,b a 5 NULL 5 Using where explain select * from t1 where (a is null or a = 7) and b=7 and c=0; -table type possible_keys key key_len ref rows Extra -t1 ALL a,b NULL NULL NULL 12 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using where explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3; -table type possible_keys key key_len ref rows Extra -t1 ref a,b a 5 const 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a > 1 and a < 3 limit 1; -table type possible_keys key key_len ref rows Extra -t1 range a a 5 NULL 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1 Using where explain select * from t1 where a is null and b=7 or a > 1 and a < 3 limit 1; -table type possible_keys key key_len ref rows Extra -t1 range a,b a 5 NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a,b a 5 NULL 4 Using where explain select * from t1 where a > 8 and a < 9; -table type possible_keys key key_len ref rows Extra -t1 range a a 5 NULL 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1 Using where explain select * from t1 where b like "6%"; -table type possible_keys key key_len ref rows Extra -t1 range b b 12 NULL 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 12 NULL 1 Using where select * from t1 where a is null; a b c NULL 7 0 @@ -125,8 +130,8 @@ NULL 9 0 NULL 9 0 select * from t1 where (a is null or a = 7) and b=7 and c=0; a b c -NULL 7 0 7 7 0 +NULL 7 0 select * from t1 where a is null and b=9 or a is null and b=7 limit 3; a b c NULL 7 0 @@ -136,26 +141,122 @@ select * from t1 where b like "6%"; a b c 6 6 0 drop table t1; -DROP TABLE IF EXISTS t1,t2; +rename table t2 to t1; +alter table t1 modify b int null; +insert into t1 values (7,null), (8,null), (8,7); +explain select * from t1 where a = 7 and (b=7 or b is null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null a,b a 10 const,const 2 Using where; Using index +select * from t1 where a = 7 and (b=7 or b is null); +a b +7 7 +7 NULL +explain select * from t1 where (a = 7 or a is null) and (b=7 or b is null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a,b a 10 NULL 3 Using where; Using index +select * from t1 where (a = 7 or a is null) and (b=7 or b is null); +a b +NULL 7 +7 NULL +7 7 +explain select * from t1 where (a = 7 or a is null) and (a = 7 or a is null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null a a 5 const 5 Using where; Using index +select * from t1 where (a = 7 or a is null) and (a = 7 or a is null); +a b +7 NULL +7 7 +NULL 7 +NULL 9 +NULL 9 +create table t2 (a int); +insert into t2 values (7),(8); +explain select * from t2 straight_join t1 where t1.a=t2.a and b is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ref a,b a 10 test.t2.a,const 2 Using where; Using index +drop index b on t1; +explain select * from t2,t1 where t1.a=t2.a and b is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ref a a 10 test.t2.a,const 2 Using where; Using index +select * from t2,t1 where t1.a=t2.a and b is null; +a a b +7 7 NULL +8 8 NULL +explain select * from t2,t1 where t1.a=t2.a and (b= 7 or b is null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ref_or_null a a 10 test.t2.a,const 4 Using where; Using index +select * from t2,t1 where t1.a=t2.a and (b= 7 or b is null); +a a b +7 7 7 +7 7 NULL +8 8 7 +8 8 NULL +explain select * from t2,t1 where (t1.a=t2.a or t1.a is null) and b= 7; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ref_or_null a a 10 test.t2.a,const 4 Using where; Using index +select * from t2,t1 where (t1.a=t2.a or t1.a is null) and b= 7; +a a b +7 7 7 +7 NULL 7 +8 8 7 +8 NULL 7 +explain select * from t2,t1 where (t1.a=t2.a or t1.a is null) and (b= 7 or b is null); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ref_or_null a a 5 test.t2.a 4 Using where; Using index +select * from t2,t1 where (t1.a=t2.a or t1.a is null) and (b= 7 or b is null); +a a b +7 7 NULL +7 7 7 +7 NULL 7 +8 8 NULL +8 8 7 +8 NULL 7 +insert into t2 values (null),(6); +delete from t1 where a=8; +explain select * from t2,t1 where t1.a=t2.a or t1.a is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 +1 SIMPLE t1 ref_or_null a a 5 test.t2.a 4 Using where; Using index +explain select * from t2,t1 where t1.a<=>t2.a or (t1.a is null and t1.b <> 9); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 +1 SIMPLE t1 ref_or_null a a 5 test.t2.a 4 Using where; Using index +select * from t2,t1 where t1.a<=>t2.a or (t1.a is null and t1.b <> 9); +a a b +7 7 NULL +7 7 7 +7 NULL 7 +8 NULL 7 +NULL NULL 7 +NULL NULL 9 +NULL NULL 9 +6 6 6 +6 NULL 7 +drop table t1,t2; CREATE TABLE t1 ( id int(10) unsigned NOT NULL auto_increment, uniq_id int(10) unsigned default NULL, PRIMARY KEY (id), UNIQUE KEY idx1 (uniq_id) -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( id int(10) unsigned NOT NULL auto_increment, uniq_id int(10) unsigned default NULL, PRIMARY KEY (id) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL); INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL); explain select id from t1 where uniq_id is null; -table type possible_keys key key_len ref rows Extra -t1 ref idx1 idx1 5 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref idx1 idx1 5 const 1 Using where explain select id from t1 where uniq_id =1; -table type possible_keys key key_len ref rows Extra -t1 const idx1 idx1 5 const 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const idx1 idx1 5 const 1 UPDATE t1 SET id=id+100 where uniq_id is null; UPDATE t2 SET id=id+100 where uniq_id is null; select id from t1 where uniq_id is null; @@ -194,13 +295,13 @@ CREATE TABLE `t1` ( `product_id` char(32) NOT NULL default '', `product_type` int(11) NOT NULL default '0', PRIMARY KEY (`order_id`,`product_id`,`product_type`) -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE `t2` ( `order_id` char(32) NOT NULL default '', `product_id` char(32) NOT NULL default '', `product_type` int(11) NOT NULL default '0', PRIMARY KEY (`order_id`,`product_id`,`product_type`) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 (order_id, product_id, product_type) VALUES ('3d7ce39b5d4b3e3d22aaafe9b633de51',1206029, 3), ('3d7ce39b5d4b3e3d22aaafe9b633de51',5880836, 3), @@ -235,6 +336,8 @@ index (id), index (id2) ); insert into t1 values(null,null),(1,1); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id2' at row 1 select * from t1; id id2 NULL 0 diff --git a/mysql-test/r/odbc.result b/mysql-test/r/odbc.result index 5aa163a663e..c0b2ada0053 100644 --- a/mysql-test/r/odbc.result +++ b/mysql-test/r/odbc.result @@ -1,7 +1,7 @@ +drop table if exists t1; select {fn length("hello")}, { date "1997-10-20" }; {fn length("hello")} 1997-10-20 5 1997-10-20 -drop table if exists t1; create table t1 (a int not null auto_increment,b int not null,primary key (a,b)); insert into t1 SET A=NULL,B=1; insert into t1 SET a=null,b=2; @@ -11,6 +11,6 @@ a b select * from t1 where a is null; a b explain select * from t1 where b is null; -Comment -Impossible WHERE noticed after reading const tables +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 52bd83df5ed..bcbe5a8791c 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -1,27 +1,309 @@ -drop table if exists sales; -create table sales ( product varchar(32), country varchar(32), year int, profit int); -insert into sales values ( 'Computer', 'India',2000, 1200), -( 'TV', 'United States', 1999, 150), -( 'Calculator', 'United States', 1999,50), -( 'Computer', 'United States', 1999,1500), -( 'Computer', 'United States', 2000,1500), -( 'TV', 'United States', 2000, 150), -( 'TV', 'India', 2000, 100), -( 'TV', 'India', 2000, 100), -( 'Calculator', 'United States', 2000,75), -( 'Calculator', 'India', 2000,75), -( 'TV', 'India', 1999, 100), -( 'Computer', 'India', 1999,1200), -( 'Computer', 'United States', 2000,1500), -( 'Calculator', 'United States', 2000,75); -select product, country , year, sum(profit) from sales group by product, country, year with cube; -This version of MySQL doesn't yet support 'CUBE' -explain select product, country , year, sum(profit) from sales group by product, country, year with cube; -This version of MySQL doesn't yet support 'CUBE' -select product, country , year, sum(profit) from sales group by product, country, year with rollup; -This version of MySQL doesn't yet support 'ROLLUP' -explain select product, country , year, sum(profit) from sales group by product, country, year with rollup; -This version of MySQL doesn't yet support 'ROLLUP' -select product, country , year, sum(profit) from sales group by product, country, year with cube union all select product, country , year, sum(profit) from sales group by product, country, year with rollup; -This version of MySQL doesn't yet support 'CUBE' -drop table sales; +drop table if exists t1,t2; +create table t1 (product varchar(32), country_id int not null, year int, profit int); +insert into t1 values ( 'Computer', 2,2000, 1200), +( 'TV', 1, 1999, 150), +( 'Calculator', 1, 1999,50), +( 'Computer', 1, 1999,1500), +( 'Computer', 1, 2000,1500), +( 'TV', 1, 2000, 150), +( 'TV', 2, 2000, 100), +( 'TV', 2, 2000, 100), +( 'Calculator', 1, 2000,75), +( 'Calculator', 2, 2000,75), +( 'TV', 1, 1999, 100), +( 'Computer', 1, 1999,1200), +( 'Computer', 2, 2000,1500), +( 'Calculator', 2, 2000,75), +( 'Phone', 3, 2003,10) +; +create table t2 (country_id int primary key, country char(20) not null); +insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); +select product, sum(profit) from t1 group by product; +product sum(profit) +Calculator 275 +Computer 6900 +Phone 10 +TV 600 +select product, sum(profit) from t1 group by product with rollup; +product sum(profit) +Calculator 275 +Computer 6900 +Phone 10 +TV 600 +NULL 7785 +select product, sum(profit) from t1 group by 1 with rollup; +product sum(profit) +Calculator 275 +Computer 6900 +Phone 10 +TV 600 +NULL 7785 +select product, sum(profit),avg(profit) from t1 group by product with rollup; +product sum(profit) avg(profit) +Calculator 275 68.7500 +Computer 6900 1380.0000 +Phone 10 10.0000 +TV 600 120.0000 +NULL 7785 519.0000 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year; +product country_id year sum(profit) +Calculator 1 1999 50 +Calculator 1 2000 75 +Calculator 2 2000 150 +Computer 1 1999 2700 +Computer 1 2000 1500 +Computer 2 2000 2700 +Phone 3 2003 10 +TV 1 1999 250 +TV 1 2000 150 +TV 2 2000 200 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup; +product country_id year sum(profit) +Calculator 1 1999 50 +Calculator 1 2000 75 +Calculator 1 NULL 125 +Calculator 2 2000 150 +Calculator 2 NULL 150 +Calculator NULL NULL 275 +Computer 1 1999 2700 +Computer 1 2000 1500 +Computer 1 NULL 4200 +Computer 2 2000 2700 +Computer 2 NULL 2700 +Computer NULL NULL 6900 +Phone 3 2003 10 +Phone 3 NULL 10 +Phone NULL NULL 10 +TV 1 1999 250 +TV 1 2000 150 +TV 1 NULL 400 +TV 2 2000 200 +TV 2 NULL 200 +TV NULL NULL 600 +NULL NULL NULL 7785 +explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort +Warnings: +Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup +select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup; +product country_id sum(profit) +TV 1 400 +TV 2 200 +TV NULL 600 +Phone 3 10 +Phone NULL 10 +Computer 1 4200 +Computer 2 2700 +Computer NULL 6900 +Calculator 1 125 +Calculator 2 150 +Calculator NULL 275 +NULL NULL 7785 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup limit 5; +product country_id year sum(profit) +Calculator 1 1999 50 +Calculator 1 2000 75 +Calculator 1 NULL 125 +Calculator 2 2000 150 +Calculator 2 NULL 150 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup limit 3,3; +product country_id year sum(profit) +Calculator 2 2000 150 +Calculator 2 NULL 150 +Calculator NULL NULL 275 +select product, country_id, count(*), count(distinct year) from t1 group by product, country_id; +product country_id count(*) count(distinct year) +Calculator 1 2 2 +Calculator 2 2 1 +Computer 1 3 2 +Computer 2 2 1 +Phone 3 1 1 +TV 1 3 2 +TV 2 2 1 +select product, country_id, count(*), count(distinct year) from t1 group by product, country_id with rollup; +product country_id count(*) count(distinct year) +Calculator 1 2 2 +Calculator 2 2 1 +Calculator NULL 4 2 +Computer 1 3 2 +Computer 2 2 1 +Computer NULL 5 2 +Phone 3 1 1 +Phone NULL 1 1 +TV 1 3 2 +TV 2 2 1 +TV NULL 5 2 +NULL NULL 15 3 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup having country_id = 1; +product country_id year sum(profit) +Calculator 1 1999 50 +Calculator 1 2000 75 +Calculator 1 NULL 125 +Computer 1 1999 2700 +Computer 1 2000 1500 +Computer 1 NULL 4200 +TV 1 1999 250 +TV 1 2000 150 +TV 1 NULL 400 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup having sum(profit) > 200; +product country_id year sum(profit) +Calculator NULL NULL 275 +Computer 1 1999 2700 +Computer 1 2000 1500 +Computer 1 NULL 4200 +Computer 2 2000 2700 +Computer 2 NULL 2700 +Computer NULL NULL 6900 +TV 1 1999 250 +TV 1 NULL 400 +TV NULL NULL 600 +NULL NULL NULL 7785 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup having sum(profit) > 7000; +product country_id year sum(profit) +NULL NULL NULL 7785 +select concat(product,':',country_id) as 'prod', concat(":",year,":") as 'year',1+1, sum(profit)/count(*) from t1 group by 1,2 with rollup; +prod year 1+1 sum(profit)/count(*) +Calculator:1 :1999: 2 50.00 +Calculator:1 :2000: 2 75.00 +Calculator:1 NULL 2 62.50 +Calculator:2 :2000: 2 75.00 +Calculator:2 NULL 2 75.00 +Computer:1 :1999: 2 1350.00 +Computer:1 :2000: 2 1500.00 +Computer:1 NULL 2 1400.00 +Computer:2 :2000: 2 1350.00 +Computer:2 NULL 2 1350.00 +Phone:3 :2003: 2 10.00 +Phone:3 NULL 2 10.00 +TV:1 :1999: 2 125.00 +TV:1 :2000: 2 150.00 +TV:1 NULL 2 133.33 +TV:2 :2000: 2 100.00 +TV:2 NULL 2 100.00 +NULL NULL 2 519.00 +select product, sum(profit)/count(*) from t1 group by product with rollup; +product sum(profit)/count(*) +Calculator 68.75 +Computer 1380.00 +Phone 10.00 +TV 120.00 +NULL 519.00 +select left(product,4) as prod, sum(profit)/count(*) from t1 group by prod with rollup; +prod sum(profit)/count(*) +Calc 68.75 +Comp 1380.00 +Phon 10.00 +TV 120.00 +NULL 519.00 +select concat(product,':',country_id), 1+1, sum(profit)/count(*) from t1 group by concat(product,':',country_id) with rollup; +concat(product,':',country_id) 1+1 sum(profit)/count(*) +Calculator:1 2 62.50 +Calculator:2 2 75.00 +Computer:1 2 1400.00 +Computer:2 2 1350.00 +Phone:3 2 10.00 +TV:1 2 133.33 +TV:2 2 100.00 +NULL 2 519.00 +select product, country , year, sum(profit) from t1,t2 where t1.country_id=t2.country_id group by product, country, year with rollup; +product country year sum(profit) +Calculator India 2000 150 +Calculator India NULL 150 +Calculator USA 1999 50 +Calculator USA 2000 75 +Calculator USA NULL 125 +Calculator NULL NULL 275 +Computer India 2000 2700 +Computer India NULL 2700 +Computer USA 1999 2700 +Computer USA 2000 1500 +Computer USA NULL 4200 +Computer NULL NULL 6900 +Phone Finland 2003 10 +Phone Finland NULL 10 +Phone NULL NULL 10 +TV India 2000 200 +TV India NULL 200 +TV USA 1999 250 +TV USA 2000 150 +TV USA NULL 400 +TV NULL NULL 600 +NULL NULL NULL 7785 +select product, `sum` from (select product, sum(profit) as 'sum' from t1 group by product with rollup) as tmp where product is null; +product sum +NULL 7785 +select product from t1 where exists (select product, country_id , sum(profit) from t1 as t2 where t1.product=t2.product group by product, country_id with rollup having sum(profit) > 6000); +product +Computer +Computer +Computer +Computer +Computer +select product, country_id , year, sum(profit) from t1 group by product, country_id, year having country_id is NULL; +product country_id year sum(profit) +select concat(':',product,':'), sum(profit),avg(profit) from t1 group by product with rollup; +concat(':',product,':') sum(profit) avg(profit) +:Calculator: 275 68.7500 +:Computer: 6900 1380.0000 +:Phone: 10 10.0000 +:TV: 600 120.0000 +:TV: 7785 519.0000 +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube; +ERROR 42000: This version of MySQL doesn't yet support 'CUBE' +explain select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube; +ERROR 42000: This version of MySQL doesn't yet support 'CUBE' +select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube union all select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup; +ERROR 42000: This version of MySQL doesn't yet support 'CUBE' +drop table t1,t2; +CREATE TABLE t1 (i int); +INSERT INTO t1 VALUES(100); +CREATE TABLE t2 (i int); +INSERT INTO t2 VALUES (100),(200); +SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP; +i COUNT(*) +100 1 +NULL 1 +SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP; +i i COUNT(*) +100 100 1 +100 200 1 +100 NULL 2 +NULL NULL 2 +drop table t1,t2; +CREATE TABLE user_day( +user_id INT NOT NULL, +date DATE NOT NULL, +UNIQUE INDEX user_date (user_id, date) +); +INSERT INTO user_day VALUES +(1, '2004-06-06' ), +(1, '2004-06-07' ), +(2, '2004-06-06' ); +SELECT +d.date AS day, +COUNT(d.user_id) as sample, +COUNT(next_day.user_id) AS not_cancelled +FROM user_day d +LEFT JOIN user_day next_day +ON next_day.user_id=d.user_id AND +next_day.date= DATE_ADD( d.date, interval 1 day ) +GROUP BY day; +day sample not_cancelled +2004-06-06 2 1 +2004-06-07 1 0 +SELECT +d.date AS day, +COUNT(d.user_id) as sample, +COUNT(next_day.user_id) AS not_cancelled +FROM user_day d +LEFT JOIN user_day next_day +ON next_day.user_id=d.user_id AND +next_day.date= DATE_ADD( d.date, interval 1 day ) +GROUP BY day +WITH ROLLUP; +day sample not_cancelled +2004-06-06 2 1 +2004-06-07 1 0 +NULL 3 1 +DROP TABLE user_day; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index f6c7bf5bc79..a87d0c33559 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -10,22 +10,22 @@ select * from t1; f1 5 delete from t1; -Access denied for user: 'ssl_user1@localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user1'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -Access denied for user: 'ssl_user2@localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user2'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -Access denied for user: 'ssl_user3@localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user3'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -Access denied for user: 'ssl_user4@localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user4'@'localhost' to database 'test' delete from mysql.user where user='ssl_user%'; delete from mysql.db where user='ssl_user%'; flush privileges; diff --git a/mysql-test/r/openssl_2.result b/mysql-test/r/openssl_2.result index b5c67dfbcb0..879c623dd40 100644 --- a/mysql-test/r/openssl_2.result +++ b/mysql-test/r/openssl_2.result @@ -1,2 +1,25 @@ -SHOW STATUS LIKE 'SSL%'; +SHOW STATUS LIKE 'Ssl%'; Variable_name Value +Ssl_accepts 1 +Ssl_finished_accepts 1 +Ssl_finished_connects 0 +Ssl_accept_renegotiates 0 +Ssl_connect_renegotiates 0 +Ssl_callback_cache_hits 0 +Ssl_session_cache_hits 0 +Ssl_session_cache_misses 0 +Ssl_session_cache_timeouts 0 +Ssl_used_session_cache_entries 1 +Ssl_client_connects 0 +Ssl_session_cache_overflows 0 +Ssl_session_cache_size 128 +Ssl_session_cache_mode SERVER +Ssl_sessions_reused 0 +Ssl_ctx_verify_mode 7 +Ssl_ctx_verify_depth 4294967295 +Ssl_verify_mode 7 +Ssl_verify_depth 4294967295 +Ssl_version TLSv1 +Ssl_cipher EDH-RSA-DES-CBC3-SHA +Ssl_cipher_list +Ssl_default_timeout 7200 diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 859d9d4cab0..b3bc4a18a40 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -85,6 +85,15 @@ i 1 3 drop table t1; +create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null); +insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c'); +select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc; +Building Name Building Number +Alpha 001 +Beta 200c +Gamma 123 +Gamma Ext 123a +drop table t1; create table t1 (id int not null,col1 int not null,col2 int not null,index(col1)); insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4); select * from t1 order by col1,col2; @@ -107,7 +116,7 @@ col1 2 3 2 -select col1 as id from t1 order by t1.id; +select col1 as id from t1 order by id; id 1 1 @@ -117,16 +126,16 @@ id 2 2 3 -select concat(col1) as id from t1 order by t1.id; +select concat(col1) as id from t1 order by id; id -2 -2 1 1 1 2 -3 2 +2 +2 +3 drop table t1; CREATE TABLE t1 (id int auto_increment primary key,aika varchar(40),aikakentta timestamp); insert into t1 (aika) values ('Keskiviikko'); @@ -222,7 +231,6 @@ DateOfAction TransactionID 1999-07-27 834 1999-07-27 840 drop table t1,t2,t3; -drop table if exists t1; CREATE TABLE t1 ( member_id int(11) NOT NULL auto_increment, inschrijf_datum varchar(20) NOT NULL default '', @@ -252,7 +260,7 @@ favo_muziek varchar(30) NOT NULL default '', info text NOT NULL, ipnr varchar(30) NOT NULL default '', PRIMARY KEY (member_id) -) TYPE=MyISAM PACK_KEYS=1; +) ENGINE=MyISAM PACK_KEYS=1; insert into t1 (member_id) values (1),(2),(3); select member_id, nickname, voornaam FROM t1 ORDER by lastchange_datum DESC LIMIT 2; @@ -263,14 +271,14 @@ drop table t1; create table t1 (a int not null, b int, c varchar(10), key (a, b, c)); insert into t1 values (1, NULL, NULL), (1, NULL, 'b'), (1, 1, NULL), (1, 1, 'b'), (1, 1, 'b'), (2, 1, 'a'), (2, 1, 'b'), (2, 2, 'a'), (2, 2, 'b'), (2, 3, 'c'),(1,3,'b'); explain select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 20 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 20 NULL 2 Using where; Using index select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc; a b c 1 NULL b explain select * from t1 where a >= 1 and a < 3 order by a desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 4 NULL 10 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 4 NULL 10 Using where; Using index select * from t1 where a >= 1 and a < 3 order by a desc; a b c 2 3 c @@ -285,8 +293,8 @@ a b c 1 NULL b 1 NULL NULL explain select * from t1 where a = 1 order by a desc, b desc; -table type possible_keys key key_len ref rows Extra -t1 ref a a 4 const 5 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 4 const 5 Using where; Using index select * from t1 where a = 1 order by a desc, b desc; a b c 1 3 b @@ -296,34 +304,34 @@ a b c 1 NULL b 1 NULL NULL explain select * from t1 where a = 1 and b is null order by a desc, b desc; -table type possible_keys key key_len ref rows Extra -t1 ref a a 9 const,const 2 Using where; Using index; Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 9 const,const 2 Using where; Using index; Using filesort select * from t1 where a = 1 and b is null order by a desc, b desc; a b c 1 NULL NULL 1 NULL b explain select * from t1 where a >= 1 and a < 3 and b >0 order by a desc,b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 8 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 9 NULL 8 Using where; Using index explain select * from t1 where a = 2 and b >0 order by a desc,b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 4 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 9 NULL 5 Using where; Using index explain select * from t1 where a = 2 and b is null order by a desc,b desc; -table type possible_keys key key_len ref rows Extra -t1 ref a a 9 const,const 1 Using where; Using index; Using filesort +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 9 const,const 1 Using where; Using index; Using filesort explain select * from t1 where a = 2 and (b is null or b > 0) order by a desc,b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 5 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 9 NULL 6 Using where; Using index explain select * from t1 where a = 2 and b > 0 order by a desc,b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 4 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 9 NULL 5 Using where; Using index explain select * from t1 where a = 2 and b < 2 order by a desc,b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 9 NULL 2 Using where; Using index explain select * from t1 where a = 1 order by b desc; -table type possible_keys key key_len ref rows Extra -t1 ref a a 4 const 5 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 4 const 5 Using where; Using index select * from t1 where a = 1 order by b desc; a b c 1 3 b @@ -333,9 +341,14 @@ a b c 1 NULL b 1 NULL NULL alter table t1 modify b int not null, modify c varchar(10) not null; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 explain select * from t1 order by a, b, c; -table type possible_keys key key_len ref rows Extra -t1 index NULL a 18 NULL 11 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 18 NULL 11 Using index select * from t1 order by a, b, c; a b c 1 0 @@ -350,8 +363,8 @@ a b c 2 2 b 2 3 c explain select * from t1 order by a desc, b desc, c desc; -table type possible_keys key key_len ref rows Extra -t1 index NULL a 18 NULL 11 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 18 NULL 11 Using index select * from t1 order by a desc, b desc, c desc; a b c 2 3 c @@ -366,15 +379,15 @@ a b c 1 0 b 1 0 explain select * from t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 18 NULL 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 18 NULL 3 Using where; Using index select * from t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc; a b c 1 1 b 1 1 b explain select * from t1 where a < 2 and b <= 1 order by a desc, b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 4 NULL 6 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 4 NULL 6 Using where; Using index select * from t1 where a < 2 and b <= 1 order by a desc, b desc; a b c 1 1 b @@ -397,8 +410,8 @@ a b c 1 1 b 1 1 explain select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 8 NULL 10 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 8 NULL 10 Using where; Using index select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc; a b c 2 1 b @@ -409,8 +422,8 @@ a b c 1 0 b 1 0 explain select * from t1 where a between 0 and 1 order by a desc, b desc; -table type possible_keys key key_len ref rows Extra -t1 range a a 4 NULL 5 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 4 NULL 5 Using where; Using index select * from t1 where a between 0 and 1 order by a desc, b desc; a b c 1 3 b @@ -425,7 +438,7 @@ gid int(10) unsigned NOT NULL auto_increment, cid smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (gid), KEY component_id (cid) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (103853,108),(103867,108),(103962,108),(104505,108),(104619,108),(104620,108); ALTER TABLE t1 add skr int(10) not null; CREATE TABLE t2 ( @@ -435,12 +448,12 @@ sid tinyint(3) unsigned NOT NULL default '1', PRIMARY KEY (gid), KEY uid (uid), KEY status_id (sid) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t2 VALUES (103853,250,5),(103867,27,5),(103962,27,5),(104505,117,5),(104619,75,5),(104620,15,5); CREATE TABLE t3 ( uid smallint(6) NOT NULL auto_increment, PRIMARY KEY (uid) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t3 VALUES (1),(15),(27),(75),(117),(250); ALTER TABLE t3 add skr int(10) not null; select t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid; @@ -460,27 +473,27 @@ gid sid uid 104505 5 117 103853 5 250 EXPLAIN select t1.gid, t2.sid, t3.uid from t3, t2, t1 where t2.gid = t1.gid and t2.uid = t3.uid order by t1.gid, t3.uid; -table type possible_keys key key_len ref rows Extra -t1 index PRIMARY PRIMARY 4 NULL 6 Using index -t2 eq_ref PRIMARY,uid PRIMARY 4 t1.gid 1 -t3 eq_ref PRIMARY PRIMARY 2 t2.uid 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 6 Using index +1 SIMPLE t2 eq_ref PRIMARY,uid PRIMARY 4 test.t1.gid 1 +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 2 test.t2.uid 1 Using where; Using index EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t1.gid,t3.skr; -table type possible_keys key key_len ref rows Extra -t3 ALL PRIMARY NULL NULL NULL 6 Using temporary; Using filesort -t1 eq_ref PRIMARY PRIMARY 4 t3.uid 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL PRIMARY NULL NULL NULL 6 Using temporary; Using filesort +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.uid 1 Using where; Using index EXPLAIN SELECT t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid; -table type possible_keys key key_len ref rows Extra -t1 index PRIMARY PRIMARY 4 NULL 6 Using index; Using temporary; Using filesort -t2 eq_ref PRIMARY,uid PRIMARY 4 t1.gid 1 -t3 eq_ref PRIMARY PRIMARY 2 t2.uid 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 6 Using index; Using temporary; Using filesort +1 SIMPLE t2 eq_ref PRIMARY,uid PRIMARY 4 test.t1.gid 1 +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 2 test.t2.uid 1 Using where; Using index EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t3.skr,t1.gid; -table type possible_keys key key_len ref rows Extra -t3 ALL PRIMARY NULL NULL NULL 6 Using temporary; Using filesort -t1 eq_ref PRIMARY PRIMARY 4 t3.uid 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ALL PRIMARY NULL NULL NULL 6 Using temporary; Using filesort +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.uid 1 Using where; Using index EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.skr = t3.uid order by t1.gid,t3.skr; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort -t3 eq_ref PRIMARY PRIMARY 2 t1.skr 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 2 test.t1.skr 1 Using where drop table t1,t2,t3; CREATE TABLE t1 ( `titre` char(80) NOT NULL default '', @@ -542,15 +555,171 @@ a b 1 2 5 NULL DROP TABLE t1; +create table t1(id int not null auto_increment primary key, t char(12)); +explain select id,t from t1 order by id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 Using filesort +explain select id,t from t1 force index (primary) order by id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 1000 +drop table t1; +CREATE TABLE t1 ( +FieldKey varchar(36) NOT NULL default '', +LongVal bigint(20) default NULL, +StringVal mediumtext, +KEY FieldKey (FieldKey), +KEY LongField (FieldKey,LongVal), +KEY StringField (FieldKey,StringVal(32)) +); +INSERT INTO t1 VALUES ('0',3,'0'),('0',2,'1'),('0',1,'2'),('1',2,'1'),('1',1,'3'), ('1',0,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('3',2,'1'),('3',1,'2'),('3','3','3'); +EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref FieldKey,LongField,StringField LongField 36 const 3 Using where +SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal; +FieldKey LongVal StringVal +1 0 2 +1 1 3 +1 2 1 +EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 36 NULL 4 Using where; Using filesort +SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal; +FieldKey LongVal StringVal +3 1 2 +3 2 1 +3 3 3 +EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range FieldKey,LongField,StringField LongField 36 NULL 4 Using where +SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal; +FieldKey LongVal StringVal +3 1 2 +3 2 1 +3 3 3 +DROP TABLE t1; CREATE TABLE t1 (a INT, b INT); SET @id=0; UPDATE t1 SET a=0 ORDER BY (a=@id), b; DROP TABLE t1; -create table t1(id int not null auto_increment primary key, t char(12)); -explain select id,t from t1 order by id; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 1000 Using filesort -explain select id,t from t1 force index (primary) order by id; -table type possible_keys key key_len ref rows Extra -t1 index NULL PRIMARY 4 NULL 1000 +CREATE TABLE t1 ( id smallint(6) unsigned NOT NULL default '0', menu tinyint(4) NOT NULL default '0', KEY id (id), KEY menu (menu)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (11384, 2),(11392, 2); +SELECT id FROM t1 WHERE id <11984 AND menu =2 ORDER BY id DESC LIMIT 1 ; +id +11392 drop table t1; +create table t1(a int, b int, index(b)); +insert into t1 values (2, 1), (1, 1), (4, NULL), (3, NULL), (6, 2), (5, 2); +explain select * from t1 where b=1 or b is null order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null b b 5 const 3 Using where; Using filesort +select * from t1 where b=1 or b is null order by a; +a b +1 1 +2 1 +3 NULL +4 NULL +explain select * from t1 where b=2 or b is null order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null b b 5 const 4 Using where; Using filesort +select * from t1 where b=2 or b is null order by a; +a b +3 NULL +4 NULL +5 2 +6 2 +drop table t1; +create table t1 (a int not null auto_increment, b int not null, c int not null, d int not null, +key(a,b,d), key(c,b,a)); +create table t2 like t1; +insert into t1 values (NULL, 1, 2, 0), (NULL, 2, 1, 1), (NULL, 3, 4, 2), (NULL, 4, 3, 3); +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +set @row=10; +insert into t1 select 1, b, c + (@row:=@row - 1) * 10, d - @row from t2 limit 10; +select * from t1 where a=1 and b in (1) order by c, b, a; +a b c d +1 1 2 0 +1 1 12 -1 +1 1 52 -5 +1 1 92 -9 +select * from t1 where a=1 and b in (1); +a b c d +1 1 92 -9 +1 1 52 -5 +1 1 12 -1 +1 1 2 0 +drop table t1, t2; +create table t1 (col1 int, col int); +create table t2 (col2 int, col int); +insert into t1 values (1,1),(2,2),(3,3); +insert into t2 values (1,3),(2,2),(3,1); +select t1.* , t2.col as t2_col from t1 left join t2 on (t1.col1=t2.col2) +order by col; +col1 col t2_col +1 1 3 +2 2 2 +3 3 1 +select col1 as col, col from t1 order by col; +ERROR 23000: Column 'col' in order clause is ambiguous +select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2 +order by col; +ERROR 23000: Column 'col' in order clause is ambiguous +select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2 +order by col; +ERROR 23000: Column 'col' in order clause is ambiguous +select col1 from t1, t2 where t1.col1=t2.col2 order by col; +ERROR 23000: Column 'col' in order clause is ambiguous +select t1.col as t1_col, t2.col from t1, t2 where t1.col1=t2.col2 +order by col; +t1_col col +3 1 +2 2 +1 3 +select col2 as c, col as c from t2 order by col; +c c +3 1 +2 2 +1 3 +select col2 as col, col as col2 from t2 order by col; +col col2 +1 3 +2 2 +3 1 +select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2 +order by col; +t1_col col2 +1 1 +2 2 +3 3 +select t2.col2, t2.col, t2.col from t2 order by col; +col2 col col +3 1 1 +2 2 2 +1 3 3 +select t2.col2 as col from t2 order by t2.col; +col +3 +2 +1 +select t2.col2 as col, t2.col from t2 order by t2.col; +col col +3 1 +2 2 +1 3 +select t2.col2, t2.col, t2.col from t2 order by t2.col; +col2 col col +3 1 1 +2 2 2 +1 3 3 +drop table t1, t2; diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index 6733f2b142e..dfb5595e02d 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -8,11 +8,13 @@ len select repeat('a',2000); repeat('a',2000) NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (1024) - truncated select @@net_buffer_length, @@max_allowed_packet; @@net_buffer_length @@max_allowed_packet 1024 1024 SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; -Got a packet bigger than 'max_allowed_packet' +ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes set global max_allowed_packet=default; set max_allowed_packet=default; set global net_buffer_length=default; diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result new file mode 100644 index 00000000000..f0b99a8d6f1 --- /dev/null +++ b/mysql-test/r/preload.result @@ -0,0 +1,167 @@ +drop table if exists t1, t2; +create table t1 ( +a int not null auto_increment, +b char(16) not null, +primary key (a), +key (b) +); +create table t2( +a int not null auto_increment, +b char(16) not null, +primary key (a), +key (b) +); +insert into t1(b) values +('test0'), +('test1'), +('test2'), +('test3'), +('test4'), +('test5'), +('test6'), +('test7'); +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +insert into t2(b) select b from t1; +insert into t1(b) select b from t2; +select count(*) from t1; +count(*) +33448 +select count(*) from t2; +count(*) +20672 +flush tables; +flush status; +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +select count(*) from t1 where b = 'test1'; +count(*) +4181 +show status like "key_read%"; +Variable_name Value +Key_read_requests 217 +Key_reads 45 +select count(*) from t1 where b = 'test1'; +count(*) +4181 +show status like "key_read%"; +Variable_name Value +Key_read_requests 434 +Key_reads 45 +flush tables; +flush status; +select @@preload_buffer_size; +@@preload_buffer_size +32768 +load index into cache t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +select count(*) from t1 where b = 'test1'; +count(*) +4181 +show status like "key_read%"; +Variable_name Value +Key_read_requests 217 +Key_reads 45 +flush tables; +flush status; +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +set session preload_buffer_size=256*1024; +select @@preload_buffer_size; +@@preload_buffer_size +262144 +load index into cache t1 ignore leaves; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +select count(*) from t1 where b = 'test1'; +count(*) +4181 +show status like "key_read%"; +Variable_name Value +Key_read_requests 217 +Key_reads 45 +flush tables; +flush status; +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +set session preload_buffer_size=1*1024; +select @@preload_buffer_size; +@@preload_buffer_size +1024 +load index into cache t1, t2 key (primary,b) ignore leaves; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +test.t2 preload_keys status OK +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +select count(*) from t1 where b = 'test1'; +count(*) +4181 +select count(*) from t2 where b = 'test1'; +count(*) +2584 +show status like "key_read%"; +Variable_name Value +Key_read_requests 351 +Key_reads 73 +flush tables; +flush status; +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +load index into cache t3, t2 key (primary,b) ; +Table Op Msg_type Msg_text +test.t3 preload_keys error Table 'test.t3' doesn't exist +test.t2 preload_keys status OK +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +flush tables; +flush status; +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +load index into cache t3 key (b), t2 key (c) ; +Table Op Msg_type Msg_text +test.t3 preload_keys error Table 'test.t3' doesn't exist +test.t2 preload_keys error Key column 'c' doesn't exist in table +test.t2 preload_keys status Operation failed +show status like "key_read%"; +Variable_name Value +Key_read_requests 0 +Key_reads 0 +drop table t1, t2; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result new file mode 100644 index 00000000000..321b8894796 --- /dev/null +++ b/mysql-test/r/ps.result @@ -0,0 +1,272 @@ +drop table if exists t1,t2; +create table t1 +( +a int primary key, +b char(10) +); +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +set @a=2; +prepare stmt1 from 'select * from t1 where a <= ?'; +execute stmt1 using @a; +a b +1 one +2 two +set @a=3; +execute stmt1 using @a; +a b +1 one +2 two +3 three +deallocate prepare no_such_statement; +ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEALLOCATE PREPARE +execute stmt1; +ERROR HY000: Incorrect arguments to EXECUTE +prepare stmt2 from 'prepare nested_stmt from "select 1"'; +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 +prepare stmt2 from 'execute stmt1'; +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 'stmt1' at line 1 +prepare stmt2 from 'deallocate prepare z'; +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 'z' at line 1 +prepare stmt3 from 'insert into t1 values (?,?)'; +set @arg1=5, @arg2='five'; +execute stmt3 using @arg1, @arg2; +select * from t1 where a>3; +a b +4 four +5 five +prepare stmt4 from 'update t1 set a=? where b=?'; +set @arg1=55, @arg2='five'; +execute stmt4 using @arg1, @arg2; +select * from t1 where a>3; +a b +4 four +55 five +prepare stmt4 from 'create table t2 (a int)'; +execute stmt4; +prepare stmt4 from 'drop table t2'; +execute stmt4; +execute stmt4; +ERROR 42S02: Unknown table 't2' +prepare stmt5 from 'select ? + a from t1'; +set @a=1; +execute stmt5 using @a; +? + a +2 +3 +4 +5 +56 +execute stmt5 using @no_such_var; +? + a +NULL +NULL +NULL +NULL +NULL +set @nullvar=1; +set @nullvar=NULL; +execute stmt5 using @nullvar; +? + a +NULL +NULL +NULL +NULL +NULL +set @nullvar2=NULL; +execute stmt5 using @nullvar2; +? + a +NULL +NULL +NULL +NULL +NULL +prepare stmt6 from 'select 1; select2'; +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 '; select2' at line 1 +prepare stmt6 from 'insert into t1 values (5,"five"); select2'; +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 '; select2' at line 1 +explain prepare stmt6 from 'insert into t1 values (5,"five"); select2'; +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 'from 'insert into t1 values (5,"five"); select2'' at line 1 +create table t2 +( +a int +); +insert into t2 values (0); +set @arg00=NULL ; +prepare stmt1 from 'select 1 FROM t2 where a=?' ; +execute stmt1 using @arg00 ; +1 +prepare stmt1 from @nosuchvar; +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 'NULL' at line 1 +set @ivar= 1234; +prepare stmt1 from @ivar; +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 '1234' at line 1 +set @fvar= 123.4567; +prepare stmt1 from @fvar; +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 '123.4567' at line 1 +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; +? +1234 +drop table t1,t2; +PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?"; +set @var='A'; +EXECUTE stmt1 USING @var; +_utf8 'A' collate utf8_bin = ? +1 +DEALLOCATE PREPARE stmt1; +create table t1 (id int); +prepare stmt1 from "select FOUND_ROWS()"; +select SQL_CALC_FOUND_ROWS * from t1; +id +execute stmt1; +FOUND_ROWS() +0 +insert into t1 values (1); +select SQL_CALC_FOUND_ROWS * from t1; +id +1 +execute stmt1; +FOUND_ROWS() +1 +execute stmt1; +FOUND_ROWS() +0 +deallocate prepare stmt1; +drop table t1; +create table t1 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday') +) engine = MYISAM ; +create table t2 like t1; +set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +deallocate prepare stmt1; +drop tables t1,t2; +set @arg00=1; +prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ; +execute stmt1 ; +select m from t1; +m +1 +drop table t1; +prepare stmt1 from ' create table t1 (m int) as select ? as m ' ; +execute stmt1 using @arg00; +select m from t1; +m +1 +deallocate prepare stmt1; +drop table t1; +create table t1 (id int(10) unsigned NOT NULL default '0', +name varchar(64) NOT NULL default '', +PRIMARY KEY (id), UNIQUE KEY `name` (`name`)); +insert into t1 values (1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'); +prepare stmt1 from 'select name from t1 where id=? or id=?'; +set @id1=1,@id2=6; +execute stmt1 using @id1, @id2; +name +1 +6 +select name from t1 where id=1 or id=6; +name +1 +6 +deallocate prepare stmt1; +drop table t1; +create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; +prepare stmt1 from ' show table status from test like ''t1%'' '; +execute stmt1; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL +show table status from test like 't1%' ; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL +deallocate prepare stmt1 ; +drop table t1; +create table t1(a varchar(2), b varchar(3)); +prepare stmt1 from "select a, b from t1 where (not (a='aa' and b < 'zzz'))"; +execute stmt1; +a b +execute stmt1; +a b +deallocate prepare stmt1; +drop table t1; +prepare stmt1 from "select 1 into @var"; +execute stmt1; +execute stmt1; +prepare stmt1 from "create table t1 select 1 as i"; +execute stmt1; +drop table t1; +execute stmt1; +prepare stmt1 from "insert into t1 select i from t1"; +execute stmt1; +execute stmt1; +prepare stmt1 from "select * from t1 into outfile 'f1.txt'"; +execute stmt1; +deallocate prepare stmt1; +drop table t1; +prepare stmt1 from 'select 1'; +prepare STMT1 from 'select 2'; +execute sTmT1; +2 +2 +deallocate prepare StMt1; +deallocate prepare Stmt1; +ERROR HY000: Unknown prepared statement handler (Stmt1) given to DEALLOCATE PREPARE +set names utf8; +prepare `ÃŒ` from 'select 1234'; +execute `ÃŒ` ; +1234 +1234 +set names latin1; +execute `ü`; +1234 +1234 +set names default; +create table t1 (a varchar(10)) charset=utf8; +insert into t1 (a) values ('yahoo'); +set character_set_connection=latin1; +prepare stmt from 'select a from t1 where a like ?'; +set @var='google'; +execute stmt using @var; +a +execute stmt using @var; +a +deallocate prepare stmt; +drop table t1; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result new file mode 100644 index 00000000000..e9a5f705fa7 --- /dev/null +++ b/mysql-test/r/ps_1general.result @@ -0,0 +1,746 @@ +use test; +test_sequence +------ basic tests ------ +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +PREPARE stmt FROM ' select * from t1 where a = ? ' ; +SET @var= 2 ; +EXECUTE stmt USING @var ; +a b +2 two +select * from t1 where a = @var ; +a b +2 two +DEALLOCATE PREPARE stmt ; +prepare stmt1 from ' select 1 as my_col ' ; +prepare stmt1 from ' select ? as my_col ' ; +prepare ; +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 +prepare stmt1 ; +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 +prepare stmt1 from ; +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 +prepare_garbage stmt1 from ' select 1 ' ; +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 'prepare_garbage stmt1 from ' select 1 '' at line 1 +prepare stmt1 from_garbage ' select 1 ' ; +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 'from_garbage ' select 1 '' at line 1 +prepare stmt1 from ' select_garbage 1 ' ; +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_garbage 1' at line 1 +prepare from ' select 1 ' ; +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 'from ' select 1 '' at line 1 +prepare stmt1 ' select 1 ' ; +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 +prepare ? from ' select ? as my_col ' ; +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 '? from ' select ? as my_col '' at line 1 +set @arg00='select 1 as my_col'; +prepare stmt1 from @arg00; +set @arg00=''; +prepare stmt1 from @arg00; +ERROR 42000: Query was empty +set @arg00=NULL; +prepare stmt1 from @arg01; +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 'NULL' at line 1 +prepare stmt1 from ' select * from t1 where a <= 2 ' ; +prepare stmt1 from ' select * from t1 where x <= 2 ' ; +ERROR 42S22: Unknown column 'x' in 'where clause' +drop table if exists not_exist ; +prepare stmt1 from ' select * from not_exist where a <= 2 ' ; +ERROR 42S02: Table 'test.not_exist' doesn't exist +prepare stmt1 from ' insert into t1 values(? ' ; +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 +prepare stmt1 from ' select a, b from t1 + where a=? and where ' ; +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 'where' at line 2 +execute never_prepared ; +ERROR HY000: Unknown prepared statement handler (never_prepared) given to EXECUTE +prepare stmt1 from ' select * from t1 where a <= 2 ' ; +prepare stmt1 from ' select * from not_exist where a <= 2 ' ; +ERROR 42S02: Table 'test.not_exist' doesn't exist +execute stmt1 ; +ERROR HY000: Unknown prepared statement handler (stmt1) given to EXECUTE +create table to_be_dropped +( +a int primary key, +b char(30), +c int +); +insert into to_be_dropped( a, b, c) values( 1, 'original table', 1); +prepare stmt2 from ' select * from to_be_dropped ' ; +execute stmt2 ; +a b c +1 original table 1 +drop table to_be_dropped ; +execute stmt2 ; +ERROR 42S02: Table 'test.to_be_dropped' doesn't exist +create table to_be_dropped +( +a int primary key, +b char(30), +c int +); +insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +execute stmt2 ; +a b c +9 recreated table 9 +drop table to_be_dropped ; +create table to_be_dropped +( +a int primary key, +c int, +b char(30) +); +insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +execute stmt2 ; +a b c +9 recreated table 9 +drop table to_be_dropped ; +create table to_be_dropped +( +a int primary key, +b char(30), +c int, +d timestamp default current_timestamp +); +insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +execute stmt2 ; +a b c +9 recreated table 9 +drop table to_be_dropped ; +create table to_be_dropped +( +a int primary key, +d timestamp default current_timestamp, +b char(30), +c int +); +insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +execute stmt2 ; +a b c +9 recreated table 9 +drop table to_be_dropped ; +create table to_be_dropped +( +a timestamp default '2004-02-29 18:01:59', +b char(30), +c int +); +insert into to_be_dropped( b, c) values( 'recreated table', 9); +execute stmt2 ; +a b c +2004-02-29 18:01:59 recreated table 9 +drop table to_be_dropped ; +create table to_be_dropped +( +f1 int primary key, +f2 char(30), +f3 int +); +insert into to_be_dropped( f1, f2, f3) values( 9, 'recreated table', 9); +execute stmt2 ; +ERROR 42S22: Unknown column 'to_be_dropped.a' in 'field list' +drop table to_be_dropped ; +prepare stmt1 from ' select * from t1 where a <= 2 ' ; +execute stmt1 ; +a b +1 one +2 two +set @arg00=1 ; +set @arg01='two' ; +prepare stmt1 from ' select * from t1 where a <= ? ' ; +execute stmt1 using @arg00; +a b +1 one +execute stmt1 ; +ERROR HY000: Incorrect arguments to EXECUTE +execute stmt1 using @arg00, @arg01; +ERROR HY000: Incorrect arguments to EXECUTE +execute stmt1 using @not_set; +a b +deallocate prepare never_prepared ; +ERROR HY000: Unknown prepared statement handler (never_prepared) given to DEALLOCATE PREPARE +prepare stmt1 from ' select * from t1 where a <= 2 ' ; +prepare stmt1 from ' select * from not_exist where a <= 2 ' ; +ERROR 42S02: Table 'test.not_exist' doesn't exist +deallocate prepare stmt1; +ERROR HY000: Unknown prepared statement handler (stmt1) given to DEALLOCATE PREPARE +create table to_be_dropped +( +a int primary key, +b char(10) +); +prepare stmt2 from ' select a,b from to_be_dropped where a <= 2 ' ; +drop table to_be_dropped ; +deallocate prepare stmt2; +prepare stmt1 from ' select a from t1 where a <= 2 ' ; +prepare stmt2 from ' select b from t1 where a <= 2 ' ; +execute stmt2 ; +b +one +two +execute stmt1 ; +a +1 +2 +prepare stmt1 from ' select a from t1 where a <= 2 ' ; +prepare stmt2 from ' select a from t1 where a <= 2 ' ; +execute stmt2 ; +a +1 +2 +execute stmt1 ; +a +1 +2 +deallocate prepare stmt1 ; +execute stmt2 ; +a +1 +2 +test_sequence +------ show and misc tests ------ +drop table if exists t2; +create table t2 +( +a int primary key, b char(10) +); +prepare stmt4 from ' show databases '; +execute stmt4; +Database +mysql +test +prepare stmt4 from ' show tables from test like ''t2%'' '; +execute stmt4; +Tables_in_test (t2%) +t2 +prepare stmt4 from ' show columns from t2 from test like ''a%'' '; +execute stmt4; +Field Type Null Key Default Extra +a int(11) PRI 0 +create index t2_idx on t2(b); +prepare stmt4 from ' show index from t2 from test '; +execute stmt4; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 a A 0 NULL NULL BTREE +t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE +prepare stmt4 from ' show table status from test like ''t2%'' '; +execute stmt4; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL +prepare stmt4 from ' show table status from test like ''t_many_col_types%'' '; +execute stmt4; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t_many_col_types MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL +prepare stmt4 from ' show status like ''Threads_running'' '; +execute stmt4; +Variable_name Value +Threads_running 1 +prepare stmt4 from ' show variables like ''sql_mode'' '; +execute stmt4; +Variable_name Value +sql_mode +prepare stmt4 from ' show engine bdb logs '; +execute stmt4; +prepare stmt4 from ' show full processlist '; +execute stmt4; +Id User Host db Command Time State Info +number root localhost test Query 0 NULL show full processlist +prepare stmt4 from ' show grants for user '; +prepare stmt4 from ' show create table t2 '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' show master status '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' show master logs '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' show slave status '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' show warnings limit 20 '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' show errors limit 20 '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' show storage engines '; +execute stmt4; +Engine Support Comment +MyISAM YES/NO Default engine as of MySQL 3.23 with great performance +HEAP YES/NO Alias for MEMORY +MEMORY YES/NO Hash based, stored in memory, useful for temporary tables +MERGE YES/NO Collection of identical MyISAM tables +MRG_MYISAM YES/NO Alias for MERGE +ISAM YES/NO Obsolete storage engine, now replaced by MyISAM +MRG_ISAM YES/NO Obsolete storage engine, now replaced by MERGE +InnoDB YES/NO Supports transactions, row-level locking, and foreign keys +INNOBASE YES/NO Alias for INNODB +BDB YES/NO Supports transactions and page-level locking +BERKELEYDB YES/NO Alias for BDB +NDBCLUSTER YES/NO Clustered, fault-tolerant, memory-based tables +NDB YES/NO Alias for NDBCLUSTER +EXAMPLE YES/NO Example storage engine +ARCHIVE YES/NO Archive storage engine +CSV YES/NO CSV storage engine +drop table if exists tx; +prepare stmt1 from ' drop table if exists tx ' ; +execute stmt1 ; +Warnings: +Note 1051 Unknown table 'tx' +prepare stmt1 from ' drop table tx ' ; +execute stmt1 ; +ERROR 42S02: Unknown table 'tx' +prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ; +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 +prepare stmt1 from ' execute stmt2 ' ; +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 'stmt2' at line 1 +prepare stmt1 from ' deallocate prepare never_prepared ' ; +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 'never_prepared' at line 1 +prepare stmt4 from ' use test ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt3 from ' create database mysqltest '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +create database mysqltest ; +prepare stmt3 from ' drop database mysqltest '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +drop database mysqltest ; +prepare stmt3 from ' grant all on test.t1 to drop_user@localhost +identified by ''looser'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +grant all on test.t1 to drop_user@localhost +identified by 'looser' ; +prepare stmt3 from ' revoke all privileges on test.t1 from +drop_user@localhost '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +revoke all privileges on test.t1 from drop_user@localhost ; +prepare stmt3 from ' drop user drop_user@localhost '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +drop user drop_user@localhost; +prepare stmt3 from ' describe t2 '; +execute stmt3; +Field Type Null Key Default Extra +a int(11) PRI 0 +b char(10) YES MUL NULL +drop table t2 ; +execute stmt3; +ERROR 42S02: Table 'test.t2' doesn't exist +prepare stmt3 from ' lock tables t1 read ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt3 from ' unlock tables ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' load data infile ''data.txt'' +into table t1 fields terminated by ''\t'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' select * into outfile ''data.txt'' from t1 '; +execute stmt1 ; +prepare stmt1 from ' optimize table t1 ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' analyze table t1 ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' checksum table t1 ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' repair table t1 ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' restore table t1 from ''data.txt'' ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' handler t1 open '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt3 from ' commit ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt3 from ' rollback ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt4 from ' SET sql_mode=ansi '; +execute stmt4; +select 'a' || 'b' ; +'a' || 'b' +ab +prepare stmt4 from ' SET sql_mode="" '; +execute stmt4; +select 'a' || 'b' ; +'a' || 'b' +0 +prepare stmt5 from ' select ''a'' || ''b'' ' ; +execute stmt5; +'a' || 'b' +0 +SET sql_mode=ansi; +execute stmt5; +'a' || 'b' +0 +SET sql_mode=""; +prepare stmt1 from ' flush local privileges ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' reset query cache ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' KILL 0 '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt1 from ' explain select a from t1 order by b '; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 63 +def table 253 64 2 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 14 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort +SET @arg00=1 ; +prepare stmt1 from ' explain select a from t1 where a > ? order by b '; +execute stmt1 using @arg00; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 63 +def table 253 64 2 N 1 31 63 +def type 253 10 5 N 1 31 63 +def possible_keys 253 4096 7 Y 0 31 63 +def key 253 64 7 Y 0 31 63 +def key_len 8 3 1 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 27 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort +test_sequence +------ create/drop/alter/rename tests ------ +drop table if exists t2, t3; +prepare stmt_drop from ' drop table if exists t2 ' ; +execute stmt_drop; +prepare stmt_create from ' create table t2 ( + a int primary key, b char(10)) '; +execute stmt_create; +prepare stmt3 from ' create table t3 like t2 '; +execute stmt3; +drop table t3; +set @arg00=1; +prepare stmt3 from ' create table t3 (m int) select ? as m ' ; +execute stmt3 using @arg00; +select m from t3; +m +1 +drop table t3; +prepare stmt3 from ' create index t2_idx on t2(b) '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt3 from ' drop index t2_idx on t2 ' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +prepare stmt3 from ' alter table t2 drop primary key '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +drop table if exists new_t2; +prepare stmt3 from ' rename table t2 to new_t2 '; +execute stmt3; +execute stmt3; +ERROR 42S01: Table 'new_t2' already exists +rename table new_t2 to t2; +drop table t2; +test_sequence +------ big statement tests ------ +select 'ABC' as my_const_col from t1 where +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 ; +my_const_col +ABC +ABC +ABC +ABC +prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 AND +1 = 1 ' ; +execute stmt1 ; +my_const_col +ABC +ABC +ABC +ABC +execute stmt1 ; +my_const_col +ABC +ABC +ABC +ABC +select 'ABC' as my_const_col FROM t1 WHERE +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' ; +my_const_col +ABC +ABC +ABC +ABC +prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND +''1234567890123456789012345678901234567890123456789012345678901234567890'' += ''1234567890123456789012345678901234567890123456789012345678901234567890'' '; +execute stmt1 ; +my_const_col +ABC +ABC +ABC +ABC +execute stmt1 ; +my_const_col +ABC +ABC +ABC +ABC +set @arg00= 1; +set @arg01= 1; +set @arg02= 1; +set @arg03= 1; +set @arg04= 1; +set @arg05= 1; +set @arg06= 1; +set @arg07= 1; +set @arg10= 1; +set @arg11= 1; +set @arg12= 1; +set @arg13= 1; +set @arg14= 1; +set @arg15= 1; +set @arg16= 1; +set @arg17= 1; +set @arg20= 1; +set @arg21= 1; +set @arg22= 1; +set @arg23= 1; +set @arg24= 1; +set @arg25= 1; +set @arg26= 1; +set @arg27= 1; +set @arg30= 1; +set @arg31= 1; +set @arg32= 1; +set @arg33= 1; +set @arg34= 1; +set @arg35= 1; +set @arg36= 1; +set @arg37= 1; +set @arg40= 1; +set @arg41= 1; +set @arg42= 1; +set @arg43= 1; +set @arg44= 1; +set @arg45= 1; +set @arg46= 1; +set @arg47= 1; +set @arg50= 1; +set @arg51= 1; +set @arg52= 1; +set @arg53= 1; +set @arg54= 1; +set @arg55= 1; +set @arg56= 1; +set @arg57= 1; +set @arg60= 1; +set @arg61= 1; +select 'ABC' as my_const_col FROM t1 WHERE +@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and +@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and +@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and +@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and +@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and +@arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and +@arg00=@arg00 ; +my_const_col +ABC +ABC +ABC +ABC +prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE + ? = ? and ? = ? and ? = ? and ? = ? and + ? = ? and ? = ? and ? = ? and ? = ? and + ? = ? and ? = ? and ? = ? and ? = ? and + ? = ? and ? = ? and ? = ? and ? = ? and + ? = ? and ? = ? and ? = ? and ? = ? and + ? = ? and ? = ? and ? = ? and ? = ? and + ? = ? ' ; +execute stmt1 using +@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00; +my_const_col +ABC +ABC +ABC +ABC +execute stmt1 using +@arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, +@arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, +@arg20, @arg21, @arg22, @arg23, @arg24, @arg25, @arg26, @arg27, +@arg30, @arg31, @arg32, @arg33, @arg34, @arg35, @arg36, @arg37, +@arg40, @arg41, @arg42, @arg43, @arg44, @arg45, @arg46, @arg47, +@arg50, @arg51, @arg52, @arg53, @arg54, @arg55, @arg56, @arg57, +@arg60, @arg61 ; +my_const_col +ABC +ABC +ABC +ABC +drop table t1 ; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result new file mode 100644 index 00000000000..b49eedb4067 --- /dev/null +++ b/mysql-test/r/ps_2myisam.result @@ -0,0 +1,1279 @@ +use test; +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +test_sequence +------ simple select tests ------ +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists new_tab ; +create table new_tab (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table new_tab ; +drop table if exists new_tab ; +create table new_tab(session_id char(9) not null) ; +insert into new_tab values ('abc') ; +prepare stmt1 from ' select * from new_tab +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table new_tab ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? '; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t_many_col_types; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t_many_col_types.c2 - 0e-3) = t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t_many_col_types.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' select * from t_many_col_types ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 +def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 +def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 +def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 +def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 +def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 +def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 +def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 +def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 +def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 +def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 +def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 +def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select a,b from t1; +a b +1 one +0 two +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +select a,b from t1 ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1; +a b +1 one +2 two +3 three +4 four +5 five +7 sixmodified +0 NULL +8 eight +81 8-1 +82 8-2 +9 nine +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 ; +a b +1 one +2 two +3 three +4 four +0 NULL +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +1000 NULL +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1004 duplicate four +1003 duplicate three +1002 duplicate two +1001 duplicate one +1000 NULL +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +81 duplicate +82 duplicate +8 duplicate +4 duplicate +9 duplicate +7 duplicate +3 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +81 duplicate +82 duplicate +8 duplicate +4 duplicate +9 duplicate +7 duplicate +3 duplicate +103 three +drop table t2; +drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result new file mode 100644 index 00000000000..3a2708376fa --- /dev/null +++ b/mysql-test/r/ps_3innodb.result @@ -0,0 +1,1279 @@ +use test; +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'InnoDB' ; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'InnoDB' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +test_sequence +------ simple select tests ------ +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists new_tab ; +create table new_tab (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table new_tab ; +drop table if exists new_tab ; +create table new_tab(session_id char(9) not null) ; +insert into new_tab values ('abc') ; +prepare stmt1 from ' select * from new_tab +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table new_tab ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? '; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t_many_col_types; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t_many_col_types.c2 - 0e-3) = t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t_many_col_types.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' select * from t_many_col_types ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 +def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 +def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 +def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 +def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 +def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 +def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 +def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 +def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 +def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 +def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 +def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 +def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select a,b from t1; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +select a,b from t1 ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate +103 three +drop table t2; +drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result new file mode 100644 index 00000000000..4228d95677d --- /dev/null +++ b/mysql-test/r/ps_4heap.result @@ -0,0 +1,1280 @@ +use test; +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'HEAP' ; +drop table if exists t_many_col_types; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), +c25 char(100), c26 char(100), c27 char(100), c28 char(100), +c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'HEAP' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +test_sequence +------ simple select tests ------ +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists new_tab ; +create table new_tab (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table new_tab ; +drop table if exists new_tab ; +create table new_tab(session_id char(9) not null) ; +insert into new_tab values ('abc') ; +prepare stmt1 from ' select * from new_tab +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table new_tab ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? '; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t_many_col_types; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t_many_col_types.c2 - 0e-3) = t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t_many_col_types.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' select * from t_many_col_types ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 +def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 +def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 +def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 +def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 +def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 +def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 +def test t_many_col_types t_many_col_types c23 c23 253 100 8 Y 0 0 8 +def test t_many_col_types t_many_col_types c24 c24 253 100 8 Y 0 0 8 +def test t_many_col_types t_many_col_types c25 c25 253 100 4 Y 0 0 8 +def test t_many_col_types t_many_col_types c26 c26 253 100 4 Y 0 0 8 +def test t_many_col_types t_many_col_types c27 c27 253 100 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c28 c28 253 100 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c29 c29 253 100 8 Y 0 0 8 +def test t_many_col_types t_many_col_types c30 c30 253 100 8 Y 0 0 8 +def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 +def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select a,b from t1; +a b +1 one +0 two +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +select a,b from t1 ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1; +a b +1 one +2 two +3 three +4 four +5 five +7 sixmodified +0 NULL +8 eight +81 8-1 +82 8-2 +9 nine +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 ; +a b +1100 x1000_1updated +1000 x1000_3 +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 ; +a b +1 one +2 two +3 three +4 four +0 NULL +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1002 duplicate two +1001 duplicate one +1003 duplicate three +1004 duplicate four +1000 NULL +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1000 NULL +1004 duplicate four +1003 duplicate three +1002 duplicate two +1001 duplicate one +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +81 duplicate +82 duplicate +8 duplicate +4 duplicate +9 duplicate +7 duplicate +3 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +81 duplicate +82 duplicate +8 duplicate +4 duplicate +9 duplicate +7 duplicate +3 duplicate +103 three +drop table t2; +drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result new file mode 100644 index 00000000000..03020ccc0f3 --- /dev/null +++ b/mysql-test/r/ps_5merge.result @@ -0,0 +1,2430 @@ +use test; +drop table if exists t1, t1_1, t1_2, +t_many_col_types, t_many_col_types_1, t_many_col_types_2; +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +rename table t1 to t1_1, t_many_col_types to t_many_col_types_1 ; +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +rename table t1 to t1_2, t_many_col_types to t_many_col_types_2 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) ENGINE = MERGE UNION=(t1_1,t1_2) +INSERT_METHOD=FIRST; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2) +INSERT_METHOD=FIRST; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +test_sequence +------ simple select tests ------ +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists new_tab ; +create table new_tab (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table new_tab ; +drop table if exists new_tab ; +create table new_tab(session_id char(9) not null) ; +insert into new_tab values ('abc') ; +prepare stmt1 from ' select * from new_tab +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table new_tab ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? '; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t_many_col_types; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t_many_col_types.c2 - 0e-3) = t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t_many_col_types.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' select * from t_many_col_types ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 +def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 +def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 +def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 +def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 +def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 +def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 +def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 +def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 +def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 +def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 +def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 +def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select a,b from t1; +a b +3 three +0 two +1 one +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1; +a b +3 three +2 two +1 one +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +select a,b from t1 ; +a b +3 three +2 two +1 one +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1; +a b +4 four +3 three +2 two +1 one +5 five +7 sixmodified +0 NULL +8 eight +81 8-1 +82 8-2 +9 nine +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +drop table t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) ENGINE = MERGE UNION=(t1_1,t1_2) +INSERT_METHOD=LAST; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2) +INSERT_METHOD=LAST; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +test_sequence +------ simple select tests ------ +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists new_tab ; +create table new_tab (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table new_tab ; +drop table if exists new_tab ; +create table new_tab(session_id char(9) not null) ; +insert into new_tab values ('abc') ; +prepare stmt1 from ' select * from new_tab +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table new_tab ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? '; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t_many_col_types; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t_many_col_types.c2 - 0e-3) = t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t_many_col_types.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' select * from t_many_col_types ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 +def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 +def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 +def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 +def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 +def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 +def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 +def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 +def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 +def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 +def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 +def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 +def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select a,b from t1; +a b +3 three +0 two +1 one +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1; +a b +3 three +2 two +1 one +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +select a,b from t1 ; +a b +3 three +2 two +1 one +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1; +a b +4 four +3 three +2 two +1 one +5 five +7 sixmodified +0 NULL +8 eight +81 8-1 +82 8-2 +9 nine +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +drop table t1, t1_1, t1_2, +t_many_col_types_1, t_many_col_types_2, t_many_col_types; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result new file mode 100644 index 00000000000..b8730cce101 --- /dev/null +++ b/mysql-test/r/ps_6bdb.result @@ -0,0 +1,1279 @@ +use test; +drop table if exists t1, t_many_col_types ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'BDB' ; +create table t_many_col_types +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'BDB' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +test_sequence +------ simple select tests ------ +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists new_tab ; +create table new_tab (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table new_tab ; +drop table if exists new_tab ; +create table new_tab(session_id char(9) not null) ; +insert into new_tab values ('abc') ; +prepare stmt1 from ' select * from new_tab +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table new_tab ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? '; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t_many_col_types; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t_many_col_types.c2 - 0e-3) = t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 + GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t_many_col_types.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t_many_col_types, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +2 0 1 0 +18 1 0 1 +2 0 1 0 +18 1 0 1 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 63 +def table 253 64 16 N 1 31 63 +def type 253 10 3 N 1 31 63 +def possible_keys 253 4096 0 Y 0 31 63 +def key 253 64 0 Y 0 31 63 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 63 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 63 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' select * from t_many_col_types ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 +def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 +def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 +def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 +def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 +def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 +def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 +def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 +def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 +def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 +def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 +def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 +def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 +def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 +def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 +def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 +def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 +def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 +def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 +def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select a,b from t1; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +select a,b from t1 ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t_many_col_types ; +insert into t_many_col_types +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t_many_col_types +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +select a,b from t2; +a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate +103 three +drop table t2; +drop table t1, t_many_col_types; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index a9e9f167e5f..a93ea1aa7fe 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -44,7 +44,7 @@ create table t1 (a int not null); insert into t1 values (1),(2),(3); create table t2 (a int not null); insert into t2 values (4),(5),(6); -create table t3 (a int not null) type=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST; +create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST; select * from t3; a 1 @@ -292,7 +292,7 @@ DATABASE() select ENCRYPT("test") from t1; ENCRYPT("test") select LAST_INSERT_ID() from t1; -last_insert_id() +LAST_INSERT_ID() select RAND() from t1; RAND() select UNIX_TIMESTAMP() from t1; @@ -301,6 +301,11 @@ select USER() from t1; USER() select benchmark(1,1) from t1; benchmark(1,1) +explain extended select benchmark(1,1) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select sql_no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 @@ -382,8 +387,9 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 drop table t1; -create table t1 (a char(1) not null); -insert into t1 values("á"); +create table t1 (a char(1) not null collate koi8r_general_ci); +insert into t1 values(_koi8r"á"); +set CHARACTER SET koi8r; select * from t1; a á @@ -510,6 +516,74 @@ drop table t1; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 +show global variables like "query_cache_min_res_unit"; +Variable_name Value +query_cache_min_res_unit 4096 +set GLOBAL query_cache_min_res_unit=1001; +show global variables like "query_cache_min_res_unit"; +Variable_name Value +query_cache_min_res_unit 1008 +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a int not null); +insert into t2 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select * from t1; +a +1 +2 +3 +select * from t2; +a +1 +2 +3 +select * from t2; +a +1 +2 +3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 11 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +drop table t1; +select a from t2; +a +1 +2 +3 +select a from t2; +a +1 +2 +3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 12 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +drop table t2; +set GLOBAL query_cache_min_res_unit=default; +show global variables like "query_cache_min_res_unit"; +Variable_name Value +query_cache_min_res_unit 4096 +create table t1 (a int not null); +insert into t1 values (1); +select "aaa" from t1; +aaa +aaa +select "AAA" from t1; +AAA +AAA +drop table t1; create table t1 (a int); set GLOBAL query_cache_size=1000; show global variables like "query_cache_size"; @@ -518,24 +592,32 @@ query_cache_size 0 select * from t1; a set GLOBAL query_cache_size=1024; +Warnings: +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 select * from t1; a set GLOBAL query_cache_size=10240; +Warnings: +Warning 1282 Query cache failed to set size 10240; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 select * from t1; a set GLOBAL query_cache_size=20480; +Warnings: +Warning 1282 Query cache failed to set size 20480; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 select * from t1; a set GLOBAL query_cache_size=40960; +Warnings: +Warning 1282 Query cache failed to set size 40960; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -585,6 +667,7 @@ i show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 2 +update t1 set i=(select distinct 1 from (select * from t2) a); drop table t1, t2, t3; use mysql; select * from db; @@ -603,28 +686,32 @@ id 2 alter table t1 rename to t2; select * from t1 where id=2; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist drop table t2; select * from t1 where id=2; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist create table t1 (word char(20) not null); select * from t1; word show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 -load data infile '../../std_data/words.dat' into table t1; +load data infile 'TEST_DIR/std_data/words.dat' into table t1; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 +select count(*) from t1; +count(*) +70 drop table t1; -drop table if exists t1; create table t1 (a int); insert into t1 values (1),(2),(3); show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 -select * from t1 into outfile "query_caceh.out.file"; +select * from t1 into outfile "query_cache.out.file"; +select * from t1 into outfile "query_cache.out.file"; +ERROR HY000: File 'query_cache.out.file' already exists select * from t1 limit 1 into dumpfile "query_cache.dump.file"; show status like "Qcache_queries_in_cache"; Variable_name Value @@ -704,4 +791,64 @@ Qcache_queries_in_cache 1 unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; -set GLOBAL query_cache_size=0; +SET NAMES koi8r; +CREATE TABLE t1 (a char(1) character set koi8r); +INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á'); +SELECT a,'Â','â'='Â' FROM t1; +a  'â'='Â' +á  1 +Á  1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +set collation_connection=koi8r_bin; +SELECT a,'Â','â'='Â' FROM t1; +a  'â'='Â' +á  0 +Á  0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +set character_set_client=cp1251; +SELECT a,'Â','â'='Â' FROM t1; +a ÷ '×'='÷' +á ÷ 0 +Á ÷ 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 3 +set character_set_results=cp1251; +SELECT a,'Â','â'='Â' FROM t1; +a  'â'='Â' +À  0 +à  0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 4 +DROP TABLE t1; +CREATE TABLE t1 (a int(1)); +CREATE DATABASE mysqltest; +USE mysqltest; +DROP DATABASE mysqltest; +SELECT * FROM test.t1; +a +USE test; +DROP TABLE t1; +set character_set_results=null; +select @@character_set_results; +@@character_set_results +NULL +set character_set_results=default; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result index 408e3b5480f..459da1cdf49 100644 --- a/mysql-test/r/raid.result +++ b/mysql-test/r/raid.result @@ -1,16 +1,17 @@ -create database test_raid; -create table test_raid.r1 (i int) raid_type=1; -create table test_raid.r2 (i int) raid_type=1 raid_chunks=32; -drop database test_raid; -create database test_raid; -create table test_raid.r2 (i int) raid_type=1 raid_chunks=257; -show create table test_raid.r2; +DROP TABLE IF EXISTS t1,t2; +DROP DATABASE IF EXISTS test_$1; +create database test_$1; +create table test_$1.r1 (i int) raid_type=1; +create table test_$1.r2 (i int) raid_type=1 raid_chunks=32; +drop database test_$1; +create database test_$1; +create table test_$1.r2 (i int) raid_type=1 raid_chunks=257; +show create table test_$1.r2; Table Create Table r2 CREATE TABLE `r2` ( `i` int(11) default NULL -) TYPE=MyISAM RAID_TYPE=striped RAID_CHUNKS=255 RAID_CHUNKSIZE=256 -drop database test_raid; -DROP TABLE IF EXISTS t1,t2; +) ENGINE=MyISAM DEFAULT CHARSET=latin1 RAID_TYPE=striped RAID_CHUNKS=255 RAID_CHUNKSIZE=256 +drop database test_$1; CREATE TABLE t1 ( id int unsigned not null auto_increment primary key, c char(255) not null @@ -108,7 +109,6 @@ count(*) 450 DROP TABLE t2; /* variable rows */ -DROP TABLE IF EXISTS t2; CREATE TABLE t1 ( id int unsigned not null auto_increment primary key, c varchar(255) not null diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 55e03731fc7..4ca96316800 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; CREATE TABLE t1 ( event_date date DEFAULT '0000-00-00' NOT NULL, type int(11) DEFAULT '0' NOT NULL, @@ -32,8 +32,8 @@ event_date type event_id 1999-07-13 100600 26 1999-07-14 100600 10 explain select event_date,type,event_id from t1 WHERE type = 100601 and event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date; -Comment -Impossible WHERE +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date <= "1999-07-15" AND (type=100600 OR type=100100) or event_date >= "1999-07-01" AND event_date <= "1999-07-15" AND type=100099; event_date type event_id 1999-07-10 100100 24 @@ -150,7 +150,7 @@ believe in myself drop table t1; CREATE TABLE t1 ( t1ID int(10) unsigned NOT NULL auto_increment, -art char(1) binary NOT NULL default '', +art binary(1) NOT NULL default '', KNR char(5) NOT NULL default '', RECHNR char(6) NOT NULL default '', POSNR char(2) NOT NULL default '', @@ -160,7 +160,7 @@ PRIMARY KEY (t1ID), KEY IdxArt (art), KEY IdxKnr (KNR), KEY IdxArtnr (ARTNR) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), @@ -201,7 +201,7 @@ INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j' ('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'); select count(*) from t1 where upper(art) = 'J'; count(*) -602 +213 select count(*) from t1 where art = 'J' or art = 'j'; count(*) 602 @@ -215,78 +215,63 @@ select count(*) from t1 where art = 'J'; count(*) 213 drop table t1; -create table t1 ( id1 int not null, id2 int not null, idnull int null, c char(20), primary key (id1,id2)); -insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), -(3,1,NULL,"aaa"), (4,1,NULL,"aaa"), (5,1,NULL,"aaa"), -(6,1,NULL,"aaa"), (7,1,NULL,"aaa"), (8,1,NULL,"aaa"), -(9,1,NULL,"aaa"), (10,1,NULL,"aaa"), (11,1,NULL,"aaa"), -(12,1,NULL,"aaa"), (13,1,NULL,"aaa"), (14,1,NULL,"aaa"), -(15,1,NULL,"aaa"), (16,1,NULL,"aaa"), (17,1,NULL,"aaa"), -(18,1,NULL,"aaa"), (19,1,NULL,"aaa"), (20,1,NULL,"aaa"); -select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; -id1 idnull -drop table t1; create table t1 (x int, y int, index(x), index(y)); insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9); update t1 set y=x; explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0; -table type possible_keys key key_len ref rows Extra -t1 ref y y 5 const 1 Using where -t2 range x x 5 NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 range x x 5 NULL 4 Using where explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0; -table type possible_keys key key_len ref rows Extra -t1 ref y y 5 const 1 Using where -t2 range x x 5 NULL 4 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 range x x 5 NULL 4 Using where explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1; -table type possible_keys key key_len ref rows Extra -t1 ref y y 5 const 1 Using where -t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1) +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 0x1) explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1; -table type possible_keys key key_len ref rows Extra -t1 ref y y 5 const 1 Using where -t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1) +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 0x1) explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y; -table type possible_keys key key_len ref rows Extra -t1 ref y y 5 const 1 Using where -t2 ALL x NULL NULL NULL 9 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y; -table type possible_keys key key_len ref rows Extra -t1 ref y y 5 const 1 Using where -t2 range x x 5 NULL 2 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 range x x 5 NULL 2 Using where explain select count(*) from t1 where x in (1); -table type possible_keys key key_len ref rows Extra -t1 ref x x 5 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref x x 5 const 1 Using where; Using index explain select count(*) from t1 where x in (1,2); -table type possible_keys key key_len ref rows Extra -t1 range x x 5 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index drop table t1; -CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1)); +CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1)); INSERT INTO t1 VALUES (0),(0),(1),(1); CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya)); INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3; -table type possible_keys key key_len ref rows Extra -t2 ref j1 j1 4 const 1 Using where; Using index -t1 ALL i1,i2 NULL NULL NULL 4 Range checked for each record (index map: 3) -explain select * from t1 force index(i2), t2 where (t1.key1 <t2.keya + 1) and t2.keya=3; -table type possible_keys key key_len ref rows Extra -t2 ref j1 j1 4 const 1 Using where; Using index -t1 ALL i2 NULL NULL NULL 4 Range checked for each record (index map: 2) +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref j1 j1 4 const 1 Using where; Using index +1 SIMPLE t1 ALL i1 NULL NULL NULL 4 Range checked for each record (index map: 0x1) DROP TABLE t1,t2; CREATE TABLE t1 ( a int(11) default NULL, b int(11) default NULL, KEY a (a), KEY b (b) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),(10,2), (13,2),(14,2),(15,2),(16,2),(17,3),(17,3),(16,3),(17,3),(19,3),(20,3), (21,4),(22,5),(23,5),(24,5),(25,5),(26,5),(30,5),(31,5),(32,5),(33,5), (33,5),(33,5),(33,5),(33,5),(34,5),(35,5); EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5; -table type possible_keys key key_len ref rows Extra -t1 range a,b a 5 NULL 2 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a,b a 5 NULL 2 Using where SELECT * FROM t1 WHERE a IN(1,2) AND b=5; a b DROP TABLE t1; @@ -335,3 +320,244 @@ id columnid tableid content showid line ordinal 13 13 1 188 1 5 0 15 15 1 188 1 1 0 drop table t1; +create table t1 (id int(10) primary key); +insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9); +select id from t1 where id in (2,5,9) ; +id +2 +5 +9 +select id from t1 where id=2 or id=5 or id=9 ; +id +2 +5 +9 +drop table t1; +create table t1 ( id1 int not null, id2 int not null, idnull int null, c char(20), primary key (id1,id2)); +insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), +(3,1,NULL,"aaa"), (4,1,NULL,"aaa"), (5,1,NULL,"aaa"), +(6,1,NULL,"aaa"), (7,1,NULL,"aaa"), (8,1,NULL,"aaa"), +(9,1,NULL,"aaa"), (10,1,NULL,"aaa"), (11,1,NULL,"aaa"), +(12,1,NULL,"aaa"), (13,1,NULL,"aaa"), (14,1,NULL,"aaa"), +(15,1,NULL,"aaa"), (16,1,NULL,"aaa"), (17,1,NULL,"aaa"), +(18,1,NULL,"aaa"), (19,1,NULL,"aaa"), (20,1,NULL,"aaa"); +select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; +id1 idnull +drop table t1; +create table t1 ( +id int not null auto_increment, +name char(1) not null, +uid int not null, +primary key (id), +index uid_index (uid)); +create table t2 ( +id int not null auto_increment, +name char(1) not null, +uid int not null, +primary key (id), +index uid_index (uid)); +insert into t1(id, uid, name) values(1, 0, ' '); +insert into t1(uid, name) values(0, ' '); +insert into t2(uid, name) select uid, name from t1; +insert into t1(uid, name) select uid, name from t2; +insert into t2(uid, name) select uid, name from t1; +insert into t1(uid, name) select uid, name from t2; +insert into t2(uid, name) select uid, name from t1; +insert into t1(uid, name) select uid, name from t2; +insert into t2(uid, name) select uid, name from t1; +insert into t1(uid, name) select uid, name from t2; +insert into t2(uid, name) select uid, name from t1; +insert into t1(uid, name) select uid, name from t2; +insert into t2(uid, name) select uid, name from t1; +insert into t2(uid, name) select uid, name from t1; +insert into t2(uid, name) select uid, name from t1; +insert into t2(uid, name) select uid, name from t1; +insert into t1(uid, name) select uid, name from t2; +delete from t2; +insert into t2(uid, name) values +(1, CHAR(64+1)), +(2, CHAR(64+2)), +(3, CHAR(64+3)), +(4, CHAR(64+4)), +(5, CHAR(64+5)), +(6, CHAR(64+6)), +(7, CHAR(64+7)), +(8, CHAR(64+8)), +(9, CHAR(64+9)), +(10, CHAR(64+10)), +(11, CHAR(64+11)), +(12, CHAR(64+12)), +(13, CHAR(64+13)), +(14, CHAR(64+14)), +(15, CHAR(64+15)), +(16, CHAR(64+16)), +(17, CHAR(64+17)), +(18, CHAR(64+18)), +(19, CHAR(64+19)), +(20, CHAR(64+20)), +(21, CHAR(64+21)), +(22, CHAR(64+22)), +(23, CHAR(64+23)), +(24, CHAR(64+24)), +(25, CHAR(64+25)), +(26, CHAR(64+26)); +insert into t1(uid, name) select uid, name from t2; +delete from t2; +insert into t2(id, uid, name) select id, uid, name from t1; +select count(*) from t1; +count(*) +1026 +select count(*) from t2; +count(*) +1026 +explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range uid_index uid_index 4 NULL 128 Using where +1 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 38 +explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range uid_index uid_index 4 NULL 129 Using where +1 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 38 +select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0; +id name uid id name uid +1001 A 1 1001 A 1 +1002 B 2 1002 B 2 +1003 C 3 1003 C 3 +1004 D 4 1004 D 4 +1005 E 5 1005 E 5 +1006 F 6 1006 F 6 +1007 G 7 1007 G 7 +1008 H 8 1008 H 8 +1009 I 9 1009 I 9 +1010 J 10 1010 J 10 +1011 K 11 1011 K 11 +1012 L 12 1012 L 12 +1013 M 13 1013 M 13 +1014 N 14 1014 N 14 +1015 O 15 1015 O 15 +1016 P 16 1016 P 16 +1017 Q 17 1017 Q 17 +1018 R 18 1018 R 18 +1019 S 19 1019 S 19 +1020 T 20 1020 T 20 +1021 U 21 1021 U 21 +1022 V 22 1022 V 22 +1023 W 23 1023 W 23 +1024 X 24 1024 X 24 +1025 Y 25 1025 Y 25 +1026 Z 26 1026 Z 26 +select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0; +id name uid id name uid +1001 A 1 1001 A 1 +1002 B 2 1002 B 2 +1003 C 3 1003 C 3 +1004 D 4 1004 D 4 +1005 E 5 1005 E 5 +1006 F 6 1006 F 6 +1007 G 7 1007 G 7 +1008 H 8 1008 H 8 +1009 I 9 1009 I 9 +1010 J 10 1010 J 10 +1011 K 11 1011 K 11 +1012 L 12 1012 L 12 +1013 M 13 1013 M 13 +1014 N 14 1014 N 14 +1015 O 15 1015 O 15 +1016 P 16 1016 P 16 +1017 Q 17 1017 Q 17 +1018 R 18 1018 R 18 +1019 S 19 1019 S 19 +1020 T 20 1020 T 20 +1021 U 21 1021 U 21 +1022 V 22 1022 V 22 +1023 W 23 1023 W 23 +1024 X 24 1024 X 24 +1025 Y 25 1025 Y 25 +1026 Z 26 1026 Z 26 +drop table t1,t2; +create table t1 (x bigint unsigned not null); +insert into t1(x) values (0xfffffffffffffff0); +insert into t1(x) values (0xfffffffffffffff1); +select * from t1; +x +18446744073709551600 +18446744073709551601 +select count(*) from t1 where x>0; +count(*) +2 +select count(*) from t1 where x=0; +count(*) +0 +select count(*) from t1 where x<0; +count(*) +0 +select count(*) from t1 where x < -16; +count(*) +0 +select count(*) from t1 where x = -16; +count(*) +0 +select count(*) from t1 where x > -16; +count(*) +2 +select count(*) from t1 where x = 18446744073709551601; +count(*) +1 +create table t2 (x bigint not null); +insert into t2(x) values (0xfffffffffffffff0); +insert into t2(x) values (0xfffffffffffffff1); +select * from t2; +x +-16 +-15 +select count(*) from t2 where x>0; +count(*) +0 +select count(*) from t2 where x=0; +count(*) +0 +select count(*) from t2 where x<0; +count(*) +2 +select count(*) from t2 where x < -16; +count(*) +0 +select count(*) from t2 where x = -16; +count(*) +1 +select count(*) from t2 where x > -16; +count(*) +1 +select count(*) from t2 where x = 18446744073709551601; +count(*) +0 +drop table t1; +create table t1 (x bigint unsigned not null primary key) engine=innodb; +insert into t1(x) values (0xfffffffffffffff0); +insert into t1(x) values (0xfffffffffffffff1); +select * from t1; +x +18446744073709551600 +18446744073709551601 +select count(*) from t1 where x>0; +count(*) +2 +select count(*) from t1 where x=0; +count(*) +0 +select count(*) from t1 where x<0; +count(*) +0 +select count(*) from t1 where x < -16; +count(*) +0 +select count(*) from t1 where x = -16; +count(*) +0 +select count(*) from t1 where x > -16; +count(*) +1 +select count(*) from t1 where x = 18446744073709551601; +count(*) +1 +drop table t1; diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result index b2bb659502a..ec36f015412 100644 --- a/mysql-test/r/rename.result +++ b/mysql-test/r/rename.result @@ -1,4 +1,5 @@ drop table if exists t0,t1,t2,t3,t4; +drop table if exists t0,t5,t6,t7,t8,t9; create table t0 SELECT 1,"table 1"; create table t2 SELECT 2,"table 2"; create table t3 SELECT 3,"table 3"; @@ -37,3 +38,19 @@ select * from t3; 3 table 3 3 table 3 drop table if exists t1,t2,t3,t4; +Warnings: +Note 1051 Unknown table 't4' +CREATE TABLE t1 (a int); +CREATE TABLE t3 (a int); +FLUSH TABLES WITH READ LOCK; + RENAME TABLE t1 TO t2, t3 to t4; +show tables; +Tables_in_test +t1 +t3 +UNLOCK TABLES; +show tables; +Tables_in_test +t2 +t4 +drop table t2, t4; diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 6c2107b2cf3..dbca5c39a6c 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -4,12 +4,36 @@ repair table t1 use_frm; Table Op Msg_type Msg_text test.t1 repair warning Number of rows changed from 0 to 1 test.t1 repair status OK -alter table t1 TYPE=HEAP; +alter table t1 ENGINE=HEAP; repair table t1 use_frm; Table Op Msg_type Msg_text -test.t1 repair error The handler for the table doesn't support repair +test.t1 repair note The storage engine for the table doesn't support repair +drop table t1; +create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st)); +insert into t1 values(1, "One"); +alter table t1 disable keys; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id A 1 NULL NULL BTREE +t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled +repair table t1 extended; +Table Op Msg_type Msg_text +test.t1 repair status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id A 1 NULL NULL BTREE +t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled drop table t1; repair table t1 use_frm; Table Op Msg_type Msg_text test.t1 repair error Table 'test.t1' doesn't exist -create table t1 type=myisam SELECT 1,"table 1"; +create table t1 engine=myisam SELECT 1,"table 1"; +flush tables; +repair table t1; +Table Op Msg_type Msg_text +test.t1 repair error Can't open file: 't1.MYI' (errno: 130) +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 1 +test.t1 repair status OK +drop table t1; diff --git a/mysql-test/r/repair_part2.result b/mysql-test/r/repair_part2.result deleted file mode 100644 index 77aa98c3da9..00000000000 --- a/mysql-test/r/repair_part2.result +++ /dev/null @@ -1,8 +0,0 @@ -repair table t1; -Table Op Msg_type Msg_text -test.t1 repair error Can't open file: 't1.MYI'. (errno: 130) -repair table t1 use_frm; -Table Op Msg_type Msg_text -test.t1 repair warning Number of rows changed from 0 to 1 -test.t1 repair status OK -drop table t1; diff --git a/mysql-test/r/replace.result b/mysql-test/r/replace.result index 0aa80e18ccc..83cde76215a 100644 --- a/mysql-test/r/replace.result +++ b/mysql-test/r/replace.result @@ -3,24 +3,26 @@ CREATE TABLE t1 ( gesuchnr int(11) DEFAULT '0' NOT NULL, benutzer_id int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (gesuchnr,benutzer_id) -) type=ISAM; +) engine=ISAM; replace into t1 (gesuchnr,benutzer_id) values (2,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); -alter table t1 type=myisam; +alter table t1 engine=myisam; replace into t1 (gesuchnr,benutzer_id) values (1,1); -alter table t1 type=heap; +alter table t1 engine=heap; replace into t1 (gesuchnr,benutzer_id) values (1,1); drop table t1; -create table t1 (a tinyint not null auto_increment primary key, b char(20)); -insert into t1 values (126,"first"),(0,"last"); +create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value"); +insert into t1 values (126,"first"),(63, "middle"),(0,"last"); insert into t1 values (0,"error"); -Duplicate entry '127' for key 1 +ERROR 23000: Duplicate entry '127' for key 1 replace into t1 values (0,"error"); -Duplicate entry '127' for key 1 +ERROR 23000: Duplicate entry '127' for key 1 replace into t1 values (126,"first updated"); +replace into t1 values (63,default); select * from t1; a b 126 first updated +63 default_value 127 last drop table t1; diff --git a/mysql-test/r/rollback.result b/mysql-test/r/rollback.result index a5eb6f8729f..e562b73c981 100644 --- a/mysql-test/r/rollback.result +++ b/mysql-test/r/rollback.result @@ -1,12 +1,29 @@ drop table if exists t1; -create table t1 (n int not null primary key) type=myisam; +create table t1 (n int not null primary key) engine=myisam; begin work; insert into t1 values (4); insert into t1 values (5); rollback; -Warning: Some non-transactional changed tables couldn't be rolled back +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +select @@warning_count; +@@warning_count +1 +select @@error_count; +@@error_count +0 +show warnings; +Level Code Message +Warning 1196 Some non-transactional changed tables couldn't be rolled back +show errors; +Level Code Message select * from t1; n 4 5 +select @@warning_count; +@@warning_count +0 +show warnings; +Level Code Message drop table t1; diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result new file mode 100644 index 00000000000..76d6fa13766 --- /dev/null +++ b/mysql-test/r/row.result @@ -0,0 +1,172 @@ +drop table if exists t1; +select (1,2,3) IN ((3,2,3), (1,2,3), (1,3,3)); +(1,2,3) IN ((3,2,3), (1,2,3), (1,3,3)) +1 +select row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)); +row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3)) +0 +select row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)); +row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)) +1 +select row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)); +row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)) +0 +select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')); +row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')) +1 +select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)); +row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)) +1 +select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3)); +row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3)) +1 +select row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)); +row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)) +1 +select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)); +row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3)) +0 +select row('b',1.5,3) IN (row('b',NULL,3), row('a',1.5,3), row(1,3,3)); +row('b',1.5,3) IN (row('b',NULL,3), row('a',1.5,3), row(1,3,3)) +NULL +select row('b',1.5,3) IN (row('b',NULL,4), row('a',1.5,3), row(1,3,3)); +row('b',1.5,3) IN (row('b',NULL,4), row('a',1.5,3), row(1,3,3)) +0 +select (1,2,(3,4)) IN ((3,2,(3,4)), (1,2,(3,4))); +(1,2,(3,4)) IN ((3,2,(3,4)), (1,2,(3,4))) +1 +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4)); +ERROR 21000: Operand should contain 2 column(s) +select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL))); +row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL))) +NULL +explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL))); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))` +SELECT (1,2,3)=(0,NULL,3); +(1,2,3)=(0,NULL,3) +0 +SELECT (1,2,3)=(1,NULL,3); +(1,2,3)=(1,NULL,3) +NULL +SELECT (1,2,3)=(1,NULL,0); +(1,2,3)=(1,NULL,0) +NULL +SELECT ROW(1,2,3)=ROW(1,2,3); +ROW(1,2,3)=ROW(1,2,3) +1 +SELECT ROW(2,2,3)=ROW(1+1,2,3); +ROW(2,2,3)=ROW(1+1,2,3) +1 +SELECT ROW(1,2,3)=ROW(1+1,2,3); +ROW(1,2,3)=ROW(1+1,2,3) +0 +SELECT ROW(1,2,3)<ROW(1+1,2,3); +ROW(1,2,3)<ROW(1+1,2,3) +1 +SELECT ROW(1,2,3)>ROW(1+1,2,3); +ROW(1,2,3)>ROW(1+1,2,3) +0 +SELECT ROW(1,2,3)<=ROW(1+1,2,3); +ROW(1,2,3)<=ROW(1+1,2,3) +1 +SELECT ROW(1,2,3)>=ROW(1+1,2,3); +ROW(1,2,3)>=ROW(1+1,2,3) +0 +SELECT ROW(1,2,3)<>ROW(1+1,2,3); +ROW(1,2,3)<>ROW(1+1,2,3) +1 +SELECT ROW(NULL,2,3)=ROW(NULL,2,3); +ROW(NULL,2,3)=ROW(NULL,2,3) +NULL +SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); +ROW(NULL,2,3)<=>ROW(NULL,2,3) +1 +SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); +ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)) +1 +SELECT ROW('test',2,3.33)=ROW('test',2,3.33); +ROW('test',2,3.33)=ROW('test',2,3.33) +1 +SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); +ERROR 21000: Operand should contain 3 column(s) +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33)); +ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33)) +1 +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3)); +ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3)) +0 +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL)); +ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL)) +NULL +SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4); +ERROR 21000: Operand should contain 2 column(s) +create table t1 ( a int, b int, c int); +insert into t1 values (1,2,3), (2,3,1), (3,2,1), (1,2,NULL); +select * from t1 where ROW(1,2,3)=ROW(a,b,c); +a b c +1 2 3 +select * from t1 where ROW(0,2,3)=ROW(a,b,c); +a b c +select * from t1 where ROW(1,2,3)<ROW(a,b,c); +a b c +2 3 1 +3 2 1 +select ROW(a,2,3) IN(row(1,b,c), row(2,3,1)) from t1; +ROW(a,2,3) IN(row(1,b,c), row(2,3,1)) +1 +0 +0 +NULL +select ROW(c,2,3) IN(row(1,b,a), row(2,3,1)) from t1; +ROW(c,2,3) IN(row(1,b,a), row(2,3,1)) +0 +0 +1 +NULL +select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1; +ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) +1 +0 +1 +NULL +select ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) from t1; +ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) +1 +1 +1 +1 +drop table t1; +select ROW(1,1); +ERROR 21000: Operand should contain 1 column(s) +create table t1 (i int); +select 1 from t1 where ROW(1,1); +ERROR 21000: Operand should contain 1 column(s) +select count(*) from t1 order by ROW(1,1); +ERROR 21000: Operand should contain 1 column(s) +select count(*) from t1 having (1,1) order by i; +ERROR 21000: Operand should contain 1 column(s) +drop table t1; +create table t1 (a int, b int); +insert into t1 values (1, 4); +insert into t1 values (10, 40); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +insert into t1 values (10, 41); +insert into t1 values (1, 4); +insert into t1 values (10, 43); +insert into t1 values (1, 4); +select a, MAX(b), (1, MAX(b)) = (1, 4) from t1 group by a; +a MAX(b) (1, MAX(b)) = (1, 4) +1 4 1 +10 43 0 +drop table t1; +SELECT ROW(2,10) <=> ROW(3,4); +ROW(2,10) <=> ROW(3,4) +0 +SELECT ROW(NULL,10) <=> ROW(3,NULL); +ROW(NULL,10) <=> ROW(3,NULL) +0 diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index f3b52b43b19..eef986d8f8c 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -1,10 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1,t2,t3; +start slave; create table t1 (word char(20) not null); load data infile '../../std_data/words.dat' into table t1; load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1; @@ -20,9 +19,9 @@ abandoned abandoning abandonment abandons -slave stop; +stop slave; set password for root@"localhost" = password('foo'); -slave start; +start slave; set password for root@"localhost" = password(''); create table t3(n int); insert into t3 values(1),(2); @@ -35,16 +34,26 @@ sum(length(word)) 1022 drop table t1,t3; reset master; -slave stop; +stop slave; reset slave; create table t1(n int); select get_lock("hold_slave",10); get_lock("hold_slave",10) 1 -slave start; +explain extended select get_lock("hold_slave",10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache get_lock(_latin1'hold_slave',10) AS `get_lock("hold_slave",10)` +start slave; select release_lock("hold_slave"); release_lock("hold_slave") 1 +explain extended select release_lock("hold_slave"); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache release_lock(_latin1'hold_slave') AS `release_lock("hold_slave")` unlock tables; create table t2(id int); insert into t2 values(connection_id()); @@ -56,9 +65,9 @@ select (@id := id) - id from t2; 0 kill @id; drop table t2; -Server shutdown in progress +ERROR 08S01: Server shutdown in progress set global sql_slave_skip_counter=1; -slave start; +start slave; select count(*) from t1; count(*) 5000 @@ -67,17 +76,17 @@ create table t1 (n int); insert into t1 values(3456); insert into mysql.user (Host, User, Password) VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); -select select_priv,user from mysql.user where user = 'blafasel2'; +select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user N blafasel2 -update mysql.user set Select_priv = "Y" where User="blafasel2"; -select select_priv,user from mysql.user where user = 'blafasel2'; +update mysql.user set Select_priv = "Y" where User= _binary"blafasel2"; +select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user Y blafasel2 select n from t1; n 3456 -select select_priv,user from mysql.user where user = 'blafasel2'; +select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user Y blafasel2 drop table t1; diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result index 4c2b3bdfde6..e5e661795fe 100644 --- a/mysql-test/r/rpl000002.result +++ b/mysql-test/r/rpl000002.result @@ -1,10 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; create table t1 (n int auto_increment primary key); set insert_id = 2000; insert into t1 values (NULL),(NULL),(NULL); @@ -17,16 +16,31 @@ show slave hosts; Server_id Host Port Rpl_recovery_rank Master_id 2 127.0.0.1 9999 2 1 drop table t1; -slave stop; -drop table if exists t2; +stop slave; create table t2(id int auto_increment primary key, created datetime); set timestamp=12345; insert into t2 set created=now(); select * from t2; id created 1 1970-01-01 06:25:45 -slave start; +create table t3 like t2; +create temporary table t4 like t2; +create table t5 select * from t4; +start slave; select * from t2; id created 1 1970-01-01 06:25:45 -drop table t2; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `id` int(11) NOT NULL auto_increment, + `created` datetime default NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table t5; +Table Create Table +t5 CREATE TABLE `t5` ( + `id` int(11) NOT NULL default '0', + `created` datetime default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t2,t3,t5; diff --git a/mysql-test/r/rpl000003.result b/mysql-test/r/rpl000003.result deleted file mode 100644 index b123b3d98c5..00000000000 --- a/mysql-test/r/rpl000003.result +++ /dev/null @@ -1,17 +0,0 @@ -slave stop; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; -create table t1(n int primary key); -insert into t1 values (1),(2),(2); -Duplicate entry '2' for key 1 -insert into t1 values (3); -select * from t1; -n -1 -2 -3 -drop table t1; diff --git a/mysql-test/r/rpl000004.result b/mysql-test/r/rpl000004.result index 3142adc50d6..9abb4db7974 100644 --- a/mysql-test/r/rpl000004.result +++ b/mysql-test/r/rpl000004.result @@ -1,22 +1,17 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; set SQL_LOG_BIN=0; -drop table if exists t1; create table t1 (word char(20) not null, index(word)); load data infile '../../std_data/words.dat' into table t1; -drop table if exists t2; create table t2 (word char(20) not null); load data infile '../../std_data/words.dat' into table t2; create table t3 (word char(20) not null primary key); -drop table if exists t1; load table t1 from master; -drop table if exists t2; load table t2 from master; -drop table if exists t3; load table t3 from master; check table t1; Table Op Msg_type Msg_text diff --git a/mysql-test/r/rpl000005.result b/mysql-test/r/rpl000005.result index 3e9028bf2cf..0202e43dcb2 100644 --- a/mysql-test/r/rpl000005.result +++ b/mysql-test/r/rpl000005.result @@ -1,10 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; CREATE TABLE t1 (name varchar(64), age smallint(3)); INSERT INTO t1 SET name='Andy', age=31; INSERT t1 SET name='Jacob', age=2; diff --git a/mysql-test/r/rpl000006.result b/mysql-test/r/rpl000006.result index e7fc5151ac4..e4c2006c2f0 100644 --- a/mysql-test/r/rpl000006.result +++ b/mysql-test/r/rpl000006.result @@ -1,17 +1,15 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; set SQL_LOG_BIN=0,timestamp=200006; -drop table if exists t1; create table t1(t timestamp not null,a char(1)); insert into t1 ( a) values ('F'); select unix_timestamp(t) from t1; unix_timestamp(t) 200006 -drop table if exists t1; load table t1 from master; select unix_timestamp(t) from t1; unix_timestamp(t) @@ -21,7 +19,7 @@ drop table t1; set SQL_LOG_BIN=0; CREATE TABLE t1 ( a int not null -) TYPE=MyISAM MAX_ROWS=4000 CHECKSUM=1; +) ENGINE=MyISAM MAX_ROWS=4000 CHECKSUM=1; INSERT INTO t1 VALUES (1); load table t1 from master; check table t1; diff --git a/mysql-test/r/rpl000008.result b/mysql-test/r/rpl000008.result index a0230d55702..a88a3c690ed 100644 --- a/mysql-test/r/rpl000008.result +++ b/mysql-test/r/rpl000008.result @@ -1,25 +1,23 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; use test; -drop table if exists foo; -create table foo (n int); -insert into foo values(4); +drop table if exists mysqltest_foo; +drop table if exists mysqltest_bar; +create table mysqltest_foo (n int); +insert into mysqltest_foo values(4); use test; -drop table if exists foo; -create table foo (n int); -insert into foo values(5); -drop table if exists bar; -create table bar (m int); -insert into bar values(15); -drop table if exists choo; -create table choo (k int); -insert into choo values(55); -select foo.n,bar.m,choo.k from foo,bar,choo; +create table mysqltest_foo (n int); +insert into mysqltest_foo values(5); +create table mysqltest_bar (m int); +insert into mysqltest_bar values(15); +create table t1 (k int); +insert into t1 values(55); +select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1; n m k 4 15 55 -drop table if exists foo,bar,choo; -drop table if exists foo,bar,choo; +drop table mysqltest_foo,mysqltest_bar,t1; +drop table mysqltest_foo,mysqltest_bar,t1; diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result index a4611cf7d42..bb82dcb1e6a 100644 --- a/mysql-test/r/rpl000009.result +++ b/mysql-test/r/rpl000009.result @@ -1,133 +1,136 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop database if exists foo; -create database foo; -drop database if exists bar; -create database bar; -create database foo; -drop table if exists foo.foo; -create table foo.foo (n int); -insert into foo.foo values(4); -drop table if exists foo.foo; -create table foo.foo (n int); -insert into foo.foo values(5); -drop table if exists bar.bar; -create table bar.bar (m int); -insert into bar.bar values(15); -select foo.foo.n,bar.bar.m from foo.foo,bar.bar; +start slave; +drop database if exists mysqltest; +drop database if exists mysqltest2; +drop database if exists mysqltest3; +drop database if exists mysqltest; +drop database if exists mysqltest2; +drop database if exists mysqltest3; +create database mysqltest2; +create database mysqltest; +create database mysqltest2; +create table mysqltest2.foo (n int); +insert into mysqltest2.foo values(4); +create table mysqltest2.foo (n int); +insert into mysqltest2.foo values(5); +create table mysqltest.bar (m int); +insert into mysqltest.bar values(15); +select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.bar; n m 4 15 -drop database bar; -drop database if exists foo; -drop database bar; -Can't drop database 'bar'. Database doesn't exist -drop database foo; +drop database mysqltest; +drop database if exists mysqltest2; +drop database mysqltest; +ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist +drop database mysqltest2; set sql_log_bin = 0; -create database foo; -create database bar; +create database mysqltest2; +create database mysqltest; show databases; Database -bar -foo mysql +mysqltest +mysqltest2 test -create table foo.t1(n int, s char(20)); -create table foo.t2(n int, s text); -insert into foo.t1 values (1, 'one'), (2, 'two'), (3, 'three'); -insert into foo.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen'); -create table bar.t1(n int, s char(20)); -create table bar.t2(n int, s text); -insert into bar.t1 values (1, 'one bar'), (2, 'two bar'), (3, 'three bar'); -insert into bar.t2 values (11, 'eleven bar'), (12, 'twelve bar'), -(13, 'thirteen bar'); +create table mysqltest2.t1(n int, s char(20)); +create table mysqltest2.t2(n int, s text); +insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three'); +insert into mysqltest2.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen'); +create table mysqltest.t1(n int, s char(20)); +create table mysqltest.t2(n int, s text); +insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three test'); +insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'), +(13, 'thirteen test'); set sql_log_bin = 1; show databases; Database mysql test -create database foo; -create table foo.t1(n int, s char(20)); -insert into foo.t1 values (1, 'original foo.t1'); -create table foo.t3(n int, s char(20)); -insert into foo.t3 values (1, 'original foo.t3'); -create database foo2; -create table foo2.t1(n int, s char(20)); -insert into foo2.t1 values (1, 'original foo2.t1'); -create database bar; -create table bar.t1(n int, s char(20)); -insert into bar.t1 values (1, 'original bar.t1'); -create table bar.t3(n int, s char(20)); -insert into bar.t3 values (1, 'original bar.t3'); +create database mysqltest2; +create table mysqltest2.t1(n int, s char(20)); +insert into mysqltest2.t1 values (1, 'original foo.t1'); +create table mysqltest2.t3(n int, s char(20)); +insert into mysqltest2.t3 values (1, 'original foo.t3'); +create database mysqltest3; +create table mysqltest3.t1(n int, s char(20)); +insert into mysqltest3.t1 values (1, 'original foo2.t1'); +create database mysqltest; +create table mysqltest.t1(n int, s char(20)); +insert into mysqltest.t1 values (1, 'original bar.t1'); +create table mysqltest.t3(n int, s char(20)); +insert into mysqltest.t3 values (1, 'original bar.t3'); load data from master; show databases; Database -bar -foo -foo2 mysql +mysqltest +mysqltest2 +mysqltest3 test -use foo; +use mysqltest2; show tables; -Tables_in_foo +Tables_in_mysqltest2 t1 t3 select * from t1; n s 1 original foo.t1 -use foo2; +use mysqltest3; show tables; -Tables_in_foo2 +Tables_in_mysqltest3 t1 select * from t1; n s 1 original foo2.t1 -use bar; +use mysqltest; show tables; -Tables_in_bar +Tables_in_mysqltest t1 t2 t3 -select * from bar.t1; +select * from mysqltest.t1; n s -1 one bar -2 two bar -3 three bar -select * from bar.t2; +1 one test +2 two test +3 three test +select * from mysqltest.t2; n s -11 eleven bar -12 twelve bar -13 thirteen bar -select * from bar.t3; +11 eleven test +12 twelve test +13 thirteen test +select * from mysqltest.t3; n s 1 original bar.t3 -insert into bar.t1 values (4, 'four bar'); -select * from bar.t1; +insert into mysqltest.t1 values (4, 'four test'); +select * from mysqltest.t1; n s -1 one bar -2 two bar -3 three bar -4 four bar +1 one test +2 two test +3 three test +4 four test stop slave; reset slave; load data from master; start slave; -insert into bar.t1 values (5, 'five bar'); -select * from bar.t1; +insert into mysqltest.t1 values (5, 'five bar'); +select * from mysqltest.t1; n s -1 one bar -2 two bar -3 three bar -4 four bar +1 one test +2 two test +3 three test +4 four test 5 five bar +load table mysqltest.t1 from master; +ERROR 42S01: Table 't1' already exists +drop table mysqltest.t1; +load table mysqltest.t1 from master; load table bar.t1 from master; -Table 't1' already exists -drop table bar.t1; -load table bar.t1 from master; -drop database bar; -drop database foo; -drop database foo; -drop database foo2; +ERROR HY000: Error from master: 'Table 'bar.t1' doesn't exist' +drop database mysqltest; +drop database mysqltest2; +drop database mysqltest2; +drop database mysqltest3; diff --git a/mysql-test/r/rpl000010.result b/mysql-test/r/rpl000010.result index 49538ed148e..65191ea411f 100644 --- a/mysql-test/r/rpl000010.result +++ b/mysql-test/r/rpl000010.result @@ -1,11 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; -drop table if exists t1; +start slave; create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); diff --git a/mysql-test/r/rpl000011.result b/mysql-test/r/rpl000011.result index 5d22c29bdba..dd0fa2fbe74 100644 --- a/mysql-test/r/rpl000011.result +++ b/mysql-test/r/rpl000011.result @@ -1,14 +1,13 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; create table t1 (n int); insert into t1 values(1); -slave stop; -slave start; +stop slave; +start slave; insert into t1 values(2); select * from t1; n diff --git a/mysql-test/r/rpl000012.result b/mysql-test/r/rpl000012.result index 45de6502bbd..17fb53010ab 100644 --- a/mysql-test/r/rpl000012.result +++ b/mysql-test/r/rpl000012.result @@ -1,21 +1,19 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1,t2,t3; +start slave; create table t2 (n int); create temporary table t1 (n int); insert into t1 values(1),(2),(3); insert into t2 select * from t1; -drop table if exists test.t3; -create temporary table test.t3 (n int not null); -alter table test.t3 add primary key(n); +create temporary table t3 (n int not null); +alter table t3 add primary key(n); flush logs; insert into t3 values (100); insert into t2 select * from t3; -drop table if exists test.t3; +drop table if exists t3; insert into t2 values (101); create temporary table t1 (n int); insert into t1 values (4),(5); @@ -35,3 +33,5 @@ show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 't1' diff --git a/mysql-test/r/rpl000013.result b/mysql-test/r/rpl000013.result index 9e802da59c5..37838bb88e0 100644 --- a/mysql-test/r/rpl000013.result +++ b/mysql-test/r/rpl000013.result @@ -1,10 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t2; +start slave; create table t2(n int); create temporary table t1 (n int); insert into t1 values(1),(2),(3); @@ -25,3 +24,5 @@ show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 't1' diff --git a/mysql-test/r/rpl000015.result b/mysql-test/r/rpl000015.result index 7010349e5ff..8cbbe3ab0e8 100644 --- a/mysql-test/r/rpl000015.result +++ b/mysql-test/r/rpl000015.result @@ -1,23 +1,23 @@ reset master; show master status; -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 79 +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 79 reset slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master change master to master_host='127.0.0.1'; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 test MASTER_PORT 7 4 slave-relay-bin.001 4 No No 0 0 0 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 test MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No # change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.001 4 No No 0 0 0 4 -slave start; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No # +start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 7 master-bin.001 79 slave-relay-bin.001 120 master-bin.001 Yes Yes 0 0 79 120 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 79 slave-relay-bin.000001 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No # drop table if exists t1; create table t1 (n int); insert into t1 values (10),(45),(90); diff --git a/mysql-test/r/rpl000017.result b/mysql-test/r/rpl000017.result index bac0573165d..64e13042e9c 100644 --- a/mysql-test/r/rpl000017.result +++ b/mysql-test/r/rpl000017.result @@ -1,7 +1,7 @@ reset master; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; -slave start; +start slave; drop table if exists t1; create table t1(n int); insert into t1 values(24); diff --git a/mysql-test/r/rpl000018.result b/mysql-test/r/rpl000018.result index 282c1e492a1..b71f6492b97 100644 --- a/mysql-test/r/rpl000018.result +++ b/mysql-test/r/rpl000018.result @@ -1,10 +1,10 @@ reset master; reset slave; -slave start; -show master logs; +start slave; +show binary logs; Log_name -master-bin.001 -master-bin.002 +master-bin.000001 +master-bin.000002 drop table if exists t1; create table t1(n int); insert into t1 values (3351); diff --git a/mysql-test/r/rpl_EE_error.result b/mysql-test/r/rpl_EE_error.result index a5043250df6..49ad4832c81 100644 --- a/mysql-test/r/rpl_EE_error.result +++ b/mysql-test/r/rpl_EE_error.result @@ -1,16 +1,16 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -create table t1 (a int) type=myisam; +start slave; +create table t1 (a int) engine=myisam; flush tables; drop table t1; -create table t1 (a int, unique(a)) type=myisam; +create table t1 (a int, unique(a)) engine=myisam; set sql_log_bin=0; insert into t1 values(2); set sql_log_bin=1; insert into t1 values(1),(2); -Duplicate entry '2' for key 1 +ERROR 23000: Duplicate entry '2' for key 1 drop table t1; diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/r/rpl_alter.result index 729c7df6808..6ef5ce3462a 100644 --- a/mysql-test/r/rpl_alter.result +++ b/mysql-test/r/rpl_alter.result @@ -1,21 +1,21 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop database if exists test_$1; -create database test_$1; -create table test_$1.t1 ( n int); -alter table test_$1.t1 add m int; -insert into test_$1.t1 values (1,2); -create table test_$1.t2 (n int); -insert into test_$1.t2 values (45); -rename table test_$1.t2 to test_$1.t3, test_$1.t1 to test_$1.t2; -select * from test_$1.t2; +start slave; +drop database if exists mysqltest; +create database mysqltest; +create table mysqltest.t1 ( n int); +alter table mysqltest.t1 add m int; +insert into mysqltest.t1 values (1,2); +create table mysqltest.t2 (n int); +insert into mysqltest.t2 values (45); +rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; +select * from mysqltest.t2; n m 1 2 -select * from test_$1.t3; +select * from mysqltest.t3; n 45 -drop database test_$1; +drop database mysqltest; diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index 966f07af9d5..a6342d47b49 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; select get_lock("a",5); get_lock("a",5) 1 @@ -15,12 +15,12 @@ select * from t1; n 1 show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_MYPORT 1 master-bin.001 273 slave-relay-bin.002 255 master-bin.001 No No 0 0 214 314 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No # change master to master_user='root'; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_MYPORT 1 master-bin.001 214 slave-relay-bin.001 4 master-bin.001 No No 0 0 214 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 214 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 214 4 None 0 No # select release_lock("a"); release_lock("a") 1 diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result new file mode 100644 index 00000000000..a60c9269625 --- /dev/null +++ b/mysql-test/r/rpl_charset.result @@ -0,0 +1,201 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop database if exists mysqltest2; +drop database if exists mysqltest3; +create database mysqltest2 character set latin2; +set @@character_set_server=latin5; +create database mysqltest3; + +--- --master-- +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ + +--- --slave-- +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ +set @@collation_server=armscii8_bin; +drop database mysqltest3; +create database mysqltest3; + +--- --master-- +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ + +--- --slave-- +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ +use mysqltest2; +create table t1 (a int auto_increment primary key, b varchar(100)); +set character_set_client=cp850, collation_connection=latin2_croatian_ci; +insert into t1 (b) values(@@character_set_server); +insert into t1 (b) values(@@collation_server); +insert into t1 (b) values(@@character_set_client); +insert into t1 (b) values(@@character_set_connection); +insert into t1 (b) values(@@collation_connection); + +--- --master-- +select * from t1 order by a; +a b +1 armscii8 +2 armscii8_bin +3 cp850 +4 latin2 +5 latin2_croatian_ci + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 armscii8 +2 armscii8_bin +3 cp850 +4 latin2 +5 latin2_croatian_ci +set character_set_client=latin1, collation_connection=latin1_german1_ci; +truncate table t1; +insert into t1 (b) values(@@collation_connection); +insert into t1 (b) values(LEAST("Müller","Muffler")); +set collation_connection=latin1_german2_ci; +insert into t1 (b) values(@@collation_connection); +insert into t1 (b) values(LEAST("Müller","Muffler")); + +--- --master-- +select * from t1 order by a; +a b +1 latin1_german1_ci +2 Muffler +3 latin1_german2_ci +4 Müller + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 latin1_german1_ci +2 Muffler +3 latin1_german2_ci +4 Müller +load data infile '../../std_data/words.dat' into table t1 (b); +set @a= _cp850 'Müller' collate cp850_general_ci; +truncate table t1; +insert into t1 (b) values(collation(@a)); + +--- --master-- +select * from t1 order by a; +a b +1 cp850_general_ci + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 cp850_general_ci +drop database mysqltest2; +drop database mysqltest3; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; drop database if exists mysqltest2 +master-bin.000001 148 Query 1 148 use `test`; drop database if exists mysqltest3 +master-bin.000001 217 Query 1 217 use `test`; create database mysqltest2 character set latin2 +master-bin.000001 299 Query 1 299 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 +master-bin.000001 433 Query 1 433 use `test`; create database mysqltest3 +master-bin.000001 494 Query 1 494 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 628 Query 1 628 use `test`; drop database mysqltest3 +master-bin.000001 687 Query 1 687 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 821 Query 1 821 use `test`; create database mysqltest3 +master-bin.000001 882 Query 1 882 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1022 Query 1 1022 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 1129 Query 1 1129 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1270 Intvar 1 1270 INSERT_ID=1 +master-bin.000001 1298 Query 1 1298 use `mysqltest2`; insert into t1 (b) values(@@character_set_server) +master-bin.000001 1388 Query 1 1388 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1529 Intvar 1 1529 INSERT_ID=2 +master-bin.000001 1557 Query 1 1557 use `mysqltest2`; insert into t1 (b) values(@@collation_server) +master-bin.000001 1643 Query 1 1643 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1784 Intvar 1 1784 INSERT_ID=3 +master-bin.000001 1812 Query 1 1812 use `mysqltest2`; insert into t1 (b) values(@@character_set_client) +master-bin.000001 1902 Query 1 1902 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2043 Intvar 1 2043 INSERT_ID=4 +master-bin.000001 2071 Query 1 2071 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) +master-bin.000001 2165 Query 1 2165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2306 Intvar 1 2306 INSERT_ID=5 +master-bin.000001 2334 Query 1 2334 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2424 Query 1 2424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2564 Query 1 2564 use `mysqltest2`; truncate table t1 +master-bin.000001 2622 Query 1 2622 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2762 Intvar 1 2762 INSERT_ID=1 +master-bin.000001 2790 Query 1 2790 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2880 Query 1 2880 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3020 Intvar 1 3020 INSERT_ID=2 +master-bin.000001 3048 Query 1 3048 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3141 Query 1 3141 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3282 Intvar 1 3282 INSERT_ID=3 +master-bin.000001 3310 Query 1 3310 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 3400 Query 1 3400 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3541 Intvar 1 3541 INSERT_ID=4 +master-bin.000001 3569 Query 1 3569 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3662 Query 1 3662 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3803 Intvar 1 3803 INSERT_ID=74 +master-bin.000001 3831 Create_file 1 3831 db=mysqltest2;table=t1;file_id=1;block_len=581 +master-bin.000001 4504 Query 1 4504 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4645 Intvar 1 4645 INSERT_ID=5 +master-bin.000001 4673 Exec_load 1 4673 ;file_id=1 +master-bin.000001 4696 Query 1 4696 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4837 Query 1 4837 use `mysqltest2`; truncate table t1 +master-bin.000001 4895 Query 1 4895 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5036 Intvar 1 5036 INSERT_ID=1 +master-bin.000001 5064 User var 1 5064 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci +master-bin.000001 5104 Query 1 5104 use `mysqltest2`; insert into t1 (b) values(collation(@a)) +master-bin.000001 5185 Query 1 5185 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5326 Query 1 5326 use `mysqltest2`; drop database mysqltest2 +master-bin.000001 5391 Query 1 5391 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5522 Query 1 5522 drop database mysqltest3 +set global character_set_server=latin2; +ERROR HY000: Binary logging and replication forbid changing the global server character set or collation +set global character_set_server=latin2; +ERROR HY000: Binary logging and replication forbid changing the global server character set or collation +set one_shot @@character_set_server=latin5; +set @@max_join_size=1000; +select @@character_set_server; +@@character_set_server +latin5 +select @@character_set_server; +@@character_set_server +latin1 +set @@character_set_server=latin5; +select @@character_set_server; +@@character_set_server +latin5 +select @@character_set_server; +@@character_set_server +latin5 +set one_shot max_join_size=10; +ERROR HY000: The SET ONE_SHOT syntax is reserved for purposes internal to the MySQL server +set character_set_client=9999999; +ERROR 42000: Unknown character set: '9999999' +set collation_server=9999998; +ERROR HY000: Unknown collation: '9999998' +use test; +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +SET CHARACTER_SET_CLIENT=koi8r, +CHARACTER_SET_CONNECTION=cp1251, +CHARACTER_SET_RESULTS=koi8r; +INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +drop table t1; diff --git a/mysql-test/r/rpl_delete_all.result b/mysql-test/r/rpl_delete_all.result new file mode 100644 index 00000000000..5ed221823e8 --- /dev/null +++ b/mysql-test/r/rpl_delete_all.result @@ -0,0 +1,31 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create database mysqltest; +drop database if exists mysqltest; +Warnings: +Note 1008 Can't drop database 'mysqltest'; database doesn't exist +show tables from mysqltest; +ERROR HY000: Can't read dir of './mysqltest/' (Errcode: X) +create table t1 (a int); +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +create table t1 (a int); +insert into t1 values(1); +delete from t1; +select * from t1; +a +insert into t1 values(1); +insert into t1 values(2); +update t1 set a=2; +select * from t1; +a +2 +2 +drop table t1; diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result index fec935ae7ac..ff3e059503c 100644 --- a/mysql-test/r/rpl_do_grant.result +++ b/mysql-test/r/rpl_do_grant.result @@ -1,14 +1,14 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -delete from mysql.user where user='rpl_do_grant'; -delete from mysql.db where user='rpl_do_grant'; +start slave; +delete from mysql.user where user=_binary'rpl_do_grant'; +delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; grant select on *.* to rpl_do_grant@localhost; grant drop on test.* to rpl_do_grant@localhost; @@ -17,10 +17,10 @@ Grants for rpl_do_grant@localhost GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost' GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost' set password for rpl_do_grant@localhost=password("does it work?"); -select password<>'' from mysql.user where user='rpl_do_grant'; -password<>'' +select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; +password<>_binary'' 1 -delete from mysql.user where user='rpl_do_grant'; -delete from mysql.db where user='rpl_do_grant'; +delete from mysql.user where user=_binary'rpl_do_grant'; +delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; flush privileges; diff --git a/mysql-test/r/rpl_drop.result b/mysql-test/r/rpl_drop.result index ce1f5b6ee81..b83594c9bb1 100644 --- a/mysql-test/r/rpl_drop.result +++ b/mysql-test/r/rpl_drop.result @@ -1,10 +1,10 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; drop table if exists t1, t2; create table t1 (a int); drop table t1, t2; -Unknown table 't2' +ERROR 42S02: Unknown table 't2' diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/r/rpl_empty_master_crash.result index 19e2bf28dcd..3e234d4ef59 100644 --- a/mysql-test/r/rpl_empty_master_crash.result +++ b/mysql-test/r/rpl_empty_master_crash.result @@ -1,13 +1,12 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master load table t1 from master; -Error connecting to master: Master is not configured +ERROR 08S01: Error connecting to master: Master is not configured load table t1 from master; -Error from master: 'Table 'test.t1' doesn't exist' +ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist' diff --git a/mysql-test/r/rpl_error_ignored_table.result b/mysql-test/r/rpl_error_ignored_table.result index 329af301073..4a562dbfc70 100644 --- a/mysql-test/r/rpl_error_ignored_table.result +++ b/mysql-test/r/rpl_error_ignored_table.result @@ -1,15 +1,15 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1 (a int primary key); insert into t1 values (1),(1); -Duplicate entry '1' for key 1 +ERROR 23000: Duplicate entry '1' for key 1 show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 213 slave-relay-bin.002 254 master-bin.001 Yes Yes 0 0 213 254 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 213 257 None 0 No # show tables like 't1'; Tables_in_test (t1) drop table t1; @@ -26,15 +26,14 @@ select (@id := id) - id from t3; 0 kill @id; drop table t2,t3; -Got one of the listed errors show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; create table t1 (a int primary key) -master-bin.001 149 Query 1 149 use `test`; insert into t1 values (1),(1) -master-bin.001 213 Query 1 213 use `test`; drop table t1 -master-bin.001 261 Query 1 261 use `test`; create table t2 (a int primary key) -master-bin.001 331 Query 1 331 use `test`; insert into t2 values(1) -master-bin.001 390 Query 1 390 use `test`; create table t3 (id int) -master-bin.001 449 Query 1 449 use `test`; insert into t3 values(connection_id()) -master-bin.001 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10) -master-bin.001 613 Query 1 613 use `test`; drop table t2,t3 +master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int primary key) +master-bin.000001 149 Query 1 149 use `test`; insert into t1 values (1),(1) +master-bin.000001 213 Query 1 213 use `test`; drop table t1 +master-bin.000001 261 Query 1 261 use `test`; create table t2 (a int primary key) +master-bin.000001 331 Query 1 331 use `test`; insert into t2 values(1) +master-bin.000001 390 Query 1 390 use `test`; create table t3 (id int) +master-bin.000001 449 Query 1 449 use `test`; insert into t3 values(connection_id()) +master-bin.000001 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10) +master-bin.000001 613 Query 1 613 use `test`; drop table t2,t3 diff --git a/mysql-test/r/rpl_failsafe.result b/mysql-test/r/rpl_failsafe.result index 7e8aeea64f7..956555f9318 100644 --- a/mysql-test/r/rpl_failsafe.result +++ b/mysql-test/r/rpl_failsafe.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; show variables like 'rpl_recovery_rank'; Variable_name Value rpl_recovery_rank 1 @@ -18,14 +18,14 @@ rpl_recovery_rank 2 show status like 'Rpl_status'; Variable_name Value Rpl_status ACTIVE_SLAVE -slave start; +start slave; show variables like 'rpl_recovery_rank'; Variable_name Value rpl_recovery_rank 3 show status like 'Rpl_status'; Variable_name Value Rpl_status ACTIVE_SLAVE -slave start; +start slave; show variables like 'rpl_recovery_rank'; Variable_name Value rpl_recovery_rank 4 diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result index 18786b1931b..25177a6bca3 100644 --- a/mysql-test/r/rpl_flush_log_loop.result +++ b/mysql-test/r/rpl_flush_log_loop.result @@ -1,17 +1,17 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; -slave start; -slave stop; +start slave; +stop slave; change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=SLAVE_PORT; -slave start; +start slave; flush logs; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root SLAVE_PORT 60 slave-bin.001 79 relay-log.002 4 slave-bin.001 Yes Yes 0 0 79 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 161 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 161 4 None 0 No # diff --git a/mysql-test/r/rpl_flush_tables.result b/mysql-test/r/rpl_flush_tables.result new file mode 100644 index 00000000000..70e4774a920 --- /dev/null +++ b/mysql-test/r/rpl_flush_tables.result @@ -0,0 +1,40 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (a int); +insert into t1 values (10); +create table t2 (a int); +create table t3 (a int) engine=merge union(t1); +create table t4 (a int); +insert into t4 select * from t3; +rename table t1 to t5, t2 to t1; +flush no_write_to_binlog tables; +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: SERVER_VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int) +master-bin.000001 137 Query 1 137 use `test`; insert into t1 values (10) +master-bin.000001 198 Query 1 198 use `test`; create table t2 (a int) +master-bin.000001 256 Query 1 256 use `test`; create table t3 (a int) engine=merge union(t1) +master-bin.000001 337 Query 1 337 use `test`; create table t4 (a int) +master-bin.000001 395 Query 1 395 use `test`; insert into t4 select * from t3 +master-bin.000001 461 Query 1 461 use `test`; rename table t1 to t5, t2 to t1 +select * from t3; +a +flush tables; +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: SERVER_VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int) +master-bin.000001 137 Query 1 137 use `test`; insert into t1 values (10) +master-bin.000001 198 Query 1 198 use `test`; create table t2 (a int) +master-bin.000001 256 Query 1 256 use `test`; create table t3 (a int) engine=merge union(t1) +master-bin.000001 337 Query 1 337 use `test`; create table t4 (a int) +master-bin.000001 395 Query 1 395 use `test`; insert into t4 select * from t3 +master-bin.000001 461 Query 1 461 use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 527 Query 1 527 use `test`; flush tables +select * from t3; +a diff --git a/mysql-test/r/rpl_free_items.result b/mysql-test/r/rpl_free_items.result index 743fbbc8fc7..91c1e2aa6e5 100644 --- a/mysql-test/r/rpl_free_items.result +++ b/mysql-test/r/rpl_free_items.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1 (a int); create table t2 (a int); drop table t1; diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result index a8e602be03f..26f33bfb42c 100644 --- a/mysql-test/r/rpl_get_lock.result +++ b/mysql-test/r/rpl_get_lock.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1(n int); insert into t1 values(get_lock("lock",2)); select get_lock("lock",2); @@ -18,9 +18,14 @@ get_lock("lock",3) select * from t1; n 1 -select is_free_lock("lock"); -is_free_lock("lock") -0 +select is_free_lock("lock"), is_used_lock("lock") = connection_id(); +is_free_lock("lock") is_used_lock("lock") = connection_id() +0 1 +explain extended select is_free_lock("lock"), is_used_lock("lock"); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")` select is_free_lock("lock2"); is_free_lock("lock2") 1 diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/r/rpl_ignore_grant.result index 6cd7d5b4c00..5169cc8e888 100644 --- a/mysql-test/r/rpl_ignore_grant.result +++ b/mysql-test/r/rpl_ignore_grant.result @@ -1,14 +1,14 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +start slave; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; grant select on *.* to rpl_ignore_grant@localhost; grant drop on test.* to rpl_ignore_grant@localhost; @@ -17,21 +17,21 @@ Grants for rpl_ignore_grant@localhost GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost' GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost' show grants for rpl_ignore_grant@localhost; -There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' -select count(*) from mysql.user where user='rpl_ignore_grant'; +ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' +select count(*) from mysql.user where user=_binary'rpl_ignore_grant'; count(*) 0 -select count(*) from mysql.db where user='rpl_ignore_grant'; +select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; count(*) 0 grant select on *.* to rpl_ignore_grant@localhost; set password for rpl_ignore_grant@localhost=password("does it work?"); -select password<>'' from mysql.user where user='rpl_ignore_grant'; -password<>'' +select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; +password<>_binary'' 0 -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; diff --git a/mysql-test/r/rpl_init_slave.result b/mysql-test/r/rpl_init_slave.result new file mode 100644 index 00000000000..83d0a3289a2 --- /dev/null +++ b/mysql-test/r/rpl_init_slave.result @@ -0,0 +1,24 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +show variables like 'init_slave'; +Variable_name Value +init_slave set global max_connections=500 +show variables like 'max_connections'; +Variable_name Value +max_connections 500 +reset master; +show variables like 'init_slave'; +Variable_name Value +init_slave +show variables like 'max_connections'; +Variable_name Value +max_connections 100 +set global init_connect="set @c=1"; +show variables like 'init_connect'; +Variable_name Value +init_connect set @c=1 +stop slave; diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result index d2dfbb05675..8001cb59a35 100644 --- a/mysql-test/r/rpl_insert_id.result +++ b/mysql-test/r/rpl_insert_id.result @@ -1,10 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; create table t1(a int auto_increment, key(a)); create table t2(b int auto_increment, c int, key(b)); insert into t1 values (1),(2),(3); @@ -21,8 +20,8 @@ b c 1 4 drop table t1; drop table t2; -create table t1(a int auto_increment, key(a)) type=innodb; -create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) type=innodb; +create table t1(a int auto_increment, key(a)) engine=innodb; +create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=innodb; SET FOREIGN_KEY_CHECKS=0; insert into t1 values (10); insert into t1 values (null),(null),(null); diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index 268e383ce69..65fc9d1b415 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; reset master; create table t1(a int not null auto_increment, b int, primary key(a) ); load data infile '../../std_data/rpl_loaddata.dat' into table t1; @@ -21,8 +21,8 @@ day id category name 2003-03-22 2161 c asdf 2003-03-22 2416 a bbbbb show master status; -File Position Binlog_do_db Binlog_ignore_db -slave-bin.001 964 +File Position Binlog_Do_DB Binlog_Ignore_DB +slave-bin.000001 964 drop table t1; drop table t2; drop table t3; @@ -32,8 +32,8 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1; set global sql_slave_skip_counter=1; start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 1311 slave-relay-bin.002 1352 master-bin.001 Yes Yes 0 0 1311 1352 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1311 slave-relay-bin.000002 1355 master-bin.000001 Yes Yes 0 0 1311 1355 None 0 No # set sql_log_bin=0; delete from t1; set sql_log_bin=1; @@ -42,8 +42,8 @@ stop slave; change master to master_user='test'; change master to master_user='root'; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 1419 slave-relay-bin.001 4 master-bin.001 No No 0 0 1419 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1419 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 1419 4 None 0 No # set global sql_slave_skip_counter=1; start slave; set sql_log_bin=0; @@ -53,16 +53,16 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1; stop slave; reset slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No # reset master; create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)); load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; -Duplicate entry '2003-03-22' for key 1 +ERROR 23000: Duplicate entry '2003-03-22' for key 1 show master status; -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 491 +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 491 drop table t2; diff --git a/mysql-test/r/rpl_loaddata_rule_m.result b/mysql-test/r/rpl_loaddata_rule_m.result index 8d8ed749c71..a34453b0a2b 100644 --- a/mysql-test/r/rpl_loaddata_rule_m.result +++ b/mysql-test/r/rpl_loaddata_rule_m.result @@ -1,14 +1,15 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -reset master; -create database test2; +start slave; +drop database if exists mysqltest; +stop slave; +create database mysqltest; create table t1(a int, b int, unique(b)); -use test2; +use mysqltest; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -drop database test2; +drop database mysqltest; diff --git a/mysql-test/r/rpl_loaddata_rule_s.result b/mysql-test/r/rpl_loaddata_rule_s.result index a84368501a9..26893cb1e9e 100644 --- a/mysql-test/r/rpl_loaddata_rule_s.result +++ b/mysql-test/r/rpl_loaddata_rule_s.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; reset master; create table t1(a int, b int, unique(b)); load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result index dc98b1b5bfb..b49ea842485 100644 --- a/mysql-test/r/rpl_loaddatalocal.result +++ b/mysql-test/r/rpl_loaddatalocal.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1(a int); select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; truncate table t1; diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 7e2a8df75ac..2f8a54369c9 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -1,10 +1,10 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -slave stop; +start slave; +stop slave; reset master; reset slave; reset master; @@ -19,83 +19,83 @@ count(*) drop table t1; show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.001 172 Intvar 1 172 INSERT_ID=1 -master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL) -master-bin.001 263 Query 1 263 use `test`; drop table t1 -master-bin.001 311 Query 1 311 use `test`; create table t1 (word char(20) not null) -master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 -master-bin.001 1056 Exec_load 1 1056 ;file_id=1 -master-bin.001 1079 Query 1 1079 use `test`; drop table t1 +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 172 Intvar 1 172 INSERT_ID=1 +master-bin.000001 200 Query 1 200 use `test`; insert into t1 values (NULL) +master-bin.000001 263 Query 1 263 use `test`; drop table t1 +master-bin.000001 311 Query 1 311 use `test`; create table t1 (word char(20) not null) +master-bin.000001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 +master-bin.000001 1056 Exec_load 1 1056 ;file_id=1 +master-bin.000001 1079 Query 1 1079 use `test`; drop table t1 show binlog events from 79 limit 1; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) show binlog events from 79 limit 2; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.001 172 Intvar 1 172 INSERT_ID=1 +master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 172 Intvar 1 172 INSERT_ID=1 show binlog events from 79 limit 2,1; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL) +master-bin.000001 200 Query 1 200 use `test`; insert into t1 values (NULL) flush logs; create table t5 (a int); drop table t5; -slave start; +start slave; flush logs; -slave stop; +stop slave; create table t1 (n int); insert into t1 values (1); drop table t1; show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.001 172 Intvar 1 172 INSERT_ID=1 -master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL) -master-bin.001 263 Query 1 263 use `test`; drop table t1 -master-bin.001 311 Query 1 311 use `test`; create table t1 (word char(20) not null) -master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 -master-bin.001 1056 Exec_load 1 1056 ;file_id=1 -master-bin.001 1079 Query 1 1079 use `test`; drop table t1 -master-bin.001 1127 Rotate 1 1127 master-bin.002;pos=4 -show binlog events in 'master-bin.002'; +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 172 Intvar 1 172 INSERT_ID=1 +master-bin.000001 200 Query 1 200 use `test`; insert into t1 values (NULL) +master-bin.000001 263 Query 1 263 use `test`; drop table t1 +master-bin.000001 311 Query 1 311 use `test`; create table t1 (word char(20) not null) +master-bin.000001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 +master-bin.000001 1056 Exec_load 1 1056 ;file_id=1 +master-bin.000001 1079 Query 1 1079 use `test`; drop table t1 +master-bin.000001 1127 Rotate 1 1127 master-bin.000002;pos=4 +show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.002 4 Query 1 4 use `test`; create table t5 (a int) -master-bin.002 62 Query 1 62 use `test`; drop table t5 -master-bin.002 110 Query 1 110 use `test`; create table t1 (n int) -master-bin.002 168 Query 1 168 use `test`; insert into t1 values (1) -master-bin.002 228 Query 1 228 use `test`; drop table t1 -show master logs; +master-bin.000002 4 Query 1 4 use `test`; create table t5 (a int) +master-bin.000002 62 Query 1 62 use `test`; drop table t5 +master-bin.000002 110 Query 1 110 use `test`; create table t1 (n int) +master-bin.000002 168 Query 1 168 use `test`; insert into t1 values (1) +master-bin.000002 228 Query 1 228 use `test`; drop table t1 +show binary logs; Log_name -master-bin.001 -master-bin.002 -slave start; -show master logs; +master-bin.000001 +master-bin.000002 +start slave; +show binary logs; Log_name -slave-bin.001 -slave-bin.002 -show binlog events in 'slave-bin.001' from 4; +slave-bin.000001 +slave-bin.000002 +show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3 -slave-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) -slave-bin.001 172 Intvar 1 172 INSERT_ID=1 -slave-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL) -slave-bin.001 263 Query 1 263 use `test`; drop table t1 -slave-bin.001 311 Query 1 311 use `test`; create table t1 (word char(20) not null) -slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 -slave-bin.001 1065 Exec_load 1 1065 ;file_id=1 -slave-bin.001 1088 Query 1 1088 use `test`; drop table t1 -slave-bin.001 1136 Query 1 1136 use `test`; create table t5 (a int) -slave-bin.001 1194 Query 1 1194 use `test`; drop table t5 -slave-bin.001 1242 Rotate 2 1242 slave-bin.002;pos=4 -show binlog events in 'slave-bin.002' from 4; +slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3 +slave-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +slave-bin.000001 172 Intvar 1 172 INSERT_ID=1 +slave-bin.000001 200 Query 1 200 use `test`; insert into t1 values (NULL) +slave-bin.000001 263 Query 1 263 use `test`; drop table t1 +slave-bin.000001 311 Query 1 311 use `test`; create table t1 (word char(20) not null) +slave-bin.000001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581 +slave-bin.000001 1065 Exec_load 1 1065 ;file_id=1 +slave-bin.000001 1088 Query 1 1088 use `test`; drop table t1 +slave-bin.000001 1136 Query 1 1136 use `test`; create table t5 (a int) +slave-bin.000001 1194 Query 1 1194 use `test`; drop table t5 +slave-bin.000001 1242 Rotate 2 1242 slave-bin.000002;pos=4 +show binlog events in 'slave-bin.000002' from 4; Log_name Pos Event_type Server_id Orig_log_pos Info -slave-bin.002 4 Query 1 4 use `test`; create table t1 (n int) -slave-bin.002 62 Query 1 62 use `test`; insert into t1 values (1) -slave-bin.002 122 Query 1 122 use `test`; drop table t1 +slave-bin.000002 4 Query 1 4 use `test`; create table t1 (n int) +slave-bin.000002 62 Query 1 62 use `test`; insert into t1 values (1) +slave-bin.000002 122 Query 1 122 use `test`; drop table t1 show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.002 276 slave-relay-bin.003 211 master-bin.002 Yes Yes 0 0 276 211 -show binlog events in 'slave-bin.005' from 4; -Error when executing command SHOW BINLOG EVENTS: Could not find target log +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 276 slave-relay-bin.000003 214 master-bin.000002 Yes Yes 0 0 276 214 None 0 No # +show binlog events in 'slave-bin.000005' from 4; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result index f7e59e55577..10c78272de6 100644 --- a/mysql-test/r/rpl_log_pos.result +++ b/mysql-test/r/rpl_log_pos.result @@ -1,43 +1,43 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; show master status; -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 79 +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 79 show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 120 -slave stop; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No # +stop slave; change master to master_log_pos=73; -slave start; -slave stop; +start slave; +stop slave; change master to master_log_pos=73; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No No 0 0 73 4 -slave start; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 73 4 None 0 No # +start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 45 master-bin.001 No Yes 0 0 73 45 -slave stop; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 48 master-bin.000001 No Yes 0 0 73 48 None 0 No # +stop slave; change master to master_log_pos=173; -slave start; +start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 173 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 173 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 173 slave-relay-bin.000001 4 master-bin.000001 No Yes 0 0 173 4 None 0 No # show master status; -File Position Binlog_do_db Binlog_ignore_db -master-bin.001 79 +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 79 create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); -slave stop; +stop slave; change master to master_log_pos=79; -slave start; +start slave; select * from t1; n 1 diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/r/rpl_master_pos_wait.result index cb6ee31a54d..e92d1ffa361 100644 --- a/mysql-test/r/rpl_master_pos_wait.result +++ b/mysql-test/r/rpl_master_pos_wait.result @@ -1,12 +1,17 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; select master_pos_wait('master-bin.999999',0,2); master_pos_wait('master-bin.999999',0,2) -1 +explain extended select master_pos_wait('master-bin.999999',0,2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)` select master_pos_wait('master-bin.999999',0); stop slave sql_thread; master_pos_wait('master-bin.999999',0) diff --git a/mysql-test/r/rpl_max_relay_size.result b/mysql-test/r/rpl_max_relay_size.result index d74bc80c0ab..5c3360b0f66 100644 --- a/mysql-test/r/rpl_max_relay_size.result +++ b/mysql-test/r/rpl_max_relay_size.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; create table t1 (a int); drop table t1; @@ -15,8 +15,8 @@ select @@global.max_relay_log_size; 4096 start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.014 1221 master-bin.001 Yes Yes 0 0 50477 1221 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000014 1221 master-bin.000001 Yes Yes 0 0 50477 1221 None 0 No # stop slave; reset slave; set global max_relay_log_size=(5*4096); @@ -25,8 +25,8 @@ select @@global.max_relay_log_size; 20480 start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.004 9457 master-bin.001 Yes Yes 0 0 50477 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000004 9457 master-bin.000001 Yes Yes 0 0 50477 9457 None 0 No # stop slave; reset slave; set global max_relay_log_size=0; @@ -35,27 +35,27 @@ select @@global.max_relay_log_size; 0 start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.008 1283 master-bin.001 Yes Yes 0 0 50477 1283 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 50477 slave-relay-bin.000008 1283 master-bin.000001 Yes Yes 0 0 50477 1283 None 0 No # stop slave; reset slave; flush logs; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No # reset slave; start slave; flush logs; create table t1 (a int); show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 50535 slave-relay-bin.009 62 master-bin.001 Yes Yes 0 0 50535 62 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 50535 slave-relay-bin.000009 62 master-bin.000001 Yes Yes 0 0 50535 62 None 0 No # flush logs; drop table t1; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 50583 slave-relay-bin.010 52 master-bin.001 Yes Yes 0 0 50583 52 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 50583 slave-relay-bin.000010 52 master-bin.000001 Yes Yes 0 0 50583 52 None 0 No # flush logs; show master status; -File Position Binlog_do_db Binlog_ignore_db -master-bin.002 4 +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000002 4 diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/r/rpl_misc_functions.result new file mode 100644 index 00000000000..a687063706d --- /dev/null +++ b/mysql-test/r/rpl_misc_functions.result @@ -0,0 +1,21 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1(id int, i int, r1 int, r2 int, p varchar(100)); +insert into t1 values(1, connection_id(), 0, 0, ""); +insert into t1 values(2, 0, rand()*1000, rand()*1000, ""); +set sql_log_bin=0; +insert into t1 values(6, 0, rand(), rand(), ""); +delete from t1 where id=6; +set sql_log_bin=1; +insert into t1 values(3, 0, 0, 0, password('does_this_work?')); +insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); +select * into outfile 'rpl_misc_functions.outfile' from t1; +create table t2 like t1; +load data local infile './var/master-data/test/rpl_misc_functions.outfile' into table t2; +select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); +id i r1 r2 p id i r1 r2 p +stop slave; diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/r/rpl_multi_delete.result index fa254d76393..e94a4e7947e 100644 --- a/mysql-test/r/rpl_multi_delete.result +++ b/mysql-test/r/rpl_multi_delete.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1 (a int); create table t2 (a int); insert into t1 values (1); diff --git a/mysql-test/r/rpl_multi_delete2.result b/mysql-test/r/rpl_multi_delete2.result index 8b6d87801fe..c6c088111fc 100644 --- a/mysql-test/r/rpl_multi_delete2.result +++ b/mysql-test/r/rpl_multi_delete2.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1 (a int); create table t2 (a int); insert into t1 values (1); @@ -15,7 +15,7 @@ select * from t2; a 1 select * from t1; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist select * from t2; -Table 'test.t2' doesn't exist +ERROR 42S02: Table 'test.t2' doesn't exist drop table t1,t2; diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/r/rpl_multi_update.result index 0cd6ea2c6f7..34f99746c7d 100644 --- a/mysql-test/r/rpl_multi_update.result +++ b/mysql-test/r/rpl_multi_update.result @@ -1,18 +1,17 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1,t2; +start slave; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (NULL, 0); INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t2 VALUES (NULL, 0), (NULL,1); diff --git a/mysql-test/r/rpl_mystery22.result b/mysql-test/r/rpl_mystery22.result index 5dd665fe9d5..348b3211cd5 100644 --- a/mysql-test/r/rpl_mystery22.result +++ b/mysql-test/r/rpl_mystery22.result @@ -1,20 +1,20 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1(n int auto_increment primary key); insert into t1 values (2); insert into t1 values(NULL); insert into t1 values(NULL); delete from t1 where n = 2; -slave start; -slave stop; +start slave; +stop slave; create table t2(n int); drop table t2; insert into t1 values(NULL); -slave start; +start slave; select * from t1; n 1 diff --git a/mysql-test/r/rpl_openssl.result b/mysql-test/r/rpl_openssl.result new file mode 100644 index 00000000000..ad7251fd631 --- /dev/null +++ b/mysql-test/r/rpl_openssl.result @@ -0,0 +1,30 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +grant replication slave on *.* to replssl@'%' require ssl; +create table t1 (t int); +stop slave; +change master to master_user='replssl',master_password=''; +start slave; +insert into t1 values (1); +select * from t1; +t +stop slave; +change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem'; +start slave; +select * from t1; +t +1 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 replssl MASTER_MYPORT 1 master-bin.000001 289 slave-relay-bin.000001 108 master-bin.000001 Yes Yes 0 0 289 108 None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # +stop slave; +change master to master_user='root',master_password='', master_ssl=0; +start slave; +drop table t1; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 337 slave-relay-bin.000001 96 master-bin.000001 Yes Yes 0 0 337 96 None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # diff --git a/mysql-test/r/rpl_optimize.result b/mysql-test/r/rpl_optimize.result index 5ed541516dc..79891169fbc 100644 --- a/mysql-test/r/rpl_optimize.result +++ b/mysql-test/r/rpl_optimize.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1 (a int not null auto_increment primary key, b int, key(b)); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO t1 (a) SELECT null FROM t1; diff --git a/mysql-test/r/rpl_ps.result b/mysql-test/r/rpl_ps.result new file mode 100644 index 00000000000..c969575de76 --- /dev/null +++ b/mysql-test/r/rpl_ps.result @@ -0,0 +1,28 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop table if exists t1; +create table t1(n char(30)); +prepare stmt1 from 'insert into t1 values (?)'; +set @var1= "from-master-1"; +execute stmt1 using @var1; +set @var1= "from-master-2-'',"; +execute stmt1 using @var1; +select * from t1; +n +from-master-1 +from-master-2-'', +set @var2= 'insert into t1 values (concat("from-var-", ?))'; +prepare stmt2 from @var2; +set @var1='from-master-3'; +execute stmt2 using @var1; +select * from t1; +n +from-master-1 +from-master-2-'', +from-var-from-master-3 +drop table t1; +stop slave; diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/r/rpl_redirect.result index 6103a075684..9dd51eaba4d 100644 --- a/mysql-test/r/rpl_redirect.result +++ b/mysql-test/r/rpl_redirect.result @@ -1,15 +1,14 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; SHOW SLAVE STATUS; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master SHOW SLAVE HOSTS; Server_id Host Port Rpl_recovery_rank Master_id 2 127.0.0.1 SLAVE_PORT 2 1 -drop table if exists t1; create table t1 ( n int); insert into t1 values (1),(2),(3),(4); insert into t1 values(5); diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result new file mode 100644 index 00000000000..bf9bbbb9b93 --- /dev/null +++ b/mysql-test/r/rpl_relayrotate.result @@ -0,0 +1,19 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +create table t1 (a int) engine=innodb; +reset slave; +start slave; +stop slave; +start slave; +select master_pos_wait('master-bin.001',3000)>=0; +master_pos_wait('master-bin.001',3000)>=0 +1 +select * from t1 where a=8000; +a +8000 +drop table t1; diff --git a/mysql-test/r/rpl_relayspace.result b/mysql-test/r/rpl_relayspace.result index 721c6a882bd..1f2a739d3e3 100644 --- a/mysql-test/r/rpl_relayspace.result +++ b/mysql-test/r/rpl_relayspace.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; create table t1 (a int); drop table t1; diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index 372d8c07f64..ca290d46fda 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; drop table if exists t11; drop table if exists t11; create table t2 (n int); @@ -24,5 +24,8 @@ select * from t2; n 4 select * from t11; -Table 'test.t11' doesn't exist -drop table if exists t1,t2,t3,t11; +ERROR 42S02: Table 'test.t11' doesn't exist +drop table if exists t1,t2,t11; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1340 slave-relay-bin.000002 1384 master-bin.000001 Yes Yes test.t1 0 0 1340 1384 None 0 No # diff --git a/mysql-test/r/rpl_reset_slave.result b/mysql-test/r/rpl_reset_slave.result index fb931064720..42d41533cb0 100644 --- a/mysql-test/r/rpl_reset_slave.result +++ b/mysql-test/r/rpl_reset_slave.result @@ -1,25 +1,25 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 120 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No # stop slave; change master to master_user='test'; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 test MASTER_PORT 1 master-bin.001 79 slave-relay-bin.001 4 master-bin.001 No No 0 0 79 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 79 4 None 0 No # reset slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No # start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 120 +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 89d7f4a795a..62e5522fad9 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -1,22 +1,22 @@ drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4; -slave start; -Could not initialize master info structure, more error messages can be found in the MySQL error log -slave start; -Could not initialize master info structure, more error messages can be found in the MySQL error log +start slave; +ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log +start slave; +ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; -Could not initialize master info structure, more error messages can be found in the MySQL error log +ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log reset slave; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; reset master; -slave start; +start slave; create temporary table temp_table (a char(80) not null); insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 60 master-bin.001 417 slave-relay-bin.001 458 master-bin.001 Yes Yes 0 0 417 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461 None 0 No # select * from t1; s Could not break slave @@ -25,11 +25,11 @@ flush logs; create table t2(m int not null auto_increment primary key); insert into t2 values (34),(67),(123); flush logs; -show master logs; +show binary logs; Log_name -master-bin.001 -master-bin.002 -master-bin.003 +master-bin.000001 +master-bin.000002 +master-bin.000003 create table t3 select * from temp_table; select * from t3; a @@ -39,15 +39,25 @@ insert into t2 values(1234); set insert_id=1234; insert into t2 values(NULL); set global sql_slave_skip_counter=1; -slave start; -purge master logs to 'master-bin.003'; +start slave; +purge master logs to 'master-bin.000002'; show master logs; Log_name -master-bin.003 +master-bin.000002 +master-bin.000003 +purge binary logs to 'master-bin.000002'; +show binary logs; +Log_name +master-bin.000002 +master-bin.000003 +purge master logs before now(); +show binary logs; +Log_name +master-bin.000003 insert into t2 values (65); show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 60 master-bin.003 290 slave-relay-bin.001 1073 master-bin.003 Yes Yes 0 0 290 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088 None 0 No # select * from t2; m 34 @@ -62,19 +72,19 @@ select count(*) from t3 where n >= 4; count(*) 100 create table t4 select * from temp_table; -show master logs; +show binary logs; Log_name -master-bin.003 -master-bin.004 +master-bin.000003 +master-bin.000004 show master status; -File Position Binlog_do_db Binlog_ignore_db -master-bin.004 2886 +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000004 2886 select * from t4; a testing temporary tables part 2 show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 60 master-bin.004 2886 slave-relay-bin.001 7870 master-bin.004 Yes Yes 0 0 2886 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891 None 0 No # lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result index d8b23b9ca41..32e14b053d7 100644 --- a/mysql-test/r/rpl_server_id1.result +++ b/mysql-test/r/rpl_server_id1.result @@ -1,23 +1,19 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; create table t1 (n int); reset master; stop slave; change master to master_port=SLAVE_PORT; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 4 None 0 No NULL start slave; insert into t1 values (1); show status like "slave_running"; Variable_name Value -Slave_running ON -select * from t1; -n -1 +Slave_running OFF drop table t1; diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result index 1b5d946998c..82ab1ff85a7 100644 --- a/mysql-test/r/rpl_server_id2.result +++ b/mysql-test/r/rpl_server_id2.result @@ -1,16 +1,16 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t1 (n int); reset master; stop slave; change master to master_port=SLAVE_PORT; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 4 None 0 No NULL start slave; insert into t1 values (1); select * from t1; diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result index 946d64ad7c5..e52426c381c 100644 --- a/mysql-test/r/rpl_skip_error.result +++ b/mysql-test/r/rpl_skip_error.result @@ -1,10 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; -drop table if exists t1; +start slave; create table t1 (n int not null primary key); insert into t1 values (1); insert into t1 values (1); diff --git a/mysql-test/r/rpl_sporadic_master.result b/mysql-test/r/rpl_sporadic_master.result index a6a58515f0a..789c3bf2b2b 100644 --- a/mysql-test/r/rpl_sporadic_master.result +++ b/mysql-test/r/rpl_sporadic_master.result @@ -1,16 +1,16 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; create table t2(n int); create table t1(n int not null auto_increment primary key); insert into t1 values (NULL),(NULL); truncate table t1; insert into t1 values (4),(NULL); -slave stop; -slave start; +stop slave; +start slave; insert into t1 values (NULL),(NULL); flush logs; truncate table t1; diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result new file mode 100644 index 00000000000..b9865d282fa --- /dev/null +++ b/mysql-test/r/rpl_temporary.result @@ -0,0 +1,91 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +reset master; +SET @save_select_limit=@@session.sql_select_limit; +SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; +ERROR HY000: Access denied; you need the SUPER privilege for this operation +SELECT @@session.sql_select_limit = @save_select_limit; +@@session.sql_select_limit = @save_select_limit +1 +SET @@session.sql_select_limit=10, @@session.sql_log_bin=0; +ERROR HY000: Access denied; you need the SUPER privilege for this operation +SELECT @@session.sql_select_limit = @save_select_limit; +@@session.sql_select_limit = @save_select_limit +1 +SET @@session.pseudo_thread_id=100; +SET @@session.pseudo_thread_id=connection_id(); +SET @@session.sql_log_bin=0; +SET @@session.sql_log_bin=1; +drop table if exists t1,t2; +create table t1(f int); +create table t2(f int); +insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +create temporary table t3(f int); +insert into t3 select * from t1 where f<6; +create temporary table t3(f int); +insert into t2 select count(*) from t3; +insert into t3 select * from t1 where f>=4; +drop temporary table t3; +insert into t2 select count(*) from t3; +drop temporary table t3; +select * from t2; +f +5 +7 +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; drop table if exists t1,t2 +master-bin.000001 140 Query 1 140 use `test`; create table t1(f int) +master-bin.000001 197 Query 1 197 use `test`; create table t2(f int) +master-bin.000001 254 Query 1 254 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10) +master-bin.000001 351 Query 1 351 use `test`; create temporary table t3(f int) +master-bin.000001 418 Query 1 418 use `test`; insert into t3 select * from t1 where f<6 +master-bin.000001 494 Query 1 494 use `test`; create temporary table t3(f int) +master-bin.000001 561 Query 1 561 use `test`; insert into t2 select count(*) from t3 +master-bin.000001 634 Query 1 634 use `test`; insert into t3 select * from t1 where f>=4 +master-bin.000001 711 Query 1 711 use `test`; drop temporary table t3 +master-bin.000001 769 Query 1 769 use `test`; insert into t2 select count(*) from t3 +master-bin.000001 842 Query 1 842 use `test`; drop temporary table t3 +drop table t1, t2; +use test; +SET TIMESTAMP=1040323920; +create table t1(f int); +SET TIMESTAMP=1040323931; +create table t2(f int); +SET TIMESTAMP=1040323938; +insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SET TIMESTAMP=1040323945; +SET @@session.pseudo_thread_id=1; +create temporary table t3(f int); +SET TIMESTAMP=1040323952; +SET @@session.pseudo_thread_id=1; +insert into t3 select * from t1 where f<6; +SET TIMESTAMP=1040324145; +SET @@session.pseudo_thread_id=2; +create temporary table t3(f int); +SET TIMESTAMP=1040324186; +SET @@session.pseudo_thread_id=1; +insert into t2 select count(*) from t3; +SET TIMESTAMP=1040324200; +SET @@session.pseudo_thread_id=2; +insert into t3 select * from t1 where f>=4; +SET TIMESTAMP=1040324211; +SET @@session.pseudo_thread_id=1; +drop temporary table t3; +SET TIMESTAMP=1040324219; +SET @@session.pseudo_thread_id=2; +insert into t2 select count(*) from t3; +SET TIMESTAMP=1040324224; +SET @@session.pseudo_thread_id=2; +drop temporary table t3; +select * from t2; +f +5 +7 +drop table t1,t2; +create temporary table t3 (f int); diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result new file mode 100644 index 00000000000..c7be3324533 --- /dev/null +++ b/mysql-test/r/rpl_timezone.result @@ -0,0 +1,77 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (t timestamp); +create table t2 (t char(32)); +select @@time_zone; +@@time_zone +Europe/Moscow +set time_zone='UTC'; +insert into t1 values ('20040101000000'), ('20040611093902'); +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +select * from t1; +t +2004-01-01 03:00:00 +2004-06-11 13:39:02 +delete from t1; +set time_zone='Europe/Moscow'; +insert into t1 values ('20040101000000'), ('20040611093902'); +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1 (t timestamp) +master-bin.000001 143 Query 1 143 use `test`; create table t2 (t char(32)) +master-bin.000001 206 Query 1 206 use `test`; SET ONE_SHOT TIME_ZONE='UTC' +master-bin.000001 269 Query 1 269 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') +master-bin.000001 364 Query 1 364 use `test`; delete from t1 +master-bin.000001 413 Query 1 413 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') +set time_zone='MET'; +insert into t2 (select t from t1); +select * from t1; +t +2003-12-31 22:00:00 +2004-06-11 07:39:02 +select * from t2; +t +2003-12-31 22:00:00 +2004-06-11 07:39:02 +delete from t2; +set timestamp=1000072000; +insert into t2 values (current_timestamp), (current_date), (current_time); +set timestamp=1000072000; +select current_timestamp, current_date, current_time; +current_timestamp current_date current_time +2001-09-10 01:46:40 2001-09-10 01:46:40 +select * from t2; +t +2001-09-09 23:46:40 +2001-09-09 +23:46:40 +delete from t2; +insert into t2 values (from_unixtime(1000000000)), +(unix_timestamp('2001-09-09 03:46:40')); +select * from t2; +t +2001-09-09 03:46:40 +1000000000 +select * from t2; +t +2001-09-09 03:46:40 +1000000000 +set global time_zone='MET'; +ERROR HY000: Binary logging and replication forbid changing of the global server time zone +drop table t1, t2; diff --git a/mysql-test/r/rpl_trunc_binlog.result b/mysql-test/r/rpl_trunc_binlog.result index 27b7c3c5677..085a2937584 100644 --- a/mysql-test/r/rpl_trunc_binlog.result +++ b/mysql-test/r/rpl_trunc_binlog.result @@ -1,13 +1,13 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; flush logs; reset slave; start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.002 4 slave-relay-bin.002 120 master-bin.001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # None 0 No # diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_until.result new file mode 100644 index 00000000000..5772f176919 --- /dev/null +++ b/mysql-test/r/rpl_until.result @@ -0,0 +1,72 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +create table t1(n int not null auto_increment primary key); +insert into t1 values (1),(2),(3),(4); +drop table t1; +create table t2(n int not null auto_increment primary key); +insert into t2 values (1),(2); +insert into t2 values (3),(4); +drop table t2; +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 172 Query 1 172 use `test`; insert into t1 values (1),(2),(3),(4) +master-bin.000001 244 Query 1 244 use `test`; drop table t1 +master-bin.000001 292 Query 1 292 use `test`; create table t2(n int not null auto_increment primary key) +master-bin.000001 385 Query 1 385 use `test`; insert into t2 values (1),(2) +master-bin.000001 449 Query 1 449 use `test`; insert into t2 values (3),(4) +master-bin.000001 513 Query 1 513 use `test`; drop table t2 +start slave until master_log_file='master-bin.000001', master_log_pos=244; +select * from t1; +n +1 +2 +3 +4 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 244 # Master master-bin.000001 244 No # +start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; +select * from t1; +n +1 +2 +3 +4 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 244 # Master master-no-such-bin.000001 291 No # +start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537; +select * from t2; +n +1 +2 +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 449 # Relay slave-relay-bin.000002 537 No # +start slave; +stop slave; +start slave until master_log_file='master-bin.000001', master_log_pos=561; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 561 # Master master-bin.000001 561 No # +start slave until master_log_file='master-bin', master_log_pos=561; +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL +start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL +start slave until master_log_file='master-bin.000001'; +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL +start slave until relay_log_file='slave-relay-bin.000002'; +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL +start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL +start slave sql_thread; +start slave until master_log_file='master-bin.000001', master_log_pos=561; +Warnings: +Note 1254 Slave is already running diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result new file mode 100644 index 00000000000..85768270ba3 --- /dev/null +++ b/mysql-test/r/rpl_user_variables.result @@ -0,0 +1,109 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +reset master; +create table t1(n char(30)); +set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1; +set @s1:='This is a test', @r1:=12.5, @r2:=-12.5; +set @n1:=null; +set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def'; +insert into t1 values (@i1), (@i2), (@i3), (@i4); +insert into t1 values (@r1), (@r2); +insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); +insert into t1 values (@n1); +insert into t1 values (@n2); +insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); +insert into t1 values (@a+(@b:=@a+1)); +set @q:='abc'; +insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')); +set @a:=5; +insert into t1 values (@a),(@a); +insert into t1 values (@a),(@a),(@a*5); +select * from t1; +n +12345678901234 +-12345678901234 +0 +-1 +12.5 +-12.5 +This is a test + +abc'def +abc\def +abc'def +NULL +NULL +0 +1 +2 +5 +abc +abcn1 +abcn1n2 +5 +5 +NULL +NULL +NULL +select * from t1; +n +12345678901234 +-12345678901234 +0 +-1 +12.5 +-12.5 +This is a test + +abc'def +abc\def +abc'def +NULL +NULL +0 +1 +2 +5 +abc +abcn1 +abcn1n2 +5 +5 +NULL +NULL +NULL +show binlog events from 141; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000001 141 User var 2 141 @`i1`=12345678901234 +slave-bin.000001 184 User var 2 184 @`i2`=-12345678901234 +slave-bin.000001 227 User var 2 227 @`i3`=0 +slave-bin.000001 270 User var 2 270 @`i4`=-1 +slave-bin.000001 313 Query 1 313 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4) +slave-bin.000001 396 User var 2 396 @`r1`=12.5 +slave-bin.000001 439 User var 2 439 @`r2`=-12.5 +slave-bin.000001 482 Query 1 482 use `test`; insert into t1 values (@r1), (@r2) +slave-bin.000001 551 User var 2 551 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci +slave-bin.000001 600 User var 2 600 @`s2`=_latin1 "" COLLATE latin1_swedish_ci +slave-bin.000001 635 User var 2 635 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 677 User var 2 677 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci +slave-bin.000001 719 User var 2 719 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 761 Query 1 761 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) +slave-bin.000001 851 User var 2 851 @`n1`=NULL +slave-bin.000001 877 Query 1 877 use `test`; insert into t1 values (@n1) +slave-bin.000001 939 User var 2 939 @`n2`=NULL +slave-bin.000001 965 Query 1 965 use `test`; insert into t1 values (@n2) +slave-bin.000001 1027 Query 1 1027 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) +slave-bin.000001 1115 User var 2 1115 @`a`=2 +slave-bin.000001 1157 Query 1 1157 use `test`; insert into t1 values (@a+(@b:=@a+1)) +slave-bin.000001 1229 User var 2 1229 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci +slave-bin.000001 1266 Query 1 1266 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) +slave-bin.000001 1370 User var 2 1370 @`a`=5 +slave-bin.000001 1412 Query 1 1412 use `test`; insert into t1 values (@a),(@a) +slave-bin.000001 1478 User var 2 1478 @`a`=NULL +slave-bin.000001 1503 Query 1 1503 use `test`; insert into t1 values (@a),(@a),(@a*5) +drop table t1; +stop slave; diff --git a/mysql-test/r/sel000001.result b/mysql-test/r/sel000001.result deleted file mode 100644 index 6b6b9b7dffc..00000000000 --- a/mysql-test/r/sel000001.result +++ /dev/null @@ -1,21 +0,0 @@ -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (s CHAR(20) PRIMARY KEY, id INT); -INSERT INTO t1 VALUES ('cat', 1), ('mouse', 3), ('dog', 2), ('snake', 77); -SELECT s, id FROM t1 WHERE s = 'mouse'; -s id -mouse 3 -drop table t1; -CREATE TABLE t1 ( -node int(11) NOT NULL default '0', -maxchild int(11) NOT NULL default '0', -PRIMARY KEY (`node`) -); -INSERT INTO t1 (node, maxchild) VALUES (4,4),(5,5),(1,244); -SELECT * FROM t1 g1, t1 g2 -WHERE g1.node <= g2.node and g2.node <= g1.maxchild and g2.node = g2.maxchild; -node maxchild node maxchild -4 4 4 4 -5 5 5 5 -1 244 4 4 -1 244 5 5 -DROP TABLE t1; diff --git a/mysql-test/r/sel000002.result b/mysql-test/r/sel000002.result deleted file mode 100644 index b824de8de4a..00000000000 --- a/mysql-test/r/sel000002.result +++ /dev/null @@ -1,9 +0,0 @@ -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (n INT); -INSERT INTO t1 VALUES (1), (2), (3); -SELECT * FROM t1; -n -1 -2 -3 -drop table t1; diff --git a/mysql-test/r/sel000003.result b/mysql-test/r/sel000003.result deleted file mode 100644 index c3853832f87..00000000000 --- a/mysql-test/r/sel000003.result +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score)); -INSERT INTO t1 VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10); -SELECT COUNT(*) as n, score FROM t1 GROUP BY score; -n score -4 10 -2 20 -drop table t1; diff --git a/mysql-test/r/sel000031.result b/mysql-test/r/sel000031.result deleted file mode 100644 index d3f01ab687f..00000000000 --- a/mysql-test/r/sel000031.result +++ /dev/null @@ -1,12 +0,0 @@ -drop table if exists t1,t2; -create table t1 (id int(10) not null unique); -create table t2 (id int(10) not null primary key, -val int(10) not null); -insert into t1 values (1),(2),(4); -insert into t2 values (1,1),(2,1),(3,1),(4,2); -select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id; -id elt(two.val,'one','two') -1 one -2 one -4 two -drop table t1,t2; diff --git a/mysql-test/r/sel000032.result b/mysql-test/r/sel000032.result deleted file mode 100644 index 4cca245d75b..00000000000 --- a/mysql-test/r/sel000032.result +++ /dev/null @@ -1,12 +0,0 @@ -drop table if exists t1,t2; -create table t1 (id int(10) not null unique); -create table t2 (id int(10) not null primary key, -val int(10) not null); -insert into t1 values (1),(2),(4); -insert into t2 values (1,1),(2,1),(3,1),(4,2); -select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id; -id elt(two.val,'one','two') -1 one -2 one -4 two -drop table t1,t2; diff --git a/mysql-test/r/sel000033.result b/mysql-test/r/sel000033.result deleted file mode 100644 index 1bfafaf5b27..00000000000 --- a/mysql-test/r/sel000033.result +++ /dev/null @@ -1,14 +0,0 @@ -drop table if exists t1; -create table t1 (id int(10) primary key); -insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9); -select id from t1 where id in (2,5,9) ; -id -2 -5 -9 -select id from t1 where id=2 or id=5 or id=9 ; -id -2 -5 -9 -drop table t1; diff --git a/mysql-test/r/sel000100.result b/mysql-test/r/sel000100.result deleted file mode 100644 index 3ffa4004b84..00000000000 --- a/mysql-test/r/sel000100.result +++ /dev/null @@ -1,38 +0,0 @@ -DROP TABLE IF EXISTS t1,t2; -CREATE TABLE t1 ( -ID int(11) NOT NULL auto_increment, -NAME varchar(75) DEFAULT '' NOT NULL, -LINK_ID int(11) DEFAULT '0' NOT NULL, -PRIMARY KEY (ID), -KEY NAME (NAME), -KEY LINK_ID (LINK_ID) -); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); -CREATE TABLE t2 ( -ID int(11) NOT NULL auto_increment, -NAME varchar(150) DEFAULT '' NOT NULL, -PRIMARY KEY (ID), -KEY NAME (NAME) -); -SELECT DISTINCT -t2.id AS key_link_id, -t2.name AS link -FROM t1 -LEFT JOIN t2 ON t1.link_id=t2.id -GROUP BY t1.id -ORDER BY link; -key_link_id link -NULL NULL -drop table t1,t2; -CREATE TABLE t1 ( -html varchar(5) default NULL, -rin int(11) default '0', -out int(11) default '0' -) TYPE=MyISAM; -INSERT INTO t1 VALUES ('1',1,0); -SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; -html prod -1 0.00 -drop table t1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 206fa507615..8da1660a109 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -127,31 +127,31 @@ fld3 select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; fld3 explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; -table type possible_keys key key_len ref rows Extra -t2 ref fld3 fld3 30 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; -table type possible_keys key key_len ref rows Extra -t2 ref fld3 fld3 30 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; -table type possible_keys key key_len ref rows Extra -t2 ref fld3 fld3 30 const 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index explain select fld3 from t2 ignore index (fld3,not_used); -Key column 'not_used' doesn't exist in table +ERROR 42000: Key column 'not_used' doesn't exist in table explain select fld3 from t2 use index (not_used); -Key column 'not_used' doesn't exist in table +ERROR 42000: Key column 'not_used' doesn't exist in table select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; fld3 honeysuckle honoring explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; -table type possible_keys key key_len ref rows Extra -t2 range fld3 fld3 30 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; fld1 fld3 148504 Colombo @@ -170,8 +170,8 @@ fld1 250501 250502 explain select fld1 from t2 where fld1=250501 or fld1="250502"; -table type possible_keys key key_len ref rows Extra -t2 range fld1 fld1 4 NULL 2 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; fld1 250501 @@ -179,8 +179,8 @@ fld1 250505 250601 explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; -table type possible_keys key key_len ref rows Extra -t2 range fld1 fld1 4 NULL 4 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; fld1 fld3 218401 faithful @@ -488,7 +488,7 @@ price2 double(11,0), key (period), key (name) ); -create temporary table tmp type = myisam select * from t3; +create temporary table tmp engine = myisam select * from t3; insert into t3 select * from tmp; insert into tmp select * from t3; insert into t3 select * from tmp; @@ -596,21 +596,21 @@ companynr rtrim(space(512+companynr)) select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; fld3 explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; -table type possible_keys key key_len ref rows Extra -t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort -t3 eq_ref PRIMARY PRIMARY 4 t2.fld1 1 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; -table type possible_keys key key_len ref rows Extra -t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort -t3 ref period period 4 t1.period 4181 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; -table type possible_keys key key_len ref rows Extra -t3 index period period 4 NULL 41810 -t1 ref period period 4 t3.period 4181 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; -table type possible_keys key key_len ref rows Extra -t1 index period period 4 NULL 41810 -t3 ref period period 4 t1.period 4181 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 select period from t1; period 9410 @@ -623,9 +623,9 @@ select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3. fld3 period breaking 1001 explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; -table type possible_keys key key_len ref rows Extra -t2 const fld1 fld1 4 const 1 -t3 const PRIMARY,period PRIMARY 4 const 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 select fld3,period from t2,t1 where companynr*10 = 37*10; fld3 period breaking 9410 @@ -1283,13 +1283,12 @@ fld1 fld3 period price price2 018601 vacuuming 1001 5987435 234724 018801 inch 1001 5987435 234724 018811 repetitions 1001 5987435 234724 -drop table if exists company; create table t4 ( companynr tinyint(2) unsigned zerofill NOT NULL default '00', companyname char(30) NOT NULL default '', PRIMARY KEY (companynr), UNIQUE KEY companyname(companyname) -) TYPE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; companynr companyname 00 Unknown @@ -1356,46 +1355,46 @@ select count(*) from t2 left join t4 using (companynr) where t4.companynr is not count(*) 1199 explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1200 -t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; -table type possible_keys key key_len ref rows Extra -t4 ALL NULL NULL NULL NULL 12 -t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists delete from t2 where fld1=999999; explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 Using where -t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 Using where -t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 Using where -t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; -table type possible_keys key key_len ref rows Extra -t4 ALL NULL NULL NULL NULL 12 -t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; -table type possible_keys key key_len ref rows Extra -t4 ALL PRIMARY NULL NULL NULL 12 -t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; -table type possible_keys key key_len ref rows Extra -t4 ALL NULL NULL NULL NULL 12 -t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; companynr companynr 37 36 41 40 explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 Using temporary -t4 index NULL PRIMARY 1 NULL 12 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using temporary +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using where; Using index select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; fld1 companynr fld3 period 038008 37 reporters 1008 @@ -1464,14 +1463,19 @@ companynr count(*) 58 23 53 4 50 11 -select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1) from t2 where companynr = 34 and fld4<>""; -count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) -70 absentee vest 17788966 254128.0857 3272.5940 -select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1) from t2 group by companynr limit 3; -companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) -00 82 Anthony windmills 10355753 126289.6707 115550.9757 -29 95 abut wetness 14473298 152350.5053 8368.5480 -34 70 absentee vest 17788966 254128.0857 3272.5940 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(test.t2.fld4) AS `min(fld4)`,max(test.t2.fld4) AS `max(fld4)`,sum(test.t2.fld1) AS `sum(fld1)`,avg(test.t2.fld1) AS `avg(fld1)`,std(test.t2.fld1) AS `std(fld1)`,variance(test.t2.fld1) AS `variance(fld1)` from test.t2 where ((test.t2.companynr = 34) and (test.t2.fld4 <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; companynr t2nr count(price) sum(price) min(price) max(price) avg(price) 37 1 1 5987435 5987435 5987435 5987435.0000 @@ -1904,11 +1908,11 @@ select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = fld1 sum(price) 038008 234298 explain select fld3 from t2 where 1>2 or 2>3; -Comment -Impossible WHERE +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain select fld3 from t2 where fld1=fld1; -table type possible_keys key key_len ref rows Extra -t2 ALL NULL NULL NULL NULL 1199 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; companynr fld1 34 250501 @@ -1959,8 +1963,8 @@ select count(*) from t3 where companynr=512 and price2=76234234; count(*) 4181 explain select min(fld1),max(fld1),count(*) from t2; -Comment -Select tables optimized away +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) 0 1232609 1199 @@ -2027,23 +2031,23 @@ Tables_in_test (s%) show tables from test like "t?"; Tables_in_test (t?) show full columns from t2; -Field Type Null Key Default Extra Privileges -auto int(11) PRI NULL auto_increment select,insert,update,references -fld1 int(6) unsigned zerofill UNI 000000 select,insert,update,references -companynr tinyint(2) unsigned zerofill 00 select,insert,update,references -fld3 char(30) MUL select,insert,update,references -fld4 char(35) select,insert,update,references -fld5 char(35) select,insert,update,references -fld6 char(4) select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL 00 select,insert,update,references +fld3 char(30) latin1_swedish_ci MUL select,insert,update,references +fld4 char(35) latin1_swedish_ci select,insert,update,references +fld5 char(35) latin1_swedish_ci select,insert,update,references +fld6 char(4) latin1_swedish_ci select,insert,update,references show full columns from t2 from test like 'f%'; -Field Type Null Key Default Extra Privileges -fld1 int(6) unsigned zerofill UNI 000000 select,insert,update,references -fld3 char(30) MUL select,insert,update,references -fld4 char(35) select,insert,update,references -fld5 char(35) select,insert,update,references -fld6 char(4) select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL UNI 000000 select,insert,update,references +fld3 char(30) latin1_swedish_ci MUL select,insert,update,references +fld4 char(35) latin1_swedish_ci select,insert,update,references +fld5 char(35) latin1_swedish_ci select,insert,update,references +fld6 char(4) latin1_swedish_ci select,insert,update,references show full columns from t2 from test like 's%'; -Field Type Null Key Default Extra Privileges +Field Type Collation Null Key Default Extra Privileges Comment show keys from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE @@ -2063,11 +2067,18 @@ INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 1 as rnd1 from t1 where rand() > 2; rnd1 DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM; +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); @@ -2085,6 +2096,16 @@ select wss_type from t1 where wss_type =102935229216544093; wss_type 102935229216544093 drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.26 create table t1 (a int not null auto_increment primary key); insert into t1 values (); insert into t1 values (); @@ -2265,19 +2286,19 @@ a a a 2 2 2 3 3 3 select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a a a -1 1 1 -2 2 2 -3 3 3 +a a +1 1 +2 2 +3 3 select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; a a a 1 1 1 2 2 2 3 3 3 drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM; +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; aa id t2_id id @@ -2297,11 +2318,11 @@ insert into t2 values (1); insert into t4 values (1,1); explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -table type possible_keys key key_len ref rows Extra -t3 system NULL NULL NULL NULL 0 const row not found -t1 ALL NULL NULL NULL NULL 2 -t2 ALL NULL NULL NULL NULL 1 -t4 ALL id4 NULL NULL NULL 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 left join t4 on id3 = id4 where id2 = 1 or id4 = 1; id1 id2 id3 id4 id44 diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 444124bcd67..00dbcb54d93 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -81,7 +81,10 @@ email varchar(50) NOT NULL default '', PRIMARY KEY (id), UNIQUE KEY e_n (email,name) ); -INSERT INTO t2 VALUES (1,'name1','email1'),(2,'name2','email2'),(3,'name3','email3'),(4,'name4','email4'),(5,'name5','email5'),(6,'name6','email6'),(7,'name7','email7'),(8,'name8','email8'),(9,'name9','email9'),(10,'name10','email10'),(11,'name11','email11'),(12,'name12','email12'),(13,'name13','email13'),(14,'name14','email14'),(15,'name15','email15'),(16,'name16','email16'),(17,'name17','email17'),(18,'name18','email18'),(19,'name19','email19'),(20,'name20','email20'),(21,'name21','email21'),(22,'name22','email22'),(23,'name23','email23'),(24,'name24','email24'),(25,'name25','email25'),(26,'name26','email26'),(27,'name27','email27'),(28,'name28','email28'),(29,'name29','email29'),(30,'name30','email30'),(31,'name31','email31'),(32,'name32','email32'),(33,'name33','email33'),(34,'name34','email34'),(35,'name35','email35'),(36,'name36','email36'),(37,'name37','email37'),(38,'name38','email38'),(39,'name39','email39'),(40,'name40','email40'),(41,'name41','email41'),(42,'name42','email42'),(43,'name43','email43'),(44,'name44','email44'),(45,'name45','email45'),(46,'name46','email46'),(47,'name47','email47'),(48,'name48','email48'),(49,'name49','email49'),(50,'name50','email50'),(51,'name51','email51'),(52,'name52','email52'),(53,'name53','email53'),(54,'name54','email54'),(55,'name55','email55'),(56,'name56','email56'),(57,'name57','email57'),(58,'name58','email58'),(59,'name59','email59'),(60,'name60','email60'),(61,'name61','email61'),(62,'name62','email62'),(63,'name63','email63'),(64,'name64','email64'),(65,'name65','email65'),(66,'name66','email66'),(67,'name67','email67'),(68,'name68','email68'),(69,'name69','email69'),(70,'name70','email70'),(71,'name71','email71'),(72,'name72','email72'),(73,'name73','email73'),(74,'name74','email74'),(75,'name75','email75'),(76,'name76','email76'),(77,'name77','email77'),(78,'name78','email78'),(79,'name79','email79'),(80,'name80','email80'),(81,'name81','email81'),(82,'name82','email82'),(83,'name83','email83'),(84,'name84','email84'),(85,'name85','email85'),(86,'name86','email86'),(87,'name87','email87'),(88,'name88','email88'),(89,'name89','email89'),(90,'name90','email90'),(91,'name91','email91'),(92,'name92','email92'),(93,'name93','email93'),(94,'name94','email94'),(95,'name95','email95'),(96,'name96','email96'),(97,'name97','email97'),(98,'name98','email98'),(99,'name99','email99'),(100,'name100','email100'),(101,'name101','email101'),(102,'name102','email102'),(103,'name103','email103'),(104,'name104','email104'),(105,'name105','email105'),(106,'name106','email106'),(107,'name107','email107'),(108,'name108','email108'),(109,'name109','email109'),(110,'name110','email110'),(111,'name111','email111'),(112,'name112','email112'),(113,'name113','email113'),(114,'name114','email114'),(115,'name115','email115'),(116,'name116','email116'),(117,'name117','email117'),(118,'name118','email118'),(119,'name119','email119'),(120,'name120','email120'),(121,'name121','email121'),(122,'name122','email122'),(123,'name123','email123'),(124,'name124','email124'),(125,'name125','email125'),(126,'name126','email126'),(127,'name127','email127'),(128,'name128','email128'),(129,'name129','email129'),(130,'name130','email130'),(131,'name131','email131'),(132,'name132','email132'),(133,'name133','email133'),(134,'name134','email134'),(135,'name135','email135'),(136,'name136','email136'),(137,'name137','email137'),(138,'name138','email138'),(139,'name139','email139'),(140,'name140','email140'),(141,'name141','email141'),(142,'name142','email142'),(143,'name143','email143'),(144,'name144','email144'),(145,'name145','email145'),(146,'name146','email146'),(147,'name147','email147'),(148,'name148','email148'),(149,'name149','email149'),(150,'name150','email150'),(151,'name151','email151'),(152,'name152','email152'),(153,'name153','email153'),(154,'name154','email154'),(155,'name155','email155'),(156,'name156','email156'),(157,'name157','email157'),(158,'name158','email158'),(159,'name159','email159'),(160,'name160','email160'),(161,'name161','email161'),(162,'name162','email162'),(163,'name163','email163'),(164,'name164','email164'),(165,'name165','email165'),(166,'name166','email166'),(167,'name167','email167'),(168,'name168','email168'),(169,'name169','email169'),(170,'name170','email170'),(171,'name171','email171'),(172,'name172','email172'),(173,'name173','email173'),(174,'name174','email174'),(175,'name175','email175'),(176,'name176','email176'),(177,'name177','email177'),(178,'name178','email178'),(179,'name179','email179'),(180,'name180','email180'),(181,'name181','email181'),(182,'name182','email182'),(183,'name183','email183'),(184,'name184','email184'),(185,'name185','email185'),(186,'name186','email186'),(187,'name187','email187'),(188,'name188','email188'),(189,'name189','email189'),(190,'name190','email190'),(191,'name191','email191'),(192,'name192','email192'),(193,'name193','email193'),(194,'name194','email194'),(195,'name195','email195'),(196,'name196','email196'),(197,'name197','email197'),(198,'name198','email198'),(199,'name199','email199'),(200,'name200','email200'); +EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system PRIMARY,kid NULL NULL NULL 0 const row not found +1 SIMPLE t2 index NULL e_n 100 NULL 200 SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10; email email1 @@ -136,7 +139,7 @@ email104 email105 email106 email107 -INSERT INTO `t1` (`id`, `kid`) VALUES ('', '150'); +INSERT INTO `t1` (`id`, `kid`) VALUES ('0', '150'); SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10; email email1 @@ -159,7 +162,7 @@ CREATE TABLE `t1` ( `maxnumrep` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`numeropost`), KEY `maxnumrep` (`maxnumrep`) -) TYPE=MyISAM ROW_FORMAT=FIXED; +) ENGINE=MyISAM ROW_FORMAT=FIXED; INSERT INTO t1 (titre,maxnumrep) VALUES ('test1','1'),('test2','2'),('test3','3'); SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1; @@ -168,6 +171,26 @@ test2 2 2 SELECT FOUND_ROWS(); FOUND_ROWS() 2 +SELECT SQL_CALC_FOUND_ROWS 1 FROM (SELECT 1) as a LIMIT 0; +1 +SELECT FOUND_ROWS(); +FOUND_ROWS() +1 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE numeropost > 1 LIMIT 0; +titre numeropost maxnumrep +SELECT FOUND_ROWS(); +FOUND_ROWS() +2 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 0; +titre numeropost maxnumrep +SELECT FOUND_ROWS(); +FOUND_ROWS() +3 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 ORDER BY numeropost LIMIT 0; +titre numeropost maxnumrep +SELECT FOUND_ROWS(); +FOUND_ROWS() +3 drop table t1; create table t1 (id int, primary key (id)); insert into t1 values (1), (2), (3), (4), (5); diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index 1ee1368d029..766ee8c0e14 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -20,17 +20,17 @@ select 1 from t1,t1 as t2,t1 as t3; 1 1 update t1 set b="a"; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column update t1 set b="a" where b="test"; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column delete from t1; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column delete from t1 where b="test"; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column delete from t1 where a+0=1; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5; -The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok +ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay update t1 set b="a" limit 1; update t1 set b="a" where b="b" limit 2; delete from t1 where b="test" limit 1; @@ -38,11 +38,11 @@ delete from t1 where a+0=1 limit 2; alter table t1 add key b (b); SET MAX_JOIN_SIZE=2; SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS; -@@max_join_size @@sql_big_selects +@@MAX_JOIN_SIZE @@SQL_BIG_SELECTS 2 0 insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); SELECT * from t1 order by a; -The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok +ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay SET SQL_BIG_SELECTS=1; SELECT * from t1 order by a; a b @@ -52,7 +52,7 @@ a b 5 a SET MAX_JOIN_SIZE=2; SELECT * from t1; -The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok +ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay SET MAX_JOIN_SIZE=DEFAULT; SELECT * from t1; a b @@ -61,21 +61,21 @@ a b 4 a 5 a SELECT @@MAX_SEEKS_FOR_KEY; -@@max_seeks_for_key +@@MAX_SEEKS_FOR_KEY 4294967295 analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; -table type possible_keys key key_len ref rows Extra -t1 ALL b NULL NULL NULL 21 -t2 ref b b 21 t1.b 6 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL b NULL NULL NULL 21 +1 SIMPLE t2 ref b b 21 test.t1.b 6 Using where set MAX_SEEKS_FOR_KEY=1; explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; -table type possible_keys key key_len ref rows Extra -t1 ALL b NULL NULL NULL 21 -t2 ref b b 21 t1.b 6 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL b NULL NULL NULL 21 +1 SIMPLE t2 ref b b 21 test.t1.b 6 Using where SET MAX_SEEKS_FOR_KEY=DEFAULT; drop table t1; SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index f40b0693585..8b52e6efedc 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +drop database if exists mysqltest; create table t1 (a int not null primary key, b int not null,c int not null, key(b,c)); insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4); check table t1 fast; @@ -26,7 +27,7 @@ t1 0 PRIMARY 1 a A 5 NULL NULL BTREE t1 1 b 1 b A 1 NULL NULL BTREE t1 1 b 2 c A 5 NULL NULL BTREE insert into t1 values (5,5,5); -Duplicate entry '5' for key 1 +ERROR 23000: Duplicate entry '5' for key 1 optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK @@ -43,7 +44,7 @@ wait_timeout 28800 show variables like "this_doesn't_exists%"; Variable_name Value show table status from test like "this_doesn't_exists%"; -Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Create_options Comment +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment show databases; Database mysql @@ -77,24 +78,48 @@ show create table t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 rename t2; show create table t2; Table Create Table t2 CREATE TEMPORARY TABLE `t2` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2; create table t1 ( test_set set( 'val1', 'val2', 'val3' ) not null default '', -name char(20) default 'O''Brien' +name char(20) default 'O''Brien' comment 'O''Brien as default', +c int not null comment 'int column', +`c-b` int comment 'name with a minus', +`space 2` int comment 'name with a space' ) comment = 'it\'s a table' ; -show create table t1 ; +show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `test_set` set('val1','val2','val3') NOT NULL default '', - `name` char(20) default 'O''Brien' -) TYPE=MyISAM COMMENT='it''s a table' + `name` char(20) default 'O''Brien' COMMENT 'O''Brien as default', + `c` int(11) NOT NULL default '0' COMMENT 'int column', + `c-b` int(11) default NULL COMMENT 'name with a minus', + `space 2` int(11) default NULL COMMENT 'name with a space' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table' +set sql_quote_show_create=0; +show create table t1; +Table Create Table +t1 CREATE TABLE t1 ( + test_set set('val1','val2','val3') NOT NULL default '', + name char(20) default 'O''Brien' COMMENT 'O''Brien as default', + c int(11) NOT NULL default '0' COMMENT 'int column', + `c-b` int(11) default NULL COMMENT 'name with a minus', + `space 2` int(11) default NULL COMMENT 'name with a space' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table' +set sql_quote_show_create=1; +show full columns from t1; +Field Type Collation Null Key Default Extra Privileges Comment +test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references +name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default +c int(11) NULL 0 select,insert,update,references int column +c-b int(11) NULL YES NULL select,insert,update,references name with a minus +space 2 int(11) NULL YES NULL select,insert,update,references name with a space drop table t1; create table t1 (a int not null, unique aa (a)); show create table t1; @@ -102,7 +127,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', UNIQUE KEY `aa` (`a`) -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int not null, primary key (a)); show create table t1; @@ -110,7 +135,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', PRIMARY KEY (`a`) -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; flush tables; show open tables; @@ -121,14 +146,14 @@ show open tables; Database Table In_use Name_locked test t1 0 0 drop table t1; -create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed; +create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` char(10) default NULL, KEY `b` (`b`) -) TYPE=MyISAM MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0; show create table t1; Table Create Table @@ -136,7 +161,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` varchar(10) default NULL, KEY `b` (`b`) -) TYPE=MyISAM MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test' ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default; show create table t1; Table Create Table @@ -144,7 +169,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` varchar(10) default NULL, KEY `b` (`b`) -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0)); show columns from t1; @@ -155,6 +180,14 @@ e double(9,2) YES NULL f double(5,0) YES NULL h float(3,2) YES NULL i float(3,0) YES NULL +show full columns from t1; +Field Type Collation Null Key Default Extra Privileges Comment +a decimal(9,2) NULL YES NULL select,insert,update,references +b decimal(9,0) NULL YES NULL select,insert,update,references +e double(9,2) NULL YES NULL select,insert,update,references +f double(5,0) NULL YES NULL select,insert,update,references +h float(3,2) NULL YES NULL select,insert,update,references +i float(3,0) NULL YES NULL select,insert,update,references drop table t1; create table t1 ( type_bool bool not null, @@ -179,7 +212,7 @@ type_blob blob, type_medium_blob mediumblob, type_long_blob longblob, index(type_short) -) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1; +) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -193,7 +226,7 @@ t1 CREATE TABLE `t1` ( `empty_char` char(0) default NULL, `type_char` char(2) default NULL, `type_varchar` varchar(10) default NULL, - `type_timestamp` timestamp(14) NOT NULL, + `type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `type_date` date NOT NULL default '0000-00-00', `type_time` time NOT NULL default '00:00:00', `type_datetime` datetime NOT NULL default '0000-00-00 00:00:00', @@ -206,11 +239,11 @@ t1 CREATE TABLE `t1` ( `type_long_blob` longblob, PRIMARY KEY (`type_tiny`), KEY `type_short` (`type_short`) -) TYPE=MyISAM MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' insert into t1 (type_timestamp) values ("2003-02-07 10:00:01"); select * from t1; type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob -0 1 NULL NULL NULL NULL NULL NULL NULL NULL 20030207100001 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL +0 1 NULL NULL NULL NULL NULL NULL NULL NULL 2003-02-07 10:00:01 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL drop table t1; create table t1 (a int not null); create table t2 select max(a) from t1; @@ -233,3 +266,139 @@ c decimal(4,3) YES NULL d double(4,3) YES NULL f float(4,3) YES NULL drop table t1; +SET @old_sql_mode= @@sql_mode, sql_mode= ''; +SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF; +CREATE TABLE `a/b` (i INT); +ERROR 42000: Incorrect table name 'a/b' +SET sql_mode= 'ANSI_QUOTES'; +SET sql_mode= ''; +SET sql_quote_show_create= OFF; +CREATE TABLE t1 (i INT); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE t1 ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE `table` (i INT); +SHOW CREATE TABLE `table`; +Table Create Table +table CREATE TABLE `table` ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE `table`; +SET sql_quote_show_create= @old_sql_quote_show_create; +SET sql_mode= @old_sql_mode; +select @@max_heap_table_size; +@@max_heap_table_size +1047552 +CREATE TABLE t1 ( +a int(11) default NULL, +KEY a TYPE BTREE (a) +) ENGINE=HEAP; +CREATE TABLE t2 ( +b int(11) default NULL, +index(b) +) ENGINE=HEAP; +CREATE TABLE t3 ( +a int(11) default NULL, +b int(11) default NULL, +KEY a TYPE BTREE (a), +index(b) +) ENGINE=HEAP; +insert into t1 values (1),(2); +insert into t2 values (1),(2); +insert into t3 values (1,1),(2,2); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +insert into t1 values (3),(4); +insert into t2 values (3),(4); +insert into t3 values (3,3),(4,4); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +insert into t1 values (5); +insert into t2 values (5); +insert into t3 values (5,5); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +delete from t1 where a=3; +delete from t2 where b=3; +delete from t3 where a=3; +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +delete from t1; +delete from t2; +delete from t3; +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +insert into t1 values (5); +insert into t2 values (5); +insert into t3 values (5,5); +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +delete from t1 where a=5; +delete from t2 where b=5; +delete from t3 where a=5; +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +drop table t1, t2, t3; +create database mysqltest; +show create database mysqltest; +Database Create Database +mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */ +create table mysqltest.t1(a int); +insert into mysqltest.t1 values(1); +grant select on `mysqltest`.* to mysqltest_1@localhost; +grant usage on `mysqltest`.* to mysqltest_2@localhost; +grant drop on `mysqltest`.* to mysqltest_3@localhost; +select * from t1; +a +1 +show create database mysqltest; +Database Create Database +mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */ +drop table t1; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest' +drop database mysqltest; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest' +select * from mysqltest.t1; +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest' +show create database mysqltest; +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest' +drop table mysqltest.t1; +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest' +drop database mysqltest; +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest' +select * from mysqltest.t1; +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest' +show create database mysqltest; +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest' +drop table mysqltest.t1; +drop database mysqltest; +set names binary; +delete from mysql.user +where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; +delete from mysql.db +where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; +flush privileges; diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result new file mode 100644 index 00000000000..77fe5d06bb0 --- /dev/null +++ b/mysql-test/r/sql_mode.result @@ -0,0 +1,87 @@ +drop table if exists t1; +CREATE TABLE `t1` ( +a int not null auto_increment, +`pseudo` varchar(35) character set latin2 NOT NULL default '', +`email` varchar(60) character set latin2 NOT NULL default '', +PRIMARY KEY (a), +UNIQUE KEY `email` USING BTREE (`email`) +) ENGINE=HEAP CHARSET=latin1 ROW_FORMAT DYNAMIC; +set @@sql_mode=""; +show variables like 'sql_mode'; +Variable_name Value +sql_mode +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL auto_increment, + `pseudo` varchar(35) character set latin2 NOT NULL default '', + `email` varchar(60) character set latin2 NOT NULL default '', + PRIMARY KEY (`a`), + UNIQUE KEY `email` TYPE BTREE (`email`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +set @@sql_mode="ansi_quotes"; +show variables like 'sql_mode'; +Variable_name Value +sql_mode ANSI_QUOTES +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" int(11) NOT NULL auto_increment, + "pseudo" varchar(35) character set latin2 NOT NULL default '', + "email" varchar(60) character set latin2 NOT NULL default '', + PRIMARY KEY ("a"), + UNIQUE KEY "email" TYPE BTREE ("email") +) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +set @@sql_mode="no_table_options"; +show variables like 'sql_mode'; +Variable_name Value +sql_mode NO_TABLE_OPTIONS +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL auto_increment, + `pseudo` varchar(35) character set latin2 NOT NULL default '', + `email` varchar(60) character set latin2 NOT NULL default '', + PRIMARY KEY (`a`), + UNIQUE KEY `email` TYPE BTREE (`email`) +) +set @@sql_mode="no_key_options"; +show variables like 'sql_mode'; +Variable_name Value +sql_mode NO_KEY_OPTIONS +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL auto_increment, + `pseudo` varchar(35) character set latin2 NOT NULL default '', + `email` varchar(60) character set latin2 NOT NULL default '', + PRIMARY KEY (`a`), + UNIQUE KEY `email` (`email`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +set @@sql_mode="no_field_options,mysql323,mysql40"; +show variables like 'sql_mode'; +Variable_name Value +sql_mode NO_FIELD_OPTIONS,MYSQL323,MYSQL40 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL auto_increment, + `pseudo` varchar(35) NOT NULL default '', + `email` varchar(60) NOT NULL default '', + PRIMARY KEY (`a`), + UNIQUE KEY `email` (`email`) +) TYPE=HEAP ROW_FORMAT=DYNAMIC +set sql_mode="postgresql,oracle,mssql,db2,maxdb"; +select @@sql_mode; +@@sql_mode +PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" int(11) NOT NULL, + "pseudo" varchar(35) NOT NULL default '', + "email" varchar(60) NOT NULL default '', + PRIMARY KEY ("a"), + UNIQUE KEY "email" ("email") +) +drop table t1; diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index 3ef6cec32b3..e9616232fa1 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -5,7 +5,7 @@ Table_locks_immediate 0 Table_locks_waited 0 SET SQL_LOG_BIN=0; drop table if exists t1; -create table t1(n int) type=myisam; +create table t1(n int) engine=myisam; insert into t1 values(1); lock tables t1 read; unlock tables; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result new file mode 100644 index 00000000000..ff5c9dfe813 --- /dev/null +++ b/mysql-test/r/subselect.result @@ -0,0 +1,1970 @@ +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; +select (select 2); +(select 2) +2 +explain extended select (select 2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1003 select 2 AS `(select 2)` +SELECT (SELECT 1) UNION SELECT (SELECT 2); +(SELECT 1) +1 +2 +explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1249 Select 4 was reduced during optimization +Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` +SELECT (SELECT (SELECT 0 UNION SELECT 0)); +(SELECT (SELECT 0 UNION SELECT 0)) +0 +explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` +SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; +ERROR 42S22: Reference 'a' not supported (forward reference in item list) +SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; +ERROR 42S22: Reference 'b' not supported (forward reference in item list) +SELECT (SELECT 1),MAX(1) FROM (SELECT 1) as a; +(SELECT 1) MAX(1) +1 1 +SELECT (SELECT a) as a; +ERROR 42S22: Reference 'a' not supported (forward reference in item list) +EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 +3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1 +Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1) +SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; +1 +1 +SELECT (SELECT 1), a; +ERROR 42S22: Unknown column 'a' in 'checking transformed subquery' +SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1; +a +1 +SELECT 1 FROM (SELECT (SELECT a) b) c; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id); +id +1 +SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1); +ERROR 21000: Operand should contain 1 column(s) +SELECT 1 IN (SELECT 1); +1 IN (SELECT 1) +1 +SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); +1 +1 +select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); +ERROR HY000: Incorrect usage of PROCEDURE and subquery +SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); +ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; +a +SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; +a +1 +SELECT (SELECT 1,2,3) = ROW(1,2,3); +(SELECT 1,2,3) = ROW(1,2,3) +1 +SELECT (SELECT 1,2,3) = ROW(1,2,1); +(SELECT 1,2,3) = ROW(1,2,1) +0 +SELECT (SELECT 1,2,3) < ROW(1,2,1); +(SELECT 1,2,3) < ROW(1,2,1) +0 +SELECT (SELECT 1,2,3) > ROW(1,2,1); +(SELECT 1,2,3) > ROW(1,2,1) +1 +SELECT (SELECT 1,2,3) = ROW(1,2,NULL); +(SELECT 1,2,3) = ROW(1,2,NULL) +NULL +SELECT ROW(1,2,3) = (SELECT 1,2,3); +ROW(1,2,3) = (SELECT 1,2,3) +1 +SELECT ROW(1,2,3) = (SELECT 1,2,1); +ROW(1,2,3) = (SELECT 1,2,1) +0 +SELECT ROW(1,2,3) < (SELECT 1,2,1); +ROW(1,2,3) < (SELECT 1,2,1) +0 +SELECT ROW(1,2,3) > (SELECT 1,2,1); +ROW(1,2,3) > (SELECT 1,2,1) +1 +SELECT ROW(1,2,3) = (SELECT 1,2,NULL); +ROW(1,2,3) = (SELECT 1,2,NULL) +NULL +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); +(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +1 +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); +(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +0 +SELECT (SELECT 1.5,2,'a') = ROW('b',2,'b'); +(SELECT 1.5,2,'a') = ROW('b',2,'b') +0 +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); +(SELECT 'b',2,'a') = ROW(1.5,2,'a') +0 +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'c','a'); +(SELECT 1.5,2,'a') = ROW(1.5,'c','a') +0 +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); +(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +0 +SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a); +ERROR 21000: Operand should contain 1 column(s) +SELECT 1 as a,(SELECT a+a) b,(SELECT b); +a b (SELECT b) +1 2 2 +create table t1 (a int); +create table t2 (a int, b int); +create table t3 (a int); +create table t4 (a int not null, b int not null); +insert into t1 values (2); +insert into t2 values (1,7),(2,7); +insert into t4 values (4,8),(3,8),(5,9); +select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1; +ERROR 42S22: Reference 'a1' not supported (forward reference in item list) +select (select a from t1 where t1.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a) a +NULL 1 +2 2 +select (select a from t1 where t1.a=t2.b), a from t2; +(select a from t1 where t1.a=t2.b) a +NULL 1 +NULL 2 +select (select a from t1), a, (select 1 union select 2 limit 1) from t2; +(select a from t1) a (select 1 union select 2 limit 1) +2 1 1 +2 2 1 +select (select a from t3), a from t2; +(select a from t3) a +NULL 1 +NULL 2 +select * from t2 where t2.a=(select a from t1); +a b +2 7 +insert into t3 values (6),(7),(3); +select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1); +a b +1 7 +2 7 +(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 order by a limit 2) limit 3; +a b +1 7 +2 7 +3 8 +(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a); +a b +1 7 +2 7 +3 8 +4 8 +explain extended (select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where +2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using filesort +3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort +4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 +NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) +select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2; +(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a +3 1 +7 2 +select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from +(select * from t2 where a>1) as tt; +(select t3.a from t3 where a<8 order by 1 desc limit 1) a +7 2 +explain extended select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from +(select * from t2 where a>1) as tt; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived3> system NULL NULL NULL NULL 1 +3 DERIVED t2 ALL NULL NULL NULL NULL 2 Using where +2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort +Warnings: +Note 1003 select (select test.t3.a AS `a` from test.t3 where (test.t3.a < 8) order by test.t3.a desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,tt.a AS `a` from (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a > 1)) tt +select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); +a +2 +select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a > t1.a) order by 1 desc limit 1); +a +2 +select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); +a +select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +8 7.5000 +8 4.5000 +9 7.5000 +explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 +3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where +Warnings: +Note 1276 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4 +select * from t3 where exists (select * from t2 where t2.b=t3.a); +a +7 +select * from t3 where not exists (select * from t2 where t2.b=t3.a); +a +6 +3 +select * from t3 where a in (select b from t2); +a +7 +select * from t3 where a not in (select b from t2); +a +6 +3 +select * from t3 where a = some (select b from t2); +a +7 +select * from t3 where a <> any (select b from t2); +a +6 +3 +select * from t3 where a = all (select b from t2); +a +7 +select * from t3 where a <> all (select b from t2); +a +6 +3 +insert into t2 values (100, 5); +select * from t3 where a < any (select b from t2); +a +6 +3 +select * from t3 where a < all (select b from t2); +a +3 +select * from t3 where a >= any (select b from t2); +a +6 +7 +explain extended select * from t3 where a >= any (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) +select * from t3 where a >= all (select b from t2); +a +7 +delete from t2 where a=100; +select * from t3 where a in (select a,b from t2); +ERROR 21000: Operand should contain 1 column(s) +select * from t3 where a in (select * from t2); +ERROR 21000: Operand should contain 1 column(s) +insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10); +select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b); +b ma +insert into t2 values (2,10); +select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b); +b ma +10 1 +delete from t2 where a=2 and b=10; +select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 where t2.b=t4.b); +b ma +7 12 +create table t5 (a int); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +insert into t5 values (5); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +insert into t5 values (2); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 +3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2 +select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; +ERROR 21000: Subquery returns more than 1 row +create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); +create table t7( uq int primary key, name char(25)); +insert into t7 values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta"); +insert into t6 values (1,1),(1,2),(2,2),(1,3); +select * from t6 where exists (select * from t7 where uq = clinic_uq); +patient_uq clinic_uq +1 1 +1 2 +2 2 +explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where +2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 Using index +Warnings: +Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1 +Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select 1 AS `Not_used` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) +select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); +ERROR 23000: Column 'a' in field list is ambiguous +drop table t1,t2,t3; +CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0'); +INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b'); +CREATE TABLE t2 (a varchar(20),b int NOT NULL default '0'); +INSERT INTO t2 VALUES ('W','1'),('A','3'),('J','2'); +CREATE TABLE t1 (a varchar(20),b date NOT NULL default '0000-00-00'); +INSERT INTO t1 VALUES ('W','1732-02-22'),('A','1735-10-30'),('J','1743-04-13'); +SELECT * FROM t1 WHERE b = (SELECT MIN(b) FROM t1); +a b +W 1732-02-22 +SELECT * FROM t2 WHERE b = (SELECT MIN(b) FROM t2); +a b +W 1 +SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3); +a b +W a +CREATE TABLE `t8` ( +`pseudo` varchar(35) character set latin1 NOT NULL default '', +`email` varchar(60) character set latin1 NOT NULL default '', +PRIMARY KEY (`pseudo`), +UNIQUE KEY `email` (`email`) +) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC; +INSERT INTO t8 (pseudo,email) VALUES ('joce','test'); +INSERT INTO t8 (pseudo,email) VALUES ('joce1','test1'); +INSERT INTO t8 (pseudo,email) VALUES ('2joce1','2test1'); +EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce')) FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t8 const PRIMARY PRIMARY 35 const 1 Using index +4 SUBQUERY t8 const PRIMARY PRIMARY 35 1 Using index +2 SUBQUERY t8 const PRIMARY PRIMARY 35 const 1 +3 SUBQUERY t8 const PRIMARY PRIMARY 35 1 Using index +Warnings: +Note 1003 select test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce'))) +SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM +t8 WHERE pseudo='joce'); +ERROR 21000: Operand should contain 1 column(s) +SELECT pseudo FROM t8 WHERE pseudo=(SELECT * FROM t8 WHERE +pseudo='joce'); +ERROR 21000: Operand should contain 1 column(s) +SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); +pseudo +joce +SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%'); +ERROR 21000: Subquery returns more than 1 row +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE `t1` ( +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`pseudo`,`date`,`topic`), +KEY `topic` (`topic`) +) ENGINE=MyISAM ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (topic,date,pseudo) VALUES +('43506','2002-10-02','joce'),('40143','2002-08-03','joce'); +EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 41 NULL 2 Using where; Using index +Warnings: +Note 1003 select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803) +EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 index NULL PRIMARY 41 NULL 2 Using where; Using index +Warnings: +Note 1003 select (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; +date +2002-08-03 +SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); +(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03') +2002-08-03 +SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1; +1 +1 +1 +1 +SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1; +ERROR 21000: Subquery returns more than 1 row +EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL topic 3 NULL 2 Using index +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select 1 AS `1` from test.t1 +drop table t1; +CREATE TABLE `t1` ( +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +UNIQUE KEY `maxnumrep` (`maxnumrep`) +) ENGINE=MyISAM ROW_FORMAT=FIXED; +INSERT INTO t1 (numeropost,maxnumrep) VALUES (40143,1),(43506,2); +CREATE TABLE `t2` ( +`mot` varchar(30) NOT NULL default '', +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) NOT NULL default '', +PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`) +) ENGINE=MyISAM ROW_FORMAT=DYNAMIC; +INSERT INTO t2 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce'); +select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); +a +40143 +SELECT numeropost,maxnumrep FROM t1 WHERE exists (SELECT 1 FROM t2 WHERE (mot='joce') AND date >= '2002-10-21' AND t1.numeropost = t2.topic) ORDER BY maxnumrep DESC LIMIT 0, 20; +numeropost maxnumrep +43506 2 +40143 1 +SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) b; +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT 1 IN (SELECT 1 FROM t2 HAVING a); +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); +mot topic date pseudo +SELECT * from t2 where topic IN (SELECT SUM(topic) FROM t1); +mot topic date pseudo +SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); +mot topic date pseudo +SELECT * from t2 where topic = any (SELECT SUM(topic) FROM t1); +mot topic date pseudo +SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic); +mot topic date pseudo +SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; +mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +joce 40143 2002-10-22 joce 1 +joce 43506 2002-10-22 joce 1 +SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); +mot topic date pseudo +SELECT * from t2 where topic <> any (SELECT SUM(topic) FROM t2); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); +mot topic date pseudo +joce 40143 2002-10-22 joce +SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); +mot topic date pseudo +joce 40143 2002-10-22 joce +SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); +mot topic date pseudo +joce 40143 2002-10-22 joce +SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; +mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +joce 40143 2002-10-22 joce 1 +joce 43506 2002-10-22 joce 0 +drop table t1,t2; +CREATE TABLE `t1` ( +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +UNIQUE KEY `maxnumrep` (`maxnumrep`) +) ENGINE=MyISAM ROW_FORMAT=FIXED; +INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1); +select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); +ERROR 21000: Subquery returns more than 1 row +select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1); +ERROR 21000: Subquery returns more than 1 row +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +(select * from t1) union (select * from t1) order by (select a from t1 limit 1); +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b'); +INSERT INTO t1 VALUES (); +SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b'); +ERROR 21000: Subquery returns more than 1 row +drop table t1; +CREATE TABLE `t1` ( +`numeropost` mediumint(8) unsigned NOT NULL default '0', +`numreponse` int(10) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) NOT NULL default '', +PRIMARY KEY (`numeropost`,`numreponse`), +UNIQUE KEY `numreponse` (`numreponse`), +KEY `pseudo` (`pseudo`,`numeropost`) +) ENGINE=MyISAM; +SELECT (SELECT numeropost FROM t1 HAVING numreponse=a),numreponse FROM (SELECT * FROM t1) as a; +ERROR 42S22: Reference 'numreponse' not supported (forward reference in item list) +SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=a) FROM (SELECT * FROM t1) as a; +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT * FROM t1) as a; +numreponse (SELECT numeropost FROM t1 HAVING numreponse=1) +INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test'); +EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1'); +ERROR 21000: Subquery returns more than 1 row +EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1') +EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3)) +drop table t1; +CREATE TABLE t1 (a int(1)); +INSERT INTO t1 VALUES (1); +SELECT 1 FROM (SELECT a FROM t1) b HAVING (SELECT b.a)=1; +1 +1 +drop table t1; +create table t1 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t1 values (0, 10),(1, 11),(2, 12); +insert into t2 values (1, 21),(2, 22),(3, 23); +select * from t1; +a b +0 10 +1 11 +2 12 +update t1 set b= (select b from t1); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +update t1 set b= (select b from t2); +ERROR 21000: Subquery returns more than 1 row +update t1 set b= (select b from t2 where t1.a = t2.a); +select * from t1; +a b +0 NULL +1 21 +2 22 +drop table t1, t2; +create table t1 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t1 values (0, 10),(1, 11),(2, 12); +insert into t2 values (1, 21),(2, 12),(3, 23); +select * from t1; +a b +0 10 +1 11 +2 12 +select * from t1 where b = (select b from t2 where t1.a = t2.a); +a b +2 12 +delete from t1 where b = (select b from t1); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete from t1 where b = (select b from t2); +ERROR 21000: Subquery returns more than 1 row +delete from t1 where b = (select b from t2 where t1.a = t2.a); +select * from t1; +a b +0 10 +1 11 +drop table t1, t2; +create table t11 (a int NOT NULL, b int, primary key (a)); +create table t12 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t11 values (0, 10),(1, 11),(2, 12); +insert into t12 values (33, 10),(22, 11),(2, 12); +insert into t2 values (1, 21),(2, 12),(3, 23); +select * from t11; +a b +0 10 +1 11 +2 12 +select * from t12; +a b +33 10 +22 11 +2 12 +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a); +ERROR HY000: You can't specify target table 't12' for update in FROM clause +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2); +ERROR 21000: Subquery returns more than 1 row +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a); +select * from t11; +a b +0 10 +1 11 +select * from t12; +a b +33 10 +22 11 +drop table t11, t12, t2; +CREATE TABLE t1 (x int); +create table t2 (a int); +create table t3 (b int); +insert into t2 values (1); +insert into t3 values (1),(2); +INSERT INTO t1 (x) VALUES ((SELECT x FROM t1)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +INSERT INTO t1 (x) VALUES ((SELECT b FROM t3)); +ERROR 21000: Subquery returns more than 1 row +INSERT INTO t1 (x) VALUES ((SELECT a FROM t2)); +select * from t1; +x +1 +insert into t2 values (1); +INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2)); +select * from t1; +x +1 +2 +INSERT INTO t1 (x) select (SELECT SUM(a)+1 FROM t2) FROM t2; +select * from t1; +x +1 +2 +3 +3 +INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2; +INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2)); +ERROR 42S22: Unknown column 'x' in 'field list' +INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2)); +select * from t1; +x +1 +2 +3 +3 +11 +11 +2 +drop table t1, t2, t3; +CREATE TABLE t1 (x int not null, y int, primary key (x)); +create table t2 (a int); +create table t3 (a int); +insert into t2 values (1); +insert into t3 values (1),(2); +select * from t1; +x y +replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2)); +ERROR 21000: Subquery returns more than 1 row +replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2)); +select * from t1; +x y +1 2 +replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+2 FROM t2)); +select * from t1; +x y +1 3 +replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a FROM t2)); +select * from t1; +x y +1 3 +4 1 +replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2)); +select * from t1; +x y +1 3 +4 2 +replace LOW_PRIORITY into t1 (x, y) VALUES ((SELECT a+1 FROM t2), (SELECT a FROM t2)); +select * from t1; +x y +1 3 +4 2 +2 1 +drop table t1, t2, t3; +SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); +ERROR HY000: No tables used +CREATE TABLE t2 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES (1),(2); +SELECT * FROM t2 WHERE id IN (SELECT 1); +id +1 +EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ref id id 5 const 1 Using where; Using index +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1) +SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); +id +1 +SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1)); +id +2 +EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ref id id 5 const 1 Using where; Using index +Warnings: +Note 1249 Select 3 was reduced during optimization +Note 1249 Select 2 was reduced during optimization +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1)) +EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL id 5 NULL 2 Using where; Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select test.t2.id AS `id` from test.t2 where <in_optimizer>(test.t2.id,<exists>(select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(1)) union select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(3)))) +SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); +id +SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); +id +2 +INSERT INTO t2 VALUES ((SELECT * FROM t2)); +ERROR HY000: You can't specify target table 't2' for update in FROM clause +INSERT INTO t2 VALUES ((SELECT id FROM t2)); +ERROR HY000: You can't specify target table 't2' for update in FROM clause +SELECT * FROM t2; +id +1 +2 +CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 values (1),(1); +UPDATE t2 SET id=(SELECT * FROM t1); +ERROR 21000: Subquery returns more than 1 row +drop table t2, t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +select 1 IN (SELECT * from t1); +1 IN (SELECT * from t1) +1 +select 10 IN (SELECT * from t1); +10 IN (SELECT * from t1) +0 +select NULL IN (SELECT * from t1); +NULL IN (SELECT * from t1) +NULL +update t1 set a=NULL where a=2; +select 1 IN (SELECT * from t1); +1 IN (SELECT * from t1) +1 +select 3 IN (SELECT * from t1); +3 IN (SELECT * from t1) +1 +select 10 IN (SELECT * from t1); +10 IN (SELECT * from t1) +NULL +select 1 > ALL (SELECT * from t1); +1 > ALL (SELECT * from t1) +0 +select 10 > ALL (SELECT * from t1); +10 > ALL (SELECT * from t1) +NULL +select 1 > ANY (SELECT * from t1); +1 > ANY (SELECT * from t1) +NULL +select 10 > ANY (SELECT * from t1); +10 > ANY (SELECT * from t1) +1 +drop table t1; +create table t1 (a varchar(20)); +insert into t1 values ('A'),('BC'),('DEF'); +select 'A' IN (SELECT * from t1); +'A' IN (SELECT * from t1) +1 +select 'XYZS' IN (SELECT * from t1); +'XYZS' IN (SELECT * from t1) +0 +select NULL IN (SELECT * from t1); +NULL IN (SELECT * from t1) +NULL +update t1 set a=NULL where a='BC'; +select 'A' IN (SELECT * from t1); +'A' IN (SELECT * from t1) +1 +select 'DEF' IN (SELECT * from t1); +'DEF' IN (SELECT * from t1) +1 +select 'XYZS' IN (SELECT * from t1); +'XYZS' IN (SELECT * from t1) +NULL +select 'A' > ALL (SELECT * from t1); +'A' > ALL (SELECT * from t1) +0 +select 'XYZS' > ALL (SELECT * from t1); +'XYZS' > ALL (SELECT * from t1) +NULL +select 'A' > ANY (SELECT * from t1); +'A' > ANY (SELECT * from t1) +NULL +select 'XYZS' > ANY (SELECT * from t1); +'XYZS' > ANY (SELECT * from t1) +1 +drop table t1; +create table t1 (a float); +insert into t1 values (1.5),(2.5),(3.5); +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +0 +select NULL IN (SELECT * from t1); +NULL IN (SELECT * from t1) +NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL +select 10.5 > ANY (SELECT * from t1); +10.5 > ANY (SELECT * from t1) +1 +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 +Warnings: +Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1 +select (select a+1) from t1; +(select a+1) +2.5 +NULL +4.5 +drop table t1; +CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a)); +CREATE TABLE t2 (a int(11) default '0', INDEX (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t2 VALUES (1),(2),(3); +SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; +a t1.a in (select t2.a from t2) +1 1 +2 1 +3 1 +4 0 +explain extended SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index +2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index +Warnings: +Note 1003 select test.t1.a AS `a`,<in_optimizer>(test.t1.a,<exists>(<index_lookup>(<cache>(test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1 +CREATE TABLE t3 (a int(11) default '0'); +INSERT INTO t3 VALUES (1),(2),(3); +SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; +a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) +1 1 +2 1 +3 1 +4 0 +explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index +2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 Using where; Using index +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where +Warnings: +Note 1003 select test.t1.a AS `a`,<in_optimizer>(test.t1.a,<exists>(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and ((<cache>(test.t1.a) = test.t2.a) or isnull(test.t2.a))) having <is_not_null_test>(test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1 +drop table t1,t2,t3; +create table t1 (a float); +select 10.5 IN (SELECT * from t1 LIMIT 1); +ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); +ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +drop table t1; +create table t1 (a int, b int, c varchar(10)); +create table t2 (a int); +insert into t1 values (1,2,'a'),(2,3,'b'),(3,4,'c'); +insert into t2 values (1),(2),(NULL); +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; +a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a) +1 1 a +2 0 b +NULL NULL NULL +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; +a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a) +1 0 a +2 1 b +NULL NULL NULL +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; +a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a) +1 0 a +2 0 b +NULL NULL NULL +drop table t1,t2; +create table t1 (a int, b real, c varchar(10)); +insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); +select ROW(1, 1, 'a') IN (select a,b,c from t1); +ROW(1, 1, 'a') IN (select a,b,c from t1) +1 +select ROW(1, 2, 'a') IN (select a,b,c from t1); +ROW(1, 2, 'a') IN (select a,b,c from t1) +NULL +select ROW(1, 1, 'a') IN (select b,a,c from t1); +ROW(1, 1, 'a') IN (select b,a,c from t1) +1 +select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null); +ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null) +1 +select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null); +ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null) +0 +select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null); +ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null) +1 +select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a'); +ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a') +1 +select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a'); +ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a') +NULL +select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a'); +ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a') +1 +select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2); +ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +drop table t1; +create table t1 (a int); +insert into t1 values (1); +do @a:=(SELECT a from t1); +select @a; +@a +1 +set @a:=2; +set @a:=(SELECT a from t1); +select @a; +@a +1 +drop table t1; +do (SELECT a from t1); +ERROR 42S02: Table 'test.t1' doesn't exist +set @a:=(SELECT a from t1); +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE TABLE t1 (a int, KEY(a)); +HANDLER t1 OPEN; +HANDLER t1 READ a=((SELECT 1)); +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 +HANDLER t1 CLOSE; +drop table t1; +create table t1 (a int); +create table t2 (b int); +insert into t1 values (1),(2); +insert into t2 values (1); +select a from t1 where a in (select a from t1 where a in (select b from t2)); +a +1 +drop table t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +insert into t1 values (1,2),(1,3),(1,4),(1,5); +insert into t2 values (1,2),(1,3); +select * from t1 where row(a,b) in (select a,b from t2); +a b +1 2 +1 3 +drop table t1, t2; +CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1); +UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +ERROR HY000: Invalid use of group function +drop table t1; +CREATE TABLE t1 (a int(1)); +EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select sql_no_cache (select sql_no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1 +EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select sql_no_cache (select sql_no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1 +EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select sql_no_cache (select sql_no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1 +drop table t1; +CREATE TABLE `t1` ( +`mot` varchar(30) character set latin1 NOT NULL default '', +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`), +KEY `pseudo` (`pseudo`,`date`,`topic`), +KEY `topic` (`topic`) +) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC; +CREATE TABLE `t2` ( +`mot` varchar(30) character set latin1 NOT NULL default '', +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`), +KEY `pseudo` (`pseudo`,`date`,`topic`), +KEY `topic` (`topic`) +) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC; +CREATE TABLE `t3` ( +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +UNIQUE KEY `maxnumrep` (`maxnumrep`) +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES ('joce','1','','joce'),('test','2','','test'); +Warnings: +Warning 1265 Data truncated for column 'date' at row 1 +Warning 1265 Data truncated for column 'date' at row 2 +INSERT INTO t2 VALUES ('joce','1','','joce'),('test','2','','test'); +Warnings: +Warning 1265 Data truncated for column 'date' at row 1 +Warning 1265 Data truncated for column 'date' at row 2 +INSERT INTO t3 VALUES (1,1); +SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE +numeropost=topic); +topic +2 +select * from t1; +mot topic date pseudo +joce 1 0000-00-00 joce +test 2 0000-00-00 test +DELETE FROM t1 WHERE topic IN (SELECT DISTINCT topic FROM t2 WHERE NOT +EXISTS(SELECT * FROM t3 WHERE numeropost=topic)); +select * from t1; +mot topic date pseudo +joce 1 0000-00-00 joce +drop table t1, t2, t3; +SELECT * FROM (SELECT 1 as a,(SELECT a)) a; +a (SELECT a) +1 1 +CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL default '0', + `(SELECT 1)` bigint(20) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL default '0', + `(SELECT a)` bigint(20) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL default '0', + `(SELECT a+0)` bigint(20) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; +select * from t1; +a +2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a int); +insert into t1 values (1), (2), (3); +explain extended select a,(select (select rand() from t1 limit 1) from t1 limit 1) +from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 +2 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 +3 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 +Warnings: +Note 1003 select sql_no_cache test.t1.a AS `a`,(select sql_no_cache (select sql_no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1 +drop table t1; +select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +name char(35) NOT NULL default '', +t2 char(3) NOT NULL default '', +District char(20) NOT NULL default '', +Population int(11) NOT NULL default '0', +PRIMARY KEY (ID) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (130,'Sydney','AUS','New South Wales',3276207); +INSERT INTO t1 VALUES (131,'Melbourne','AUS','Victoria',2865329); +INSERT INTO t1 VALUES (132,'Brisbane','AUS','Queensland',1291117); +CREATE TABLE t2 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '', +PRIMARY KEY (Code) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); +Continent Name Population +Oceania Sydney 3276207 +drop table t1, t2; +CREATE TABLE `t1` ( +`id` mediumint(8) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `pseudo` (`pseudo`) +) ENGINE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (pseudo) VALUES ('test'); +SELECT 0 IN (SELECT 1 FROM t1 a); +0 IN (SELECT 1 FROM t1 a) +0 +EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 0 IN (SELECT 1 FROM t1 a); +0 IN (SELECT 1 FROM t1 a) +0 +EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` +drop table t1; +CREATE TABLE `t1` ( +`i` int(11) NOT NULL default '0', +PRIMARY KEY (`i`) +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1); +UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); +ERROR HY000: Invalid use of group function +UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +ERROR HY000: Invalid use of group function +UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); +ERROR 42S02: Unknown table 't' in field list +drop table t1; +CREATE TABLE t1 ( +id int(11) default NULL +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1),(1),(2),(2),(1),(3); +CREATE TABLE t2 ( +id int(11) default NULL, +name varchar(15) default NULL +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES (4,'vita'), (1,'vita'), (2,'vita'), (1,'vita'); +update t1, t2 set t2.name='lenka' where t2.id in (select id from t1); +select * from t2; +id name +4 vita +1 lenka +2 lenka +1 lenka +drop table t1,t2; +create table t1 (a int, unique index indexa (a)); +insert into t1 values (-1), (-4), (-2), (NULL); +select -10 IN (select a from t1 FORCE INDEX (indexa)); +-10 IN (select a from t1 FORCE INDEX (indexa)) +NULL +drop table t1; +create table t1 (id int not null auto_increment primary key, salary int, key(salary)); +insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); +explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref salary salary 5 const 1 Using where +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1)) +drop table t1; +CREATE TABLE t1 ( +ID int(10) unsigned NOT NULL auto_increment, +SUB_ID int(3) unsigned NOT NULL default '0', +REF_ID int(10) unsigned default NULL, +REF_SUB int(3) unsigned default '0', +PRIMARY KEY (ID,SUB_ID), +UNIQUE KEY t1_PK (ID,SUB_ID), +KEY t1_FK (REF_ID,REF_SUB), +KEY t1_REFID (REF_ID) +) ENGINE=MyISAM CHARSET=cp1251; +INSERT INTO t1 VALUES (1,0,NULL,NULL),(2,0,NULL,NULL); +SELECT DISTINCT REF_ID FROM t1 WHERE ID= (SELECT DISTINCT REF_ID FROM t1 WHERE ID=2); +REF_ID +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,0), (2,0), (3,0); +insert into t2 values (1,1), (2,1), (3,1), (2,2); +update ignore t1 set b=(select b from t2 where t1.a=t2.a); +Warnings: +Error 1242 Subquery returns more than 1 row +select * from t1; +a b +1 1 +2 NULL +3 1 +drop table t1, t2; +CREATE TABLE `t1` ( +`id` mediumint(8) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) NOT NULL default '', +`email` varchar(60) NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `email` (`email`), +UNIQUE KEY `pseudo` (`pseudo`) +) ENGINE=MyISAM CHARSET=latin1 PACK_KEYS=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1'); +SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1); +a b +test test +test1 test1 +drop table if exists t1; +(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0); +a +1 +create table t1 (a int not null, b int, primary key (a)); +create table t2 (a int not null, primary key (a)); +create table t3 (a int not null, b int, primary key (a)); +insert into t1 values (1,10), (2,20), (3,30), (4,40); +insert into t2 values (2), (3), (4), (5); +insert into t3 values (10,3), (20,4), (30,5); +select * from t2 where t2.a in (select a from t1); +a +2 +3 +4 +explain extended select * from t2 where t2.a in (select a from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<primary_index_lookup>(<cache>(test.t2.a) in t1 on PRIMARY))) +select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +a +2 +4 +explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<primary_index_lookup>(<cache>(test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30)))) +select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +a +2 +3 +explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 Using where +2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where; Using index +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a)))) +drop table t1, t2, t3; +create table t1 (a int, b int, index a (a,b)); +create table t2 (a int, index a (a)); +create table t3 (a int, b int, index a (a)); +insert into t1 values (1,10), (2,20), (3,30), (4,40); +insert into t2 values (2), (3), (4), (5); +insert into t3 values (10,3), (20,4), (30,5); +select * from t2 where t2.a in (select a from t1); +a +2 +3 +4 +explain extended select * from t2 where t2.a in (select a from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a))) +select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +a +2 +4 +explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a where (test.t1.b <> 30)))) +select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +a +2 +3 +explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 Using where; Using index +2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using where; Using index +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a)))) +insert into t1 values (3,31); +select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +a +2 +3 +4 +select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31); +a +2 +4 +explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where +Warnings: +Note 1003 select test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(<index_lookup>(<cache>(test.t2.a) in t1 on a where (test.t1.b <> 30)))) +drop table t1, t2, t3; +create table t1 (a int, b int); +create table t2 (a int, b int); +create table t3 (a int, b int); +insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); +insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); +insert into t3 values (3,3), (2,2), (1,1); +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; +a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t1,t2,t3; +create table t1 (s1 int); +create table t2 (s1 int); +insert into t1 values (1); +insert into t2 values (1); +select * from t1 where exists (select s1 from t2 having max(t2.s1)=t1.s1); +s1 +1 +drop table t1,t2; +create table t1 (s1 int); +create table t2 (s1 int); +insert into t1 values (1); +insert into t2 values (1); +update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A); +ERROR 42S22: Unknown column 'x.s1' in 'field list' +DROP TABLE t1, t2; +CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, +s2 CHAR(5) COLLATE latin1_swedish_ci); +INSERT INTO t1 VALUES ('z','?'); +select * from t1 where s1 > (select max(s2) from t1); +ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>' +select * from t1 where s1 > any (select max(s2) from t1); +ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>' +drop table t1; +create table t1(toid int,rd int); +create table t2(userid int,pmnew int,pmtotal int); +insert into t2 values(1,0,0),(2,0,0); +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); +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); +userid pmtotal pmnew calc_total calc_new +1 0 0 9 3 +2 0 0 4 2 +drop table t1, t2; +create table t1 (s1 char(5)); +select (select 'a','b' from t1 union select 'a','b' from t1) from t1; +ERROR 21000: Operand should contain 1 column(s) +insert into t1 values ('tttt'); +select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1); +s1 +tttt +explain extended (select * from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 (select test.t1.s1 AS `s1` from test.t1) +(select * from t1); +s1 +tttt +drop table t1; +create table t1 (s1 char(5), index s1(s1)); +create table t2 (s1 char(5), index s1(s1)); +insert into t1 values ('a1'),('a2'),('a3'); +insert into t2 values ('a1'),('a2'); +select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +s1 s1 NOT IN (SELECT s1 FROM t2) +a1 0 +a2 0 +a3 1 +select s1, s1 = ANY (SELECT s1 FROM t2) from t1; +s1 s1 = ANY (SELECT s1 FROM t2) +a1 1 +a2 1 +a3 0 +select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; +s1 s1 <> ALL (SELECT s1 FROM t2) +a1 0 +a2 0 +a3 1 +select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +s1 s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') +a1 0 +a2 1 +a3 1 +explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index +Warnings: +Note 1003 select test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 +explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index +Warnings: +Note 1003 select test.t1.s1 AS `s1`,<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 +explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index +Warnings: +Note 1003 select test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 +explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where +Warnings: +Note 1003 select test.t1.s1 AS `s1`,not(<in_optimizer>(test.t1.s1,<exists>(<index_lookup>(<cache>(test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 +drop table t1,t2; +create table t2 (a int, b int); +create table t3 (a int); +insert into t3 values (6),(7),(3); +select * from t3 where a >= all (select b from t2); +a +6 +7 +3 +explain extended select * from t3 where a >= all (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a < (select max(test.t2.b) from test.t2))) +insert into t2 values (2,2), (2,1), (3,3), (3,1); +select * from t3 where a > all (select max(b) from t2 group by a); +a +6 +7 +explain extended select * from t3 where a > all (select max(b) from t2 group by a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a <= <max>(select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a))) +drop table t2, t3; +CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) 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 ; +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()); +CREATE TABLE `t2` (`db_id` int(11) NOT NULL auto_increment,`name` varchar(200) NOT NULL default '',`primary_uid` smallint(6) NOT NULL default '0',`secondary_uid` smallint(6) NOT NULL default '0',PRIMARY KEY (`db_id`),UNIQUE KEY `name_2` (`name`),FULLTEXT KEY `name` (`name`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2147483647; +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); +CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(11) NOT NULL default '0',`taskid` int(11) NOT NULL default '0',`mon` tinyint(4) NOT NULL default '1',`tues` tinyint(4) NOT NULL default '1',`wed` tinyint(4) NOT NULL default '1',`thur` tinyint(4) NOT NULL default '1',`fri` tinyint(4) NOT NULL default '1',`sat` tinyint(4) NOT NULL default '0',`sun` tinyint(4) NOT NULL default '0',`how_often` smallint(6) NOT NULL default '1',`userid` smallint(6) NOT NULL default '0',`active` tinyint(4) NOT NULL default '1',PRIMARY KEY (`taskgenid`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2 ; +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); +CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; +INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); +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; +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') +-1 Valid 1 +-1 Valid 2 1 +-1 Should Not Return 0 +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; +dbid name +-1 Valid +-1 Valid 2 +drop table t1,t2,t3,t4; +CREATE TABLE t1 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES (2),(6); +select * from t1 where (1,2,6) in (select * from t2); +ERROR 21000: Operand should contain 3 column(s) +DROP TABLE t1,t2; +create table t1 (s1 int); +insert into t1 values (1); +insert into t1 values (2); +set sort_buffer_size = (select s1 from t1); +ERROR 21000: Subquery returns more than 1 row +do (select * from t1); +drop table t1; +create table t1 (s1 char); +insert into t1 values ('e'); +select * from t1 where 'f' > any (select s1 from t1); +s1 +e +select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +s1 +e +explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY t1 system NULL NULL NULL NULL 1 +3 UNION t1 system NULL NULL NULL NULL 1 +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select test.t1.s1 AS `s1` from test.t1 +drop table t1; +CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); +CREATE TABLE t2 (code char(5) NOT NULL default '',UNIQUE KEY code (code)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES ('1'),('1226'),('1245'),('1862'),('18623'),('1874'),('1967'),('6'); +select c.number as phone,(select p.code from t2 p where c.number like concat(p.code, '%') order by length(p.code) desc limit 1) as code from t1 c; +phone code +69294728265 6 +18621828126 1862 +89356874041 NULL +95895001874 NULL +drop table t1, t2; +create table t1 (s1 int); +create table t2 (s1 int); +select * from t1 where (select count(*) from t2 where t1.s2) = 1; +ERROR 42S22: Unknown column 't1.s2' in 'where clause' +select * from t1 where (select count(*) from t2 group by t1.s2) = 1; +ERROR 42S22: Unknown column 't1.s2' in 'group statement' +select count(*) from t2 group by t1.s2; +ERROR 42S02: Unknown table 't1' in group statement +drop table t1, t2; +CREATE TABLE t1(COLA FLOAT NOT NULL,COLB FLOAT NOT NULL,COLC VARCHAR(20) DEFAULT NULL,PRIMARY KEY (COLA, COLB)); +CREATE TABLE t2(COLA FLOAT NOT NULL,COLB FLOAT NOT NULL,COLC CHAR(1) NOT NULL,PRIMARY KEY (COLA)); +INSERT INTO t1 VALUES (1,1,'1A3240'), (1,2,'4W2365'); +INSERT INTO t2 VALUES (100, 200, 'C'); +SELECT DISTINCT COLC FROM t1 WHERE COLA = (SELECT COLA FROM t2 WHERE COLB = 200 AND COLC ='C' LIMIT 1); +COLC +DROP TABLE t1, t2; +CREATE TABLE t1 (a int(1)); +INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(3),(4),(5); +SELECT DISTINCT (SELECT a) FROM t1 LIMIT 100; +(SELECT a) +1 +2 +3 +4 +5 +DROP TABLE t1; +create table t1 (a int, b decimal(13, 3)); +insert into t1 values (1, 0.123); +select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1; +delete from t1; +load data infile "subselect.out.file.1" into table t1; +select * from t1; +a b +1 0.123 +drop table t1; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL auto_increment, +`id_cns` tinyint(3) unsigned NOT NULL default '0', +`tipo` enum('','UNO','DUE') NOT NULL default '', +`anno_dep` smallint(4) unsigned zerofill NOT NULL default '0000', +`particolare` mediumint(8) unsigned NOT NULL default '0', +`generale` mediumint(8) unsigned NOT NULL default '0', +`bis` tinyint(3) unsigned NOT NULL default '0', +PRIMARY KEY (`id`), +UNIQUE KEY `idx_cns_gen_anno` (`anno_dep`,`id_cns`,`generale`,`particolare`), +UNIQUE KEY `idx_cns_par_anno` (`id_cns`,`anno_dep`,`tipo`,`particolare`,`bis`) +); +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); +CREATE TABLE `t2` ( +`id` tinyint(3) unsigned NOT NULL auto_increment, +`max_anno_dep` smallint(6) unsigned NOT NULL default '0', +PRIMARY KEY (`id`) +); +INSERT INTO `t2` VALUES (16,1987),(50,1990),(51,1990); +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; +id max_anno_dep PIPPO +16 1987 1 +50 1990 0 +51 1990 NULL +DROP TABLE t1, t2; +create table t1 (a int); +insert into t1 values (1), (2), (3); +SET SQL_SELECT_LIMIT=1; +select sum(a) from (select * from t1) as a; +sum(a) +6 +select 2 in (select * from t1); +2 in (select * from t1) +1 +SET SQL_SELECT_LIMIT=default; +drop table t1; +CREATE TABLE t1 (a int, b int, INDEX (a)); +INSERT INTO t1 VALUES (1, 1), (1, 2), (1, 3); +SELECT * FROM t1 WHERE a = (SELECT MAX(a) FROM t1 WHERE a = 1) ORDER BY b; +a b +1 1 +1 2 +1 3 +DROP TABLE t1; +create table t1(val varchar(10)); +insert into t1 values ('aaa'), ('bbb'),('eee'),('mmm'),('ppp'); +select count(*) from t1 as w1 where w1.val in (select w2.val from t1 as w2 where w2.val like 'm%') and w1.val in (select w3.val from t1 as w3 where w3.val like 'e%'); +count(*) +0 +drop table t1; +create table t1 (id int not null, text varchar(20) not null default '', primary key (id)); +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'); +select * from t1 where id not in (select id from t1 where id < 8); +id text +8 text8 +9 text9 +10 text10 +11 text11 +12 text12 +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); +id text +8 text8 +9 text9 +10 text10 +11 text11 +12 text12 +explain extended select * from t1 where id not in (select id from t1 where id < 8); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where +Warnings: +Note 1003 select test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not(<in_optimizer>(test.t1.id,<exists>(<primary_index_lookup>(<cache>(test.t1.id) in t1 on PRIMARY where (test.t1.id < 8))))) +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); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where +2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 7 Using where; Using index +Warnings: +Note 1276 Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1 +Note 1003 select test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null))) +insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); +create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); +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'); +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); +id text id text id text +1 text1 1 text1 1 text1 +2 text2 2 text2 2 text2 +3 text3 3 text3 3 text3 +4 text4 4 text4 4 text4 +5 text5 5 text5 5 text5 +6 text6 6 text6 6 text6 +7 text7 7 text7 7 text7 +8 text8 8 text8 8 text8 +9 text9 9 text9 9 text9 +10 text10 10 text10 10 text10 +11 text11 11 text1 11 text11 +12 text12 12 text2 12 text12 +1000 text1000 NULL NULL 1000 text1000 +1001 text1001 NULL NULL 1000 text1000 +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); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE a ALL NULL NULL NULL NULL 14 +1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 +1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 Using where +Warnings: +Note 1003 select test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id) +drop table t1,t2; +create table t1 (a int); +insert into t1 values (1); +explain select benchmark(1000, (select a from t1 where a=sha(rand()))); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 +drop table t1; +create table t1(id int); +create table t2(id int); +create table t3(flag int); +select (select * from t3 where id not null) from t1, t2; +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 'null) from t1, t2' at line 1 +drop table t1,t2,t3; +CREATE TABLE t1 (id INT); +CREATE TABLE t2 (id INT); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1); +SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id); +id c +1 1 +2 0 +SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id; +id c +1 1 +2 0 +DROP TABLE t1,t2; +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +ALTER TABLE t1 ADD INDEX (a); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +DROP TABLE t1; +create table t1 (a int, b int); +insert into t1 values (1,2),(3,4); +select * from t1 up where exists (select * from t1 where t1.a=up.a); +a b +1 2 +3 4 +explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY up ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +Warnings: +Note 1276 Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select test.up.a AS `a`,test.up.b AS `b` from test.t1 up where exists(select 1 AS `Not_used` from test.t1 where (test.t1.a = test.up.a)) +drop table t1; +CREATE TABLE t1 (t1_a int); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b)); +INSERT INTO t2 VALUES (1, 1), (1, 2); +SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1 +HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a); +t1_a t2_a t2_b +1 1 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (id int(11) default NULL,name varchar(10) default NULL); +INSERT INTO t1 VALUES (1,'Tim'),(2,'Rebecca'),(3,NULL); +CREATE TABLE t2 (id int(11) default NULL, pet varchar(10) default NULL); +INSERT INTO t2 VALUES (1,'Fido'),(2,'Spot'),(3,'Felix'); +SELECT a.*, b.* FROM (SELECT * FROM t1) AS a JOIN t2 as b on a.id=b.id; +id name id pet +1 Tim 1 Fido +2 Rebecca 2 Spot +3 NULL 3 Felix +drop table t1,t2; +CREATE TABLE t1 ( a int, b int ); +CREATE TABLE t2 ( c int, d int ); +INSERT INTO t1 VALUES (1,2), (2,3), (3,4); +SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +abc b +1 2 +2 3 +3 4 +INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +select * from t2; +c d +1 2 +2 3 +3 4 +CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +select * from t3; +abc b +1 2 +2 3 +3 4 +prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +deallocate prepare stmt1; +select * from t2; +c d +1 2 +2 3 +3 4 +1 2 +2 3 +3 4 +drop table t3; +prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +select * from t3; +abc b +1 2 +2 3 +3 4 +deallocate prepare stmt1; +DROP TABLE t1, t2, t3; +CREATE TABLE `t1` ( `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t1 values (1); +CREATE TABLE `t2` ( `b` int(11) default NULL, `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t2 values (1,2); +select t000.a, count(*) `C` FROM t1 t000 GROUP BY t000.a HAVING count(*) > ALL (SELECT count(*) FROM t2 t001 WHERE t001.a=1); +a C +1 1 +drop table t1,t2; +create table t1 (a int not null auto_increment primary key, b varchar(40), fulltext(b)); +insert into t1 (b) values ('ball'),('ball games'), ('games'), ('foo'), ('foobar'), ('Serg'), ('Sergei'),('Georg'), ('Patrik'),('Hakan'); +create table t2 (a int); +insert into t2 values (1),(3),(2),(7); +select a,b from t1 where match(b) against ('Ball') > 0; +a b +1 ball +2 ball games +select a from t2 where a in (select a from t1 where match(b) against ('Ball') > 0); +a +1 +2 +drop table t1,t2; +CREATE TABLE t1(`IZAVORGANG_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`KUERZEL` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin,`IZAANALYSEART_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`IZAPMKZ_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin); +CREATE INDEX AK01IZAVORGANG ON t1(izaAnalyseart_id,Kuerzel); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000001','601','D0000000001','I0000000001'); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000002','602','D0000000001','I0000000001'); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000003','603','D0000000001','I0000000001'); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000004','101','D0000000001','I0000000001'); +SELECT `IZAVORGANG_ID` FROM t1 WHERE `KUERZEL` IN(SELECT MIN(`KUERZEL`)`Feld1` FROM t1 WHERE `KUERZEL` LIKE'601%'And`IZAANALYSEART_ID`='D0000000001'); +IZAVORGANG_ID +D0000000001 +drop table t1; +CREATE TABLE `t1` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`)); +CREATE TABLE `t2` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`)); +insert into t1 values (1,1),(1,2),(2,1),(2,2); +insert into t2 values (1,2),(2,2); +select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid); +aid bid +1 1 +2 1 +alter table t2 drop primary key; +alter table t2 add key KEY1 (aid, bid); +select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid); +aid bid +1 1 +2 1 +alter table t2 drop key KEY1; +alter table t2 add primary key (bid, aid); +select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid); +aid bid +1 1 +2 1 +drop table t1,t2; +CREATE TABLE t1 (howmanyvalues bigint, avalue int); +INSERT INTO t1 VALUES (1, 1),(2, 1),(2, 2),(3, 1),(3, 2),(3, 3),(4, 1),(4, 2),(4, 3),(4, 4); +SELECT howmanyvalues, count(*) from t1 group by howmanyvalues; +howmanyvalues count(*) +1 1 +2 2 +3 3 +4 4 +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 2 +3 3 +4 4 +CREATE INDEX t1_howmanyvalues_idx ON t1 (howmanyvalues); +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues+1 = a.howmanyvalues+1) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 2 +3 3 +4 4 +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 2 +3 3 +4 4 +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues; +ERROR 42S22: Unknown column 'a.avalue' in 'where clause' +drop table t1; diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result new file mode 100644 index 00000000000..b04fec26c6f --- /dev/null +++ b/mysql-test/r/subselect2.result @@ -0,0 +1,131 @@ +drop table if exists t1, t2, t3, t4; +CREATE TABLE t1 +( +DOCID VARCHAR(32)BINARY NOT NULL +, UUID VARCHAR(32)BINARY NOT NULL +, MIMETYPE VARCHAR(80)BINARY +, CONTENTDATA LONGBLOB +, CONTENTSIZE INTEGER +, VERSIONID INTEGER +, REPID VARCHAR(32)BINARY +, MODIFIED TIMESTAMP +, MODIFIER VARCHAR(255)BINARY +, ORIGINATOR INTEGER +, PRIMARY KEY ( DOCID ) +) ENGINE=InnoDB +; +CREATE TABLE t2 +( +DOCID VARCHAR(32)BINARY NOT NULL +, DOCNAME VARCHAR(255)BINARY NOT NULL +, DOCTYPEID VARCHAR(32)BINARY NOT NULL +, FOLDERID VARCHAR(32)BINARY NOT NULL +, AUTHOR VARCHAR(255)BINARY +, CREATED TIMESTAMP NOT NULL +, TITLE VARCHAR(255)BINARY +, SUBTITLE VARCHAR(255)BINARY +, DOCABSTRACT LONGBLOB +, PUBLISHDATE TIMESTAMP +, EXPIRATIONDATE TIMESTAMP +, LOCKEDBY VARCHAR(80)BINARY +, STATUS VARCHAR(80)BINARY +, PARENTDOCID VARCHAR(32)BINARY +, REPID VARCHAR(32)BINARY +, MODIFIED TIMESTAMP NOT NULL +, MODIFIER VARCHAR(255)BINARY NOT NULL +, PUBLISHSTATUS INTEGER +, ORIGINATOR INTEGER +, PRIMARY KEY ( DOCID ) +) ENGINE=InnoDB +; +CREATE INDEX DDOCTYPEID_IDX ON t2 (DOCTYPEID); +CREATE INDEX DFOLDERID_IDX ON t2 (FOLDERID); +CREATE TABLE t3 +( +FOLDERID VARCHAR(32)BINARY NOT NULL +, FOLDERNAME VARCHAR(255)BINARY NOT NULL +, CREATOR VARCHAR(255)BINARY +, CREATED TIMESTAMP NOT NULL +, DESCRIPTION VARCHAR(255)BINARY +, FOLDERTYPE INTEGER NOT NULL +, MODIFIED TIMESTAMP +, MODIFIER VARCHAR(255)BINARY +, FOLDERSIZE INTEGER NOT NULL +, PARENTID VARCHAR(32)BINARY +, REPID VARCHAR(32)BINARY +, ORIGINATOR INTEGER +, PRIMARY KEY ( FOLDERID ) +) ENGINE=InnoDB; +CREATE INDEX FFOLDERID_IDX ON t3 (FOLDERID); +CREATE INDEX CMFLDRPARNT_IDX ON t3 (PARENTID); +CREATE TABLE t4 +( +DOCTYPEID VARCHAR(32)BINARY NOT NULL +, DOCTYPENAME VARCHAR(80)BINARY NOT NULL +, DESCRIPTION VARCHAR(255)BINARY +, EXTNDATA LONGBLOB +, MODIFIED TIMESTAMP +, MODIFIER VARCHAR(255)BINARY +, ORIGINATOR INTEGER +, PRIMARY KEY ( DOCTYPEID ) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES("c373e9f59cf15a6c3e57444553544200", "c373e9f59cf15a6c3e57444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-06 07:48:42", NULL, NULL, NULL, "2003-06-06 07:48:42", "2003-06-06 07:48:42", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-06 07:48:42", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5a472f43ba45e444553544200", "c373e9f5a472f43ba45e444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-07 18:50:12", NULL, NULL, NULL, "2003-06-07 18:50:12", "2003-06-07 18:50:12", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-07 18:50:12", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5a4a0f56014eb444553544200", "c373e9f5a4a0f56014eb444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-07 19:39:26", NULL, NULL, NULL, "2003-06-07 19:39:26", "2003-06-07 19:39:26", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-07 19:39:26", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5a4a0f8fa4a86444553544200", "c373e9f5a4a0f8fa4a86444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-07 19:43:05", NULL, NULL, NULL, "2003-06-07 19:43:05", "2003-06-07 19:43:05", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-07 19:43:05", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5ac7b537205ce444553544200", "c373e9f5ac7b537205ce444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-09 08:15:24", NULL, NULL, NULL, "2003-06-09 08:15:24", "2003-06-09 08:15:24", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-09 08:15:24", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5ad0792012454444553544200", "c373e9f5ad0792012454444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-09 10:51:44", NULL, NULL, NULL, "2003-06-09 10:51:44", "2003-06-09 10:51:44", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-09 10:51:44", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5ad079821ef34444553544200", "First Discussion", "c373e9f5ad079174ff17444553544200", "c373e9f5ad0796c0eca4444553544200", "Goldilocks", "2003-06-09 11:16:50", "Title: First Discussion", NULL, NULL, "2003-06-09 10:51:26", "2003-06-09 10:51:26", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-09 11:16:50", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5ad07993f3859444553544200", "Last Discussion", "c373e9f5ad079174ff17444553544200", "c373e9f5ad0796c0eca4444553544200", "Goldilocks", "2003-06-09 11:21:06", "Title: Last Discussion", NULL, "Setting new abstract and keeping doc checked out", "2003-06-09 10:51:26", "2003-06-09 10:51:26", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-09 11:21:06", "admin", "0", NULL); +INSERT INTO t2 VALUES("c373e9f5ad079a3219c4444553544200", "testdoclayout", "340d243c45f111d497b00010a4ef934d", "c373e9f5ad0796c0eca4444553544200", "Goldilocks", "2003-06-09 11:25:31", "Title: Test doc layout", "Subtitle: test doc layout", NULL, "2003-06-09 10:51:27", "2003-06-09 10:51:27", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-09 11:25:31", "admin", "0", NULL); +INSERT INTO t3 VALUES("0c9aab05b15048c59bc35c8461507deb", "System", "System", "2003-06-05 16:30:00", "The system content repository folder.", "3", "2003-06-05 16:30:00", "System", "0", NULL, "9c9aab05b15048c59bc35c8461507deb", "1"); +INSERT INTO t3 VALUES("2f6161e879db43c1a5b82c21ddc49089", "Default", "System", "2003-06-09 10:52:02", "The default content repository folder.", "3", "2003-06-05 16:30:00", "System", "0", NULL, "03eea05112b845949f3fd03278b5fe43", "1"); +INSERT INTO t3 VALUES("c373e9f5ad0791724315444553544200", "AddDocumentTest", "admin", "2003-06-09 10:51:25", "Movie Reviews", "0", "2003-06-09 10:51:25", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad07919e1963444553544200", "NewDestDirectory", "admin", "2003-06-09 10:51:28", "Adding new directory", "128", "2003-06-09 10:51:28", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad07919fe525444553544200", "SubDestDirectory", "admin", "2003-06-09 10:51:28", "Adding new directory", "128", "2003-06-09 10:51:28", "admin", "0", "c373e9f5ad07919e1963444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791a0dab5444553544200", "Level1", "admin", "2003-06-09 10:51:29", NULL, "0", "2003-06-09 10:51:29", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791a14669444553544200", "Level2", "admin", "2003-06-09 10:51:29", NULL, "0", "2003-06-09 10:51:29", "admin", "0", "c373e9f5ad0791a0dab5444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791a23c0e444553544200", "Level3", "admin", "2003-06-09 10:51:29", NULL, "0", "2003-06-09 10:51:29", "admin", "0", "c373e9f5ad0791a14669444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791a6b11f444553544200", "Dir1", "admin", "2003-06-09 10:51:30", NULL, "0", "2003-06-09 10:51:30", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791a897d6444553544200", "Dir2", "admin", "2003-06-09 10:51:30", NULL, "0", "2003-06-09 10:51:30", "admin", "0", "c373e9f5ad0791a6b11f444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791a9a063444553544200", "NewDestDirectory", "admin", "2003-06-09 10:51:31", NULL, "0", "2003-06-09 10:51:31", "admin", "0", "c373e9f5ad0791a897d6444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791aa73e3444553544200", "LevelA", "admin", "2003-06-09 10:51:31", NULL, "0", "2003-06-09 10:51:31", "admin", "0", "c373e9f5ad0791a0dab5444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791ab034b444553544200", "LevelB", "admin", "2003-06-09 10:51:31", NULL, "0", "2003-06-09 10:51:31", "admin", "0", "c373e9f5ad0791aa73e3444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791ac7311444553544200", "LevelC", "admin", "2003-06-09 10:51:32", NULL, "0", "2003-06-09 10:51:32", "admin", "0", "c373e9f5ad0791ab034b444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791ad66cf444553544200", "test2", "admin", "2003-06-09 10:51:32", NULL, "0", "2003-06-09 10:51:32", "admin", "0", "c373e9f5ad0791724315444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791aebd87444553544200", "test3", "admin", "2003-06-09 10:51:33", NULL, "0", "2003-06-09 10:51:33", "admin", "0", "c373e9f5ad0791ad66cf444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0791dbaac4444553544200", "Special Café Folder", "admin", "2003-06-09 10:51:43", "test folder names with special chars", "0", "2003-06-09 10:51:43", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0796bf913f444553544200", "CopiedFolder", "admin", "2003-06-09 11:09:05", "Movie Reviews", "0", "2003-06-09 11:09:05", "admin", "0", "c373e9f5ad0791a23c0e444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0796c0eca4444553544200", "Movie Reviews", "admin", "2003-06-09 11:09:13", "Movie Reviews", "0", "2003-06-09 11:09:13", "admin", "33", "c373e9f5ad0796bf913f444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad0796d9b895444553544200", "NewBookFolder", "admin", "2003-06-09 11:12:41", "NewBooks - folder", "0", "2003-06-09 11:12:41", "admin", "0", "c373e9f5ad0796c0eca4444553544200", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t3 VALUES("c373e9f5ad079b4c9355444553544200", "CopiedFolder", "admin", "2003-06-09 11:26:34", "Movie Reviews", "0", "2003-06-09 11:26:34", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +INSERT INTO t4 VALUES("340d243c45f111d497b00010a4ef934d", "Document Layout", "The system Document Layouts Document Type", NULL, "2003-06-05 16:30:00", "System", "1"); +INSERT INTO t4 VALUES("340d243d45f111d497b00010a4ef934d", "Default", "The default system Document Type", NULL, "2003-06-05 16:30:00", "System", "1"); +INSERT INTO t4 VALUES("4d09dd60850711d4998a204c4f4f5020", "__SystemResourceType", "The type for all the uploaded resources", NULL, "2003-06-05 16:30:00", "System", "1"); +INSERT INTO t4 VALUES("91d4d595478211d497b40010a4ef934d", "__PmcSystemDefaultType", "The type for all the default available fields", NULL, "2003-06-05 16:30:00", "System", "1"); +INSERT INTO t4 VALUES("c373e9f59cf15a59b08a444553544200", "NoFieldDocType", "plain doc type", NULL, "2003-06-06 07:48:40", "admin", NULL); +INSERT INTO t4 VALUES("c373e9f59cf15a5c6a99444553544200", "Movie Review", "This doc type is for movie reviews", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<props autocheckin=\"false\" autopublish=\"false\" binary=\"choice\" categories=\"none\" cleanup=\"false\" folder=\"none\"><![CDATA[Doc type for cm tests]]></props>\r\n", "2003-06-06 07:48:40", "admin", NULL); +INSERT INTO t4 VALUES("c373e9f59cf15a6116a5444553544200", "Special DocÃu20A4u20A4u0113ééøÉu016BType", "test special chars xxxé in doc type", NULL, "2003-06-06 07:48:41", "admin", NULL); +INSERT INTO t4 VALUES("c373e9f59cf15a695d47444553544200", "Movie", NULL, NULL, "2003-06-06 07:48:41", "admin", NULL); +INSERT INTO t4 VALUES("c373e9f5ad079174ff17444553544200", "Discussion", NULL, NULL, "2003-06-09 10:51:25", "admin", NULL); +INSERT INTO t4 VALUES("c373e9f5ad0791da7e2b444553544200", "Books", "list of recommended books", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<props autocheckin=\"false\" autopublish=\"false\" binary=\"choice\" categories=\"none\" cleanup=\"false\" folder=\"none\"><![CDATA[Doc type for cm tests]]><![CDATA[Doc type for book tests]]></props>\r\n", "2003-06-09 10:51:40", "admin", NULL); +ALTER TABLE t2 ADD FOREIGN KEY FK_DCMNTS_DCTYPES ( DOCTYPEID) +REFERENCES t4 (DOCTYPEID ); +ALTER TABLE t2 ADD FOREIGN KEY FK_DCMNTS_FLDRS ( FOLDERID) +REFERENCES t3 (FOLDERID ); +ALTER TABLE t3 ADD FOREIGN KEY FK_FLDRS_PRNTID ( PARENTID) +REFERENCES t3 (FOLDERID ); +SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion'; +DOCID DOCNAME DOCTYPEID FOLDERID AUTHOR CREATED TITLE SUBTITLE DOCABSTRACT PUBLISHDATE EXPIRATIONDATE LOCKEDBY STATUS PARENTDOCID REPID MODIFIED MODIFIER PUBLISHSTATUS ORIGINATOR DOCTYPENAME CONTENTSIZE MIMETYPE +c373e9f5ad07993f3859444553544200 Last Discussion c373e9f5ad079174ff17444553544200 c373e9f5ad0796c0eca4444553544200 Goldilocks 2003-06-09 11:21:06 Title: Last Discussion NULL Setting new abstract and keeping doc checked out 2003-06-09 10:51:26 2003-06-09 10:51:26 NULL NULL NULL 03eea05112b845949f3fd03278b5fe43 2003-06-09 11:21:06 admin 0 NULL Discussion NULL NULL +EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion'; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found +1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where +1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1 +2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/subselect_gis.result b/mysql-test/r/subselect_gis.result new file mode 100644 index 00000000000..34ab7748656 --- /dev/null +++ b/mysql-test/r/subselect_gis.result @@ -0,0 +1,8 @@ +drop table if exists t1; +create table t1(City VARCHAR(30),Location geometry); +insert into t1 values("Paris",GeomFromText('POINT(2.33 48.87)')); +select City from t1 where (select +intersects(GeomFromText(AsText(Location)),GeomFromText('Polygon((2 50, 2.5 +50, 2.5 47, 2 47, 2 50))'))=0); +City +drop table t1; diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result new file mode 100644 index 00000000000..bbbc607b6f8 --- /dev/null +++ b/mysql-test/r/subselect_innodb.result @@ -0,0 +1,108 @@ +drop table if exists t1,t2,t3; +CREATE TABLE t1 +( +FOLDERID VARCHAR(32)BINARY NOT NULL +, FOLDERNAME VARCHAR(255)BINARY NOT NULL +, CREATOR VARCHAR(255)BINARY +, CREATED TIMESTAMP NOT NULL +, DESCRIPTION VARCHAR(255)BINARY +, FOLDERTYPE INTEGER NOT NULL +, MODIFIED TIMESTAMP +, MODIFIER VARCHAR(255)BINARY +, FOLDERSIZE INTEGER NOT NULL +, PARENTID VARCHAR(32)BINARY +, REPID VARCHAR(32)BINARY +, ORIGINATOR INTEGER +, PRIMARY KEY ( FOLDERID ) +) ENGINE=InnoDB; +CREATE INDEX FFOLDERID_IDX ON t1 (FOLDERID); +CREATE INDEX CMFLDRPARNT_IDX ON t1 (PARENTID); +INSERT INTO t1 VALUES("0c9aab05b15048c59bc35c8461507deb", "System", "System", "2003-06-05 16:30:00", "The system content repository folder.", "3", "2003-06-05 16:30:00", "System", "0", NULL, "9c9aab05b15048c59bc35c8461507deb", "1"); +INSERT INTO t1 VALUES("2f6161e879db43c1a5b82c21ddc49089", "Default", "System", "2003-06-09 10:52:02", "The default content repository folder.", "3", "2003-06-05 16:30:00", "System", "0", NULL, "03eea05112b845949f3fd03278b5fe43", "1"); +INSERT INTO t1 VALUES("c373e9f5ad0791724315444553544200", "AddDocumentTest", "admin", "2003-06-09 10:51:25", "Movie Reviews", "0", "2003-06-09 10:51:25", "admin", "0", "2f6161e879db43c1a5b82c21ddc49089", "03eea05112b845949f3fd03278b5fe43", NULL); +SELECT 'c373e9f5ad0791a0dab5444553544200' IN(SELECT t1.FOLDERID FROM t1 WHERE t1.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t1.FOLDERNAME = 'Level1'); +'c373e9f5ad0791a0dab5444553544200' IN(SELECT t1.FOLDERID FROM t1 WHERE t1.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t1.FOLDERNAME = 'Level1') +0 +drop table t1; +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=innodb; +create table t3 (a int) engine=innodb; +insert into t1 values (1),(2),(3),(4); +insert into t2 values (10),(20),(30),(40); +insert into t3 values (1),(2),(10),(50); +select a from t3 where t3.a in (select a from t1 where a <= 3 union select * from t2 where a <= 30); +a +1 +2 +10 +drop table t1,t2,t3; +CREATE TABLE t1 ( +processor_id INTEGER NOT NULL, +PRIMARY KEY (processor_id) +) ENGINE=InnoDB; +CREATE TABLE t3 ( +yod_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, +login_processor INTEGER UNSIGNED , +PRIMARY KEY (yod_id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +processor_id INTEGER NOT NULL, +yod_id BIGINT UNSIGNED NOT NULL, +PRIMARY KEY (processor_id, yod_id), +INDEX (processor_id), +INDEX (yod_id), +FOREIGN KEY (processor_id) REFERENCES t1(processor_id), +FOREIGN KEY (yod_id) REFERENCES t3(yod_id) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t3 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +SELECT distinct p1.processor_id, (SELECT y.yod_id FROM t1 p2, t2 y WHERE p2.processor_id = p1.processor_id and p2.processor_id = y.processor_id) FROM t1 p1; +processor_id (SELECT y.yod_id FROM t1 p2, t2 y WHERE p2.processor_id = p1.processor_id and p2.processor_id = y.processor_id) +1 1 +2 2 +3 3 +drop table t2,t1,t3; +CREATE TABLE t1 ( +id int(11) NOT NULL default '0', +b int(11) default NULL, +c char(3) default NULL, +PRIMARY KEY (id), +KEY t2i1 (b) +) ENGINE=innodb DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL'); +CREATE TABLE t2 ( +id int(11) NOT NULL default '0', +b int(11) default NULL, +c char(3) default NULL, +PRIMARY KEY (id), +KEY t2i (b) +) ENGINE=innodb DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL'); +select (select max(id) from t2 where b=1 group by b) as x,b from t1 where b=1; +x b +2 1 +drop table t1,t2; +create table t1 (id int not null, value char(255), primary key(id)) engine=innodb; +create table t2 (id int not null, value char(255)) engine=innodb; +insert into t1 values (1,'a'),(2,'b'); +insert into t2 values (1,'z'),(2,'x'); +select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2; +id value (select t1.value from t1 where t1.id=t2.id) +1 z a +2 x b +select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2; +id value (select t1.value from t1 where t1.id=t2.id) +1 z a +2 x b +drop table t1,t2; +create table t1 (a int, b int) engine=innodb; +insert into t1 values (1,2), (1,3), (2,3), (2,4), (2,5), (3,4), (4,5), (4,100); +create table t2 (a int) engine=innodb; +insert into t2 values (1),(2),(3),(4); +select a, sum(b) as b from t1 group by a having b > (select max(a) from t2); +a b +1 5 +2 12 +4 105 +drop table t1, t2; diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index d07a8613883..08d75d8b562 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -40,7 +40,7 @@ t9 CREATE TABLE `t9` ( `b` char(16) NOT NULL default '', `c` int(11) NOT NULL default '0', PRIMARY KEY (`a`) -) TYPE=MyISAM DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' alter table t9 rename t8, add column d int not null; alter table t8 rename t7; rename table t7 to t9; @@ -62,25 +62,25 @@ t9 CREATE TABLE `t9` ( `c` int(11) NOT NULL default '0', `d` int(11) NOT NULL default '0', PRIMARY KEY (`a`) -) TYPE=MyISAM DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' drop database mysqltest; -create table t1 (a int not null) type=myisam; +create table t1 (a int not null) engine=myisam; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 add b int; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` int(11) default NULL -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` int(11) default NULL -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/synchronization.result b/mysql-test/r/synchronization.result new file mode 100644 index 00000000000..ad9443c86da --- /dev/null +++ b/mysql-test/r/synchronization.result @@ -0,0 +1,162 @@ +CREATE TABLE t1 (x1 int); + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x1 x2 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; + ALTER TABLE t1 CHANGE x2 x1 int; +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `xx` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 59cb6c38a59..ebb24159373 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -3,77 +3,86 @@ Tables_in_db columns_priv db func +help_category +help_keyword +help_relation +help_topic host tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type user show create table db; Table Create Table db CREATE TABLE `db` ( - `Host` char(60) binary NOT NULL default '', - `Db` char(64) binary NOT NULL default '', - `User` char(16) binary NOT NULL default '', - `Select_priv` enum('N','Y') NOT NULL default 'N', - `Insert_priv` enum('N','Y') NOT NULL default 'N', - `Update_priv` enum('N','Y') NOT NULL default 'N', - `Delete_priv` enum('N','Y') NOT NULL default 'N', - `Create_priv` enum('N','Y') NOT NULL default 'N', - `Drop_priv` enum('N','Y') NOT NULL default 'N', - `Grant_priv` enum('N','Y') NOT NULL default 'N', - `References_priv` enum('N','Y') NOT NULL default 'N', - `Index_priv` enum('N','Y') NOT NULL default 'N', - `Alter_priv` enum('N','Y') NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') NOT NULL default 'N', + `Host` char(60) collate utf8_bin NOT NULL default '', + `Db` char(64) collate utf8_bin NOT NULL default '', + `User` char(16) collate utf8_bin NOT NULL default '', + `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`,`User`), KEY `User` (`User`) -) TYPE=MyISAM COMMENT='Database privileges' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges' show create table host; Table Create Table host CREATE TABLE `host` ( - `Host` char(60) binary NOT NULL default '', - `Db` char(64) binary NOT NULL default '', - `Select_priv` enum('N','Y') NOT NULL default 'N', - `Insert_priv` enum('N','Y') NOT NULL default 'N', - `Update_priv` enum('N','Y') NOT NULL default 'N', - `Delete_priv` enum('N','Y') NOT NULL default 'N', - `Create_priv` enum('N','Y') NOT NULL default 'N', - `Drop_priv` enum('N','Y') NOT NULL default 'N', - `Grant_priv` enum('N','Y') NOT NULL default 'N', - `References_priv` enum('N','Y') NOT NULL default 'N', - `Index_priv` enum('N','Y') NOT NULL default 'N', - `Alter_priv` enum('N','Y') NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') NOT NULL default 'N', + `Host` char(60) collate utf8_bin NOT NULL default '', + `Db` char(64) collate utf8_bin NOT NULL default '', + `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`) -) TYPE=MyISAM COMMENT='Host privileges; Merged with database privileges' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges' show create table user; Table Create Table user CREATE TABLE `user` ( - `Host` varchar(60) binary NOT NULL default '', - `User` varchar(16) binary NOT NULL default '', - `Password` varchar(16) binary NOT NULL default '', - `Select_priv` enum('N','Y') NOT NULL default 'N', - `Insert_priv` enum('N','Y') NOT NULL default 'N', - `Update_priv` enum('N','Y') NOT NULL default 'N', - `Delete_priv` enum('N','Y') NOT NULL default 'N', - `Create_priv` enum('N','Y') NOT NULL default 'N', - `Drop_priv` enum('N','Y') NOT NULL default 'N', - `Reload_priv` enum('N','Y') NOT NULL default 'N', - `Shutdown_priv` enum('N','Y') NOT NULL default 'N', - `Process_priv` enum('N','Y') NOT NULL default 'N', - `File_priv` enum('N','Y') NOT NULL default 'N', - `Grant_priv` enum('N','Y') NOT NULL default 'N', - `References_priv` enum('N','Y') NOT NULL default 'N', - `Index_priv` enum('N','Y') NOT NULL default 'N', - `Alter_priv` enum('N','Y') NOT NULL default 'N', - `Show_db_priv` enum('N','Y') NOT NULL default 'N', - `Super_priv` enum('N','Y') NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') NOT NULL default 'N', - `Execute_priv` enum('N','Y') NOT NULL default 'N', - `Repl_slave_priv` enum('N','Y') NOT NULL default 'N', - `Repl_client_priv` enum('N','Y') NOT NULL default 'N', - `ssl_type` enum('','ANY','X509','SPECIFIED') NOT NULL default '', + `Host` varchar(60) collate utf8_bin NOT NULL default '', + `User` varchar(16) collate utf8_bin NOT NULL default '', + `Password` varchar(41) collate utf8_bin NOT NULL default '', + `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Reload_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Shutdown_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Process_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `File_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Show_db_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Super_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Repl_slave_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Repl_client_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `ssl_type` enum('','ANY','X509','SPECIFIED') collate utf8_bin NOT NULL default '', `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, @@ -81,39 +90,41 @@ user CREATE TABLE `user` ( `max_updates` int(11) unsigned NOT NULL default '0', `max_connections` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`Host`,`User`) -) TYPE=MyISAM COMMENT='Users and global privileges' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; Table Create Table func CREATE TABLE `func` ( - `name` char(64) binary NOT NULL default '', + `name` char(64) collate utf8_bin NOT NULL default '', `ret` tinyint(1) NOT NULL default '0', - `dl` char(128) NOT NULL default '', - `type` enum('function','aggregate') NOT NULL default 'function', + `dl` char(128) collate utf8_bin NOT NULL default '', + `type` enum('function','aggregate') collate utf8_bin NOT NULL default 'function', PRIMARY KEY (`name`) -) TYPE=MyISAM COMMENT='User defined functions' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions' show create table tables_priv; Table Create Table tables_priv CREATE TABLE `tables_priv` ( - `Host` char(60) binary NOT NULL default '', - `Db` char(64) binary NOT NULL default '', - `User` char(16) binary NOT NULL default '', - `Table_name` char(64) binary NOT NULL default '', - `Grantor` char(77) NOT NULL default '', - `Timestamp` timestamp(14) NOT NULL, - `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') NOT NULL default '', - `Column_priv` set('Select','Insert','Update','References') NOT NULL default '', + `Host` char(60) collate utf8_bin NOT NULL default '', + `Db` char(64) collate utf8_bin NOT NULL default '', + `User` char(16) collate utf8_bin NOT NULL default '', + `Table_name` char(64) collate utf8_bin NOT NULL default '', + `Grantor` char(77) collate utf8_bin NOT NULL default '', + `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') collate utf8_bin NOT NULL default '', + `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), KEY `Grantor` (`Grantor`) -) TYPE=MyISAM COMMENT='Table privileges' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges' show create table columns_priv; Table Create Table columns_priv CREATE TABLE `columns_priv` ( - `Host` char(60) binary NOT NULL default '', - `Db` char(64) binary NOT NULL default '', - `User` char(16) binary NOT NULL default '', - `Table_name` char(64) binary NOT NULL default '', - `Column_name` char(64) binary NOT NULL default '', - `Timestamp` timestamp(14) NOT NULL, - `Column_priv` set('Select','Insert','Update','References') NOT NULL default '', + `Host` char(60) collate utf8_bin NOT NULL default '', + `Db` char(64) collate utf8_bin NOT NULL default '', + `User` char(16) collate utf8_bin NOT NULL default '', + `Table_name` char(64) collate utf8_bin NOT NULL default '', + `Column_name` char(64) collate utf8_bin NOT NULL default '', + `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) -) TYPE=MyISAM COMMENT='Column privileges' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' +show tables; +Tables_in_test diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 7c8d10cf0a6..10c0a2e3652 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -21,12 +21,12 @@ a b 4 e 5 f 6 g -create TEMPORARY TABLE t2 type=heap select * from t1; -create TEMPORARY TABLE IF NOT EXISTS t2 (a int) type=heap; +create TEMPORARY TABLE t2 engine=heap select * from t1; +create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap; CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); -Table 't1' already exists +ERROR 42S01: Table 't1' already exists ALTER TABLE t1 RENAME t2; -Table 't2' already exists +ERROR 42S01: Table 't2' already exists select * from t2; a b 4 e @@ -48,7 +48,6 @@ c d e 3 b 2 drop table t1; drop table t1; -drop table if exists t1; CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255)); INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1'); SELECT CONCAT_WS(pkCrash, strCrash) FROM t1; @@ -75,12 +74,11 @@ drop table t1,t2; create temporary table t1 (a int not null); insert into t1 values (1),(1); alter table t1 add primary key (a); -Duplicate entry '1' for key 1 +ERROR 23000: Duplicate entry '1' for key 1 drop table t1; -drop table if exists t1; CREATE TABLE t1 ( d datetime default NULL -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'); flush status; select * from t1 group by d; diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result index 15f0d4121c7..10944c3706e 100644 --- a/mysql-test/r/timezone.result +++ b/mysql-test/r/timezone.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS t1; -show variables like "timezone"; +show variables like "system_time_zone"; Variable_name Value -timezone MET +system_time_zone MET select @a:=FROM_UNIXTIME(1); @a:=FROM_UNIXTIME(1) 1970-01-01 01:00:01 @@ -32,6 +32,13 @@ ts from_unixtime(ts) 1048989599 2003-03-30 03:59:59 1048989601 2003-03-30 04:00:01 DROP TABLE t1; +CREATE TABLE t1 (ts timestamp); +INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'), +('2003-03-30 02:59:59'), +('2003-03-30 03:00:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +DROP TABLE t1; select unix_timestamp('1970-01-01 01:00:00'), unix_timestamp('1970-01-01 01:00:01'), unix_timestamp('2038-01-01 00:59:59'), diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result new file mode 100644 index 00000000000..02406b77a65 --- /dev/null +++ b/mysql-test/r/timezone2.result @@ -0,0 +1,253 @@ +drop table if exists t1; +create table t1 (ts timestamp); +set time_zone='+00:00'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()) +0 +insert into t1 (ts) values ('2003-03-30 02:30:00'); +set time_zone='+10:30'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()) +-37800 +insert into t1 (ts) values ('2003-03-30 02:30:00'); +set time_zone='-10:00'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()) +36000 +insert into t1 (ts) values ('2003-03-30 02:30:00'); +select * from t1; +ts +2003-03-29 16:30:00 +2003-03-29 06:00:00 +2003-03-30 02:30:00 +drop table t1; +select Name from mysql.time_zone_name where Name in +('UTC','Universal','MET','Europe/Moscow','leap/Europe/Moscow'); +Name +Europe/Moscow +leap/Europe/Moscow +MET +Universal +UTC +create table t1 (i int, ts timestamp); +set time_zone='MET'; +insert into t1 (i, ts) values +(unix_timestamp('2003-03-01 00:00:00'),'2003-03-01 00:00:00'); +insert into t1 (i, ts) values +(unix_timestamp('2003-03-30 01:59:59'),'2003-03-30 01:59:59'), +(unix_timestamp('2003-03-30 02:30:00'),'2003-03-30 02:30:00'), +(unix_timestamp('2003-03-30 03:00:00'),'2003-03-30 03:00:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +insert into t1 (i, ts) values +(unix_timestamp('2003-05-01 00:00:00'),'2003-05-01 00:00:00'); +insert into t1 (i, ts) values +(unix_timestamp('2003-10-26 01:00:00'),'2003-10-26 01:00:00'), +(unix_timestamp('2003-10-26 02:00:00'),'2003-10-26 02:00:00'), +(unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'), +(unix_timestamp('2003-10-26 04:00:00'),'2003-10-26 04:00:00'), +(unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'); +set time_zone='UTC'; +select * from t1; +i ts +1046473200 2003-02-28 23:00:00 +1048985999 2003-03-30 00:59:59 +1048986000 2003-03-30 01:00:00 +1048986000 2003-03-30 01:00:00 +1051740000 2003-04-30 22:00:00 +1067122800 2003-10-25 23:00:00 +1067126400 2003-10-26 00:00:00 +1067129999 2003-10-26 00:59:59 +1067137200 2003-10-26 03:00:00 +1067129999 2003-10-26 00:59:59 +delete from t1; +set time_zone='Europe/Moscow'; +insert into t1 (i, ts) values +(unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'), +(unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'), +(unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'), +(unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +select * from t1; +i ts +1072904400 2004-01-01 00:00:00 +1080428400 2004-03-28 03:00:00 +1091304000 2003-08-01 00:00:00 +1099175400 2004-10-31 02:30:00 +delete from t1; +set time_zone='leap/Europe/Moscow'; +insert into t1 (i, ts) values +(unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'), +(unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'), +(unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'), +(unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +select * from t1; +i ts +1072904422 2004-01-01 00:00:00 +1080428422 2004-03-28 03:00:00 +1091304022 2003-08-01 00:00:00 +1099175422 2004-10-31 02:30:00 +delete from t1; +insert into t1 (i, ts) values +(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), +(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); +select * from t1; +i ts +362793608 1981-07-01 03:59:59 +362793610 1981-07-01 04:00:00 +select from_unixtime(362793609); +from_unixtime(362793609) +1981-07-01 03:59:60 +drop table t1; +create table t1 (ts timestamp); +set time_zone='UTC'; +insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'), +('1970-01-01 00:00:00'),('1970-01-01 00:00:01'), +('2037-12-31 23:59:59'),('2038-01-01 00:00:00'); +Warnings: +Warning 1264 Data truncated; out of range for column 'ts' at row 2 +Warning 1264 Data truncated; out of range for column 'ts' at row 3 +Warning 1264 Data truncated; out of range for column 'ts' at row 6 +select * from t1; +ts +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +1970-01-01 00:00:01 +2037-12-31 23:59:59 +0000-00-00 00:00:00 +delete from t1; +set time_zone='MET'; +insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'), +('1970-01-01 01:00:00'),('1970-01-01 01:00:01'), +('2038-01-01 00:59:59'),('2038-01-01 01:00:00'); +Warnings: +Warning 1264 Data truncated; out of range for column 'ts' at row 2 +Warning 1264 Data truncated; out of range for column 'ts' at row 3 +Warning 1264 Data truncated; out of range for column 'ts' at row 6 +select * from t1; +ts +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +1970-01-01 01:00:01 +2038-01-01 00:59:59 +0000-00-00 00:00:00 +delete from t1; +set time_zone='+01:30'; +insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'), +('1970-01-01 01:30:00'),('1970-01-01 01:30:01'), +('2038-01-01 01:29:59'),('2038-01-01 01:30:00'); +Warnings: +Warning 1264 Data truncated; out of range for column 'ts' at row 2 +Warning 1264 Data truncated; out of range for column 'ts' at row 3 +Warning 1264 Data truncated; out of range for column 'ts' at row 6 +select * from t1; +ts +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +1970-01-01 01:30:01 +2038-01-01 01:29:59 +0000-00-00 00:00:00 +drop table t1; +show variables like 'time_zone'; +Variable_name Value +time_zone +01:30 +set time_zone = default; +show variables like 'time_zone'; +Variable_name Value +time_zone SYSTEM +set time_zone= '0'; +ERROR HY000: Unknown or incorrect time zone: '0' +set time_zone= '0:0'; +ERROR HY000: Unknown or incorrect time zone: '0:0' +set time_zone= '-20:00'; +ERROR HY000: Unknown or incorrect time zone: '-20:00' +set time_zone= '+20:00'; +ERROR HY000: Unknown or incorrect time zone: '+20:00' +set time_zone= 'Some/Unknown/Time/Zone'; +ERROR HY000: Unknown or incorrect time zone: 'Some/Unknown/Time/Zone' +select convert_tz(now(),'UTC', 'Universal') = now(); +convert_tz(now(),'UTC', 'Universal') = now() +1 +select convert_tz(now(),'utc', 'UTC') = now(); +convert_tz(now(),'utc', 'UTC') = now() +1 +select convert_tz('1917-11-07 12:00:00', 'MET', 'UTC'); +convert_tz('1917-11-07 12:00:00', 'MET', 'UTC') +1917-11-07 12:00:00 +select convert_tz('1970-01-01 01:00:00', 'MET', 'UTC'); +convert_tz('1970-01-01 01:00:00', 'MET', 'UTC') +1970-01-01 01:00:00 +select convert_tz('1970-01-01 01:00:01', 'MET', 'UTC'); +convert_tz('1970-01-01 01:00:01', 'MET', 'UTC') +1970-01-01 00:00:01 +select convert_tz('2003-03-01 00:00:00', 'MET', 'UTC'); +convert_tz('2003-03-01 00:00:00', 'MET', 'UTC') +2003-02-28 23:00:00 +select convert_tz('2003-03-30 01:59:59', 'MET', 'UTC'); +convert_tz('2003-03-30 01:59:59', 'MET', 'UTC') +2003-03-30 00:59:59 +select convert_tz('2003-03-30 02:30:00', 'MET', 'UTC'); +convert_tz('2003-03-30 02:30:00', 'MET', 'UTC') +2003-03-30 01:00:00 +select convert_tz('2003-03-30 03:00:00', 'MET', 'UTC'); +convert_tz('2003-03-30 03:00:00', 'MET', 'UTC') +2003-03-30 01:00:00 +select convert_tz('2003-05-01 00:00:00', 'MET', 'UTC'); +convert_tz('2003-05-01 00:00:00', 'MET', 'UTC') +2003-04-30 22:00:00 +select convert_tz('2003-10-26 01:00:00', 'MET', 'UTC'); +convert_tz('2003-10-26 01:00:00', 'MET', 'UTC') +2003-10-25 23:00:00 +select convert_tz('2003-10-26 02:00:00', 'MET', 'UTC'); +convert_tz('2003-10-26 02:00:00', 'MET', 'UTC') +2003-10-26 00:00:00 +select convert_tz('2003-10-26 02:59:59', 'MET', 'UTC'); +convert_tz('2003-10-26 02:59:59', 'MET', 'UTC') +2003-10-26 00:59:59 +select convert_tz('2003-10-26 04:00:00', 'MET', 'UTC'); +convert_tz('2003-10-26 04:00:00', 'MET', 'UTC') +2003-10-26 03:00:00 +select convert_tz('2038-01-01 00:59:59', 'MET', 'UTC'); +convert_tz('2038-01-01 00:59:59', 'MET', 'UTC') +2037-12-31 23:59:59 +select convert_tz('2038-01-01 01:00:00', 'MET', 'UTC'); +convert_tz('2038-01-01 01:00:00', 'MET', 'UTC') +2038-01-01 01:00:00 +select convert_tz('2103-01-01 04:00:00', 'MET', 'UTC'); +convert_tz('2103-01-01 04:00:00', 'MET', 'UTC') +2103-01-01 04:00:00 +create table t1 (tz varchar(3)); +insert into t1 (tz) values ('MET'), ('UTC'); +select tz, convert_tz('2003-12-31 00:00:00',tz,'UTC'), convert_tz('2003-12-31 00:00:00','UTC',tz) from t1 order by tz; +tz convert_tz('2003-12-31 00:00:00',tz,'UTC') convert_tz('2003-12-31 00:00:00','UTC',tz) +MET 2003-12-30 23:00:00 2003-12-31 01:00:00 +UTC 2003-12-31 00:00:00 2003-12-31 00:00:00 +drop table t1; +select convert_tz('2003-12-31 04:00:00', NULL, 'UTC'); +convert_tz('2003-12-31 04:00:00', NULL, 'UTC') +NULL +select convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC'); +convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC') +NULL +select convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone'); +convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone') +NULL +select convert_tz('2003-12-31 04:00:00', 'MET', NULL); +convert_tz('2003-12-31 04:00:00', 'MET', NULL) +NULL +select convert_tz( NULL, 'MET', 'UTC'); +convert_tz( NULL, 'MET', 'UTC') +NULL +create table t1 (ts timestamp); +set timestamp=1000000000; +insert into t1 (ts) values (now()); +select convert_tz(ts, @@time_zone, 'Japan') from t1; +convert_tz(ts, @@time_zone, 'Japan') +2001-09-09 10:46:40 +drop table t1; diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result index fef15533738..74a6cb72cc6 100644 --- a/mysql-test/r/truncate.result +++ b/mysql-test/r/truncate.result @@ -14,7 +14,7 @@ select * from t1; a b c1 drop table t1; select count(*) from t1; -Table 'test.t1' doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist create temporary table t1 (n int); insert into t1 values (1),(2),(3); truncate table t1; @@ -22,7 +22,7 @@ select * from t1; n drop table t1; truncate non_existing_table; -Table 'test.non_existing_table' doesn't exist +ERROR 42S02: Table 'test.non_existing_table' doesn't exist create table t1 (a integer auto_increment primary key); insert into t1 (a) values (NULL),(NULL); truncate table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 685301f3639..95bba1d4ec7 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -1,4 +1,36 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7; +CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000)); +show columns from t1; +Field Type Null Key Default Extra +a blob YES NULL +b text YES NULL +c blob YES NULL +d mediumtext YES NULL +e longtext YES NULL +CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000)); +Warnings: +Warning 1246 Converting column 'a' from CHAR to TEXT +Warning 1246 Converting column 'b' from CHAR to BLOB +Warning 1246 Converting column 'c' from CHAR to TEXT +show columns from t2; +Field Type Null Key Default Extra +a text YES NULL +b mediumblob YES NULL +c longtext YES NULL +create table t3 (a long, b long byte); +show create TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` mediumtext, + `b` mediumblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2,t3 +#; +CREATE TABLE t1 (a char(257) default "hello"); +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead +CREATE TABLE t2 (a blob default "hello"); +ERROR 42000: BLOB/TEXT column 'a' can't have a default value +drop table if exists t1,t2; create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr)); insert into t1 values (null,"a","A"); insert into t1 values (null,"bbb","BBB"); @@ -25,7 +57,7 @@ select * from t1; a Where drop table t1; -create table t1 (t text,c char(10),b blob, d char(10) binary); +create table t1 (t text,c char(10),b blob, d binary(10)); insert into t1 values (NULL,NULL,NULL,NULL); insert into t1 values ("","","",""); insert into t1 values ("hello","hello","hello","hello"); @@ -37,18 +69,18 @@ insert into t1 values (NULL,NULL,NULL,NULL); update t1 set c="",b=null where c="1"; lock tables t1 READ; show full fields from t1; -Field Type Null Key Default Extra Privileges -t text YES NULL select,insert,update,references -c varchar(10) YES NULL select,insert,update,references -b blob YES NULL select,insert,update,references -d varchar(10) binary YES NULL select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +t text latin1_swedish_ci YES NULL select,insert,update,references +c varchar(10) latin1_swedish_ci YES NULL select,insert,update,references +b blob NULL YES NULL select,insert,update,references +d varbinary(10) NULL YES NULL select,insert,update,references lock tables t1 WRITE; show full fields from t1; -Field Type Null Key Default Extra Privileges -t text YES NULL select,insert,update,references -c varchar(10) YES NULL select,insert,update,references -b blob YES NULL select,insert,update,references -d varchar(10) binary YES NULL select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +t text latin1_swedish_ci YES NULL select,insert,update,references +c varchar(10) latin1_swedish_ci YES NULL select,insert,update,references +b blob NULL YES NULL select,insert,update,references +d varbinary(10) NULL YES NULL select,insert,update,references unlock tables; select t from t1 where t like "hello"; t @@ -98,6 +130,10 @@ select d from t1 having d like "%HELLO%"; d HELLO HELLO MY +select d from t1 having d like "%HE%LLO%"; +d +HELLO +HELLO MY select t from t1 order by t; t NULL @@ -310,9 +346,17 @@ HELLO MY 1 a 1 hello 1 drop table t1; -create table t1 (a text, key (a(300))); -Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the table handler doesn't support unique sub keys -create table t1 (a text, key (a(255))); +create table t1 (a text, unique (a(2100))); +ERROR 42000: Specified key was too long; max key length is 1000 bytes +create table t1 (a text, key (a(2100))); +Warnings: +Warning 1071 Specified key was too long; max key length is 1000 bytes +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text, + KEY `a` (`a`(1000)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 ( t1_id bigint(21) NOT NULL auto_increment, @@ -450,11 +494,30 @@ fish 10 drop table t1; create table t1 (id integer auto_increment unique,imagem LONGBLOB not null); insert into t1 (id) values (1); +select +charset(load_file('../../std_data/words.dat')), +collation(load_file('../../std_data/words.dat')), +coercibility(load_file('../../std_data/words.dat')); +charset(load_file('../../std_data/words.dat')) collation(load_file('../../std_data/words.dat')) coercibility(load_file('../../std_data/words.dat')) +binary binary 3 +explain extended select +charset(load_file('../../std_data/words.dat')), +collation(load_file('../../std_data/words.dat')), +coercibility(load_file('../../std_data/words.dat')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))` update t1 set imagem=load_file('../../std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; if(imagem is null, "ERROR", "OK") length(imagem) OK 581 drop table t1; +create table t1 select load_file('../../std_data/words.dat'); +show full fields from t1; +Field Type Collation Null Key Default Extra Privileges Comment +load_file('../../std_data/words.dat') longblob NULL YES NULL select,insert,update,references +drop table t1; create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20))); insert into t1 (txt) values ('Chevy'), ('Chevy '); select * from t1 where txt='Chevy'; @@ -533,6 +596,9 @@ id txt 3 NULL 1 Chevy 2 Chevy +explain select * from t1 where txt='Chevy' or txt is NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range txt_index txt_index 23 NULL 2 Using where select * from t1 where txt='Chevy '; id txt 1 Chevy @@ -600,6 +666,21 @@ id txt 1 Chevy 2 Chevy 4 Ford +alter table t1 modify column txt blob; +explain select * from t1 where txt='Chevy' or txt is NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where +select * from t1 where txt='Chevy' or txt is NULL; +id txt +1 Chevy +3 NULL +explain select * from t1 where txt='Chevy' or txt is NULL order by txt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where; Using filesort +select * from t1 where txt='Chevy' or txt is NULL order by txt; +id txt +3 NULL +1 Chevy drop table t1; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 5ec2c9e0434..71d1b9ad381 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -1,3 +1,4 @@ +drop table if exists t1,t2; create table t1 (a char(16), b date, c datetime); insert into t1 SET a='test 2000-01-01', b='2000-01-01', c='2000-01-01'; select * from t1 where c = '2000-01-01'; @@ -7,7 +8,6 @@ select * from t1 where b = '2000-01-01'; a b c test 2000-01-01 2000-01-01 2000-01-01 00:00:00 drop table t1; -drop table if exists t1,t2; CREATE TABLE t1 (name char(6),cdate date); INSERT INTO t1 VALUES ('name1','1998-01-01'); INSERT INTO t1 VALUES ('name2','1998-01-01'); @@ -73,7 +73,7 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2. DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800 drop table t1,t2; -CREATE TABLE t1 (f1 time default NULL, f2 time default NULL) TYPE=MyISAM; +CREATE TABLE t1 (f1 time default NULL, f2 time default NULL); INSERT INTO t1 (f1, f2) VALUES ('09:00', '12:00'); SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1; DATE_FORMAT(f1, "%l.%i %p") DATE_FORMAT(f2, "%l.%i %p") diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 756deab80e0..524bc9c50d4 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1,6 +1,6 @@ drop table if exists t1; create table t1 (t datetime); -insert into t1 values(101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000); select * from t1; t 2000-01-01 00:00:00 @@ -15,11 +15,8 @@ t 1999-12-31 23:59:59 1000-01-01 00:00:00 9999-12-31 23:59:59 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 +2003-01-00 00:00:00 +2003-00-00 00:00:00 delete from t1 where t > 0; optimize table t1; Table Op Msg_type Msg_text @@ -28,7 +25,7 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK delete from t1; -insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); select * from t1; t 2000-01-01 00:00:00 @@ -44,16 +41,13 @@ t 1999-12-31 23:59:59 1000-01-01 00:00:00 9999-12-31 23:59:59 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 +2003-01-00 00:00:00 +2003-00-00 00:00:00 drop table t1; CREATE TABLE t1 (a timestamp, b date, c time, d datetime); insert into t1 (b,c,d) values(now(),curtime(),now()); -select date_format(a,"%Y-%m-%d")=b,right(a,6)=c+0,a=d+0 from t1; -date_format(a,"%Y-%m-%d")=b right(a,6)=c+0 a=d+0 +select date_format(a,"%Y-%m-%d")=b,right(a+0,6)=c+0,a=d+0 from t1; +date_format(a,"%Y-%m-%d")=b right(a+0,6)=c+0 a=d+0 1 1 1 drop table t1; CREATE TABLE t1 (a datetime not null); @@ -82,7 +76,7 @@ CREATE TABLE `t1` ( PRIMARY KEY (`numfacture`), KEY `date` (`date`), KEY `expedition` (`expedition`) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 (expedition) VALUES ('0001-00-00 00:00:00'); SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; date numfacture expedition @@ -93,8 +87,8 @@ date numfacture expedition 0000-00-00 00:00:00 0 0001-00-00 00:00:00 0000-00-00 00:00:00 1212 0001-00-00 00:00:00 EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; -table type possible_keys key key_len ref rows Extra -t1 ref expedition expedition 8 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref expedition expedition 8 const 1 Using where drop table t1; create table t1 (a datetime not null, b datetime not null); insert into t1 values (now(), now()); @@ -102,3 +96,43 @@ insert into t1 values (now(), now()); select * from t1 where a is null or b is null; a b drop table t1; +create table t1 (t datetime); +insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't' at row 2 +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 5 +select * from t1; +t +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +delete from t1; +insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +Warnings: +Warning 1264 Data truncated; out of range for column 't' at row 1 +Warning 1264 Data truncated; out of range for column 't' at row 2 +Warning 1264 Data truncated; out of range for column 't' at row 3 +Warning 1264 Data truncated; out of range for column 't' at row 4 +Warning 1264 Data truncated; out of range for column 't' at row 5 +select * from t1; +t +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +delete from t1; +insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); +Warnings: +Warning 1264 Data truncated; out of range for column 't' at row 1 +Warning 1264 Data truncated; out of range for column 't' at row 2 +select * from t1; +t +0000-00-00 00:00:00 +2003-01-01 00:00:00 +drop table t1; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 600d8639ad5..a9dcabd121e 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1; +SET SQL_WARNINGS=1; CREATE TABLE t1 ( id int(11) NOT NULL auto_increment, datatype_id int(11) DEFAULT '0' NOT NULL, @@ -156,8 +157,18 @@ insert into t1 values ("-.1"),("+.1"),(".1"); insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 select * from t1; a 0.00 @@ -189,12 +200,33 @@ a drop table t1; create table t1 (a decimal(10,2) unsigned); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 select * from t1; a 0.00 @@ -226,12 +258,33 @@ a drop table t1; create table t1 (a decimal(10,2) zerofill); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 select * from t1; a 00000000.00 @@ -267,7 +320,14 @@ insert into t1 values (-.1),(+.1),(.1); insert into t1 values (00000000000001),(+0000000000001),(-0000000000001); insert into t1 values (+111111111.11),(111111111.11),(-11111111.11); insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values (1e+100),(1e-100),(-1e+100); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0); select * from t1; a @@ -300,6 +360,9 @@ a drop table t1; create table t1 (a decimal); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a -9999999999 @@ -312,6 +375,10 @@ a drop table t1; create table t1 (a decimal unsigned); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a 0 @@ -324,6 +391,10 @@ a drop table t1; create table t1 (a decimal zerofill); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a 0000000000 @@ -336,6 +407,10 @@ a drop table t1; create table t1 (a decimal unsigned zerofill); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); +Warnings: +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a 0000000000 @@ -348,27 +423,33 @@ a drop table t1; create table t1(a decimal(10,0)); insert into t1 values ("1e4294967295"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 select * from t1; a 99999999999 delete from t1; insert into t1 values("1e4294967297"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 select * from t1; a 99999999999 drop table t1; CREATE TABLE t1 (a_dec DECIMAL(-1,0)); -Too big column length for column 'a_dec' (max = 255). Use BLOB instead +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 '-1,0))' at line 1 CREATE TABLE t1 (a_dec DECIMAL(-2,1)); -Too big column length for column 'a_dec' (max = 255). Use BLOB instead +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 '-2,1))' at line 1 CREATE TABLE t1 (a_dec DECIMAL(-1,1)); -Too big column length for column 'a_dec' (max = 255). Use BLOB instead +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 '-1,1))' at line 1 CREATE TABLE t1 (a_dec DECIMAL(0,11)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a_dec` decimal(12,11) default NULL -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; create table t1(a decimal(7,3)); insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 03cfdc3c286..976c484dabf 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1627,22 +1627,37 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` enum('','a','b') NOT NULL default '' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a enum (' ','a','b ') not null default 'b '); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` enum('','a','b') NOT NULL default 'b' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a enum ('0','1')); insert into t1 set a='foobar'; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 select * from t1; a update t1 set a = replace(a,'x','y'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 select * from t1; a drop table t1; +set names latin1; +create table t1 (a enum(0xE4, '1', '2') not null default 0xE4); +show columns from t1; +Field Type Null Key Default Extra +a enum('ä','1','2') ä +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('ä','1','2') NOT NULL default 'ä' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index f4c5df353a3..843bdc2bdc5 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -1,3 +1,4 @@ +drop table if exists t1; SELECT 10,10.0,10.,.1e+2,100.0e-1; 10 10.0 10. .1e+2 100.0e-1 10 10.0 10 10 10 @@ -7,13 +8,15 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; 1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1 10 10 10 10 10 10 0.1 0.1 0.1 -drop table if exists t1; create table t1 (f1 float(24),f2 float(52)); show full columns from t1; -Field Type Null Key Default Extra Privileges -f1 float YES NULL select,insert,update,references -f2 double YES NULL select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +f1 float NULL YES NULL select,insert,update,references +f2 double NULL YES NULL select,insert,update,references insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); +Warnings: +Warning 1264 Data truncated; out of range for column 'f1' at row 7 +Warning 1264 Data truncated; out of range for column 'f1' at row 8 insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); select * from t1; f1 f2 @@ -83,23 +86,29 @@ t2 CREATE TABLE `t2` ( `col2` double(22,5) default NULL, `col3` double default NULL, `col4` double default NULL -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; +create table t1 (a float); +insert into t1 values (1); +select max(a),min(a),avg(a) from t1; +max(a) min(a) avg(a) +1 1 1 +drop table t1; create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6)); show full columns from t1; -Field Type Null Key Default Extra Privileges -f float YES NULL select,insert,update,references -f2 float YES NULL select,insert,update,references -f3 float(6,2) YES NULL select,insert,update,references -d double YES NULL select,insert,update,references -d2 double YES NULL select,insert,update,references -d3 double(10,3) YES NULL select,insert,update,references -de decimal(10,0) YES NULL select,insert,update,references -de2 decimal(6,0) YES NULL select,insert,update,references -de3 decimal(5,2) YES NULL select,insert,update,references -n decimal(10,0) YES NULL select,insert,update,references -n2 decimal(8,0) YES NULL select,insert,update,references -n3 decimal(7,6) YES NULL select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +f float NULL YES NULL select,insert,update,references +f2 float NULL YES NULL select,insert,update,references +f3 float(6,2) NULL YES NULL select,insert,update,references +d double NULL YES NULL select,insert,update,references +d2 double NULL YES NULL select,insert,update,references +d3 double(10,3) NULL YES NULL select,insert,update,references +de decimal(10,0) NULL YES NULL select,insert,update,references +de2 decimal(6,0) NULL YES NULL select,insert,update,references +de3 decimal(5,2) NULL YES NULL select,insert,update,references +n decimal(10,0) NULL YES NULL select,insert,update,references +n2 decimal(8,0) NULL YES NULL select,insert,update,references +n3 decimal(7,6) NULL YES NULL select,insert,update,references drop table t1; create table t1 (a decimal(7,3) not null, key (a)); insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1"); @@ -114,9 +123,21 @@ select min(a) from t1; min(a) -0.010 drop table t1; +create table t1 (a float(200,100), b double(200,100)); +insert t1 values (1.0, 2.0); +select * from t1; +a b +1.000000000000000000000000000000 2.000000000000000000000000000000 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` float(200,30) default NULL, + `b` double(200,30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; create table t1 (c20 char); -insert into t1 (c20) values (5000.0); +insert into t1 values (5000.0); drop table t1; create table t1 (f float(54)); -Incorrect column specifier for column 'f' +ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; diff --git a/mysql-test/r/type_nchar.result b/mysql-test/r/type_nchar.result new file mode 100644 index 00000000000..f844b3b0241 --- /dev/null +++ b/mysql-test/r/type_nchar.result @@ -0,0 +1,50 @@ +drop table if exists t1; +create table t1 (c nchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c national char(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c national varchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c nvarchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c nchar varchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c national character varying(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c nchar varying(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 4f4b4eb43eb..5a65c90c5c7 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3; +SET SQL_WARNINGS=1; CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", @@ -38,31 +39,31 @@ KEY (ulonglong,ulong), KEY (options,flags) ); show full fields from t1; -Field Type Null Key Default Extra Privileges -auto int(5) unsigned PRI NULL auto_increment select,insert,update,references -string varchar(10) YES hello select,insert,update,references -tiny tinyint(4) MUL 0 select,insert,update,references -short smallint(6) MUL 1 select,insert,update,references -medium mediumint(8) MUL 0 select,insert,update,references -long_int int(11) 0 select,insert,update,references -longlong bigint(13) MUL 0 select,insert,update,references -real_float float(13,1) MUL 0.0 select,insert,update,references -real_double double(16,4) YES NULL select,insert,update,references -utiny tinyint(3) unsigned MUL 0 select,insert,update,references -ushort smallint(5) unsigned zerofill MUL 00000 select,insert,update,references -umedium mediumint(8) unsigned MUL 0 select,insert,update,references -ulong int(11) unsigned MUL 0 select,insert,update,references -ulonglong bigint(13) unsigned MUL 0 select,insert,update,references -time_stamp timestamp(14) YES NULL select,insert,update,references -date_field date YES NULL select,insert,update,references -time_field time YES NULL select,insert,update,references -date_time datetime YES NULL select,insert,update,references -blob_col blob YES NULL select,insert,update,references -tinyblob_col tinyblob YES NULL select,insert,update,references -mediumblob_col mediumblob select,insert,update,references -longblob_col longblob select,insert,update,references -options enum('one','two','tree') MUL one select,insert,update,references -flags set('one','two','tree') select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +auto int(5) unsigned NULL PRI NULL auto_increment select,insert,update,references +string varchar(10) latin1_swedish_ci YES hello select,insert,update,references +tiny tinyint(4) NULL MUL 0 select,insert,update,references +short smallint(6) NULL MUL 1 select,insert,update,references +medium mediumint(8) NULL MUL 0 select,insert,update,references +long_int int(11) NULL 0 select,insert,update,references +longlong bigint(13) NULL MUL 0 select,insert,update,references +real_float float(13,1) NULL MUL 0.0 select,insert,update,references +real_double double(16,4) NULL YES NULL select,insert,update,references +utiny tinyint(3) unsigned NULL MUL 0 select,insert,update,references +ushort smallint(5) unsigned zerofill NULL MUL 00000 select,insert,update,references +umedium mediumint(8) unsigned NULL MUL 0 select,insert,update,references +ulong int(11) unsigned NULL MUL 0 select,insert,update,references +ulonglong bigint(13) unsigned NULL MUL 0 select,insert,update,references +time_stamp timestamp NULL YES CURRENT_TIMESTAMP select,insert,update,references +date_field date NULL YES NULL select,insert,update,references +time_field time NULL YES NULL select,insert,update,references +date_time datetime NULL YES NULL select,insert,update,references +blob_col blob NULL YES NULL select,insert,update,references +tinyblob_col tinyblob NULL YES NULL select,insert,update,references +mediumblob_col mediumblob NULL select,insert,update,references +longblob_col longblob NULL select,insert,update,references +options enum('one','two','tree') latin1_swedish_ci MUL one select,insert,update,references +flags set('one','two','tree') latin1_swedish_ci select,insert,update,references show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE @@ -85,10 +86,37 @@ CREATE INDEX test3 on t1 ( medium ) ; DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); -insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303 101010','','','','3',3,3); +insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); +Warnings: +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'ulong' at row 1 +Warning 1265 Data truncated for column 'options' at row 1 +Warning 1265 Data truncated for column 'flags' at row 1 insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree"); +Warnings: +Warning 1265 Data truncated for column 'string' at row 1 +Warning 1264 Data truncated; out of range for column 'tiny' at row 1 +Warning 1264 Data truncated; out of range for column 'short' at row 1 +Warning 1264 Data truncated; out of range for column 'medium' at row 1 +Warning 1264 Data truncated; out of range for column 'long_int' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'ulong' at row 1 +Warning 1265 Data truncated for column 'options' at row 1 insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0); +Warnings: +Warning 1264 Data truncated; out of range for column 'tiny' at row 1 +Warning 1264 Data truncated; out of range for column 'short' at row 1 +Warning 1264 Data truncated; out of range for column 'medium' at row 1 +Warning 1264 Data truncated; out of range for column 'long_int' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1265 Data truncated for column 'options' at row 1 insert into t1 (tiny) values (1); select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col @@ -136,6 +164,13 @@ new_field char(2), PRIMARY KEY (auto) ); INSERT INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10; +Warnings: +Warning 1265 Data truncated for column 'new_field' at row 2 +Warning 1265 Data truncated for column 'new_field' at row 3 +Warning 1265 Data truncated for column 'new_field' at row 4 +Warning 1265 Data truncated for column 'new_field' at row 5 +Warning 1265 Data truncated for column 'new_field' at row 6 +Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne @@ -166,59 +201,63 @@ options flags one one drop table t2; create table t2 select * from t1; +Warnings: +Warning 1265 Data truncated for column 'options' at row 4 +Warning 1265 Data truncated for column 'options' at row 5 +Warning 1265 Data truncated for column 'options' at row 6 update t2 set string="changed" where auto=16; show full columns from t1; -Field Type Null Key Default Extra Privileges -auto int(5) unsigned MUL NULL auto_increment select,insert,update,references -string varchar(10) YES new defaul select,insert,update,references -tiny tinyint(4) MUL 0 select,insert,update,references -short smallint(6) MUL 0 select,insert,update,references -medium mediumint(8) MUL 0 select,insert,update,references -long_int int(11) 0 select,insert,update,references -longlong bigint(13) MUL 0 select,insert,update,references -real_float float(13,1) MUL 0.0 select,insert,update,references -real_double double(16,4) YES NULL select,insert,update,references -utiny tinyint(3) unsigned 0 select,insert,update,references -ushort smallint(5) unsigned zerofill 00000 select,insert,update,references -umedium mediumint(8) unsigned MUL 0 select,insert,update,references -ulong int(11) unsigned MUL 0 select,insert,update,references -ulonglong bigint(13) unsigned MUL 0 select,insert,update,references -time_stamp timestamp(14) YES NULL select,insert,update,references -date_field varchar(10) YES NULL select,insert,update,references -time_field time YES NULL select,insert,update,references -date_time datetime YES NULL select,insert,update,references -new_blob_col varchar(20) YES NULL select,insert,update,references -tinyblob_col tinyblob YES NULL select,insert,update,references -mediumblob_col mediumblob select,insert,update,references -options enum('one','two','tree') MUL one select,insert,update,references -flags set('one','two','tree') select,insert,update,references -new_field varchar(10) new select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +auto int(5) unsigned NULL MUL NULL auto_increment select,insert,update,references +string varchar(10) latin1_swedish_ci YES new defaul select,insert,update,references +tiny tinyint(4) NULL MUL 0 select,insert,update,references +short smallint(6) NULL MUL 0 select,insert,update,references +medium mediumint(8) NULL MUL 0 select,insert,update,references +long_int int(11) NULL 0 select,insert,update,references +longlong bigint(13) NULL MUL 0 select,insert,update,references +real_float float(13,1) NULL MUL 0.0 select,insert,update,references +real_double double(16,4) NULL YES NULL select,insert,update,references +utiny tinyint(3) unsigned NULL 0 select,insert,update,references +ushort smallint(5) unsigned zerofill NULL 00000 select,insert,update,references +umedium mediumint(8) unsigned NULL MUL 0 select,insert,update,references +ulong int(11) unsigned NULL MUL 0 select,insert,update,references +ulonglong bigint(13) unsigned NULL MUL 0 select,insert,update,references +time_stamp timestamp NULL YES CURRENT_TIMESTAMP select,insert,update,references +date_field varchar(10) latin1_swedish_ci YES NULL select,insert,update,references +time_field time NULL YES NULL select,insert,update,references +date_time datetime NULL YES NULL select,insert,update,references +new_blob_col varchar(20) latin1_swedish_ci YES NULL select,insert,update,references +tinyblob_col tinyblob NULL YES NULL select,insert,update,references +mediumblob_col mediumblob NULL select,insert,update,references +options enum('one','two','tree') latin1_swedish_ci MUL one select,insert,update,references +flags set('one','two','tree') latin1_swedish_ci select,insert,update,references +new_field varchar(10) latin1_swedish_ci new select,insert,update,references show full columns from t2; -Field Type Null Key Default Extra Privileges -auto int(5) unsigned 0 select,insert,update,references -string varchar(10) YES new defaul select,insert,update,references -tiny tinyint(4) 0 select,insert,update,references -short smallint(6) 0 select,insert,update,references -medium mediumint(8) 0 select,insert,update,references -long_int int(11) 0 select,insert,update,references -longlong bigint(13) 0 select,insert,update,references -real_float float(13,1) 0.0 select,insert,update,references -real_double double(16,4) YES NULL select,insert,update,references -utiny tinyint(3) unsigned 0 select,insert,update,references -ushort smallint(5) unsigned zerofill 00000 select,insert,update,references -umedium mediumint(8) unsigned 0 select,insert,update,references -ulong int(11) unsigned 0 select,insert,update,references -ulonglong bigint(13) unsigned 0 select,insert,update,references -time_stamp timestamp(14) YES NULL select,insert,update,references -date_field varchar(10) YES NULL select,insert,update,references -time_field time YES NULL select,insert,update,references -date_time datetime YES NULL select,insert,update,references -new_blob_col varchar(20) YES NULL select,insert,update,references -tinyblob_col tinyblob YES NULL select,insert,update,references -mediumblob_col mediumblob select,insert,update,references -options enum('one','two','tree') one select,insert,update,references -flags set('one','two','tree') select,insert,update,references -new_field varchar(10) new select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +auto int(5) unsigned NULL 0 select,insert,update,references +string varchar(10) latin1_swedish_ci YES new defaul select,insert,update,references +tiny tinyint(4) NULL 0 select,insert,update,references +short smallint(6) NULL 0 select,insert,update,references +medium mediumint(8) NULL 0 select,insert,update,references +long_int int(11) NULL 0 select,insert,update,references +longlong bigint(13) NULL 0 select,insert,update,references +real_float float(13,1) NULL 0.0 select,insert,update,references +real_double double(16,4) NULL YES NULL select,insert,update,references +utiny tinyint(3) unsigned NULL 0 select,insert,update,references +ushort smallint(5) unsigned zerofill NULL 00000 select,insert,update,references +umedium mediumint(8) unsigned NULL 0 select,insert,update,references +ulong int(11) unsigned NULL 0 select,insert,update,references +ulonglong bigint(13) unsigned NULL 0 select,insert,update,references +time_stamp timestamp NULL YES 0000-00-00 00:00:00 select,insert,update,references +date_field varchar(10) latin1_swedish_ci YES NULL select,insert,update,references +time_field time NULL YES NULL select,insert,update,references +date_time datetime NULL YES NULL select,insert,update,references +new_blob_col varchar(20) latin1_swedish_ci YES NULL select,insert,update,references +tinyblob_col tinyblob NULL YES NULL select,insert,update,references +mediumblob_col mediumblob NULL select,insert,update,references +options enum('one','two','tree') latin1_swedish_ci one select,insert,update,references +flags set('one','two','tree') latin1_swedish_ci select,insert,update,references +new_field varchar(10) latin1_swedish_ci new select,insert,update,references select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null))); auto auto 16 16 @@ -228,12 +267,12 @@ auto auto drop table t2; create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, "a" as t2, repeat("a",256) as t3, binary repeat("b",256) as t4 from t1; show full columns from t2; -Field Type Null Key Default Extra Privileges -auto bigint(17) unsigned PRI 0 select,insert,update,references -t1 bigint(1) 0 select,insert,update,references -t2 char(1) select,insert,update,references -t3 mediumtext select,insert,update,references -t4 mediumblob select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +auto bigint(17) unsigned NULL PRI 0 select,insert,update,references +t1 bigint(1) NULL 0 select,insert,update,references +t2 char(1) latin1_swedish_ci select,insert,update,references +t3 longtext latin1_swedish_ci select,insert,update,references +t4 longblob NULL select,insert,update,references select * from t2; auto t1 t2 t3 t4 11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb @@ -248,13 +287,13 @@ create table t1 (c int); insert into t1 values(1),(2); create table t2 select * from t1; create table t3 select * from t1, t2; -Duplicate column name 'c' +ERROR 42S21: Duplicate column name 'c' create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2; show full columns from t3; -Field Type Null Key Default Extra Privileges -c1 int(11) YES NULL select,insert,update,references -c2 int(11) YES NULL select,insert,update,references -const bigint(1) 0 select,insert,update,references +Field Type Collation Null Key Default Extra Privileges Comment +c1 int(11) NULL YES NULL select,insert,update,references +c2 int(11) NULL YES NULL select,insert,update,references +const bigint(1) NULL 0 select,insert,update,references drop table t1,t2,t3; create table t1 ( myfield INT NOT NULL, UNIQUE INDEX (myfield), unique (myfield), index(myfield)); drop table t1; diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 59f8744e2ec..084e004cd47 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -4,12 +4,14 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` set('','a','b') NOT NULL default '' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a set (' ','a','b ') not null default 'b '); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` set('','a','b') NOT NULL default 'b' -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) ENGINE=MyISAM CHARSET=utf8; +DROP TABLE t1; diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index bacc3ec0176..025cf2a57f1 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -24,6 +24,12 @@ t 12:30:35 36:30:31 insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a"); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1264 Data truncated; out of range for column 't' at row 2 +Warning 1264 Data truncated; out of range for column 't' at row 3 +Warning 1264 Data truncated; out of range for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 6 select * from t1; t 10:22:33 diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 752a5045eb0..425e4a05586 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -15,26 +15,26 @@ SET TIMESTAMP=1238; insert into t1 (a) select a+1 from t2 where a=8; select * from t1; a t -1 19700101032034 -2 20020303000000 -3 19700101032035 -4 19700101032036 -5 20020304000000 -6 19700101032037 -7 20020305000000 -8 00000000000000 -9 19700101032038 +1 1970-01-01 03:20:34 +2 2002-03-03 00:00:00 +3 1970-01-01 03:20:35 +4 1970-01-01 03:20:36 +5 2002-03-04 00:00:00 +6 1970-01-01 03:20:37 +7 2002-03-05 00:00:00 +8 0000-00-00 00:00:00 +9 1970-01-01 03:20:38 drop table t1,t2; SET TIMESTAMP=1234; CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp, PRIMARY KEY (id)); INSERT INTO t1 VALUES ("my value", "myKey","1999-04-02 00:00:00"); SELECT stamp FROM t1 WHERE id="myKey"; stamp -19990402000000 +1999-04-02 00:00:00 UPDATE t1 SET value="my value" WHERE id="myKey"; SELECT stamp FROM t1 WHERE id="myKey"; stamp -19990402000000 +1999-04-02 00:00:00 drop table t1; create table t1 (a timestamp); insert into t1 values (now()); @@ -43,9 +43,9 @@ date_format(a,"%Y %y") year(a) year(now()) 1970 70 1970 1970 drop table t1; create table t1 (ix timestamp); -insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101); -select * from t1; -ix +insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000); +select ix+0 from t1; +ix+0 19991101000000 19990102030405 19990630232922 @@ -55,24 +55,14 @@ ix 19990501000000 19991101000000 19990501000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 delete from t1; -insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"); -select * from t1; -ix +insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"); +select ix+0 from t1; +ix+0 19991101000000 19990102030405 19990630232922 19990601000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 drop table t1; CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp); INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959); @@ -89,18 +79,18 @@ INSERT INTO t1 VALUES ("2005-01-01","2005-01-01 00:00:00",20050101000000); INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000); SELECT * FROM t1; date date_time time_stamp -1998-12-31 1998-12-31 23:59:59 19981231235959 -1999-01-01 1999-01-01 00:00:00 19990101000000 -1999-09-09 1999-09-09 23:59:59 19990909235959 -2000-01-01 2000-01-01 00:00:00 20000101000000 -2000-02-28 2000-02-28 00:00:00 20000228000000 -2000-02-29 2000-02-29 00:00:00 20000229000000 -2000-03-01 2000-03-01 00:00:00 20000301000000 -2000-12-31 2000-12-31 23:59:59 20001231235959 -2001-01-01 2001-01-01 00:00:00 20010101000000 -2004-12-31 2004-12-31 23:59:59 20041231235959 -2005-01-01 2005-01-01 00:00:00 20050101000000 -2030-01-01 2030-01-01 00:00:00 20300101000000 +1998-12-31 1998-12-31 23:59:59 1998-12-31 23:59:59 +1999-01-01 1999-01-01 00:00:00 1999-01-01 00:00:00 +1999-09-09 1999-09-09 23:59:59 1999-09-09 23:59:59 +2000-01-01 2000-01-01 00:00:00 2000-01-01 00:00:00 +2000-02-28 2000-02-28 00:00:00 2000-02-28 00:00:00 +2000-02-29 2000-02-29 00:00:00 2000-02-29 00:00:00 +2000-03-01 2000-03-01 00:00:00 2000-03-01 00:00:00 +2000-12-31 2000-12-31 23:59:59 2000-12-31 23:59:59 +2001-01-01 2001-01-01 00:00:00 2001-01-01 00:00:00 +2004-12-31 2004-12-31 23:59:59 2004-12-31 23:59:59 +2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00 +2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00 drop table t1; show variables like 'new'; Variable_name Value @@ -114,65 +104,273 @@ insert t1 values (0,0,0,0,0,0,0), "1997-12-31 23:47:59"); select * from t1; t2 t4 t6 t8 t10 t12 t14 -00 0000 000000 00000000 0000000000 000000000000 00000000000000 -97 9712 971231 19971231 9712312347 971231234759 19971231234759 +0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 set new=1; select * from t1; t2 t4 t6 t8 t10 t12 t14 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 drop table t1; -create table t1 (t1 timestamp default '2003-01-01 00:00:00', -t2 timestamp default '2003-01-01 00:00:00'); -set TIMESTAMP=1000000000; -insert into t1 values(); +create table t1 (ix timestamp); +insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000); +Warnings: +Warning 1265 Data truncated for column 'ix' at row 2 +Warning 1265 Data truncated for column 'ix' at row 3 +Warning 1265 Data truncated for column 'ix' at row 4 +Warning 1265 Data truncated for column 'ix' at row 5 +Warning 1265 Data truncated for column 'ix' at row 6 +Warning 1265 Data truncated for column 'ix' at row 7 +Warning 1265 Data truncated for column 'ix' at row 8 +select ix+0 from t1; +ix+0 +0 +0 +0 +0 +0 +0 +0 +0 +delete from t1; +insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000"); +Warnings: +Warning 1265 Data truncated for column 'ix' at row 2 +Warning 1265 Data truncated for column 'ix' at row 3 +Warning 1265 Data truncated for column 'ix' at row 4 +Warning 1265 Data truncated for column 'ix' at row 5 +Warning 1265 Data truncated for column 'ix' at row 6 +Warning 1265 Data truncated for column 'ix' at row 7 +Warning 1265 Data truncated for column 'ix' at row 8 +select ix+0 from t1; +ix+0 +0 +0 +0 +0 +0 +0 +0 +0 +delete from t1; +insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); +Warnings: +Warning 1265 Data truncated for column 'ix' at row 1 +Warning 1265 Data truncated for column 'ix' at row 2 +select ix+0 from t1; +ix+0 +0 +20030101000000 +drop table t1; +create table t1 (t1 timestamp, t2 timestamp default now()); +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +create table t1 (t1 timestamp, t2 timestamp on update now()); +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +create table t1 (t1 timestamp, t2 timestamp default now() on update now()); +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +create table t1 (t1 timestamp default now(), t2 timestamp on update now()); +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now()); +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp); +SET TIMESTAMP=1000000000; +insert into t1 values (); +SET TIMESTAMP=1000000001; +update t1 set t2=now(); +SET TIMESTAMP=1000000002; +insert into t1 (t1,t3) values (default, default); select * from t1; -t1 t2 -2001-09-09 04:46:40 2003-01-01 00:00:00 +t1 t2 t3 +2003-01-01 00:00:00 2001-09-09 04:46:41 0000-00-00 00:00:00 +2003-01-01 00:00:00 NULL 0000-00-00 00:00:00 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t1` timestamp(14) NOT NULL, - `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' -) TYPE=MyISAM + `t1` timestamp NOT NULL default '2003-01-01 00:00:00', + `t2` datetime default NULL, + `t3` timestamp NOT NULL default '0000-00-00 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 show columns from t1; Field Type Null Key Default Extra -t1 timestamp(14) YES NULL -t2 timestamp(14) YES 2003-01-01 00:00:00 -show columns from t1 like 't2'; +t1 timestamp YES 2003-01-01 00:00:00 +t2 datetime YES NULL +t3 timestamp YES 0000-00-00 00:00:00 +drop table t1; +create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp); +SET TIMESTAMP=1000000002; +insert into t1 values (); +SET TIMESTAMP=1000000003; +update t1 set t2=now(); +SET TIMESTAMP=1000000003; +insert into t1 (t1,t3) values (default, default); +select * from t1; +t1 t2 t3 +2001-09-09 04:46:42 2001-09-09 04:46:43 0000-00-00 00:00:00 +2001-09-09 04:46:43 NULL 0000-00-00 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t1` timestamp NOT NULL default CURRENT_TIMESTAMP, + `t2` datetime default NULL, + `t3` timestamp NOT NULL default '0000-00-00 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; Field Type Null Key Default Extra -t2 timestamp(14) YES 2003-01-01 00:00:00 -create table t2 (select * from t1); -show create table t2; +t1 timestamp YES CURRENT_TIMESTAMP +t2 datetime YES NULL +t3 timestamp YES 0000-00-00 00:00:00 +drop table t1; +create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime); +SET TIMESTAMP=1000000004; +insert into t1 values (); +select * from t1; +t1 t2 +2003-01-01 00:00:00 NULL +SET TIMESTAMP=1000000005; +update t1 set t2=now(); +SET TIMESTAMP=1000000005; +insert into t1 (t1) values (default); +select * from t1; +t1 t2 +2001-09-09 04:46:45 2001-09-09 04:46:45 +2003-01-01 00:00:00 NULL +show create table t1; Table Create Table -t2 CREATE TABLE `t2` ( - `t1` timestamp(14) NOT NULL, - `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' -) TYPE=MyISAM -alter table t1 add column t0 timestamp first; +t1 CREATE TABLE `t1` ( + `t1` timestamp NOT NULL default '2003-01-01 00:00:00' on update CURRENT_TIMESTAMP, + `t2` datetime default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; +Field Type Null Key Default Extra +t1 timestamp YES 2003-01-01 00:00:00 +t2 datetime YES NULL +drop table t1; +create table t1 (t1 timestamp default now() on update now(), t2 datetime); +SET TIMESTAMP=1000000006; +insert into t1 values (); +select * from t1; +t1 t2 +2001-09-09 04:46:46 NULL +SET TIMESTAMP=1000000007; +update t1 set t2=now(); +SET TIMESTAMP=1000000007; +insert into t1 (t1) values (default); +select * from t1; +t1 t2 +2001-09-09 04:46:47 2001-09-09 04:46:47 +2001-09-09 04:46:47 NULL show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t0` timestamp(14) NOT NULL, - `t1` timestamp(14) NOT NULL default '2003-01-01 00:00:00', - `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' -) TYPE=MyISAM -drop table t1,t2; -create table t1 (ts1 timestamp, ts2 timestamp); -set TIMESTAMP=1000000000; + `t1` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `t2` datetime default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; +Field Type Null Key Default Extra +t1 timestamp YES CURRENT_TIMESTAMP +t2 datetime YES NULL +drop table t1; +create table t1 (t1 timestamp, t2 datetime, t3 timestamp); +SET TIMESTAMP=1000000007; insert into t1 values (); -insert into t1 values (DEFAULT, DEFAULT); select * from t1; -ts1 ts2 -2001-09-09 04:46:40 0000-00-00 00:00:00 -2001-09-09 04:46:40 0000-00-00 00:00:00 +t1 t2 t3 +2001-09-09 04:46:47 NULL 0000-00-00 00:00:00 +SET TIMESTAMP=1000000008; +update t1 set t2=now(); +SET TIMESTAMP=1000000008; +insert into t1 (t1,t3) values (default, default); +select * from t1; +t1 t2 t3 +2001-09-09 04:46:48 2001-09-09 04:46:48 0000-00-00 00:00:00 +2001-09-09 04:46:48 NULL 0000-00-00 00:00:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t1` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `t2` datetime default NULL, + `t3` timestamp NOT NULL default '0000-00-00 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; +Field Type Null Key Default Extra +t1 timestamp YES CURRENT_TIMESTAMP +t2 datetime YES NULL +t3 timestamp YES 0000-00-00 00:00:00 +drop table t1; +create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime); +SET TIMESTAMP=1000000009; +insert into t1 values (); +select * from t1; +t1 t2 +2001-09-09 04:46:49 NULL +SET TIMESTAMP=1000000010; +update t1 set t2=now(); +SET TIMESTAMP=1000000011; +insert into t1 (t1) values (default); +select * from t1; +t1 t2 +2001-09-09 04:46:50 2001-09-09 04:46:50 +2001-09-09 04:46:51 NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t1` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `t2` datetime default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; +Field Type Null Key Default Extra +t1 timestamp YES CURRENT_TIMESTAMP +t2 datetime YES NULL +delete from t1; +insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00'); +SET TIMESTAMP=1000000012; +update t1 set t1= '2004-04-02 00:00:00'; +select * from t1; +t1 t2 +2004-04-02 00:00:00 2004-04-01 00:00:00 +update t1 as ta, t1 as tb set tb.t1= '2004-04-03 00:00:00'; +select * from t1; +t1 t2 +2004-04-03 00:00:00 2004-04-01 00:00:00 +drop table t1; +create table t1 (pk int primary key, t1 timestamp default current_timestamp on update current_timestamp, bulk int); +insert into t1 values (1, '2004-04-01 00:00:00', 10); +SET TIMESTAMP=1000000013; +replace into t1 set pk = 1, bulk= 20; +select * from t1; +pk t1 bulk +1 2001-09-09 04:46:53 20 +drop table t1; +create table t1 (pk int primary key, t1 timestamp default '2003-01-01 00:00:00' on update current_timestamp, bulk int); +insert into t1 values (1, '2004-04-01 00:00:00', 10); +SET TIMESTAMP=1000000014; +replace into t1 set pk = 1, bulk= 20; +select * from t1; +pk t1 bulk +1 2003-01-01 00:00:00 20 +drop table t1; +create table t1 (pk int primary key, t1 timestamp default current_timestamp, bulk int); +insert into t1 values (1, '2004-04-01 00:00:00', 10); +SET TIMESTAMP=1000000015; +replace into t1 set pk = 1, bulk= 20; +select * from t1; +pk t1 bulk +1 2001-09-09 04:46:55 20 +drop table t1; +create table t1 (t1 timestamp default current_timestamp on update current_timestamp); +insert into t1 values ('2004-04-01 00:00:00'); +SET TIMESTAMP=1000000016; +alter table t1 add i int default 10; +select * from t1; +t1 i +2004-04-01 00:00:00 10 drop table t1; create table t1 (ts timestamp(19)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `ts` timestamp(19) NOT NULL -) TYPE=MyISAM + `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 set TIMESTAMP=1000000000; insert into t1 values (); select * from t1; diff --git a/mysql-test/r/type_uint.result b/mysql-test/r/type_uint.result index 0b7452b566b..d8edf9085b7 100644 --- a/mysql-test/r/type_uint.result +++ b/mysql-test/r/type_uint.result @@ -1,8 +1,13 @@ drop table if exists t1; +SET SQL_WARNINGS=1; create table t1 (this int unsigned); insert into t1 values (1); insert into t1 values (-1); +Warnings: +Warning 1264 Data truncated; out of range for column 'this' at row 1 insert into t1 values ('5000000000'); +Warnings: +Warning 1265 Data truncated for column 'this' at row 1 select * from t1; this 1 diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 5ef3c1bba81..84b688429db 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -28,6 +28,8 @@ y y2 drop table t1; create table t1 (y year); insert into t1 values (now()); +Warnings: +Warning 1265 Data truncated for column 'y' at row 1 select if(y = now(), 1, 0) from t1; if(y = now(), 1, 0) 1 diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 8f33bc4c316..2062d332f5d 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -36,8 +36,6 @@ a b 1 a 2 b 3 c -3 c -3 c 4 d 5 f 6 e @@ -48,12 +46,10 @@ select 0,'#' union select a,b from t1 union all select a,b from t2 union select 1 a 2 b 3 c -3 c -3 c 4 d 5 f 6 e -7 g +7 gg select a,b from t1 union select a,b from t1; a b 1 a @@ -84,10 +80,15 @@ a b 3 c 2 b 1 a -explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 -t2 ALL NULL NULL NULL NULL 4 Using filesort +(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b; +ERROR 42000: Table 't1' from one of the SELECTs cannot be used in global ORDER clause +explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort +Warnings: +Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2; a b 1 a @@ -103,51 +104,62 @@ select found_rows(); found_rows() 8 explain select a,b from t1 union all select a,b from t2; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 -t2 ALL NULL NULL NULL NULL 4 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +2 UNION t2 ALL NULL NULL NULL NULL 4 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL explain select xx from t1 union select 1; -Unknown column 'xx' in 'field list' +ERROR 42S22: Unknown column 'xx' in 'field list' explain select a,b from t1 union select 1; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 - 0 0 No tables used +ERROR 21000: The used SELECT statements have a different number of columns explain select 1 union select a,b from t1 union select 1; -table type possible_keys key key_len ref rows Extra - 0 0 No tables used -t1 ALL NULL NULL NULL NULL 4 - 0 0 No tables used +ERROR 21000: The used SELECT statements have a different number of columns explain select a,b from t1 union select 1 limit 0; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 4 - 0 0 Impossible WHERE +ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 into outfile 'skr' union select a,b from t2; -Wrong usage of UNION and INTO +ERROR HY000: Incorrect usage of UNION and INTO select a,b from t1 order by a union select a,b from t2; -Wrong usage of UNION and ORDER BY +ERROR HY000: Incorrect usage of UNION and ORDER BY insert into t3 select a from t1 order by a union select a from t2; -Wrong usage of UNION and ORDER BY +ERROR HY000: Incorrect usage of UNION and ORDER BY create table t3 select a,b from t1 union select a from t2; -The used SELECT statements have a different number of columns +ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 union select a from t2; -The used SELECT statements have a different number of columns +ERROR 21000: The used SELECT statements have a different number of columns select * from t1 union select a from t2; -The used SELECT statements have a different number of columns +ERROR 21000: The used SELECT statements have a different number of columns select a from t1 union select * from t2; -The used SELECT statements have a different number of columns +ERROR 21000: The used SELECT statements have a different number of columns select * from t1 union select SQL_BUFFER_RESULT * from t2; -Wrong usage/placement of 'SQL_BUFFER_RESULT' +ERROR 42000: Incorrect usage/placement of 'SQL_BUFFER_RESULT' create table t3 select a,b from t1 union all select a,b from t2; insert into t3 select a,b from t1 union all select a,b from t2; replace into t3 select a,b as c from t1 union all select a,b from t2; drop table t1,t2,t3; +select * union select 1; +ERROR HY000: No tables used +select 1 as a,(select a union select a); +a (select a union select a) +1 1 +(select 1) union (select 2) order by 0; +ERROR 42S22: Unknown column '0' in 'order clause' +SELECT @a:=1 UNION SELECT @a:=@a+1; +@a:=1 +1 +2 +(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a); +ERROR 42S22: Unknown column 'a' in 'field list' +(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2); +1 3 +1 3 +2 1 CREATE TABLE t1 ( `pseudo` char(35) NOT NULL default '', `pseudo1` char(35) NOT NULL default '', `same` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`pseudo1`), KEY `pseudo` (`pseudo`) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 (pseudo,pseudo1,same) VALUES ('joce', 'testtt', 1),('joce', 'tsestset', 1),('dekad', 'joce', 1); SELECT pseudo FROM t1 WHERE pseudo1='joce' UNION SELECT pseudo FROM t1 WHERE pseudo='joce'; pseudo @@ -179,7 +191,6 @@ testtt tsestset 1 drop table t1; -drop table if exists t1,t2; create table t1 (a int); create table t2 (a int); insert into t1 values (1),(2),(3),(4),(5); @@ -330,11 +341,7 @@ select found_rows(); found_rows() 4 (SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1; -a -1 -select found_rows(); -found_rows() -4 +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 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2; a 1 @@ -417,12 +424,13 @@ a 3 3 (SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; -Wrong usage/placement of 'SQL_CALC_FOUND_ROWS' +ERROR 42000: Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS' create temporary table t1 select a from t1 union select a from t2; +drop temporary table t1; create table t1 select a from t1 union select a from t2; -INSERT TABLE 't1' isn't allowed in FROM table list +ERROR HY000: You can't specify target table 't1' for update in FROM clause select a from t1 union select a from t2 order by t2.a; -Unknown column 't2.a' in 'ORDER BY' +ERROR 42S02: Unknown table 't2' in order clause drop table t1; drop table t1,t2; select length(version()) > 1 as `*` UNION select 2; @@ -436,3 +444,555 @@ table type possible_keys key key_len ref rows Extra t1 ALL NULL NULL NULL NULL 4 t1 ALL NULL NULL NULL NULL 4 drop table t1; +CREATE TABLE t1 ( id int(3) unsigned default '0') ENGINE=MyISAM; +INSERT INTO t1 (id) VALUES("1"); +CREATE TABLE t2 ( id int(3) unsigned default '0', id_master int(5) default '0', text1 varchar(5) default NULL, text2 varchar(5) default NULL) ENGINE=MyISAM; +INSERT INTO t2 (id, id_master, text1, text2) VALUES("1", "1", +"foo1", "bar1"); +INSERT INTO t2 (id, id_master, text1, text2) VALUES("2", "1", +"foo2", "bar2"); +INSERT INTO t2 (id, id_master, text1, text2) VALUES("3", "1", NULL, +"bar3"); +INSERT INTO t2 (id, id_master, text1, text2) VALUES("4", "1", +"foo4", "bar4"); +SELECT 1 AS id_master, 1 AS id, NULL AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master; +id_master id text1 text2 +1 1 NULL ABCDE +1 1 foo1 bar1 +1 2 foo2 bar2 +1 3 NULL bar3 +1 4 foo4 bar4 +SELECT 1 AS id_master, 1 AS id, 'ABCDE' AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master; +id_master id text1 text2 +1 1 ABCDE ABCDE +1 1 foo1 bar1 +1 2 foo2 bar2 +1 3 NULL bar3 +1 4 foo4 bar4 +drop table if exists t1,t2; +create table t1 (a int not null primary key auto_increment, b int, key(b)); +create table t2 (a int not null primary key auto_increment, b int); +insert into t1 (b) values (1),(2),(2),(3); +insert into t2 (b) values (10),(11),(12),(13); +explain extended (select * from t1 where a=1) union (select * from t2 where a=1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 +2 UNION t2 const PRIMARY PRIMARY 4 const 1 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) +(select * from t1 where a=5) union (select * from t2 where a=1); +a b +1 10 +(select * from t1 where a=5 and a=6) union (select * from t2 where a=1); +a b +1 10 +(select t1.a,t1.b from t1,t2 where t1.a=5) union (select * from t2 where a=1); +a b +1 10 +(select * from t1 where a=1) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a); +a b +1 1 +2 2 +3 3 +4 4 +explain (select * from t1 where a=1 and b=10) union (select straight_join t1.a,t2.a from t1,t2 where t1.a=t2.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index +2 UNION t2 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +explain (select * from t1 where a=1) union (select * from t1 where b=1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 +2 UNION t1 ref b b 5 const 1 Using where +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +drop table t1,t2; +create table t1 ( id int not null auto_increment, primary key (id) ,user_name text ); +create table t2 ( id int not null auto_increment, primary key (id) ,group_name text ); +create table t3 ( id int not null auto_increment, primary key (id) ,user_id int ,index user_idx (user_id) ,foreign key (user_id) references users(id) ,group_id int ,index group_idx (group_id) ,foreign key (group_id) references groups(id) ); +insert into t1 (user_name) values ('Tester'); +insert into t2 (group_name) values ('Group A'); +insert into t2 (group_name) values ('Group B'); +insert into t3 (user_id, group_id) values (1,1); +select 1 'is_in_group', a.user_name, c.group_name, b.id from t1 a, t3 b, t2 c where a.id = b.user_id and b.group_id = c.id UNION select 0 'is_in_group', a.user_name, c.group_name, null from t1 a, t2 c; +is_in_group user_name group_name id +1 Tester Group A 1 +0 Tester Group A NULL +0 Tester Group B NULL +drop table t1, t2, t3; +create table t1 (mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, matintnum CHAR(6) NOT NULL, test MEDIUMINT UNSIGNED NULL); +create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED NOT NULL); +insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9); +insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105); +SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id union SELECT 0, 0; +pla_id matintnum +100 a +101 a +102 a +103 b +104 b +105 c +0 0 +drop table t1, t2; +create table t1 SELECT "a" as a UNION select "aa" as a; +select * from t1; +a +a +aa +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(2) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT 12 as a UNION select "aa" as a; +select * from t1; +a +12 +aa +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT 12 as a UNION select 12.2 as a; +select * from t1; +a +12.0 +12.2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double(53,1) NOT NULL default '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); +insert into t2 values (NULL, 1, 3, 4, 1.5, 2.5, 1972, '1972-10-22', '1972-10-22 11:50', 'testc', 'testv', 'tetetetetest', 'teeeeeeeeeeeest'); +create table t1 SELECT it2 from t2 UNION select it1 from t2; +select * from t1; +it2 +1 +NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `it2` tinyint(4) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT it2 from t2 UNION select i from t2; +select * from t1; +it2 +1 +3 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `it2` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT i from t2 UNION select f from t2; +select * from t1; +i +3 +1.5 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT f from t2 UNION select d from t2; +select * from t1; +f +1.5 +2.5 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT ib from t2 UNION select f from t2; +select * from t1; +ib +4 +1.5 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ib` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT ib from t2 UNION select d from t2; +select * from t1; +ib +4 +2.5 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ib` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT f from t2 UNION select y from t2; +select * from t1; +f +1.5 +1972 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f` float default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT f from t2 UNION select da from t2; +select * from t1; +f +1.5 +1972-10-22 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f` binary(24) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT y from t2 UNION select da from t2; +select * from t1; +y +1972 +1972-10-22 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `y` binary(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT y from t2 UNION select dt from t2; +select * from t1; +y +1972 +1972-10-22 11:50:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `y` binary(19) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT da from t2 UNION select dt from t2; +select * from t1; +da +1972-10-22 00:00:00 +1972-10-22 11:50:00 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `da` datetime default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT dt from t2 UNION select sc from t2; +select * from t1; +dt +1972-10-22 11:50:00 +testc +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `dt` binary(19) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT dt from t2 UNION select sv from t2; +select * from t1; +dt +1972-10-22 11:50:00 +testv +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `dt` binary(19) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT sc from t2 UNION select sv from t2; +select * from t1; +sc +testc +testv +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `sc` varchar(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT dt from t2 UNION select b from t2; +select * from t1; +dt +1972-10-22 11:50:00 +tetetetetest +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `dt` blob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT sv from t2 UNION select b from t2; +select * from t1; +sv +testv +tetetetetest +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `sv` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2; +select * from t1; +i +3 +2.5 +tetetetetest +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` blob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT sv from t2 UNION select tx from t2; +select * from t1; +sv +testv +teeeeeeeeeeeest +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `sv` text +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 SELECT b from t2 UNION select tx from t2; +select * from t1; +b +tetetetetest +teeeeeeeeeeeest +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; +create table t1 (d decimal(10,1)); +create table t2 (d decimal(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +d +1.234567800 +100000000.0 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `d` decimal(10,9) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2,t3; +create table t1 select 1 union select -1; +select * from t1; +1 +1 +-1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `1` bigint(20) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 select _latin1"test" union select _latin2"testt" ; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'UNION' +create table t1 select _latin2"test" union select _latin2"testt" ; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `test` char(5) character set latin2 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (s char(200)); +insert into t1 values (repeat("1",200)); +create table t2 select * from t1; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +set local tmp_table_size=1024; +select count(*) from (select * from t1 union all select * from t2 order by 1) b; +count(*) +21 +select count(*) from t1; +count(*) +8 +select count(*) from t2; +count(*) +13 +drop table t1,t2; +set local tmp_table_size=default; +create table t1 (a int, index (a), b int); +insert t1 values (1,1),(2,2),(3,3),(4,4),(5,5); +insert t1 select a+1, a+b from t1; +insert t1 select a+1, a+b from t1; +insert t1 select a+1, a+b from t1; +insert t1 select a+1, a+b from t1; +insert t1 select a+1, a+b from t1; +FLUSH STATUS; +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 0 +select count(*) from t1 where a=7; +count(*) +26 +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 0 +select count(*) from t1 where b=13; +count(*) +10 +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 1 +select count(*) from t1 where b=13 union select count(*) from t1 where a=7; +count(*) +10 +26 +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 2 +select count(*) from t1 where a=7 union select count(*) from t1 where b=13; +count(*) +26 +10 +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 3 +drop table t1; +create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM; +insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777'); +select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 A left join t1 B on A.NAME = B.NAME and B.IID = 2 where A.IID = 1 and (A.PHONE <> B.PHONE or B.NAME is null) union select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 B left join t1 A on B.NAME = A.NAME and A.IID = 1 where B.IID = 2 and (A.PHONE <> B.PHONE or A.NAME is null); +NAME PHONE NAME PHONE +a 111 NULL NULL +b 222 NULL NULL +d 444 d 454 +NULL NULL f 666 +NULL NULL g 777 +drop table t1; +create table t1 (col1 tinyint unsigned, col2 tinyint unsigned); +insert into t1 values (1,2),(3,4),(5,6),(7,8),(9,10); +select col1 n from t1 union select col2 n from t1 order by n; +n +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +alter table t1 add index myindex (col2); +select col1 n from t1 union select col2 n from t1 order by n; +n +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +drop table t1; +create table t1 (i int); +insert into t1 values (1); +select * from t1 UNION select * from t1; +i +1 +select * from t1 UNION ALL select * from t1; +i +1 +1 +select * from t1 UNION select * from t1 UNION ALL select * from t1; +i +1 +1 +drop table t1; +select 1 as a union all select 1 union all select 2 union select 1 union all select 2; +a +1 +2 +2 +set sql_select_limit=1; +select 1 union select 2; +1 +1 +(select 1) union (select 2); +1 +1 +(select 1) union (select 2) union (select 3) limit 2; +1 +1 +2 +set sql_select_limit=default; +create table t1 (a int); +insert into t1 values (100), (1); +create table t2 (a int); +insert into t2 values (100); +select a from t1 union select a from t2 order by a; +a +1 +100 +SET SQL_SELECT_LIMIT=1; +select a from t1 union select a from t2 order by a; +a +1 +drop table t1, t2; +set sql_select_limit=default; +CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +explain (select * from t1) union (select * from t2) order by not_existing_column; +ERROR 42S22: Unknown column 'not_existing_column' in 'order clause' +drop table t1, t2; +CREATE TABLE t1 (uid int(1)); +INSERT INTO t1 SELECT 150; +SELECT 'a' UNION SELECT uid FROM t1; +a +a +150 +drop table t1; +CREATE TABLE t1 ( ID1 int(10) unsigned NOT NULL DEFAULT '0' , ID2 datetime NOT NULL DEFAULT '0000-00-00 00:00:00' , DATA1 varchar(10) , DATA2 double(5,4) , DATA3 datetime , PRIMARY KEY (ID1,ID2)); +CREATE TABLE t2 ( ID int(3) unsigned NOT NULL DEFAULT '0' , DATA1 timestamp DEFAULT '0000-00-00 00:00:00' , PRIMARY KEY (ID)); +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1); +ID1 ID2 DATA1 DATA2 DATA3 ID DATA1 +drop table t1,t2; diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 11aff8fe50a..0037fb9ea95 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -1,15 +1,15 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1 (a int auto_increment , primary key (a)); insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); update t1 set a=a+10 where a > 34; update t1 set a=a+100 where a > 0; update t1 set a=a+100 where a=1 and a=2; update t1 set a=b+100 where a=1 and a=2; -Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'field list' update t1 set a=b+100 where c=1 and a=2; -Unknown column 'c' in 'where clause' +ERROR 42S22: Unknown column 'c' in 'where clause' update t1 set d=a+100 where a=1; -Unknown column 'd' in 'field list' +ERROR 42S22: Unknown column 'd' in 'field list' select * from t1; a 101 @@ -94,7 +94,7 @@ KEY k2 (type), KEY k3 (parent), KEY k4 (assignment), KEY ticket (ticket) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (773,773,'','','',980257344,20010318180652,0,'Open',10,0,0,0,1,'','','','',''); alter table t1 change lfdnr lfdnr int(10) unsigned not null auto_increment; update t1 set status=1 where type='Open'; @@ -137,13 +137,16 @@ a b 13 2 111 100 111 100 -drop table t1; +create table t2 (a int not null, b int not null); +insert into t2 values (1,1),(1,2),(1,3); +update t1 set b=(select distinct 1 from (select * from t2) a); +drop table t1,t2; CREATE TABLE t1 ( `id_param` smallint(3) unsigned NOT NULL default '0', `nom_option` char(40) NOT NULL default '', `valid` tinyint(1) NOT NULL default '0', KEY `id_param` (`id_param`,`nom_option`) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 (id_param,nom_option,valid) VALUES (185,'600x1200',1); UPDATE t1 SET nom_option='test' WHERE id_param=185 AND nom_option='600x1200' AND valid=1 LIMIT 1; select * from t1; @@ -155,7 +158,7 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6), ('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2), ('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4), ('2','2','0',1,7); -delete from t1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3); +delete from m1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3); select * from t1; F1 F2 F3 cnt groupid 0 0 0 1 6 diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 3e83438b273..2750478c1c5 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -1,10 +1,14 @@ +drop table if exists t1,t2; set @a := foo; -Unknown column 'foo' in 'field list' +ERROR 42S22: Unknown column 'foo' in 'field list' set @a := connection_id() + 3; select @a - connection_id(); @a - connection_id() 3 -drop table if exists t1,t2; +set @b := 1; +select @b; +@b +1 CREATE TABLE t1 ( i int not null, v int not null,index (i)); insert into t1 values (1,1),(1,3),(2,1); create table t2 (i int not null, unique (i)); @@ -18,17 +22,17 @@ i @vv1:=if(sv1.i,1,0) @vv2:=if(sv2.i,1,0) @vv3:=if(sv3.i,1,0) @vv1+@vv2+@vv3 1 1 0 1 2 2 1 0 0 1 explain select * from t1 where i=@vv1; -table type possible_keys key key_len ref rows Extra -t1 ref i i 4 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i i 4 const 1 Using where explain select * from t1 where @vv1:=@vv1+1 and i=@vv1; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 3 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where explain select @vv1:=i from t1 where i=@vv1; -table type possible_keys key key_len ref rows Extra -t1 index NULL i 4 NULL 3 Using where; Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i 4 NULL 3 Using where; Using index explain select * from t1 where i=@vv1; -table type possible_keys key key_len ref rows Extra -t1 ref i i 4 const 1 Using where +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i i 4 const 1 Using where drop table t1,t2; set @a=0,@b=0; select @a:=10, @b:=1, @a > @b, @a < @b; @@ -116,3 +120,78 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i; 1 3 2 0 3 6 3 0 drop table t1; +set @a=_latin2'test'; +select charset(@a),collation(@a),coercibility(@a); +charset(@a) collation(@a) coercibility(@a) +latin2 latin2_general_ci 3 +select @a=_latin2'TEST'; +@a=_latin2'TEST' +1 +select @a=_latin2'TEST' collate latin2_bin; +@a=_latin2'TEST' collate latin2_bin +0 +set @a=_latin2'test' collate latin2_general_ci; +select charset(@a),collation(@a),coercibility(@a); +charset(@a) collation(@a) coercibility(@a) +latin2 latin2_general_ci 0 +select @a=_latin2'TEST'; +@a=_latin2'TEST' +1 +select @a=_latin2'TEST' collate latin2_bin; +ERROR HY000: Illegal mix of collations (latin2_general_ci,EXPLICIT) and (latin2_bin,EXPLICIT) for operation '=' +select charset(@a:=_latin2'test'); +charset(@a:=_latin2'test') +latin2 +select collation(@a:=_latin2'test'); +collation(@a:=_latin2'test') +latin2_general_ci +select coercibility(@a:=_latin2'test'); +coercibility(@a:=_latin2'test') +3 +select collation(@a:=_latin2'test' collate latin2_bin); +collation(@a:=_latin2'test' collate latin2_bin) +latin2_bin +select coercibility(@a:=_latin2'test' collate latin2_bin); +coercibility(@a:=_latin2'test' collate latin2_bin) +0 +select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; +(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' +0 +select charset(@a),collation(@a),coercibility(@a); +charset(@a) collation(@a) coercibility(@a) +latin2 latin2_bin 0 +select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; +ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '=' +create table t1 (a varchar(50)); +reset master; +SET TIMESTAMP=10000; +SET @`a b`='hello'; +INSERT INTO t1 VALUES(@`a b`); +set @var1= "';aaa"; +insert into t1 values (@var1); +create table t2 (c char(30)) charset=ucs2; +set @v=convert('abc' using ucs2); +insert into t2 values (@v); +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci +master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) +master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci +master-bin.000001 226 Query 1 226 use `test`; insert into t1 values (@var1) +master-bin.000001 290 Query 1 290 use `test`; create table t2 (c char(30)) charset=ucs2 +master-bin.000001 366 User var 1 366 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci +master-bin.000001 406 Query 1 406 use `test`; insert into t2 values (@v) +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; +use test; +SET TIMESTAMP=10000; +INSERT INTO t1 VALUES(@`a b`); +SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; +SET TIMESTAMP=10000; +insert into t1 values (@var1); +SET TIMESTAMP=10000; +create table t2 (c char(30)) charset=ucs2; +SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; +SET TIMESTAMP=10000; +insert into t2 values (@v); +drop table t1, t2; diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index 4eb34ebfd63..ab5779859ae 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -1,3 +1,4 @@ +drop table if exists t1; select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ; 0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0 A 65 9223372036854775807 18446744073709551615 @@ -7,18 +8,19 @@ select 0x31+1,concat(0x31)+1,-0xf; select x'31',X'ffff'+0; x'31' X'ffff'+0 1 65535 -drop table if exists t1; create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) ); insert into t1 set UNIQ=0x38afba1d73e6a18a; insert into t1 set UNIQ=123; -explain select * from t1 where UNIQ=0x38afba1d73e6a18a; -table type possible_keys key key_len ref rows Extra -t1 const UNIQ UNIQ 8 const 1 +explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const UNIQ UNIQ 8 const 1 +Warnings: +Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610) drop table t1; select x'hello'; -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 'x'hello'' at line 1 +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 'x'hello'' at line 1 select 0xfg; -Unknown column '0xfg' in 'field list' +ERROR 42S22: Unknown column '0xfg' in 'field list' create table t1 select 1 as x, 2 as xx; select x,xx from t1; x xx diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 13d09e09783..5d3f32cdd55 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; set @`test`=1,@TEST=3,@select=2,@t5=1.23456; select @test,@`select`,@TEST,@not_used; @test @`select` @TEST @not_used @@ -22,6 +22,11 @@ NULL NULL NULL NULL select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; @t1:=(@t2:=1)+@t3:=4 @t1 @t2 @t3 5 5 1 4 +explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3` select @t5; @t5 1.23456 @@ -50,7 +55,7 @@ Variable_name Value max_join_size 100 show global variables like 'max_join_size'; Variable_name Value -max_join_size HA_POS_ERROR +max_join_size 10 set GLOBAL max_join_size=2000; show global variables like 'max_join_size'; Variable_name Value @@ -76,9 +81,19 @@ select @@VERSION=version(); select last_insert_id(345); last_insert_id(345) 345 +explain extended select last_insert_id(345); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache last_insert_id(345) AS `last_insert_id(345)` select @@IDENTITY,last_insert_id(), @@identity; -@@identity last_insert_id() @@identity +@@IDENTITY last_insert_id() @@identity 345 345 345 +explain extended select @@IDENTITY,last_insert_id(), @@identity; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sql_no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity` set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON"; set global concurrent_insert=ON; show variables like 'concurrent_insert'; @@ -100,13 +115,13 @@ set global concurrent_insert=DEFAULT; show variables like 'concurrent_insert'; Variable_name Value concurrent_insert ON -set table_type=MYISAM, table_type="HEAP", global table_type="INNODB"; -show local variables like 'table_type'; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +show local variables like 'storage_engine'; Variable_name Value -table_type HEAP -show global variables like 'table_type'; +storage_engine HEAP +show global variables like 'storage_engine'; Variable_name Value -table_type INNODB +storage_engine InnoDB set GLOBAL query_cache_size=100000; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; @@ -152,18 +167,10 @@ set net_buffer_length=2000000000; show variables like 'net_buffer_length'; Variable_name Value net_buffer_length 1048576 -set GLOBAL character set cp1251_koi8; -show global variables like "convert_character_set"; -Variable_name Value -convert_character_set cp1251_koi8 set character set cp1251_koi8; -show variables like "convert_character_set"; -Variable_name Value -convert_character_set cp1251_koi8 -set global character set default, session character set default; -show variables like "convert_character_set"; +show variables like "character_set_client"; Variable_name Value -convert_character_set cp1251_koi8 +character_set_client cp1251 select @@timestamp>0; @@timestamp>0 1 @@ -204,48 +211,50 @@ range_alloc_block_size 2048 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 set big_tables=OFFF; -Variable 'big_tables' can't be set to the value of 'OFFF' +ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF' set big_tables="OFFF"; -Variable 'big_tables' can't be set to the value of 'OFFF' +ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF' set unknown_variable=1; -Unknown system variable 'unknown_variable' +ERROR HY000: Unknown system variable 'unknown_variable' set max_join_size="hello"; -Wrong argument type to variable 'max_join_size' -set table_type=UNKNOWN_TABLE_TYPE; -Variable 'table_type' can't be set to the value of 'UNKNOWN_TABLE_TYPE' -set table_type=INNODB, big_tables=2; -Variable 'big_tables' can't be set to the value of '2' -show local variables like 'table_type'; -Variable_name Value -table_type HEAP +ERROR 42000: Incorrect argument type to variable 'max_join_size' +set storage_engine=UNKNOWN_TABLE_TYPE; +ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' +set storage_engine=INNODB, big_tables=2; +ERROR 42000: Variable 'big_tables' can't be set to the value of '2' +show local variables like 'storage_engine'; +Variable_name Value +storage_engine HEAP set SESSION query_cache_size=10000; -Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -set GLOBAL table_type=DEFAULT; -Variable 'table_type' doesn't have a default value -set convert_character_set=UNKNOWN_CHARACTER_SET; -Unknown character set: 'UNKNOWN_CHARACTER_SET' -set character set unknown; -Unknown character set: 'unknown' -set character set 0; -Wrong argument type to variable 'convert_character_set' +ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +set GLOBAL storage_engine=DEFAULT; +ERROR 42000: Variable 'storage_engine' doesn't have a default value +set character_set_client=UNKNOWN_CHARACTER_SET; +ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET' +set collation_connection=UNKNOWN_COLLATION; +ERROR HY000: Unknown collation: 'UNKNOWN_COLLATION' +set character_set_client=NULL; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'NULL' +set collation_connection=NULL; +ERROR 42000: Variable 'collation_connection' can't be set to the value of 'NULL' set global autocommit=1; -Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL +ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL select @@global.timestamp; -Variable 'timestamp' is a LOCAL variable +ERROR HY000: Variable 'timestamp' is a SESSION variable set @@version=''; -Unknown system variable 'version' +ERROR HY000: Unknown system variable 'version' set @@concurrent_insert=1; -Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL +ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL set @@global.sql_auto_is_null=1; -Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL +ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable and can't be used with SET GLOBAL select @@global.sql_auto_is_null; -Variable 'sql_auto_is_null' is a LOCAL variable +ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable set myisam_max_sort_file_size=100; -Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL set myisam_max_extra_sort_file_size=100; -Variable 'myisam_max_extra_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +ERROR HY000: Variable 'myisam_max_extra_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL set @@SQL_WARNINGS=NULL; -Variable 'sql_warnings' can't be set to the value of 'NULL' +ERROR 42000: Variable 'sql_warnings' can't be set to the value of 'NULL' set autocommit=1; set big_tables=1; select @@autocommit, @@big_tables; @@ -253,8 +262,8 @@ select @@autocommit, @@big_tables; 1 1 set global binlog_cache_size=100; set bulk_insert_buffer_size=100; -set convert_character_set=cp1251_koi8; -set convert_character_set=default; +set character set cp1251_koi8; +set character set default; set @@global.concurrent_insert=1; set global connect_timeout=100; select @@delay_key_write; @@ -343,14 +352,13 @@ set sql_select_limit=1; set global sql_slave_skip_counter=100; set sql_warnings=1; set global table_cache=100; -set table_type=myisam; +set storage_engine=myisam; set global thread_cache_size=100; set timestamp=1, timestamp=default; set tmp_table_size=100; set tx_isolation="READ-COMMITTED"; set wait_timeout=100; set log_warnings=1; -DROP TABLE IF EXISTS t1,t2; create table t1 (a int not null auto_increment, primary key(a)); create table t2 (a int not null auto_increment, primary key(a)); insert into t1 values(null),(null),(null); @@ -369,18 +377,65 @@ check table t1,t2; Table Op Msg_type Msg_text test.t1 check status OK test.t2 check status OK +select max(a) +1, max(a) +2 into @xx,@yy from t1; drop table t1,t2; select @@xxxxxxxxxx; -Unknown system variable 'xxxxxxxxxx' +ERROR HY000: Unknown system variable 'xxxxxxxxxx' select 1; 1 1 select @@session.key_buffer_size; -Variable 'key_buffer_size' is a GLOBAL variable +ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable +set ft_boolean_syntax = @@init_connect; +ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL +set global ft_boolean_syntax = @@init_connect; +ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '' +set init_connect = NULL; +ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with SET GLOBAL +set global init_connect = NULL; +set ft_boolean_syntax = @@init_connect; +ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL +set global ft_boolean_syntax = @@init_connect; +ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '' set global myisam_max_sort_file_size=4294967296; show global variables like 'myisam_max_sort_file_size'; Variable_name Value myisam_max_sort_file_size MAX_FILE_SIZE +set global myisam_max_sort_file_size=default; +select @@global.max_user_connections,@@local.max_join_size; +@@global.max_user_connections @@session.max_join_size +100 200 +set @svc=@@global.max_user_connections, @svj=@@local.max_join_size; +select @@global.max_user_connections,@@local.max_join_size; +@@global.max_user_connections @@session.max_join_size +100 200 +set @@global.max_user_connections=111,@@local.max_join_size=222; +select @@global.max_user_connections,@@local.max_join_size; +@@global.max_user_connections @@session.max_join_size +111 222 +set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections; +select @@global.max_user_connections,@@local.max_join_size; +@@global.max_user_connections @@session.max_join_size +222 111 +set @@global.max_user_connections=@svc, @@local.max_join_size=@svj; +select @@global.max_user_connections,@@local.max_join_size; +@@global.max_user_connections @@session.max_join_size +100 200 +set @a=1, @b=2; +set @a=@b, @b=@a; +select @a, @b; +@a @b +2 1 +set @@global.global.key_buffer_size= 1; +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 'key_buffer_size= 1' at line 1 +set GLOBAL global.key_buffer_size= 1; +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 'key_buffer_size= 1' at line 1 +SELECT @@global.global.key_buffer_size; +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 'key_buffer_size' at line 1 +SELECT @@global.session.key_buffer_size; +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 'key_buffer_size' at line 1 +SELECT @@global.local.key_buffer_size; +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 'key_buffer_size' at line 1 set @tstlw = @@log_warnings; show global variables like 'log_warnings'; Variable_name Value diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index e5713718db0..d883feb7ce2 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -1,10 +1,135 @@ -drop table if exists t1; +drop table if exists t1, t2; +SET SQL_WARNINGS=1; create table t1 (a int); insert into t1 values (1); insert into t1 values ("hej"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 insert into t1 values ("hej"),("då"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 set SQL_WARNINGS=1; insert into t1 values ("hej"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 insert into t1 values ("hej"),("då"); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 drop table t1; set SQL_WARNINGS=0; +drop temporary table if exists not_exists; +Warnings: +Note 1051 Unknown table 'not_exists' +drop table if exists not_exists_table; +Warnings: +Note 1051 Unknown table 'not_exists_table' +show warnings limit 1; +Level Code Message +Note 1051 Unknown table 'not_exists_table' +drop database if exists not_exists_db; +Warnings: +Note 1008 Can't drop database 'not_exists_db'; database doesn't exist +show count(*) warnings; +@@session.warning_count +1 +create table t1(id int); +create table if not exists t1(id int); +select @@warning_count; +@@warning_count +0 +drop table t1; +create table t1(a tinyint, b int not null, c date, d char(5)); +load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 3 +Warning 1265 Data truncated for column 'c' at row 4 +Warning 1261 Row 5 doesn't contain data for all columns +Warning 1265 Data truncated for column 'b' at row 6 +Warning 1262 Row 7 was truncated; it contained more data than there were input columns +Warning 1264 Data truncated; out of range for column 'a' at row 8 +select @@warning_count; +@@warning_count +7 +drop table t1; +create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5)); +insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test'); +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'b' at row 2 +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'b' at row 3 +Warning 1265 Data truncated for column 'c' at row 3 +alter table t1 modify c char(4); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c' at row 2 +alter table t1 add d char(2); +update t1 set a=NULL where a=10; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2 +update t1 set c='mysql ab' where c='test'; +Warnings: +Warning 1265 Data truncated for column 'c' at row 4 +update t1 set d=c; +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'd' at row 2 +Warning 1265 Data truncated for column 'd' at row 3 +Warning 1265 Data truncated for column 'd' at row 4 +create table t2(a tinyint NOT NULL, b char(3)); +insert into t2 select b,c from t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4 +Warning 1265 Data truncated for column 'b' at row 4 +insert into t2(b) values('mysqlab'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +set sql_warnings=1; +insert into t2(b) values('mysqlab'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +set sql_warnings=0; +drop table t1, t2; +create table t1(a char(10)); +alter table t1 add b char; +set max_error_count=10; +update t1 set b=a; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b' at row 4 +Warning 1265 Data truncated for column 'b' at row 5 +Warning 1265 Data truncated for column 'b' at row 6 +Warning 1265 Data truncated for column 'b' at row 7 +Warning 1265 Data truncated for column 'b' at row 8 +Warning 1265 Data truncated for column 'b' at row 9 +Warning 1265 Data truncated for column 'b' at row 10 +select @@warning_count; +@@warning_count +50 +drop table t1; +create table t1 (id int) engine=isam; +Warnings: +Warning 1266 Using storage engine MyISAM for table 't1' +alter table t1 engine=isam; +Warnings: +Warning 1266 Using storage engine MyISAM for table 't1' +drop table t1; +create table t1 (id int) type=heap; +Warnings: +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +alter table t1 type=myisam; +Warnings: +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +drop table t1; +set table_type=MYISAM; +Warnings: +Warning 1287 'table_type' is deprecated; use 'storage_engine' instead |