diff options
Diffstat (limited to 'mysql-test/r')
238 files changed, 21201 insertions, 2267 deletions
diff --git a/mysql-test/r/alias.result b/mysql-test/r/alias.result index 5ed10b58929..7f606367f39 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 c2fd5161353..9b90742762e 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,7 +121,7 @@ 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'; drop database mysqltest; @@ -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 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 character set latin1 collate latin1_general_cs +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 character set latin2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `myblob` longblob, + `mytext` longtext character set latin2 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +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,3 +458,15 @@ 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; diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 5e859bb0b7a..f18b925460c 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -1,26 +1,33 @@ 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 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/auto_increment.result b/mysql-test/r/auto_increment.result index 2d6b058d9c5..9541fa6d355 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -1,5 +1,6 @@ drop table if exists t1; -create table t1 (a int not null auto_increment,b int, primary key (a)) type=myisam auto_increment=3; +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 +119,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 +128,145 @@ 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 high_priority 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 +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..e414934b07c 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'); @@ -37,3 +37,10 @@ analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Operation need committed state drop table t1; +create table t1 (a int) engine=bdb; +set autocommit=0; +insert into t1 values(1); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Operation need committed state +drop table t1; diff --git a/mysql-test/r/bdb-deadlock.result b/mysql-test/r/bdb-deadlock.result index 55b3d3ea2a5..c5871ff282a 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 2ccb5148d58..bee40eac30d 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 error 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 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..2b4701389db 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 high_priority 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 2de8b01bc3a..f6ad190b05a 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -45,30 +45,29 @@ 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,"-") +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; +concat("-",a,"-",b,"-") 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 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,3 +79,34 @@ 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 latin1 +select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; +collation(a) collation(b) collation(binary 'ccc') +latin1_bin binary latin1_bin +drop table t1; 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..14b1788ddd6 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 high_priority (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 high_priority (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 high_priority 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..cdeb5b3dc21 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 high_priority ~(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..c0608af0de2 --- /dev/null +++ b/mysql-test/r/connect.result @@ -0,0 +1,49 @@ +show tables; +Tables_in_mysql +columns_priv +db +func +help_category +help_keyword +help_relation +help_topic +host +tables_priv +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 +user +show tables; +Tables_in_test +update mysql.user set password=old_password("gambling2") where user="test"; +flush privileges; +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 +user +show tables; +Tables_in_test +delete from mysql.user where user="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 22743782484..2405c34b9fb 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 test_$1; create table t1 (b char(0)); insert into t1 values (""),(null); select * from t1; @@ -9,33 +10,40 @@ 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 only be 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 1ea10 (1a20 int,1e int); insert into 1ea10 values(1,1); select 1ea10.1a20,1e+ 1e+10 from 1ea10; @@ -45,6 +53,8 @@ drop table 1ea10; create table t1 (t1.index int); drop table t1; drop database if exists test_$1; +Warnings: +Note 1008 Can't drop database 'test_$1'; database doesn't exist 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); @@ -55,18 +65,19 @@ create table test_$1.test2$ (a int); drop table test_$1.test2$; drop database test_$1; 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 +104,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 +180,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 +189,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 +238,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 +255,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,8 +263,280 @@ 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, 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 test_$1; +create table test_$1.t3 like t1; +create temporary table t3 like test_$1.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 test_$1.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 test_$1; +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 test_$1; +use test_$1; +select database(); +database() +test_$1 +drop database test_$1; +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/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..c837d676b6e --- /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) 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 +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 high_priority 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..2a59f976156 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 cp1251 +select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; +collation(a) collation(b) collation(binary 'ccc') +cp1251_bin binary cp1251_bin +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..b9146b5818f --- /dev/null +++ b/mysql-test/r/ctype_create.result @@ -0,0 +1,20 @@ +SET @@character_set_server=latin5; +CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251; +USE db1; +CREATE DATABASE db2; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET cp1251 */ +SHOW CREATE DATABASE db2; +Database Create Database +db2 CREATE DATABASE `db2` /*!40100 DEFAULT CHARACTER SET latin5 */ +DROP DATABASE db2; +USE db1; +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; +DROP DATABASE db1; 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..7209c86bb31 --- /dev/null +++ b/mysql-test/r/ctype_recoding.result @@ -0,0 +1,106 @@ +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 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 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_ucs.result b/mysql-test/r/ctype_ucs.result new file mode 100644 index 00000000000..30795aaf106 --- /dev/null +++ b/mysql-test/r/ctype_ucs.result @@ -0,0 +1,457 @@ +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; +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; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 223a18f19e9..b66ede3bed4 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -1,8 +1,94 @@ 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 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result new file mode 100644 index 00000000000..28af71b7681 --- /dev/null +++ b/mysql-test/r/ctype_utf8.result @@ -0,0 +1,220 @@ +drop table if exists t1; +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 +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 +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; diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result new file mode 100644 index 00000000000..fba1d9f47e3 --- /dev/null +++ b/mysql-test/r/date_formats.result @@ -0,0 +1,394 @@ +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:10AM', '%h:%i:%s%p'), +('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'), +('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'), +('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:10AM %h:%i:%s%p 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 +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 +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:10AM %h:%i:%s%p 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 +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 +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:10AM %h:%i:%s%p 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 +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 +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:10AM %h:%i:%s%p 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 +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 +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:10AM %h:%i:%s%p 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 +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 +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:10AM %h:%i:%s%p 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 +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 +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'), +('Sunday 01 2001', '%W %V %X'), +('Thursdai 12 1998', '%W %u %Y'), +(NULL, get_format(DATE,'USA')), +('Tuesday 52 2001', '%W %V %X'); +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 +Sunday 01 2001 %W %V %X NULL +Thursdai 12 1998 %W %u %Y NULL +NULL %m.%d.%Y NULL +Tuesday 52 2001 %W %V %X 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 +Sunday 01 2001 %W %V %X NULL +Thursdai 12 1998 %W %u %Y NULL +NULL %m.%d.%Y NULL +Tuesday 52 2001 %W %V %X 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: +Note 1292 Truncated wrong string 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: +Note 1292 Truncated wrong string 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(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 high_priority 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: +Note 1292 Truncated wrong 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: +Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012ABCD' +Note 1292 Truncated wrong time value: '-01:01:01.01 GG' +Note 1292 Truncated wrong datetime 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: +Note 1292 Truncated wrong date value: '2003-04-05 g' +Note 1292 Truncated wrong 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..f1acc5d2dfa 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,65 @@ 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; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result new file mode 100644 index 00000000000..f5754bb3332 --- /dev/null +++ b/mysql-test/r/derived.result @@ -0,0 +1,328 @@ +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 +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 +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 +2 DERIVED t1 ALL NULL NULL NULL NULL 2 +3 UNION t1 ALL NULL NULL NULL NULL 2 +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..d2519523f36 --- /dev/null +++ b/mysql-test/r/endspace.result @@ -0,0 +1,196 @@ +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 * 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 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 | +alter table t1 modify text1 text not null, pack_keys=1; +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 * from t1 where text1='teststring' or text1 > 'teststring\t'; +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 4 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/explain.result b/mysql-test/r/explain.result index d433078a251..02e1ace71e1 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,35 @@ 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; 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/fulltext.result b/mysql-test/r/fulltext.result index 738941f63c7..02850e4d902 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -13,6 +13,11 @@ 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 high_priority 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 high_priority 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 @@ -116,11 +142,15 @@ a b MySQL has now support for full-text search select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); a b -Full-text indexes are called collections select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); 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 select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); a b Full-text search in MySQL implements vector space model @@ -199,7 +229,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'); @@ -208,6 +238,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, @@ -215,19 +251,19 @@ KEY tig (ticket), fulltext index tix (inhalt) ); select * from t2 where MATCH inhalt AGAINST (t2.inhalt); -Wrong arguments to AGAINST +ERROR HY000: Wrong 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: Wrong 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 @@ -242,7 +278,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 @@ -252,7 +288,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 @@ -261,7 +297,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; @@ -270,7 +305,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); @@ -294,3 +328,36 @@ 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; diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result new file mode 100644 index 00000000000..0fdb7d4dbd1 --- /dev/null +++ b/mysql-test/r/fulltext2.result @@ -0,0 +1,208 @@ +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 +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..61aa1c0a497 --- /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 high_priority 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 high_priority 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 Too big size of uncompressed data. 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..70ebcf216fb 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 high_priority 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..fe3f5b9473a --- /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 high_priority 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..abdfda0423f 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 high_priority 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..5807bae6a06 --- /dev/null +++ b/mysql-test/r/func_gconcat.result @@ -0,0 +1,224 @@ +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 high_priority test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') 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) from t1 group by grp; +grp group_concat(a order by a,d+c) +1 1 +2 2,3 +3 4,5,6,7,8,9 +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 high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') 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 high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') 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); +insert into t1 values (2,"b"); +insert into t1 values (2,NULL); +insert into t1 values (3,"E"); +insert into t1 values (3,NULL); +insert into t1 values (3,"D"); +insert into t1 values (3,NULL); +insert into t1 values (3,NULL); +insert into t1 values (3,"D"); +insert into t1 values (4,""); +insert into t1 values (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 = 5; +select grp,group_concat(c) from t1 group by grp; +grp group_concat(c) +1 NULL +2 b +3 D,D,E +4 +5 NULL +Warnings: +Warning 1260 1 line(s) was(were) cut by group_concat() +show warnings; +Level Code Message +Warning 1260 1 line(s) was(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('test'),('test2'); +select * from t1 having group_concat(bar)=''; +bar +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; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 99c42bb83cf..147d7776e4d 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,22 +199,369 @@ 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( +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 (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; count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) @@ -239,11 +597,40 @@ 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 high_priority 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 (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 (col int); insert into t1 values (-1), (-2), (-3); diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 470004d2646..0a04585d77d 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 high_priority if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'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 high_priority 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..04b6fc038b0 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,61 @@ 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 high_priority 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; +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..75692738caf 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 @@ -46,3 +46,106 @@ select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; a a\b 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; diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 46ad7a14e25..9085849e582 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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.000000 10.000000 NULL NULL NULL 2.000000 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 high_priority 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.000000 10.000000 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 high_priority 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.000000 3.906891 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 high_priority 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.000000 1.255273 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 high_priority 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.000000 16.000000 +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 high_priority 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 high_priority no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()` select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1); pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) 3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398 +explain extended select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(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 high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)` 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.570796 +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 high_priority 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..fb1e715ac3b 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 high_priority (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 high_priority (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..323642cab8c 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 high_priority 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,27 @@ 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 diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result new file mode 100644 index 00000000000..31868261157 --- /dev/null +++ b/mysql-test/r/func_sapdb.result @@ -0,0 +1,215 @@ +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 +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 +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 +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 eeeb216d142..b101c18f505 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 high_priority 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,3 +39,20 @@ 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; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 7d2668c8cf6..d3225679b3e 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('') soundex('he') soundex('hello all folks') H000 H4142 +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(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") +foobar 1234567890ABCDEF 4Vx +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("") @@ -223,22 +257,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 +290,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; @@ -273,3 +305,337 @@ i ELT(j, '345', '34') 1 345 2 34 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 +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') +; +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 '' +) 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 high_priority 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)`,(_latin1'HE' collate _latin1'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; diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 5ea4ed5e4e0..338902e3f3a 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 high_priority 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 NOT NULL default '', + `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..3a945c0826f 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 high_priority (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 high_priority (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 high_priority ((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 high_priority 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 high_priority -(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 high_priority (_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 4715227425e..d2ea3c4a87c 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -376,7 +376,7 @@ 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) @@ -423,10 +423,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 @@ -440,3 +440,127 @@ 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) +2006-07-08 00:00:01 +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 +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 high_priority 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..ab5338d383b --- /dev/null +++ b/mysql-test/r/gis-rtree.result @@ -0,0 +1,752 @@ +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 4 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) +11 LINESTRING(140 140,160 160) +2 LINESTRING(149 149,151 151) +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) +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) +45 LINESTRING(51 51,60 60) +55 LINESTRING(41 51,50 60) +56 LINESTRING(41 41,50 50) +46 LINESTRING(51 41,60 50) +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; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result new file mode 100644 index 00000000000..be33c05c578 --- /dev/null +++ b/mysql-test/r/gis.result @@ -0,0 +1,468 @@ +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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 1a968fa4f2f..2c17373bd00 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -127,7 +127,78 @@ 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: Wrong 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; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result new file mode 100644 index 00000000000..0b127188586 --- /dev/null +++ b/mysql-test/r/grant2.result @@ -0,0 +1,23 @@ +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 +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..fc4073d23b1 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -121,7 +121,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 +135,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 @@ -159,7 +159,7 @@ select "user4"; user4 user4 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 diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index dba95614052..bbe3326fd34 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 high_priority 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 1cfc3a9de8b..b25150919d6 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: Wrong 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_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_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 d643070f7f9..7c88776579b 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 high_priority 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); diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index bdf7dc225f3..c3fbd73ac42 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; 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..f92a8653a69 --- /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 4 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 6a67bbc6f8b..4cec61faf0d 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,19 +1329,114 @@ 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 (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; diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result index 47abcb45fe5..5c5e0bb6dfe 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 if exists 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 diff --git a/mysql-test/r/innodb_handler.result b/mysql-test/r/innodb_handler.result index 8aa5309308f..a608e5c71ab 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..782a71e83d1 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..2e90f8b2d81 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..53867bf4546 --- /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 high_priority 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 high_priority 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..4c698075150 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 only be 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 error 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 error 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 error 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..7dbc09f9cc0 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 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 ae4d99e6241..c40f86827f8 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 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 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 @@ -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)); @@ -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 eq_ref 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,8 @@ 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; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 31d35a681aa..115f15bacb6 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'); @@ -118,13 +124,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 +152,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 +185,24 @@ 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; diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result new file mode 100644 index 00000000000..b83a226776d --- /dev/null +++ b/mysql-test/r/key_cache.result @@ -0,0 +1,261 @@ +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)); +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; +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; +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..14ca90b3dd2 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 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..5718397e1ec 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 16bc92cb711..8bf3db8cad0 100644 --- a/mysql-test/r/lowercase_table.result +++ b/mysql-test/r/lowercase_table.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t3,t4,T1; +drop table if exists t1,t2,t3,t4; 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); INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c'); @@ -18,7 +18,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; @@ -35,7 +36,25 @@ 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 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_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 7b2b9a47b0f..63e0a228aa5 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,28 @@ 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 +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 +570,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 +592,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/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..fc5ef88f045 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -74,19 +74,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 +96,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 +111,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 +125,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 +147,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 +172,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 +190,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 +235,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); @@ -310,7 +324,7 @@ a b 8 8 9 9 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 +351,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 +373,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 42000: Not unique table/alias: 't1' 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`) ); 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 1fd64377f12..5dc4803137e 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,22 @@ select * from t1 where a='807780' and b='477' and c='165'; a b c 807780 477 165 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 +453,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,'.') @@ -453,3 +482,25 @@ 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 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; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 79bf46280dd..5592524cc39 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -64,9 +64,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 +80,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/mysqldump.result b/mysql-test/r/mysqldump.result index 837a3627647..b0a15d9a021 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1,37 +1,304 @@ -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"); +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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(240,20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ("1234567890123456789012345678901234567890.00000000000000000000"),("0987654321098765432109876543210987654321.00000000000000000000"); +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 */; DROP TABLE t1; CREATE TABLE t1 (a double); INSERT INTO t1 VALUES (-9e999999); -CREATE TABLE t1 ( - a double default NULL + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES (RES); +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 */; + +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'); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 ('абÑЎе'); +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 */; + +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 (RES); + +/*!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); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 ```a`; +CREATE TABLE ```a` ( + `i` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE ```a` DISABLE KEYS */; +LOCK TABLES ```a` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE ```a` 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 */; + +drop table ```a`; +create table t1(a int); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 */; + +/*!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, CHARACTER_SET_CLIENT=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 */; + +/*!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, CHARACTER_SET_CLIENT=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 */; + +1 +2 +3 +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..a3a2bad7ec6 --- /dev/null +++ b/mysql-test/r/negation_elimination.result @@ -0,0 +1,378 @@ +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 +drop table t1; diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index ba2161d3147..cbd949d6e72 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 high_priority 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 high_priority (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 high_priority 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,3 +142,17 @@ 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 (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 diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 009a3e06eb2..4dfd17991cc 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 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..37e68d8b13e 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -1,27 +1,273 @@ -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 high_priority 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; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index f6c7bf5bc79..4cf6bee6123 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..2e9fe1995d0 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -222,7 +222,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 +251,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 +262,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 +284,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 +295,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 +332,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 +354,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 +370,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 +401,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 +413,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 +429,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 +439,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 +464,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 +546,3 @@ a b 1 2 5 NULL 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 -drop table t1; diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index 6733f2b142e..5729d7af166 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -12,7 +12,7 @@ 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' 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/query_cache.result b/mysql-test/r/query_cache.result index a9e9f167e5f..bbba7026b14 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 high_priority 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,59 @@ 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 GLOBAL query_cache_size=0; diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result index 3d27a599cf3..690ef24d809 100644 --- a/mysql-test/r/raid.result +++ b/mysql-test/r/raid.result @@ -1,8 +1,9 @@ -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; 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 TABLE t1 ( id int unsigned not null auto_increment primary key, c char(255) not null @@ -100,7 +101,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 b826dd1b677..d1a5dd00370 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,67 @@ 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 range x x 5 NULL 1 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 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)); 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) +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,i2 NULL NULL NULL 4 Range checked for each record (index map: 0x3) 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 i2 NULL NULL NULL 4 Range checked for each record (index map: 0x2) 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; @@ -314,3 +303,158 @@ a b 15 1 47 1 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; diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result index b2bb659502a..e422fbe49c1 100644 --- a/mysql-test/r/rename.result +++ b/mysql-test/r/rename.result @@ -37,3 +37,5 @@ select * from t3; 3 table 3 3 table 3 drop table if exists t1,t2,t3,t4; +Warnings: +Note 1051 Unknown table 't4' diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result deleted file mode 100644 index 6c2107b2cf3..00000000000 --- a/mysql-test/r/repair.result +++ /dev/null @@ -1,15 +0,0 @@ -drop table if exists t1; -create table t1 SELECT 1,"table 1"; -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; -repair table t1 use_frm; -Table Op Msg_type Msg_text -test.t1 repair error The handler for the table doesn't support repair -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"; diff --git a/mysql-test/r/repair_part1.result b/mysql-test/r/repair_part1.result new file mode 100644 index 00000000000..6dcec409ea6 --- /dev/null +++ b/mysql-test/r/repair_part1.result @@ -0,0 +1,30 @@ +drop table if exists t1; +create table t1 SELECT 1,"table 1"; +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 ENGINE=HEAP; +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair error 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 engine=myisam SELECT 1,"table 1"; diff --git a/mysql-test/r/repair_part2.result b/mysql-test/r/repair_part2.result index 77aa98c3da9..c9cf6c019f7 100644 --- a/mysql-test/r/repair_part2.result +++ b/mysql-test/r/repair_part2.result @@ -1,6 +1,6 @@ repair table t1; Table Op Msg_type Msg_text -test.t1 repair error Can't open file: 't1.MYI'. (errno: 130) +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 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..37d4f1d9b26 --- /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 high_priority ((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..b8071b16c2e 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 high_priority 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 high_priority 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 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_do_grant.result b/mysql-test/r/rpl_do_grant.result index fec935ae7ac..983cdf46620 100644 --- a/mysql-test/r/rpl_do_grant.result +++ b/mysql-test/r/rpl_do_grant.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; delete from mysql.user where user='rpl_do_grant'; delete from mysql.db where user='rpl_do_grant'; flush privileges; 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..dd277e41ad0 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; @@ -29,12 +29,12 @@ 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..6992b635672 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 79 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 79 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_get_lock.result b/mysql-test/r/rpl_get_lock.result index a8e602be03f..8e3e335b2d0 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"); +is_free_lock("lock") is_used_lock("lock") +0 6 +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 high_priority 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..5e970e71d0b 100644 --- a/mysql-test/r/rpl_ignore_grant.result +++ b/mysql-test/r/rpl_ignore_grant.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; delete from mysql.user where user='rpl_ignore_grant'; delete from mysql.db where user='rpl_ignore_grant'; flush privileges; @@ -17,7 +17,7 @@ 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' +ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' select count(*) from mysql.user where user='rpl_ignore_grant'; count(*) 0 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..ea917805560 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 high_priority 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_update.result b/mysql-test/r/rpl_multi_update.result index 1fa1dd104d2..65587d25f63 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_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..43de4a67ce9 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 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325 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..20755d265aa 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_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..465a1fed2b4 --- /dev/null +++ b/mysql-test/r/rpl_temporary.result @@ -0,0 +1,90 @@ +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`; create table t1(f int) +master-bin.000001 136 Query 1 136 use `test`; create table t2(f int) +master-bin.000001 193 Query 1 193 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10) +master-bin.000001 290 Query 1 290 use `test`; create temporary table t3(f int) +master-bin.000001 357 Query 1 357 use `test`; insert into t3 select * from t1 where f<6 +master-bin.000001 433 Query 1 433 use `test`; create temporary table t3(f int) +master-bin.000001 500 Query 1 500 use `test`; insert into t2 select count(*) from t3 +master-bin.000001 573 Query 1 573 use `test`; insert into t3 select * from t1 where f>=4 +master-bin.000001 650 Query 1 650 use `test`; drop temporary table t3 +master-bin.000001 708 Query 1 708 use `test`; insert into t2 select count(*) from t3 +master-bin.000001 781 Query 1 781 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_trunc_binlog.result b/mysql-test/r/rpl_trunc_binlog.result index 27b7c3c5677..ad0fb9e5022 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 326 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..120c3d7a57f --- /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: Wrong 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: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave until master_log_file='master-bin.000001'; +ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave until relay_log_file='slave-relay-bin.000002'; +ERROR HY000: Wrong 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: Wrong 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..71147772ac4 --- /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='This is a test' +slave-bin.000001 600 User var 2 600 @s2='' +slave-bin.000001 635 User var 2 635 @s3='abc'def' +slave-bin.000001 677 User var 2 677 @s4='abc\def' +slave-bin.000001 719 User var 2 719 @s5='abc'def' +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='abc' +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..a940e0f2e95 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 high_priority 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,9 +2067,9 @@ 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; gvid the_success the_fail the_size the_time @@ -2085,6 +2089,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 (); @@ -2275,9 +2289,9 @@ a a a 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 +2311,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 367bdd798b4..23a39a242a1 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -136,7 +136,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 +159,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 +168,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..6bffdd85aa4 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 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 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 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 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 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 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..3693d92693f 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -26,7 +26,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 +43,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 Type 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 +77,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' - ) comment = 'it\'s a table' ; -show create table t1 ; +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; 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 +126,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 +134,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 +145,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 +160,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 +168,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 +179,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 +211,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 +225,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, `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 +238,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 +265,100 @@ 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 Type 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 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 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 Type 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 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 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 Type 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 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 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 Type 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 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 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 Type 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 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 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 Type 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 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 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 Type 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 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +drop table t1, t2, t3; 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..cf0f9b4cc14 --- /dev/null +++ b/mysql-test/r/subselect.result @@ -0,0 +1,1709 @@ +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 optimisation +Note 1003 select high_priority 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 +Warnings: +Note 1249 Select 2 was reduced during optimisation +Note 1249 Select 4 was reduced during optimisation +Note 1003 select high_priority 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 +Warnings: +Note 1249 Select 2 was reduced during optimisation +Note 1003 select high_priority (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 high_priority 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: Wrong 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 +Warnings: +Note 1003 (select high_priority 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 high_priority (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 high_priority 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 high_priority test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2 limit 1)) +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 +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 high_priority (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 +Warnings: +Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1 +Note 1003 select high_priority test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq) limit 1) +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 if exists 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 +4 SUBQUERY t8 const PRIMARY PRIMARY 35 1 +2 SUBQUERY t8 const PRIMARY PRIMARY 35 const 1 +3 SUBQUERY t8 const PRIMARY PRIMARY 35 1 +Warnings: +Note 1003 select high_priority 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 high_priority 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 high_priority (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 +Warnings: +Note 1003 select high_priority 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 high_priority 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 +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select high_priority 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 optimisation +Note 1003 select high_priority 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 optimisation +Note 1249 Select 2 was reduced during optimisation +Note 1003 select high_priority 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 +Warnings: +Note 1003 select high_priority 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)) limit 1 union select 1 AS `Not_used` having (<cache>(test.t2.id) = <null_helper>(3)) limit 1)) +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 optimisation +Note 1003 select high_priority (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 high_priority 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 high_priority 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) limit 1)) 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 high_priority no_cache (select 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 high_priority no_cache (select 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 high_priority no_cache (select 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(1) NOT NULL default '0', + `(SELECT 1)` bigint(1) 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(1) NOT NULL default '0', + `(SELECT a)` bigint(1) 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(1) NOT NULL default '0', + `(SELECT a+0)` bigint(17) 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(17) 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 high_priority no_cache test.t1.a AS `a`,(select no_cache (select 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 high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a limit 1)) 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 high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a limit 1)) 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 high_priority 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(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; +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 high_priority 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 high_priority 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 high_priority 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)) limit 1)) +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 high_priority 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 high_priority 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 high_priority 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)) limit 1)) +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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority 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 high_priority test.t3.a AS `a` from test.t3 where <not>((test.t3.a < (select max(test.t2.b) from test.t2 limit 1))) +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 high_priority 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 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 +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 high_priority 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 high_priority 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) limit 1)) +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 high_priority 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; diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result new file mode 100644 index 00000000000..c2780a08d36 --- /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 t2 ALL DDOCTYPEID_IDX NULL NULL NULL 10 Using where +1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1 +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 32 test.t2.DOCID 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_innodb.result b/mysql-test/r/subselect_innodb.result new file mode 100644 index 00000000000..9c1816e295c --- /dev/null +++ b/mysql-test/r/subselect_innodb.result @@ -0,0 +1,98 @@ +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; 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/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 59cb6c38a59..d6d9aa1546b 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -3,15 +3,19 @@ Tables_in_db columns_priv db func +help_category +help_keyword +help_relation +help_topic host tables_priv 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 '', + `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '', + `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '', + `User` char(16) character set latin1 collate latin1_bin 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', @@ -26,12 +30,12 @@ db CREATE TABLE `db` ( `Lock_tables_priv` enum('N','Y') NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`,`User`), KEY `User` (`User`) -) TYPE=MyISAM COMMENT='Database privileges' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 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 '', + `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '', + `Db` char(64) character set latin1 collate latin1_bin 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', @@ -45,13 +49,13 @@ host CREATE TABLE `host` ( `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N', `Lock_tables_priv` enum('N','Y') NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`) -) TYPE=MyISAM COMMENT='Host privileges; Merged with database privileges' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 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 '', + `Host` varchar(60) character set latin1 collate latin1_bin NOT NULL default '', + `User` varchar(16) character set latin1 collate latin1_bin NOT NULL default '', + `Password` varchar(41) character set latin1 collate latin1_bin 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', @@ -81,39 +85,39 @@ 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=latin1 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) character set latin1 collate latin1_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', PRIMARY KEY (`name`) -) TYPE=MyISAM COMMENT='User defined functions' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 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 '', + `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '', + `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '', + `User` char(16) character set latin1 collate latin1_bin NOT NULL default '', + `Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '', `Grantor` char(77) NOT NULL default '', - `Timestamp` timestamp(14) NOT NULL, + `Timestamp` timestamp 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 '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), KEY `Grantor` (`Grantor`) -) TYPE=MyISAM COMMENT='Table privileges' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 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, + `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '', + `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '', + `User` char(16) character set latin1 collate latin1_bin NOT NULL default '', + `Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '', + `Column_name` char(64) character set latin1 collate latin1_bin NOT NULL default '', + `Timestamp` timestamp NOT NULL, `Column_priv` set('Select','Insert','Update','References') NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) -) TYPE=MyISAM COMMENT='Column privileges' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Column privileges' 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/truncate.result b/mysql-test/r/truncate.result index 1b387214292..d777bd184b2 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..e9861266b78 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: Too big column length 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 high_priority 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'; @@ -530,9 +593,9 @@ create table t1 (id integer primary key auto_increment, txt text, unique index t insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL); select * from t1 where txt='Chevy' or txt is NULL; id txt -3 NULL 1 Chevy 2 Chevy +3 NULL select * from t1 where txt='Chevy '; id txt 1 Chevy diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 8dfe14bc1a2..cebd005c2c8 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'); diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 756deab80e0..cc29c676283 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1,6 +1,12 @@ 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); +Warnings: +Warning 1265 Data truncated for column 't' at row 13 +Warning 1265 Data truncated for column 't' at row 14 +Warning 1265 Data truncated for column 't' at row 15 +Warning 1265 Data truncated for column 't' at row 16 +Warning 1265 Data truncated for column 't' at row 17 select * from t1; t 2000-01-01 00:00:00 @@ -52,8 +58,8 @@ t 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 +88,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 +99,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()); diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 5268ff3696b..dc78369f583 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,21 +423,27 @@ 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 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'); select * from t1; 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 e85bced353a..a0c0e0f5503 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 @@ -67,21 +70,27 @@ select min(a) from t1; min(a) -0.010 drop table t1; +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"); @@ -97,5 +106,5 @@ min(a) -0.010 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..4a3206005dd 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 NULL 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 NULL 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 NULL 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 longtext latin1_bin 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..68b56802120 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: +Note 1292 Truncated wrong time value: '10.22.22' +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 +Note 1292 Truncated wrong time value: '12.45a' select * from t1; t 10:22:33 diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index cd45bcf911d..72640a4a802 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()); @@ -44,8 +44,14 @@ date_format(a,"%Y %y") year(a) year(now()) 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 +Warnings: +Warning 1265 Data truncated for column 'ix' at row 10 +Warning 1265 Data truncated for column 'ix' at row 11 +Warning 1265 Data truncated for column 'ix' at row 12 +Warning 1265 Data truncated for column 'ix' at row 13 +Warning 1265 Data truncated for column 'ix' at row 14 +select ix+0 from t1; +ix+0 19991101000000 19990102030405 19990630232922 @@ -55,24 +61,24 @@ ix 19990501000000 19991101000000 19990501000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 +0 +0 +0 +0 +0 delete from t1; insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"); -select * from t1; -ix +select ix+0 from t1; +ix+0 19991101000000 19990102030405 19990630232922 19990601000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 -00000000000000 +0 +0 +0 +0 +0 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 +95,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,8 +120,8 @@ 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 @@ -132,31 +138,31 @@ t1 t2 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, + `t2` timestamp NOT NULL default '2003-01-01 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 +t1 timestamp YES NULL +t2 timestamp YES 2003-01-01 00:00:00 show columns from t1 like 't2'; Field Type Null Key Default Extra -t2 timestamp(14) YES 2003-01-01 00:00:00 +t2 timestamp YES 2003-01-01 00:00:00 create table t2 (select * from t1); show create table t2; 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 + `t1` timestamp NOT NULL, + `t2` timestamp NOT NULL default '2003-01-01 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 add column t0 timestamp first; 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 + `t0` timestamp NOT NULL, + `t1` timestamp NOT NULL default '2003-01-01 00:00:00', + `t2` timestamp NOT NULL default '2003-01-01 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create table t1 (ts1 timestamp, ts2 timestamp); set TIMESTAMP=1000000000; diff --git a/mysql-test/r/type_uint.result b/mysql-test/r/type_uint.result index 1acfc700d3a..f312e9b7f64 100644 --- a/mysql-test/r/type_uint.result +++ b/mysql-test/r/type_uint.result @@ -1,7 +1,10 @@ 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 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 4b9555c334b..8e288f9725f 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,11 +80,14 @@ 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 -t1 ALL NULL NULL NULL NULL 4 +(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 SELECT's can not 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 +Warnings: +Note 1003 (select high_priority 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 @@ -104,51 +103,68 @@ 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 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 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used 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 +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 UNION t1 ALL NULL NULL NULL NULL 4 +3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used 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 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 UNION NULL NULL NULL NULL NULL NULL NULL Impossible WHERE select a,b from t1 into outfile 'skr' union select a,b from t2; -Wrong usage of UNION and INTO +ERROR HY000: Wrong 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: Wrong 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: Wrong 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: Wrong 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 @@ -180,7 +196,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); @@ -331,11 +346,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 @@ -418,14 +429,498 @@ 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: Wrong 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 42S22: Unknown column 't2.a' in 'ORDER BY' drop table t1,t2; select length(version()) > 1 as `*` UNION select 2; * 1 2 +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 +Warnings: +Note 1003 (select high_priority 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 +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 +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(2) 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(4,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(12) 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` char(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` char(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` longblob +) 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(1) 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 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..a9351d2f1fb 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,45 @@ 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 '=' diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index 4eb34ebfd63..cf001158ae2 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 high_priority 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 b4a607cb174..aaf977efe50 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 high_priority 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 high_priority 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 high_priority 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"; +show variables like "character_set_client"; Variable_name Value -convert_character_set cp1251_koi8 -set global character set default, session character set default; -show variables like "convert_character_set"; -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'; +ERROR 42000: Wrong 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 -table_type HEAP +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,11 +377,57 @@ 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 '' +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 diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index e5713718db0..19d44ab6fea 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 |