diff options
Diffstat (limited to 'mysql-test/r')
74 files changed, 1743 insertions, 716 deletions
diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index 901f8a9acc2..178c5716911 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.416666666667 25.416666666667) +109 POINT(25.4166666666667 25.4166666666667) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon ORDER by fid; fid Area(g) @@ -326,8 +326,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; fid AsText(Centroid(g)) -117 POINT(55.588527753042 17.426536064114) -118 POINT(55.588527753042 17.426536064114) +117 POINT(55.5885277530424 17.426536064114) +118 POINT(55.5885277530424 17.426536064114) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; fid Area(g) diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index b657c620805..bab2c83448c 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -4,23 +4,23 @@ create table t4(n int); backup table t4 to '../../bogus'; Table Op Msg_type Msg_text test.t4 backup error Failed copying .frm file (errno: X) -test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X) test.t4 backup status Operation failed backup table t4 to '../../tmp'; Table Op Msg_type Msg_text -test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 backup status OK backup table t4 to '../../tmp'; Table Op Msg_type Msg_text test.t4 backup error Failed copying .frm file (errno: X) -test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X) test.t4 backup status Operation failed drop table t4; restore table t4 from '../../tmp'; Table Op Msg_type Msg_text -test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 restore status OK select count(*) from t4; count(*) @@ -29,18 +29,18 @@ create table t1(n int); insert into t1 values (23),(45),(67); backup table t1 to '../../tmp'; Table Op Msg_type Msg_text -test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 backup status OK drop table t1; restore table t1 from '../../bogus'; Table Op Msg_type Msg_text t1 restore error Failed copying .frm file Warnings: -Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X) restore table t1 from '../../tmp'; Table Op Msg_type Msg_text -test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore status OK select n from t1; n @@ -53,13 +53,13 @@ insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); backup table t2,t3 to '../../tmp'; Table Op Msg_type Msg_text -test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t2 backup status OK test.t3 backup status OK drop table t1,t2,t3; restore table t1,t2,t3 from '../../tmp'; Table Op Msg_type Msg_text -test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore status OK test.t2 restore status OK test.t3 restore status OK @@ -81,14 +81,14 @@ k drop table t1,t2,t3,t4; restore table t1 from '../../tmp'; Table Op Msg_type Msg_text -test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore status OK rename table t1 to t5; lock tables t5 write; backup table t5 to '../../tmp'; unlock tables; Table Op Msg_type Msg_text -test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t5 backup status OK drop table t5; DROP TABLE IF EXISTS `t+1`; @@ -96,12 +96,12 @@ CREATE TABLE `t+1` (c1 INT); INSERT INTO `t+1` VALUES (1), (2), (3); BACKUP TABLE `t+1` TO '../../tmp'; Table Op Msg_type Msg_text -test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t+1 backup status OK DROP TABLE `t+1`; RESTORE TABLE `t+1` FROM '../../tmp'; Table Op Msg_type Msg_text -test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t+1 restore status OK SELECT * FROM `t+1`; c1 diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 727433d3032..5e6c013bb38 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -188,7 +188,7 @@ DROP USER mysqltest_u1@localhost; # -- End of Bug#33507. -# -- Bug#35074: max_used_connections is not correct. +# -- Bug#35074: max_used_connections is not correct. FLUSH STATUS; diff --git a/mysql-test/r/consistent_snapshot.result b/mysql-test/r/consistent_snapshot.result index 90606abbe4e..694c996a58e 100644 --- a/mysql-test/r/consistent_snapshot.result +++ b/mysql-test/r/consistent_snapshot.result @@ -1,15 +1,23 @@ -drop table if exists t1; -create table t1 (a int) engine=innodb; -start transaction with consistent snapshot; -insert into t1 values(1); -select * from t1; +DROP TABLE IF EXISTS t1; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Switch to connection con1 +CREATE TABLE t1 (a INT) ENGINE=innodb; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +# Switch to connection con2 +INSERT INTO t1 VALUES(1); +# Switch to connection con1 +SELECT * FROM t1; a -commit; -delete from t1; -start transaction; -insert into t1 values(1); -select * from t1; +COMMIT; +DELETE FROM t1; +START TRANSACTION; +# Switch to connection con2 +INSERT INTO t1 VALUES(1); +# Switch to connection con1 +SELECT * FROM t1; a 1 -commit; -drop table t1; +COMMIT; +# Switch to connection default + close connections con1 and con2 +DROP TABLE t1; diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result index 34cea2a5a7d..af3a0899181 100644 --- a/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -1729,18 +1729,18 @@ DELETE FROM mysqltest2.log| CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `log` ( `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -1808,18 +1808,18 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `log` ( `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result index cf5dac3dc7c..10c2afcadc1 100644 --- a/mysql-test/r/ddl_i18n_utf8.result +++ b/mysql-test/r/ddl_i18n_utf8.result @@ -1729,18 +1729,18 @@ DELETE FROM mysqltest2.log| CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `log` ( `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -1808,18 +1808,18 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `log` ( `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; diff --git a/mysql-test/r/dirty_close.result b/mysql-test/r/dirty_close.result index c4fc19a35f8..b49b72f1b95 100644 --- a/mysql-test/r/dirty_close.result +++ b/mysql-test/r/dirty_close.result @@ -1,9 +1,9 @@ -drop table if exists t1; -create table t1 (n int); -insert into t1 values (1),(2),(3); -select * from t1; +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; +DROP TABLE t1; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 83030a00179..50bfa97c59f 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -736,6 +736,17 @@ select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mo select name from mysql.event where name = 'p' and sql_mode = @full_mode; name drop event e1; +SET @old_server_id = @@GLOBAL.server_id; +SET GLOBAL server_id = (1 << 32) - 1; +SELECT @@GLOBAL.server_id; +@@GLOBAL.server_id +4294967295 +CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS; +event_name originator +ev1 4294967295 +DROP EVENT ev1; +SET GLOBAL server_id = @old_server_id; DROP DATABASE events_test; SET GLOBAL event_scheduler= 'ON'; SET @@global.concurrent_insert= @concurrent_insert; diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 3de741b5efb..a81ff554ca2 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -155,6 +155,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1` DROP TABLE t1,t2; +CREATE TABLE t1 (a INT PRIMARY KEY); +EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; # # Bug#37870: Usage of uninitialized value caused failed assertion. # @@ -182,3 +186,4 @@ dt 2001-01-01 01:01:01 2001-01-01 01:01:01 drop tables t1, t2; +End of 5.1 tests. diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result index d5b10868358..d2197beaaab 100644 --- a/mysql-test/r/flush_block_commit.result +++ b/mysql-test/r/flush_block_commit.result @@ -1,39 +1,57 @@ -drop table if exists t1; -create table t1 (a int) engine=innodb; -begin; -insert into t1 values(1); -flush tables with read lock; -select * from t1; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Establish connection con3 (user=root) +# Switch to connection con1 +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT) ENGINE=innodb; +BEGIN; +INSERT INTO t1 VALUES(1); +# Switch to connection con2 +FLUSH TABLES WITH READ LOCK; +SELECT * FROM t1; a -commit; -select * from t1; +# Switch to connection con1 +COMMIT; +# Switch to connection con2 +SELECT * FROM t1; a -unlock tables; -begin; -select * from t1 for update; +UNLOCK TABLES; +# Switch to connection con1 +# Switch to connection con1 +BEGIN; +SELECT * FROM t1 FOR UPDATE; a 1 -begin; -select * from t1 for update; -flush tables with read lock; -commit; +# Switch to connection con2 +BEGIN; +SELECT * FROM t1 FOR UPDATE; +# Switch to connection con3 +FLUSH TABLES WITH READ LOCK; +# Switch to connection con1 +COMMIT; +# Switch to connection con2 a 1 -unlock tables; -commit; -begin; -insert into t1 values(10); -flush tables with read lock; -commit; -unlock tables; -flush tables with read lock; -unlock tables; -begin; -select * from t1; +# Switch to connection con3 +UNLOCK TABLES; +# Switch to connection con2 +COMMIT; +# Switch to connection con1 +BEGIN; +INSERT INTO t1 VALUES(10); +FLUSH TABLES WITH READ LOCK; +COMMIT; +UNLOCK TABLES; +# Switch to connection con2 +FLUSH TABLES WITH READ LOCK; +UNLOCK TABLES; +BEGIN; +SELECT * FROM t1; a 1 10 -show create database test; +SHOW CREATE DATABASE test; Database Create Database test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ -drop table t1; +DROP TABLE t1; +# Switch to connection default and close connections con1, con2, con3 diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result index 16fb143ee4c..c7fd7a11877 100644 --- a/mysql-test/r/flush_block_commit_notembedded.result +++ b/mysql-test/r/flush_block_commit_notembedded.result @@ -1,15 +1,23 @@ -create table t1 (a int) engine=innodb; -reset master; -set autocommit=0; -insert t1 values (1); -flush tables with read lock; -show master status; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Switch to connection con1 +CREATE TABLE t1 (a INT) ENGINE=innodb; +RESET MASTER; +SET AUTOCOMMIT=0; +INSERT t1 VALUES (1); +# Switch to connection con2 +FLUSH TABLES WITH READ LOCK; +SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 106 -commit; -show master status; +# Switch to connection con1 +COMMIT; +# Switch to connection con2 +SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 106 -unlock tables; -drop table t1; -set autocommit=1; +UNLOCK TABLES; +# Switch to connection con1 +DROP TABLE t1; +SET AUTOCOMMIT=1; +# Switch to connection default and close connections con1 and con2 diff --git a/mysql-test/r/flush_read_lock_kill.result b/mysql-test/r/flush_read_lock_kill.result index 0b599f343f7..b16a8b114b3 100644 --- a/mysql-test/r/flush_read_lock_kill.result +++ b/mysql-test/r/flush_read_lock_kill.result @@ -1,12 +1,12 @@ -set @old_concurrent_insert= @@global.concurrent_insert; -set @@global.concurrent_insert= 0; -drop table if exists t1; -create table t1 (kill_id int); -insert into t1 values(connection_id()); -flush tables with read lock; -select ((@id := kill_id) - kill_id) from t1; +SET @old_concurrent_insert= @@global.concurrent_insert; +SET @@global.concurrent_insert= 0; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (kill_id INT); +INSERT INTO t1 VALUES(connection_id()); +FLUSH TABLES WITH READ LOCK; +SELECT ((@id := kill_id) - kill_id) FROM t1; ((@id := kill_id) - kill_id) 0 -kill connection @id; -drop table t1; -set @@global.concurrent_insert= @old_concurrent_insert; +KILL CONNECTION @id; +DROP TABLE t1; +SET @@global.concurrent_insert= @old_concurrent_insert; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 6e2770ef940..d68d5822975 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -539,3 +539,7 @@ SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1; MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) 2 DROP TABLE t1; +CREATE TABLE t1(a TEXT); +SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE); +ERROR HY000: Incorrect arguments to AGAINST +DROP TABLE t1; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index e0a6c44eb01..3d989ad1730 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -61,7 +61,7 @@ grp sum NULL NULL 1 7 2 20.25 -3 45.483163247594 +3 45.4831632475944 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; @@ -1186,7 +1186,7 @@ std(s1/s2) 0.21325764 select std(o1/o2) from bug22555; std(o1/o2) -0.21325763586649 +0.213257635866493 select std(e1/e2) from bug22555; std(e1/e2) 0.21325764 @@ -1212,7 +1212,7 @@ round(std(s1/s2), 17) 0.21325763586649341 select std(o1/o2) from bug22555; std(o1/o2) -0.21325763586649 +0.213257635866493 select round(std(e1/e2), 17) from bug22555; round(std(e1/e2), 17) 0.21325763586649341 @@ -1237,7 +1237,7 @@ round(std(s1/s2), 17) 0.21325763586649341 select std(o1/o2) from bug22555; std(o1/o2) -0.21325763586649 +0.213257635866493 select round(std(e1/e2), 17) from bug22555; round(std(e1/e2), 17) 0.21325763586649341 diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index b4a07f18521..c3d2db2d553 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -60,7 +60,7 @@ Warnings: Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) -3 3.9068905956085 NULL NULL NULL +3 3.90689059560852 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 filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -68,7 +68,7 @@ Warnings: Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) -2 1.2552725051033 NULL NULL NULL +2 1.25527250510331 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 filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -85,7 +85,7 @@ Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4 set @@rand_seed1=10000000,@@rand_seed2=1000000; select rand(999999),rand(); rand(999999) rand() -0.014231365187309 0.028870999839968 +0.0142313651873091 0.028870999839968 explain extended select rand(999999),rand(); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -101,7 +101,7 @@ Warnings: Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` select degrees(pi()),radians(360); degrees(pi()) radians(360) -180 6.2831853071796 +180 6.28318530717959 select format(atan(-2, 2), 6); format(atan(-2, 2), 6) -0.785398 @@ -368,7 +368,7 @@ mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2) 5 5 1 select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5); pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5) -2.1359870359209e+96 2.1359870359209e+96 -32 +2.13598703592091e+96 2.13598703592091e+96 -32 CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1)); INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0); SELECT a DIV 900 y FROM t1 GROUP BY y; @@ -407,6 +407,36 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; a DIV 2 0 DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE); +INSERT INTO t1 VALUES (-1.1), (1.1), +(-1.5), (1.5), +(-1.9), (1.9), +(-2.1), (2.1), +(-2.5), (2.5), +(-2.9), (2.9), +# Check numbers with absolute values > 2^53 - 1 +# (see comments for MAX_EXACT_INTEGER) +(-1e16 - 0.5), (1e16 + 0.5), +(-1e16 - 1.5), (1e16 + 1.5); +SELECT a, ROUND(a) FROM t1; +a ROUND(a) +-1.1 -1 +1.1 1 +-1.5 -2 +1.5 2 +-1.9 -2 +1.9 2 +-2.1 -2 +2.1 2 +-2.5 -2 +2.5 2 +-2.9 -3 +2.9 3 +-1e+16 -10000000000000000 +1e+16 10000000000000000 +-1e+16 -10000000000000002 +1e+16 10000000000000002 +DROP TABLE t1; End of 5.0 tests SELECT 1e308 + 1e308; 1e308 + 1e308 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 0824f13cafc..00c98ad136c 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1351,10 +1351,10 @@ cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2)) 20.06 select conv("18383815659218730760",10,10) + 0; conv("18383815659218730760",10,10) + 0 -1.8383815659219e+19 +1.83838156592187e+19 select "18383815659218730760" + 0; "18383815659218730760" + 0 -1.8383815659219e+19 +1.83838156592187e+19 CREATE TABLE t1 (code varchar(10)); INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13'); SELECT ASCII(code), code FROM t1 WHERE code='A12'; @@ -2519,4 +2519,10 @@ def format(a, 2) 253 49 4 Y 0 31 8 format(a, 2) 1.33 drop table t1; +CREATE TABLE t1 (c DATE, aa VARCHAR(30)); +INSERT INTO t1 VALUES ('2008-12-31','aaaaaa'); +SELECT DATE_FORMAT(c, GET_FORMAT(DATE, 'eur')) h, CONCAT(UPPER(aa),', ', aa) i FROM t1; +h i +31.12.2008 AAAAAA, aaaaaa +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index fdcde4e8739..94a5fd83162 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -284,7 +284,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.416666666667 25.416666666667) +109 POINT(25.4166666666667 25.4166666666667) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon; fid Area(g) @@ -318,8 +318,8 @@ fid IsClosed(g) 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) +117 POINT(55.5885277530424 17.426536064114) +118 POINT(55.5885277530424 17.426536064114) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon; fid Area(g) @@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85998; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) -85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022) +85998 MULTIPOLYGON 0 POINT(115.318773152032 -36.2374728210215) select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) -85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469) +85984 MULTIPOLYGON 0 POINT(-114.877871869233 36.3310176346905) drop table t1; create table t1 (fl geometry not null); insert into t1 values (1); diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 18f11ebcc71..de80a83d538 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -164,7 +164,7 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -insert into mysql.db (host, db, user, select_priv) values +insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); alter table mysql.db order by db asc; flush privileges; @@ -264,7 +264,7 @@ drop user mysqltest_1@localhost; SET NAMES koi8r; CREATE DATABASE ÂÄ; USE ÂÄ; -CREATE TABLE ÔÁ (ËÏÌ int); +CREATE TABLE ÔÁ (ËÏÌ INT); GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; SHOW GRANTS FOR ÀÚÅÒ@localhost; Grants for ÀÚÅÒ@localhost @@ -383,21 +383,21 @@ grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; -SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES -WHERE GRANTEE = '''mysqltest_3''@''localhost''' -ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE; +SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES +WHERE GRANTEE = '''mysqltest_3''@''localhost''' + ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE 'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO 'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO 'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO 'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES -WHERE GRANTEE = '''mysqltest_3''@''localhost''' -ORDER BY TABLE_NAME,PRIVILEGE_TYPE; +WHERE GRANTEE = '''mysqltest_3''@''localhost''' + ORDER BY TABLE_NAME,PRIVILEGE_TYPE; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE SELECT * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES -WHERE GRANTEE = '''mysqltest_3''@''localhost''' -ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE; +WHERE GRANTEE = '''mysqltest_3''@''localhost''' + ORDER BY TABLE_SCHEMA,PRIVILEGE_TYPE; GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES WHERE GRANTEE = '''mysqltest_3''@''localhost''' @@ -459,7 +459,7 @@ Privilege Context Comment Alter Tables To alter the table Alter routine Functions,Procedures To alter or drop stored functions/procedures Create Databases,Tables,Indexes To create new databases and tables -Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE +Create routine Databases To use CREATE FUNCTION/PROCEDURE Create temporary tables Databases To use CREATE TEMPORARY TABLE Create view Tables To create new views Create user Server Admin To create new users @@ -884,11 +884,11 @@ flush privileges; drop table t2; drop table t1; CREATE DATABASE mysqltest3; -use mysqltest3; +USE mysqltest3; CREATE TABLE t_nn (c1 INT); CREATE VIEW v_nn AS SELECT * FROM t_nn; CREATE DATABASE mysqltest2; -use mysqltest2; +USE mysqltest2; CREATE TABLE t_nn (c1 INT); CREATE VIEW v_nn AS SELECT * FROM t_nn; CREATE VIEW v_yn AS SELECT * FROM t_nn; @@ -958,7 +958,7 @@ DROP TABLE mysqltest3.t_nn; DROP DATABASE mysqltest3; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost'; DROP USER 'mysqltest_1'@'localhost'; -use test; +USE test; create user mysqltest1_thisisreallytoolong; ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16) CREATE DATABASE mysqltest1; @@ -1196,16 +1196,16 @@ DROP DATABASE mysqltest1; DROP DATABASE mysqltest2; DROP USER mysqltest_1@localhost; DROP USER mysqltest_2@localhost; -use test; +USE test; CREATE TABLE t1 (f1 int, f2 int); INSERT INTO t1 VALUES(1,1), (2,2); CREATE DATABASE db27878; GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost'; GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost'; GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost'; -use db27878; +USE db27878; CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1; -use db27878; +USE db27878; UPDATE v1 SET f2 = 4; ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them SELECT * FROM test.t1; @@ -1217,7 +1217,7 @@ REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; DROP USER mysqltest_1@localhost; DROP DATABASE db27878; -use test; +USE test; DROP TABLE t1; # # Bug#33275 Server crash when creating temporary table mysql.user @@ -1355,6 +1355,6 @@ Warnings: Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2' DROP PROCEDURE sp3; DROP USER 'userbug33464'@'localhost'; -use test; +USE test; DROP DATABASE dbbug33464; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 48f97aeb428..742d4b90807 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1691,3 +1691,15 @@ FROM t1; ERROR 21000: Subquery returns more than 1 row DROP TABLE t1; SET @@sql_mode = @old_sql_mode; +SET @old_sql_mode = @@sql_mode; +SET @@sql_mode='ONLY_FULL_GROUP_BY'; +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (10); +SELECT COUNT(i) FROM t1; +COUNT(i) +2 +SELECT COUNT(i) FROM t1 WHERE i > 1; +COUNT(i) +1 +DROP TABLE t1; +SET @@sql_mode = @old_sql_mode; diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index adda0053687..b17884c4f7a 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2448,3 +2448,18 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a` drop table t1; +CREATE TABLE t1 (a int, b int, c int, d int, +KEY foo (c,d,a,b), KEY bar (c,a,b,d)); +INSERT INTO t1 VALUES (1, 1, 1, 1), (1, 1, 1, 2), (1, 1, 1, 3), (1, 1, 1, 4); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT a,b,c+1,d FROM t1; +EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL foo 10 NULL 9 Using where; Using index for group-by +SELECT DISTINCT c FROM t1 WHERE d=4; +c +1 +2 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index 3e4cef99480..59a46cabe5f 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -730,3 +730,12 @@ unlock tables; drop table t1; handler t1 read a next; ERROR 42S02: Unknown table 't1' in HANDLER +drop table if exists t1; +create table t1 (a int); +insert into t1 values (1); +handler t1 open; +alter table t1 engine=memory; +handler t1 read a next; +ERROR HY000: Table storage engine for 't1' doesn't have this option +handler t1 close; +drop table t1; diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index 0b27b07c4d2..afbf2d9fb6d 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -728,3 +728,12 @@ unlock tables; drop table t1; handler t1 read a next; ERROR 42S02: Unknown table 't1' in HANDLER +drop table if exists t1; +create table t1 (a int); +insert into t1 values (1); +handler t1 open; +alter table t1 engine=memory; +handler t1 read a next; +ERROR HY000: Table storage engine for 't1' doesn't have this option +handler t1 close; +drop table t1; diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index f8deef15819..5dd0f159428 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -99,7 +99,7 @@ t2 t3 t5 v1 -select c,table_name from v1 +select c,table_name from v1 inner join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c like "t%"; c table_name @@ -118,7 +118,7 @@ t4 t4 t2 t2 t3 t3 t5 t5 -select c,table_name from v1 +select c,table_name from v1 left join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c like "t%"; c table_name @@ -197,7 +197,7 @@ a int(11) YES NULL create view mysqltest.v1 (c) as select a from mysqltest.t1; grant select (a) on mysqltest.t1 to mysqltest_2@localhost; grant select on mysqltest.v1 to mysqltest_3; -select table_name, column_name, privileges from information_schema.columns +select table_name, column_name, privileges from information_schema.columns where table_schema = 'mysqltest' and table_name = 't1'; table_name column_name privileges t1 a select @@ -275,7 +275,7 @@ begin select * from t1; select * from t2; end| -select parameter_style, sql_data_access, dtd_identifier +select parameter_style, sql_data_access, dtd_identifier from information_schema.routines where routine_schema='test'; parameter_style sql_data_access dtd_identifier SQL CONTAINS SQL NULL @@ -560,7 +560,7 @@ drop view v1; create table t1(a NUMERIC(5,3), b NUMERIC(5,1), c float(5,2), d NUMERIC(6,4), e float, f DECIMAL(6,3), g int(11), h DOUBLE(10,3), i DOUBLE); -select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH, +select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE from information_schema.columns where table_name= 't1'; COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE @@ -621,7 +621,7 @@ TABLE_NAME= "vo"; CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME drop view vo; select TABLE_NAME,TABLE_TYPE,ENGINE -from information_schema.tables +from information_schema.tables where table_schema='information_schema' limit 2; TABLE_NAME TABLE_TYPE ENGINE CHARACTER_SETS SYSTEM VIEW MEMORY @@ -726,7 +726,7 @@ where table_schema="information_schema" and table_name="COLUMNS" and column_type varchar(32) varchar(32) -select TABLE_ROWS from information_schema.tables where +select TABLE_ROWS from information_schema.tables where table_schema="information_schema" and table_name="COLUMNS"; TABLE_ROWS NULL @@ -760,7 +760,7 @@ count(*) drop view a2, a1; drop table t_crashme; select table_schema,table_name, column_name from -information_schema.columns +information_schema.columns where data_type = 'longtext'; table_schema table_name column_name information_schema COLUMNS COLUMN_DEFAULT @@ -804,7 +804,7 @@ event last_executed datetime event starts datetime event ends datetime SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A -WHERE NOT EXISTS +WHERE NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS B WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA AND A.TABLE_NAME = B.TABLE_NAME); @@ -833,7 +833,7 @@ x_float NULL NULL x_double_precision NULL NULL drop table t1; grant select on test.* to mysqltest_4@localhost; -SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS +SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='TABLE_NAME'; TABLE_NAME COLUMN_NAME PRIVILEGES COLUMNS TABLE_NAME select @@ -1079,7 +1079,7 @@ BEGIN SELECT 'foo' FROM DUAL; END | ERROR 42000: Unknown database 'information_schema' -select ROUTINE_NAME from routines where ROUTINE_SCHEMA='information_schema'; +select ROUTINE_NAME from routines where ROUTINE_SCHEMA='information_schema'; ROUTINE_NAME grant all on information_schema.* to 'user1'@'localhost'; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' @@ -1634,7 +1634,7 @@ show events where Db= 'information_schema'; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation use test; # -# Bug#34166: Server crash in SHOW OPEN TABLES and prelocking +# Bug#34166 Server crash in SHOW OPEN TABLES and prelocking # drop table if exists t1; drop function if exists f1; diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result index 83b8217b570..475839569c7 100644 --- a/mysql-test/r/information_schema_db.result +++ b/mysql-test/r/information_schema_db.result @@ -200,7 +200,7 @@ Field Type Null Key Default Extra f1 char(4) YES NULL show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci show create view testdb_1.v1; ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1' select table_name from information_schema.columns a diff --git a/mysql-test/r/innodb-autoinc.result b/mysql-test/r/innodb-autoinc.result index 1e4b088c6cd..ade4db35ce6 100644 --- a/mysql-test/r/innodb-autoinc.result +++ b/mysql-test/r/innodb-autoinc.result @@ -579,3 +579,291 @@ c1 18446744073709551610 18446744073709551615 DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +Variable_name Value +auto_increment_increment 1 +auto_increment_offset 1 +CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL, 1); +INSERT INTO t1 VALUES(NULL, 2); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +ALTER TABLE t1 CHANGE c1 c1 SERIAL; +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +INSERT INTO t1 VALUES(NULL, 3); +INSERT INTO t1 VALUES(NULL, 4); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +3 3 +4 4 +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(NULL, 1); +INSERT INTO t1 VALUES(NULL, 2); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +ALTER TABLE t1 CHANGE c1 c1 SERIAL; +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +INSERT INTO t1 VALUES(NULL, 3); +INSERT INTO t1 VALUES(NULL, 4); +SELECT * FROM t1; +c1 c2 +1 1 +2 2 +3 3 +4 4 +DROP TABLE t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1 ( +a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, +b INT(10) UNSIGNED NOT NULL, +c ENUM('FALSE','TRUE') DEFAULT NULL, +PRIMARY KEY (a)) ENGINE = InnoDB; +CREATE TABLE t2 ( +m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, +n INT(10) UNSIGNED NOT NULL, +o enum('FALSE','TRUE') DEFAULT NULL, +PRIMARY KEY (m)) ENGINE = InnoDB; +INSERT INTO t2 (n,o) VALUES +(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'), +(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false'); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `m` int(11) unsigned NOT NULL AUTO_INCREMENT, + `n` int(10) unsigned NOT NULL, + `o` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`m`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +23 1 FALSE +24 2 FALSE +25 3 FALSE +26 4 FALSE +27 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +23 1 FALSE +24 2 FALSE +25 3 FALSE +26 4 FALSE +27 5 FALSE +30 1 FALSE +31 2 FALSE +32 3 FALSE +33 4 FALSE +34 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1 +INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false'; +SELECT * FROM t1; +a b c +1 1 TRUE +2 1 FALSE +3 2 TRUE +4 2 FALSE +5 3 TRUE +6 3 FALSE +7 4 TRUE +8 4 FALSE +9 5 TRUE +10 5 FALSE +13 1 TRUE +14 1 FALSE +15 2 TRUE +16 2 FALSE +17 3 TRUE +18 3 FALSE +19 4 TRUE +20 4 FALSE +21 5 TRUE +22 5 FALSE +23 1 FALSE +24 2 FALSE +25 3 FALSE +26 4 FALSE +27 5 FALSE +30 1 FALSE +31 2 FALSE +32 3 FALSE +33 4 FALSE +34 5 FALSE +37 1 FALSE +38 2 FALSE +39 3 FALSE +40 4 FALSE +41 5 FALSE +44 1 FALSE +45 2 FALSE +46 3 FALSE +47 4 FALSE +48 5 FALSE +51 1 FALSE +52 2 FALSE +53 3 FALSE +54 4 FALSE +55 5 FALSE +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) unsigned NOT NULL AUTO_INCREMENT, + `b` int(10) unsigned NOT NULL, + `c` enum('FALSE','TRUE') DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1( +c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT +PRIMARY KEY) ENGINE=InnoDB; +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),(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),(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),(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),(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),(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),(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),(NULL),(NULL),(NULL),(NULL); +CREATE TABLE t2( +c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT +PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t2 SELECT c1 FROM t1; +Got one of the listed errors +INSERT INTO t2 SELECT NULL FROM t1; +Got one of the listed errors +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/r/innodb_bug42419.result b/mysql-test/r/innodb_bug42419.result new file mode 100644 index 00000000000..f304bb634cb --- /dev/null +++ b/mysql-test/r/innodb_bug42419.result @@ -0,0 +1,17 @@ +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +COMMIT; +SET AUTOCOMMIT = 0; +CREATE TEMPORARY TABLE t1_tmp ( b INT ); +INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3; +INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2; +SET AUTOCOMMIT = 0; +CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int ); +INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53); +UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1; +UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2; +INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +Reap the server message for connection user2 UPDATE t1 ... +UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3; +DROP TABLE t1; diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result index ef8bdcc5f3e..c6c775afc9f 100644 --- a/mysql-test/r/innodb_gis.result +++ b/mysql-test/r/innodb_gis.result @@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.416666666667 25.416666666667) +109 POINT(25.4166666666667 25.4166666666667) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon ORDER by fid; fid Area(g) @@ -326,8 +326,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; fid AsText(Centroid(g)) -117 POINT(55.588527753042 17.426536064114) -118 POINT(55.588527753042 17.426536064114) +117 POINT(55.5885277530424 17.426536064114) +118 POINT(55.5885277530424 17.426536064114) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; fid Area(g) diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 6152e403637..7ec07fb5273 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -166,4 +166,31 @@ ERROR HY000: View's SELECT refers to a temporary table 't2' Cleanup. drop table t2, t3; +# +# Bug#39843 DELETE requires write access to table in subquery in where clause +# +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 ( +table1_rowid SMALLINT NOT NULL +); +CREATE TABLE t2 ( +table2_rowid SMALLINT NOT NULL +); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +LOCK TABLES t1 WRITE, t2 READ; +# Sub-select should not try to aquire a write lock. +DELETE FROM t1 +WHERE EXISTS +( +SELECT 'x' +FROM t2 +WHERE t1.table1_rowid = t2.table2_rowid +) ; +# While implementing the patch we didn't break old behavior; +# The following sub-select should still requires a write lock: +SELECT * FROM t1 WHERE 1 IN (SELECT * FROM t2 FOR UPDATE); +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated +UNLOCK TABLES; +DROP TABLE t1,t2; End of 5.1 tests. diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index a0e3d9fad06..50e37d28dd6 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -51,10 +51,10 @@ Field Type Null Key Default Extra a int(11) YES NULL unlock tables; drop table t1; -use mysql; +USE mysql; LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE; FLUSH TABLES; -use mysql; +USE mysql; SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1; OPTIMIZE TABLES columns_priv, db, host, user; Table Op Msg_type Msg_text @@ -65,7 +65,7 @@ mysql.user optimize status OK UNLOCK TABLES; Select_priv N -use test; +USE test; use test; CREATE TABLE t1 (c1 int); LOCK TABLE t1 WRITE; @@ -133,8 +133,8 @@ DROP TABLE t1; End of 5.0 tests create table t1 (i int); lock table t1 read; -update t1 set i= 10;; -select * from t1;; +update t1 set i= 10; +select * from t1; kill query ID; i ERROR 70100: Query execution was interrupted diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 376120abcda..f8321520880 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -56,7 +56,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' @@ -65,7 +65,7 @@ Field Type Null Key Default Extra event_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP user_host mediumtext NO NULL thread_id int(11) NO NULL -server_id int(11) NO NULL +server_id int(10) unsigned NO NULL command_type varchar(64) NO NULL argument mediumtext NO NULL show create table mysql.slow_log; @@ -80,7 +80,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show fields from mysql.slow_log; @@ -94,7 +94,7 @@ rows_examined int(11) NO NULL db varchar(512) NO NULL last_insert_id int(11) NO NULL insert_id int(11) NO NULL -server_id int(11) NO NULL +server_id int(10) unsigned NO NULL sql_text mediumtext NO NULL flush logs; flush tables; @@ -167,7 +167,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' @@ -183,7 +183,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' alter table mysql.general_log engine=myisam; @@ -194,7 +194,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log' @@ -210,7 +210,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log' set global general_log='ON'; @@ -268,7 +268,7 @@ CREATE TABLE `general_log` ( ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, -`server_id` int(11) NOT NULL, +`server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; @@ -283,7 +283,7 @@ ON UPDATE CURRENT_TIMESTAMP, `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, -`server_id` int(11) NOT NULL, +`server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; set global general_log='ON'; diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index 880a203a15f..1ef7d04bb1d 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -1,11 +1,11 @@ -call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); +call mtr.add_suppression("Cannot find or open table test/BUG29839 from .*"); DROP TABLE IF EXISTS t1,T1; -CREATE TABLE t1 (a int); -SELECT * from T1; +CREATE TABLE t1 (a INT); +SELECT * FROM T1; a -drop table t1; -flush tables; -CREATE TABLE bug29839 (a int) ENGINE=INNODB; -SELECT * from BUG29839; +FLUSH TABLES; +DROP TABLE t1; +CREATE TABLE bug29839 (a INT) ENGINE=INNODB; +SELECT * FROM BUG29839; ERROR 42S02: Table 'test.BUG29839' doesn't exist -drop table bug29839; +DROP TABLE bug29839; diff --git a/mysql-test/r/lowercase_utf8.result b/mysql-test/r/lowercase_utf8.result new file mode 100644 index 00000000000..043226e1f64 --- /dev/null +++ b/mysql-test/r/lowercase_utf8.result @@ -0,0 +1,9 @@ +set names utf8; +create table `Ö` (id int); +show tables from test like 'Ö'; +Tables_in_test (Ö) +ö +show tables from test like 'ö'; +Tables_in_test (ö) +ö +drop table `Ö`; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 1b06c71e4c1..b780e4220a1 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2027,7 +2027,6 @@ TABLE_SCHEMA = 'test' and TABLE_NAME='tm1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty DROP TABLE tm1; -End of 5.1 tests CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; @@ -2043,4 +2042,79 @@ EXPLAIN SELECT COUNT(*) FROM t4; 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, t2, t3, t4; +CREATE TABLE t1(a INT, KEY(a)); +INSERT INTO t1 VALUES(0),(1),(2),(3),(4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE m1(a INT, KEY(a)) ENGINE=MERGE UNION=(t1); +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1'; +CARDINALITY +5 +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1'; +CARDINALITY +5 +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1'; +CARDINALITY +5 +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1'; +CARDINALITY +5 +DROP TABLE t1, m1; +# +# Bug #40675 MySQL 5.1 crash with index merge algorithm and Merge tables +# +# create MYISAM table t1 and insert values into it +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(1); +# create MYISAM table t2 and insert values into it +CREATE TABLE t2(a INT, b INT, dummy CHAR(16) DEFAULT '', KEY(a), KEY(b)); +INSERT INTO t2(a,b) VALUES +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), +(1,2); +# Create the merge table t3 +CREATE TABLE t3(a INT, b INT, dummy CHAR(16) DEFAULT '', KEY(a), KEY(b)) +ENGINE=MERGE UNION=(t2) INSERT_METHOD=FIRST; +# Lock tables t1 and t3 for write +LOCK TABLES t1 WRITE, t3 WRITE; +# Insert values into the merge table t3 +INSERT INTO t3(a,b) VALUES(1,2); +# select from the join of t2 and t3 (The merge table) +SELECT t3.a FROM t1,t3 WHERE t3.b=2 AND t3.a=1; +a +1 +1 +# Unlock the tables +UNLOCK TABLES; +# drop the created tables +DROP TABLE t1, t2, t3; +# insert duplicate value in child table while merge table doesn't have key +create table t1 ( +col1 int(10), +primary key (col1) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE m1 ( +col1 int(10) NOT NULL +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(t1); +insert into m1 (col1) values (1); +insert into m1 (col1) values (1); +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +drop table m1, t1; End of 5.1 tests diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index b8f6aa9e4d4..449333a4ae6 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -375,7 +375,7 @@ update t2, t1 set t2.field=t1.field where t1.id1=t2.id2 and 0=1; delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2 where 0=1; -delete t1, t2 from t2,t1 +delete t1, t2 from t2,t1 where t1.id1=t2.id2 and 0=1; drop table t1,t2; CREATE TABLE t1 ( a int ); @@ -443,12 +443,12 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2 ERROR HY000: You can't specify target table 't1' for update in FROM clause drop table t1,t2; create table t1 ( -aclid bigint not null primary key, -status tinyint(1) not null +aclid bigint not null primary key, +status tinyint(1) not null ) engine = innodb; create table t2 ( -refid bigint not null primary key, -aclid bigint, index idx_acl(aclid) +refid bigint not null primary key, +aclid bigint, index idx_acl(aclid) ) engine = innodb; insert into t2 values(1,null); delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 25b66fe7fc6..5054c3aa76f 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -188,6 +188,10 @@ delimiter 2 @z:='1' @z=database() 1 NULL +1 +1 +1 +1 End of 5.0 tests WARNING: --server-arg option not supported in this configuration. Warning (Code 1286): Unknown table engine 'nonexistent' diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 974b4952799..34d695a0272 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -391,22 +391,28 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; CREATE TABLE t1 (c1 CHAR(10)); -flush logs; +FLUSH LOGS; INSERT INTO t1 VALUES ('0123456789'); -flush logs; +FLUSH LOGS; DROP TABLE t1; -# Query thread_id=REMOVED exec_time=REMOVED error_code=REMOVED -flush logs; -create table t1(a int); -insert into t1 values(connection_id()); -flush logs; -drop table t1; +We expect this value to be 1 +The bug being tested was that 'Query' lines were not preceded by '#' +If the line is in the table, it had to have been preceded by a '#' + +SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%'; +BUG#28293_expect_1 1 -drop table t1; +DROP TABLE patch; +FLUSH LOGS; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(connection_id()); +FLUSH LOGS; +DROP TABLE t1; +1 +DROP TABLE t1; shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql -End of 5.0 tests -flush logs; -BUG#31611: Security risk with BINLOG statement +FLUSH LOGS; +Bug#31611 Security risk with BINLOG statement SET BINLOG_FORMAT=ROW; CREATE DATABASE mysqltest1; CREATE USER untrusted@localhost; @@ -429,7 +435,7 @@ a b 1 root@localhost DROP DATABASE mysqltest1; DROP USER untrusted@localhost; -BUG#32580: mysqlbinlog cannot read binlog event with user variables +Bug#32580 mysqlbinlog cannot read binlog event with user variables USE test; SET BINLOG_FORMAT = STATEMENT; FLUSH LOGS; @@ -454,4 +460,15 @@ an_int 1000 a_decimal 907.79 a_string Just a test DROP TABLE t1; +SET @@global.server_id= 4294967295; +RESET MASTER; +FLUSH LOGS; +SELECT +(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog")) +IS NOT NULL; +(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog")) +IS NOT NULL +1 +*** Unsigned server_id 4294967295 is found: 1 *** +SET @@global.server_id= 1; End of 5.1 tests diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 6f7fcb7efde..704cd7ac3f4 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -149,7 +149,7 @@ SET NAMES DEFAULT; mysqlcheck --default-character-set="latin1" --databases test test.? Error : Table doesn't exist -error : Corrupt +status : Operation failed mysqlcheck --default-character-set="utf8" --databases test test.Ñ OK SET NAMES utf8; diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index c1c61cd7fe8..c300f3d7996 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -93,73 +93,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; DROP TABLE IF EXISTS `t3`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t3` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t3` ENABLE KEYS */; DROP TABLE IF EXISTS `t4`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t4` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; DROP TABLE IF EXISTS `t5`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t5` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t5` ENABLE KEYS */; DROP TABLE IF EXISTS `t6`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t6` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); @@ -190,73 +190,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; DROP TABLE IF EXISTS `t3`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t3` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */; INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t3` ENABLE KEYS */; DROP TABLE IF EXISTS `t4`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t4` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */; INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; DROP TABLE IF EXISTS `t5`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t5` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */; INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t5` ENABLE KEYS */; DROP TABLE IF EXISTS `t6`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t6` ( `id` int(8) DEFAULT NULL, `name` varchar(32) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index c4ed6deec09..70c41c2fb3d 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -34,12 +34,12 @@ DROP TABLE t1; CREATE TABLE t1 (a decimal(64, 20)); INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), ("0987654321098765432109876543210987654321"); -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` decimal(64,20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000'); DROP TABLE t1; # @@ -49,12 +49,12 @@ CREATE TABLE t1 (a double); INSERT INTO t1 VALUES ('-9e999999'); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` double DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (RES); DROP TABLE t1; # @@ -70,21 +70,21 @@ INSERT INTO t1 VALUES ('1.2345', 2.3456); INSERT INTO t1 VALUES ("1.2345", 2.3456); ERROR 42S22: Unknown column '1.2345' in 'field list' SET SQL_MODE=@OLD_SQL_MODE; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` decimal(10,5) DEFAULT NULL, `b` float DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` decimal(10,5) DEFAULT NULL, `b` float DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -98,13 +98,13 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` decimal(10,5) DEFAULT NULL, `b` float DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -127,13 +127,13 @@ UNLOCK TABLES; /*!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' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` decimal(10,5) DEFAULT NULL, `b` float DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -209,12 +209,12 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` varchar(255) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=koi8r; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -245,12 +245,9 @@ INSERT INTO t1 VALUES (1), (2); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) TYPE=MyISAM; -SET character_set_client = @saved_cs_client; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -271,12 +268,9 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) TYPE=MyISAM; -SET character_set_client = @saved_cs_client; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -295,12 +289,12 @@ DROP TABLE t1; # Bug#2592 mysqldump doesn't quote "tricky" names correctly # create table ```a` (i int); -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE ```a` ( `i` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; drop table ```a`; # # Bug#2591 mysqldump quotes names inconsistently @@ -318,12 +312,12 @@ create table t1(a int); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -346,12 +340,12 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES "t1" WRITE; /*!40000 ALTER TABLE "t1" DISABLE KEYS */; @@ -377,12 +371,12 @@ set global sql_mode='ANSI_QUOTES'; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -405,12 +399,12 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE "t1" ( "a" int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES "t1" WRITE; /*!40000 ALTER TABLE "t1" DISABLE KEYS */; @@ -440,12 +434,12 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -534,12 +528,12 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -570,12 +564,9 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL ) TYPE=MyISAM; -SET character_set_client = @saved_cs_client; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -596,12 +587,9 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL ) TYPE=MyISAM; -SET character_set_client = @saved_cs_client; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -622,12 +610,9 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL ) TYPE=MyISAM; -SET character_set_client = @saved_cs_client; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -661,12 +646,12 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; @@ -702,12 +687,12 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `b` blob ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -743,12 +728,12 @@ INSERT INTO t1 VALUES (4),(5),(6); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -777,12 +762,12 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); @@ -1146,8 +1131,8 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `F_c4ca4238a0b923820dcc509a6f75849b` int(11) DEFAULT NULL, `F_c81e728d9d4c2f636f067f89cc14862c` int(11) DEFAULT NULL, @@ -1480,7 +1465,7 @@ CREATE TABLE `t1` ( `F_6faa8040da20ef399b63a72d0e4ab575` int(11) DEFAULT NULL, `F_fe73f687e5bc5280214e0486b273a5f9` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -1521,12 +1506,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -1565,19 +1550,19 @@ INSERT INTO t2 VALUES (1), (2); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1600,19 +1585,19 @@ SET character_set_client = @saved_cs_client; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1812,26 +1797,26 @@ create table t3(a int); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t3`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1861,12 +1846,12 @@ mysqldump: Got error: 1064: You have an error in your SQL syntax; check the manu /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -1897,15 +1882,15 @@ insert into t1 values (0815, 4711, 2006); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE "t1" ( "a b" int(11) NOT NULL DEFAULT '0', "c""d" int(11) NOT NULL DEFAULT '0', "e`f" int(11) NOT NULL DEFAULT '0', PRIMARY KEY ("a b","c""d","e`f") ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES "t1" WRITE; /*!40000 ALTER TABLE "t1" DISABLE KEYS */; @@ -1931,15 +1916,15 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a b` int(11) NOT NULL DEFAULT '0', `c"d` int(11) NOT NULL DEFAULT '0', `e``f` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`a b`,`c"d`,`e``f`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -1985,13 +1970,13 @@ create view v2 as select * from t2 where a like 'a%' with check option; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` varchar(30) DEFAULT NULL, KEY `a` (`a`(5)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; @@ -2081,12 +2066,12 @@ create view v1 as select * from t1; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2153,13 +2138,13 @@ create view v2 as select * from t2 where a like 'a%' with check option; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` varchar(30) DEFAULT NULL, KEY `a` (`a`(5)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; @@ -2220,12 +2205,12 @@ INSERT INTO t1 VALUES ('\''); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2266,14 +2251,14 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2425,13 +2410,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2497,12 +2482,12 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; @@ -2554,13 +2539,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2568,12 +2553,12 @@ INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; @@ -2699,12 +2684,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2850,13 +2835,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY `d` (`d`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2887,13 +2872,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY `d` (`d`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -2940,12 +2925,12 @@ a2 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1 test"; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE "t1 test" ( "a1" int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES "t1 test" WRITE; /*!40000 ALTER TABLE "t1 test" DISABLE KEYS */; @@ -2969,12 +2954,12 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; DROP TABLE IF EXISTS "t2 test"; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE "t2 test" ( "a2" int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES "t2 test" WRITE; /*!40000 ALTER TABLE "t2 test" DISABLE KEYS */; @@ -3023,14 +3008,14 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` varchar(32) DEFAULT NULL, `c` varchar(32) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -3154,12 +3139,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l USE `test`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -3213,13 +3198,13 @@ insert into t1 values ('',''); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` binary(1) DEFAULT NULL, `b` blob ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -3248,13 +3233,13 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` binary(1) DEFAULT NULL, `b` blob ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -3427,12 +3412,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH USE `mysqldump_test_db`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -3489,14 +3474,14 @@ create view nasishnasifu as select mysqldump_tables.basetable.id from mysqldump_ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `mysqldump_tables`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `basetable` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `tag` varchar(64) DEFAULT NULL, UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -3520,7 +3505,7 @@ USE `mysqldump_views`; /*!50001 SET collation_connection = latin1_swedish_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */; +/*!50001 VIEW `nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -3663,31 +3648,31 @@ CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t2`,`t3`); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `t2`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `t3`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t3` WRITE; /*!40000 ALTER TABLE `t3` DISABLE KEYS */; @@ -3767,13 +3752,13 @@ drop database mysqldump_test_db; # CREATE TABLE t1 (c1 INT, c2 LONGBLOB); INSERT INTO t1 SET c1=11, c2=REPEAT('q',509); -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` longblob ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171); DROP TABLE t1; # @@ -3830,6 +3815,154 @@ DROP TABLE t1,t2; -- Dump completed on DATE +SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT; +# +# Bug #42635: mysqldump includes views that were excluded using +# the --ignore-table option +# +create database db42635; +use db42635; +create table t1 (id int); +create view db42635.v1 (c) as select * from db42635.t1; +create view db42635.v2 (c) as select * from db42635.t1; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +DROP TABLE IF EXISTS `v2`; +/*!50001 DROP VIEW IF EXISTS `v2`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v2` ( + `c` int(11) +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!50001 DROP TABLE `v2`*/; +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v2` AS select `t1`.`id` AS `c` from `t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +use test; +drop database db42635; +# +# Bug#33550 mysqldump 4.0 compatibility broken +# +SET NAMES utf8; +CREATE TABLE `straße` ( f1 INT ); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `straße`; +CREATE TABLE `straße` ( + `f1` int(11) DEFAULT NULL +) TYPE=MyISAM; + +LOCK TABLES `straße` WRITE; +/*!40000 ALTER TABLE `straße` DISABLE KEYS */; +/*!40000 ALTER TABLE `straße` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `straße`; +CREATE TABLE `straße` ( + `f1` int(11) DEFAULT NULL +) TYPE=MyISAM; + +LOCK TABLES `straße` WRITE; +/*!40000 ALTER TABLE `straße` DISABLE KEYS */; +/*!40000 ALTER TABLE `straße` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE `straße`; +CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT ); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `כדשגכחךלדגכחשךדגחכךלדגכ`; +CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( + `f1` int(11) DEFAULT NULL +) TYPE=MyISAM; + +LOCK TABLES `כדשגכחךלדגכחשךדגחכךלדגכ` WRITE; +/*!40000 ALTER TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` DISABLE KEYS */; +/*!40000 ALTER TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`; +SET NAMES latin1; # # End of 5.0 tests # @@ -3850,13 +3983,13 @@ INSERT INTO t1 VALUES (3,4), (4,5); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -3945,12 +4078,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH USE `mysqldump_test_db`; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -4047,12 +4180,12 @@ create database `test-database`; use `test-database`; create table test (a int); DROP TABLE IF EXISTS `test`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `test` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `test` WRITE; /*!40000 ALTER TABLE `test` DISABLE KEYS */; /*!40000 ALTER TABLE `test` ENABLE KEYS */; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 1a65f90bd65..a9c20e34517 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -215,7 +215,6 @@ source database "MySQL: The world's most popular ;open source database" echo message echo message -mysqltest: At line 1: command "false" failed mysqltest: At line 1: Missing argument in exec MySQL "MySQL" @@ -383,7 +382,6 @@ mysqltest: At line 1: The argument to dec must be a variable (start with $) mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do! -mysqltest: At line 1: system command 'false' failed system command 'NonExistsinfComamdn 2> /dev/null' failed test test2 @@ -745,10 +743,12 @@ select 1; -- a comment for the server; mysqltest: At line 1: Found line beginning with -- that didn't contain a valid mysqltest command, check your syntax or use # if you intended to write a comment con1 +con2 default con1 -default -con1 +con2 con1 +con2 +con2 -closed_connection- End of tests diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index cab1f7a0755..c408c14b716 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -98,12 +98,12 @@ INSERT INTO t1 VALUES (1), (2); /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -132,12 +132,12 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; @@ -166,12 +166,12 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ); -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index fa2fb33d278..ecbb47d4ee0 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -1,3 +1,5 @@ +set @max_allowed_packet=@@global.max_allowed_packet; +set @net_buffer_length=@@global.net_buffer_length; set global max_allowed_packet=100; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '100' @@ -23,3 +25,5 @@ len select length(repeat('a',2000)); length(repeat('a',2000)) 2000 +set global max_allowed_packet=@max_allowed_packet; +set global net_buffer_length=@net_buffer_length; diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 270c1ec5670..002fbd02c2a 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -522,7 +522,7 @@ select conv(255 AS p1, 10 AS p2, 16 AS p3); ERROR 42000: Incorrect parameters in the call to native function 'conv' select atan(10); atan(10) -1.4711276743037 +1.47112767430373 select atan(10 AS p1); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10 p1); @@ -533,7 +533,7 @@ select atan(10 "p1"); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10, 20); atan(10, 20) -0.46364760900081 +0.463647609000806 select atan(10 AS p1, 20); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10 p1, 20); diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index cec4e60d139..c5733e33569 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,5 +1,9 @@ SET @old_general_log= @@global.general_log; drop table if exists t1, t2; +CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a)) +ENGINE=MyISAM +PARTITION BY HASH (a); +ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning CREATE TABLE t1 ( pk INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (pk) diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 547ce1ca316..511806d64bd 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,4 +1,13 @@ drop table if exists t1; +CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a)); +INSERT INTO t1 VALUES (1),(1); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +DROP TABLE t1; +CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a)) +PARTITION BY KEY (a) PARTITIONS 2; +INSERT INTO t1 VALUES (1),(1); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +DROP TABLE t1; CREATE TABLE t1 (a INT) PARTITION BY HASH (a) ( PARTITION p0 ENGINE=MyISAM, diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result index db89c6ef6e7..f8403988f47 100644 --- a/mysql-test/r/partition_mgm_err.result +++ b/mysql-test/r/partition_mgm_err.result @@ -25,13 +25,13 @@ ALTER TABLE t1 DROP PARTITION x10, x1, x2, x3; ERROR HY000: Error in list of partitions to DROP ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO (PARTITION x11 VALUES LESS THAN (22)); -ERROR HY000: More partitions to reorganise than there are partitions +ERROR HY000: More partitions to reorganize than there are partitions ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2 INTO (PARTITION x3 VALUES LESS THAN (6)); ERROR HY000: Duplicate partition name x3 ALTER TABLE t1 REORGANIZE PARTITION x0, x2 INTO (PARTITION x11 VALUES LESS THAN (2)); -ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ERROR HY000: When reorganizing a set of partitions they must be in consecutive order ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO (PARTITION x11 VALUES LESS THAN (4)); ERROR HY000: Error in list of partitions to REORGANIZE diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result index 24a6e594a14..7ed0c62f33a 100644 --- a/mysql-test/r/preload.result +++ b/mysql-test/r/preload.result @@ -144,7 +144,7 @@ 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.t3 preload_keys error Corrupt +test.t3 preload_keys status Operation failed test.t2 preload_keys status OK show status like "key_read%"; Variable_name Value @@ -159,7 +159,7 @@ 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.t3 preload_keys error Corrupt +test.t3 preload_keys status Operation failed test.t2 preload_keys Error Key 'c' doesn't exist in table 't2' test.t2 preload_keys status Operation failed show status like "key_read%"; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 05b2d18889b..1f8a077af40 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -235,7 +235,7 @@ execute stmt1; prepare stmt1 from "insert into t1 select i from t1"; execute stmt1; execute stmt1; -prepare stmt1 from "select * from t1 into outfile 'f1.txt'"; +prepare stmt1 from "select * from t1 into outfile '<MYSQLTEST_VARDIR>/tmp/f1.txt'"; execute stmt1; deallocate prepare stmt1; drop table t1; @@ -803,6 +803,8 @@ select @@max_prepared_stmt_count; @@max_prepared_stmt_count 16382 set global max_prepared_stmt_count=-1; +Warnings: +Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1' select @@max_prepared_stmt_count; @@max_prepared_stmt_count 0 @@ -1394,13 +1396,13 @@ execute stmt; Table Op Msg_type Msg_text test.t1 repair status OK test.t4 repair Error Table 'test.t4' doesn't exist -test.t4 repair error Corrupt +test.t4 repair status Operation failed test.t3 repair status OK execute stmt; Table Op Msg_type Msg_text test.t1 repair status OK test.t4 repair Error Table 'test.t4' doesn't exist -test.t4 repair error Corrupt +test.t4 repair status Operation failed test.t3 repair status OK prepare stmt from "optimize table t1, t3, t4"; execute stmt; @@ -1408,23 +1410,23 @@ Table Op Msg_type Msg_text test.t1 optimize status OK test.t3 optimize status OK test.t4 optimize Error Table 'test.t4' doesn't exist -test.t4 optimize error Corrupt +test.t4 optimize status Operation failed execute stmt; Table Op Msg_type Msg_text test.t1 optimize status Table is already up to date test.t3 optimize status Table is already up to date test.t4 optimize Error Table 'test.t4' doesn't exist -test.t4 optimize error Corrupt +test.t4 optimize status Operation failed prepare stmt from "analyze table t4, t1"; execute stmt; Table Op Msg_type Msg_text test.t4 analyze Error Table 'test.t4' doesn't exist -test.t4 analyze error Corrupt +test.t4 analyze status Operation failed test.t1 analyze status Table is already up to date execute stmt; Table Op Msg_type Msg_text test.t4 analyze Error Table 'test.t4' doesn't exist -test.t4 analyze error Corrupt +test.t4 analyze status Operation failed test.t1 analyze status Table is already up to date deallocate prepare stmt; drop table t1, t2, t3; diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result index c90165368e3..b03a71d3fec 100644 --- a/mysql-test/r/query_cache_debug.result +++ b/mysql-test/r/query_cache_debug.result @@ -22,3 +22,52 @@ Qcache_queries_in_cache 0 set global query_cache_size= 0; use test; drop table t1; +SET @old_concurrent_insert= @@GLOBAL.concurrent_insert; +SET @old_query_cache_size= @@GLOBAL.query_cache_size; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +SET GLOBAL concurrent_insert= 1; +SET GLOBAL query_cache_size= 1024*512; +SET GLOBAL query_cache_type= ON; +# Switch to connection con1 +SET SESSION debug='+d,wait_after_query_cache_invalidate'; +# Send concurrent insert, will wait in the query cache table invalidate +INSERT INTO t1 VALUES (4); +# Switch to connection default +# Wait for concurrent insert to reach the debug point +# Switch to connection con2 +# Send SELECT that shouldn't be cached +SELECT * FROM t1; +a +1 +2 +3 +# Switch to connection default +# Notify the concurrent insert to proceed +SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST +WHERE STATE = 'wait_after_query_cache_invalidate' INTO @thread_id; +KILL QUERY @thread_id; +# Switch to connection con1 +# Gather insert result +SHOW STATUS LIKE "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +# Test that it's cacheable +SELECT * FROM t1; +a +1 +2 +3 +4 +SHOW STATUS LIKE "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +# Disconnect +# Restore defaults +RESET QUERY CACHE; +DROP TABLE t1,t2; +SET GLOBAL concurrent_insert= DEFAULT; +SET GLOBAL query_cache_size= DEFAULT; +SET GLOBAL query_cache_type= DEFAULT; diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result index 64bb40f1d17..d9bf7a6d814 100644 --- a/mysql-test/r/query_cache_notembedded.result +++ b/mysql-test/r/query_cache_notembedded.result @@ -375,6 +375,7 @@ id show status like 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 1 +USE test; DROP DATABASE bug30269; DROP USER 'bug30269'@'localhost'; set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result index cf81566f4e5..7b28da5a577 100644 --- a/mysql-test/r/read_only.result +++ b/mysql-test/r/read_only.result @@ -1,12 +1,18 @@ +set @start_read_only= @@global.read_only; DROP TABLE IF EXISTS t1,t2,t3; grant CREATE, SELECT, DROP on *.* to test@localhost; +connect (con1,localhost,test,,test); +connection default; set global read_only=0; +connection con1; create table t1 (a int); insert into t1 values(1); create table t2 select * from t1; +connection default; set global read_only=1; create table t3 (a int); drop table t3; +connection con1; select @@global.read_only; @@global.read_only 1 @@ -39,13 +45,18 @@ delete t1 from t1,t3 where t1.a=t3.a; drop table t1; insert into t1 values(1); ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +connection default; set global read_only=0; lock table t1 write; +connection con1; lock table t2 write; +connection default; set global read_only=1; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables ; +send set global read_only=1; set global read_only=1; +connection con1; select @@global.read_only; @@global.read_only 0 @@ -53,13 +64,20 @@ unlock tables ; select @@global.read_only; @@global.read_only 1 +connection default; +reap; +connection default; set global read_only=0; lock table t1 read; +connection con1; lock table t2 read; +connection default; set global read_only=1; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables ; +send set global read_only=1; set global read_only=1; +connection con1; select @@global.read_only; @@global.read_only 0 @@ -67,24 +85,35 @@ unlock tables ; select @@global.read_only; @@global.read_only 1 +connection default; +reap; +connection default; set global read_only=0; BEGIN; +connection con1; BEGIN; +connection default; set global read_only=1; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction ROLLBACK; set global read_only=1; +connection con1; select @@global.read_only; @@global.read_only 1 ROLLBACK; +connection default; set global read_only=0; flush tables with read lock; set global read_only=1; unlock tables; +connect (root2,localhost,root,,test); +connection default; set global read_only=0; flush tables with read lock; +connection root2; set global read_only=1; +connection default; select @@global.read_only; @@global.read_only 1 @@ -94,11 +123,12 @@ ERROR 42S02: Unknown table 'ttt' drop temporary table if exists ttt; Warnings: Note 1051 Unknown table 'ttt' +connection default; set global read_only=0; drop table t1,t2; drop user test@localhost; # -# Bug #27440 read_only allows create and drop database +# Bug#27440 read_only allows create and drop database # set global read_only= 1; drop database if exists mysqltest_db1; @@ -112,16 +142,20 @@ grant all on mysqltest_db2.* to `mysqltest_u1`@`%`; create database mysqltest_db1; grant all on mysqltest_db1.* to `mysqltest_u1`@`%`; flush privileges; +connect (con_bug27440,127.0.0.1,mysqltest_u1,,test,MASTER_MYPORT,); +connection con_bug27440; create database mysqltest_db2; ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement show databases like '%mysqltest_db2%'; Database (%mysqltest_db2%) drop database mysqltest_db1; ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +disconnect con_bug27440; +connection default; delete from mysql.user where User like 'mysqltest_%'; delete from mysql.db where User like 'mysqltest_%'; delete from mysql.tables_priv where User like 'mysqltest_%'; delete from mysql.columns_priv where User like 'mysqltest_%'; flush privileges; drop database mysqltest_db1; -set global read_only=0; +set global read_only= @start_read_only; diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 609733b2b02..0cb2dff6f64 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -27,7 +27,7 @@ drop table t1; repair table t1 use_frm; Table Op Msg_type Msg_text test.t1 repair Error Table 'test.t1' doesn't exist -test.t1 repair error Corrupt +test.t1 repair status Operation failed create table t1 engine=myisam SELECT 1,"table 1"; flush tables; repair table t1; diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 3feaa6255c1..2eaec67c547 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -443,3 +443,17 @@ SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a; ROW(a, 1) IN (SELECT SUM(b), 3) 0 DROP TABLE t1; +create table t1 (a varchar(200), +b int unsigned not null primary key auto_increment) +default character set 'utf8'; +create table t2 (c varchar(200), +d int unsigned not null primary key auto_increment) +default character set 'latin1'; +insert into t1 (a) values('abc'); +insert into t2 (c) values('abc'); +select * from t1,t2 where (a,b) = (c,d); +a b c d +abc 1 abc 1 +select host,user from mysql.user where (host,user) = ('localhost','test'); +host user +drop table t1,t2; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 0519489b715..621c11906cb 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2784,26 +2784,26 @@ 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(key1) from t1 where key1 <= 0.6158; max(key1) -0.61580002307892 +0.615800023078918 select max(key2) from t2 where key2 <= 1.6158; max(key2) -1.6158000230789 +1.61580002307892 select min(key1) from t1 where key1 >= 0.3762; min(key1) -0.37619999051094 +0.376199990510941 select min(key2) from t2 where key2 >= 1.3762; min(key2) -1.3761999607086 +1.37619996070862 select max(key1), min(key2) from t1, t2 where key1 <= 0.6158 and key2 >= 1.3762; max(key1) min(key2) -0.61580002307892 1.3761999607086 +0.615800023078918 1.37619996070862 select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; max(key1) -0.61580002307892 +0.615800023078918 select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; min(key1) -0.37619999051094 +0.376199990510941 DROP TABLE t1,t2; CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); INSERT INTO t1 VALUES (10); diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 2051939e4b6..e6550bee954 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -545,9 +545,9 @@ mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */ drop table mysqltest.t1; drop database mysqltest; set names binary; -delete from mysql.user +delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; -delete from mysql.db +delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; flush privileges; CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY; @@ -664,7 +664,7 @@ show create table t1; ERROR HY000: Incorrect information in file: './test/t1.frm' drop table if exists t1; -# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar. +# Bug#12183 SHOW OPEN TABLES behavior doesn't match grammar. DROP DATABASE IF EXISTS mysqltest1; CREATE DATABASE mysqltest1; @@ -784,7 +784,7 @@ show status like 'slow_queries'; Variable_name Value Slow_queries 1 create table t1 (a int); -create trigger tr1 before insert on t1 for each row +create trigger tr1 before insert on t1 for each row begin end; create view v1 as select a from t1; @@ -1010,7 +1010,7 @@ def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci ---------------------------------------------------------------- -SELECT +SELECT TRIGGER_CATALOG, TRIGGER_SCHEMA, TRIGGER_NAME, @@ -1198,7 +1198,7 @@ CREATE DATABASE mysqltest1; use mysqltest1; CREATE TABLE t1(ËÏÌÏÎËÁ1 INT); ----> Dumping mysqltest1 to show_check.mysqltest1.sql +---> Dumping mysqltest1 to outfile1 DROP DATABASE mysqltest1; @@ -1295,7 +1295,7 @@ drop database mysqltest; show full plugin; show warnings; Level Code Message -Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead +Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW PLUGINS' instead show plugin; show plugins; create database `mysqlttest\1`; diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index 8ef52e75238..8aa9877a8e9 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -5,10 +5,7 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; -select user(); -user() +SELECT USER(); +USER() # -show processlist; -Id User Host db Command Time State Info -<id> root <host> test <command> <time> <state> <info> -<id> root <host> test <command> <time> <state> <info> +SHOW PROCESSLIST; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 3def6536897..35d61ce757d 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1643,7 +1643,7 @@ create table t1 (a int) type=MyISAM; drop table t1; end| Warnings: -Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 5.2. Please use 'ENGINE=storage_engine' instead +Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 6.0. Please use 'ENGINE=storage_engine' instead call p1(); call p1(); drop procedure p1; diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 66177395ac9..65c94577a57 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -342,12 +342,12 @@ GRANT SUPER ON *.* TO mysqltest_2@localhost; GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost; ---> connection: mysqltest_2_con -use mysqltest; +USE mysqltest; CREATE PROCEDURE wl2897_p1() SELECT 1; CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1; ---> connection: mysqltest_1_con -use mysqltest; +USE mysqltest; CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2; ERROR 42000: Access denied; you need the SUPER privilege for this operation CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2; @@ -363,7 +363,7 @@ Warnings: Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist ---> connection: con1root -use mysqltest; +USE mysqltest; SHOW CREATE PROCEDURE wl2897_p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`() @@ -393,7 +393,7 @@ CREATE USER mysqltest_2@localhost; GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost; ---> connection: mysqltest_1_con -use mysqltest; +USE mysqltest; CREATE PROCEDURE bug13198_p1() SELECT 1; CREATE FUNCTION bug13198_f1() RETURNS INT @@ -406,7 +406,7 @@ bug13198_f1() 1 ---> connection: mysqltest_2_con -use mysqltest; +USE mysqltest; CALL bug13198_p1(); 1 1 @@ -418,7 +418,7 @@ bug13198_f1() DROP USER mysqltest_1@localhost; ---> connection: mysqltest_2_con -use mysqltest; +USE mysqltest; CALL bug13198_p1(); ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist SELECT bug13198_f1(); @@ -435,7 +435,7 @@ Host User Password localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C ---> connection: mysqltest_2_con -use test; +USE test; CREATE PROCEDURE sp19857() DETERMINISTIC BEGIN DECLARE a INT; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 01ddde56450..0a416a20c95 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -581,7 +581,7 @@ return 2.7182818284590452354| set @e = e()| select e(), @e| e() @e -2.718281828459 2.718281828459 +2.71828182845905 2.71828182845905 drop function if exists inc| create function inc(i int) returns int return i+1| @@ -618,7 +618,7 @@ create function fun(d double, i int, u int unsigned) returns double return mul(inc(i), fac(u)) / e()| select fun(2.3, 3, 5)| fun(2.3, 3, 5) -176.58213176229 +176.582131762292 insert into t2 values (append("xxx", "yyy"), mul(4,3), e())| insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))| select * from t2 where s = append("a", "b")| @@ -4350,10 +4350,10 @@ call bug13012()| Table Op Msg_type Msg_text test.t1 repair status OK Table Op Msg_type Msg_text -test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 backup status OK Table Op Msg_type Msg_text -test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore status OK drop procedure bug13012| create view v1 as select * from t1| @@ -6018,9 +6018,9 @@ CREATE TABLE t3 (f1 INT, f2 FLOAT)| INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| SUM(f2) bug25373(f1) -6.3000000715256 1 +6.30000007152557 1 15 2 -21.300000071526 NULL +21.3000000715256 NULL DROP FUNCTION bug25373| DROP TABLE t3| DROP DATABASE IF EXISTS mysqltest1| diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index abd454ac907..3cc251bc0a6 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -535,7 +535,7 @@ use db_bug7787| CREATE PROCEDURE p1() SHOW INNODB STATUS; | Warnings: -Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead +Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW ENGINE INNODB STATUS' instead GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost| DROP DATABASE db_bug7787| drop user user_bug7787@localhost| diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 1255284f4fe..241f4198bf7 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1305,7 +1305,7 @@ set @@sql_mode='traditional'; create table t1 (i int) comment '123456789*123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789*123456789*'; -ERROR HY000: Too long comment for table 't1' +ERROR HY000: Comment for table 't1' is too long (max = 60) create table t1 ( i int comment '123456789*123456789*123456789*123456789* @@ -1315,7 +1315,7 @@ i int comment 123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789*'); -ERROR HY000: Too long comment for field 'i' +ERROR HY000: Comment for field 'i' is too long (max = 255) set @@sql_mode= @org_mode; create table t1 (i int comment @@ -1327,7 +1327,7 @@ create table t1 123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789*'); Warnings: -Warning 1105 Unknown error +Warning 1629 Comment for field 'i' is too long (max = 255) select column_name, column_comment from information_schema.columns where table_schema = 'test' and table_name = 't1'; column_name column_comment diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index dc9abdd98e4..5fb1425f10a 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -192,11 +192,11 @@ 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 (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 +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 filtered Extra 1 PRIMARY <derived3> system NULL NULL NULL NULL 1 100.00 @@ -2303,20 +2303,20 @@ drop table t1,t2; CREATE TABLE t1 ( a int, b int ); CREATE TABLE t2 ( c int, d int ); INSERT INTO t1 VALUES (1,2), (2,3), (3,4); -SELECT a AS abc, b FROM t1 outr WHERE b = +SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a); abc b 1 2 2 3 3 4 -INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b = +INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a); select * from t2; c d 1 2 2 3 3 4 -CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b = +CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a); select * from t3; abc b @@ -2517,8 +2517,8 @@ INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,680 INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); /*!40000 ALTER TABLE t1 ENABLE KEYS */; -SELECT DISTINCT Continent AS c FROM t1 outr WHERE -Code <> SOME ( SELECT Code FROM t1 WHERE Continent = outr.Continent AND +SELECT DISTINCT Continent AS c FROM t1 outr WHERE +Code <> SOME ( SELECT Code FROM t1 WHERE Continent = outr.Continent AND Population < 200); c Oceania @@ -2628,32 +2628,32 @@ select count(distinct t2.userid) pass, groupstuff.*, count(t2.courseid) crse, -t1.categoryid, +t1.categoryid, t2.courseid, date_format(date, '%b%y') as colhead -from t2 -join t1 on t2.courseid=t1.courseid +from t2 +join t1 on t2.courseid=t1.courseid join ( -select -t5.userid, -parentid, -parentgroup, -childid, -groupname, -grouptypeid -from t5 -join +select +t5.userid, +parentid, +parentgroup, +childid, +groupname, +grouptypeid +from t5 +join ( -select t4.id as parentid, -t4.name as parentgroup, -t4.id as childid, -t4.name as groupname, -t4.grouptypeid -from t4 -) as gin on t5.groupid=gin.childid -) as groupstuff on t2.userid = groupstuff.userid -group by +select t4.id as parentid, +t4.name as parentgroup, +t4.id as childid, +t4.name as groupname, +t4.grouptypeid +from t4 +) as gin on t5.groupid=gin.childid +) as groupstuff on t2.userid = groupstuff.userid +group by groupstuff.groupname, colhead , t2.courseid; pass userid parentid parentgroup childid groupname grouptypeid crse categoryid courseid colhead 1 5141 12 group2 12 group2 5 1 5 12 Aug04 @@ -2929,9 +2929,9 @@ INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56"); INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53"); INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50"); INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50"); -select * from t1 r1 -where (r1.retailerID,(r1.changed)) in -(SELECT r2.retailerId,(max(changed)) from t1 r2 +select * from t1 r1 +where (r1.retailerID,(r1.changed)) in +(SELECT r2.retailerId,(max(changed)) from t1 r2 group by r2.retailerId); retailerID statusID changed 0026 2 2006-01-06 12:25:53 @@ -2943,41 +2943,41 @@ create table t1(a int, primary key (a)); insert into t1 values (10); create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); -explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r -ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' -ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; +explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 2 DEPENDENT SUBQUERY t2 range b b 40 NULL 2 Using where -SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r -ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' -ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; +SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; a a b 10 3 35989 -explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r -ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' -ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; +explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 2 DEPENDENT SUBQUERY t2 range b b 40 NULL 2 Using where -SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r -ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' -ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; +SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; a a b 10 1 359 drop table t1,t2; -CREATE TABLE t1 ( -field1 int NOT NULL, -field2 int NOT NULL, -field3 int NOT NULL, -PRIMARY KEY (field1,field2,field3) +CREATE TABLE t1 ( +field1 int NOT NULL, +field2 int NOT NULL, +field3 int NOT NULL, +PRIMARY KEY (field1,field2,field3) ); -CREATE TABLE t2 ( -fieldA int NOT NULL, -fieldB int NOT NULL, -PRIMARY KEY (fieldA,fieldB) +CREATE TABLE t2 ( +fieldA int NOT NULL, +fieldB int NOT NULL, +PRIMARY KEY (fieldA,fieldB) ); INSERT INTO t1 VALUES (1,1,1), (1,1,2), (1,2,1), (1,2,2), (1,2,3), (1,3,1); @@ -2991,14 +2991,14 @@ field1 field2 COUNT(*) SELECT field1, field2 FROM t1 GROUP BY field1, field2 -HAVING COUNT(*) >= ALL (SELECT fieldB +HAVING COUNT(*) >= ALL (SELECT fieldB FROM t2 WHERE fieldA = field1); field1 field2 1 2 SELECT field1, field2 FROM t1 GROUP BY field1, field2 -HAVING COUNT(*) < ANY (SELECT fieldB +HAVING COUNT(*) < ANY (SELECT fieldB FROM t2 WHERE fieldA = field1); field1 field2 1 1 @@ -3021,8 +3021,8 @@ a a IN (SELECT a FROM t1) DROP TABLE t1,t2; CREATE TABLE t1 (a DATETIME); INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25'); -CREATE TABLE t2 AS SELECT -(SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a +CREATE TABLE t2 AS SELECT +(SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a FROM t1 WHERE a > '2000-01-01'; SHOW CREATE TABLE t2; Table Create Table @@ -3188,7 +3188,7 @@ INSERT INTO t2 VALUES ( 6 ); CREATE TABLE t3 ( c3 integer ); INSERT INTO t3 VALUES ( 7 ); INSERT INTO t3 VALUES ( 8 ); -SELECT c1,c2 FROM t1 LEFT JOIN t2 ON c1 = c2 +SELECT c1,c2 FROM t1 LEFT JOIN t2 ON c1 = c2 WHERE EXISTS (SELECT c3 FROM t3 WHERE c2 IS NULL ); c1 c2 2 NULL @@ -3231,20 +3231,20 @@ E1 DROP TABLE t1,t2; CREATE TABLE t1(select_id BIGINT, values_id BIGINT); INSERT INTO t1 VALUES (1, 1); -CREATE TABLE t2 (select_id BIGINT, values_id BIGINT, +CREATE TABLE t2 (select_id BIGINT, values_id BIGINT, PRIMARY KEY(select_id,values_id)); INSERT INTO t2 VALUES (0, 1), (0, 2), (0, 3), (1, 5); -SELECT values_id FROM t1 +SELECT values_id FROM t1 WHERE values_id IN (SELECT values_id FROM t2 WHERE select_id IN (1, 0)); values_id 1 -SELECT values_id FROM t1 +SELECT values_id FROM t1 WHERE values_id IN (SELECT values_id FROM t2 WHERE select_id BETWEEN 0 AND 1); values_id 1 -SELECT values_id FROM t1 +SELECT values_id FROM t1 WHERE values_id IN (SELECT values_id FROM t2 WHERE select_id = 0 OR select_id = 1); values_id @@ -3259,7 +3259,7 @@ drop table t1; CREATE TABLE t1 (a int, b int); CREATE TABLE t2 (c int, d int); CREATE TABLE t3 (e int); -INSERT INTO t1 VALUES +INSERT INTO t1 VALUES (1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40); INSERT INTO t2 VALUES (2,10), (2,20), (4,10), (5,10), (3,20), (2,40); @@ -3322,7 +3322,7 @@ a 2 SELECT a FROM t1 GROUP BY a HAVING a IN (SELECT c FROM t2 -WHERE MIN(b) < d AND +WHERE MIN(b) < d AND EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e <= d)); a 2 @@ -3373,7 +3373,7 @@ a 4 SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > ALL(SELECT t2.c FROM t2 -WHERE EXISTS(SELECT t3.e FROM t3 +WHERE EXISTS(SELECT t3.e FROM t3 WHERE SUM(t1.a+t2.c) < t3.e/4)); ERROR HY000: Invalid use of group function SELECT t1.a from t1 GROUP BY t1.a HAVING AVG(SUM(t1.b)) > 20; @@ -3486,7 +3486,7 @@ mid bigint(20) unsigned NOT NULL, date date NOT NULL, PRIMARY KEY (id) ); -INSERT INTO t2 VALUES +INSERT INTO t2 VALUES (1, 1, '2006-03-30'), (2, 2, '2006-04-06'), (3, 3, '2006-04-13'), (4, 2, '2006-04-20'), (5, 1, '2006-05-01'); SELECT *, @@ -3524,7 +3524,7 @@ i2 int(11) NOT NULL default '0', t datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (i1,i2,t) ); -INSERT INTO t1 VALUES +INSERT INTO t1 VALUES (24,1,'2005-03-03 16:31:31'),(24,1,'2005-05-27 12:40:07'), (24,1,'2005-05-27 12:40:08'),(24,1,'2005-05-27 12:40:10'), (24,1,'2005-05-27 12:40:25'),(24,1,'2005-05-27 12:40:30'), @@ -3540,7 +3540,7 @@ PRIMARY KEY (i1) INSERT INTO t2 VALUES (24,1,'2006-06-20 12:29:40'); EXPLAIN SELECT * FROM t1,t2 -WHERE t1.t = (SELECT t1.t FROM t1 +WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); id select_type table type possible_keys key key_len ref rows Extra @@ -3548,7 +3548,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index 2 DEPENDENT SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index SELECT * FROM t1,t2 -WHERE t1.t = (SELECT t1.t FROM t1 +WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); i1 i2 t i1 i2 t @@ -3557,22 +3557,22 @@ DROP TABLE t1, t2; CREATE TABLE t1 (i INT); (SELECT i FROM t1) UNION (SELECT i FROM t1); i -SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS +SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS ( -(SELECT i FROM t1) UNION +(SELECT i FROM t1) UNION (SELECT i 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 'UNION +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 'UNION (SELECT i FROM t1) )' at line 3 -SELECT * FROM t1 +SELECT * FROM t1 WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i 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 'UNION (SELECT i FROM t1)))' at line 2 explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) 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 'union (select t12.i from t1 t12)) from t1' at line 1 -explain select * from t1 where not exists +explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); 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 'union (select t12.i from t1 t12))' at line 2 DROP TABLE t1; @@ -3591,9 +3591,9 @@ insert into t1 (a) select FLOOR(rand() * 100) from t1; insert into t1 (a) select FLOOR(rand() * 100) from t1; insert into t1 (a) select FLOOR(rand() * 100) from t1; insert into t1 (a) select FLOOR(rand() * 100) from t1; -SELECT a, -(SELECT REPEAT(' ',250) FROM t1 i1 -WHERE i1.b=t1.a ORDER BY RAND() LIMIT 1) AS a +SELECT a, +(SELECT REPEAT(' ',250) FROM t1 i1 +WHERE i1.b=t1.a ORDER BY RAND() LIMIT 1) AS a FROM t1 ORDER BY a LIMIT 5; a a 0 NULL @@ -3622,7 +3622,7 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 2 2 1 1 1 1 -SELECT COUNT(DISTINCT t1.b), +SELECT COUNT(DISTINCT t1.b), (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) FROM t1 GROUP BY t1.a; COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) @@ -3633,7 +3633,7 @@ SELECT ( SELECT ( SELECT COUNT(DISTINCT t1.b) ) -) +) FROM t1 GROUP BY t1.a; ( SELECT ( @@ -3648,8 +3648,8 @@ SELECT ( SELECT ( SELECT COUNT(DISTINCT t1.b) ) -) -FROM t1 GROUP BY t1.a LIMIT 1) +) +FROM t1 GROUP BY t1.a LIMIT 1) FROM t1 t2 GROUP BY t2.a; ( @@ -3657,7 +3657,7 @@ SELECT ( SELECT ( SELECT COUNT(DISTINCT t1.b) ) -) +) FROM t1 GROUP BY t1.a LIMIT 1) 2 2 @@ -3669,13 +3669,13 @@ PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b)); SET SESSION sort_buffer_size = 32 * 1024; Warnings: Warning 1292 Truncated incorrect sort_buffer_size value: '32768' -SELECT SQL_NO_CACHE COUNT(*) +SELECT SQL_NO_CACHE COUNT(*) FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c FROM t1) t; COUNT(*) 3000 SET SESSION sort_buffer_size = 8 * 1024 * 1024; -SELECT SQL_NO_CACHE COUNT(*) +SELECT SQL_NO_CACHE COUNT(*) FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c FROM t1) t; COUNT(*) @@ -3736,7 +3736,7 @@ sq 2 4 DEALLOCATE PREPARE stmt1; -SELECT f2, AVG(f21), +SELECT f2, AVG(f21), (SELECT t.f3 FROM t2 AS t WHERE t2.f2=t.f2 AND t.f3=MAX(t2.f3)) AS test FROM t2 GROUP BY f2; f2 AVG(f21) test @@ -3744,12 +3744,12 @@ f2 AVG(f21) test 2 2.0000 2004-02-29 11:11:11 DROP TABLE t1,t2; CREATE TABLE t1 (a int, b INT, c CHAR(10) NOT NULL); -INSERT INTO t1 VALUES -(1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'), -(2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'), (3,3,'j'), +INSERT INTO t1 VALUES +(1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'), +(2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'), (3,3,'j'), (3,2,'k'), (3,1,'l'), (1,9,'m'); -SELECT a, MAX(b), -(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) AS test +SELECT a, MAX(b), +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) AS test FROM t1 GROUP BY a; a MAX(b) test 1 9 m @@ -3900,7 +3900,7 @@ COUNT(*) a (SELECT MIN(m) FROM t2 WHERE m = count(*)) 2 2 2 3 3 3 1 4 1 -SELECT COUNT(*), a +SELECT COUNT(*), a FROM t1 GROUP BY a HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1; COUNT(*) a @@ -3931,7 +3931,7 @@ INSERT INTO t1 VALUES (1,1,0,'a'), (1,2,0,'b'), (1,3,0,'c'), (1,4,0,'d'), (1,5,0,'e'), (2,1,0,'f'), (2,2,0,'g'), (2,3,0,'h'), (3,4,0,'i'), (3,3,0,'j'), (3,2,0,'k'), (3,1,0,'l'), (1,9,0,'m'), (1,0,10,'n'), (2,0,5,'o'), (3,0,7,'p'); SELECT a, MAX(b), -(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b + 0)) as test +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b + 0)) as test FROM t1 GROUP BY a; a MAX(b) test 1 9 m @@ -3953,7 +3953,7 @@ a AVG(b) test 3 2.5000 NULL SELECT tt.a, (SELECT (SELECT c FROM t1 as t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) -LIMIT 1) FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test +LIMIT 1) FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test FROM t1 as tt; a test 1 n @@ -3975,7 +3975,7 @@ a test SELECT tt.a, (SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) LIMIT 1) -FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test +FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test FROM t1 as tt GROUP BY tt.a; a test 1 n @@ -3984,7 +3984,7 @@ a test SELECT tt.a, MAX( (SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) LIMIT 1) -FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1)) as test +FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1)) as test FROM t1 as tt GROUP BY tt.a; a test 1 n @@ -4027,11 +4027,11 @@ COUNT(1) 1 SELECT SUM( (SELECT AVG( (SELECT t1.a FROM t2) ) FROM DUAL) ) FROM t1; ERROR HY000: Invalid use of group function -SELECT +SELECT SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING t1.a < 12) ) FROM t2) ) FROM t1; ERROR HY000: Invalid use of group function -SELECT t1.a as XXA, +SELECT t1.a as XXA, SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING XXA < 12) ) FROM t2) ) FROM t1; ERROR HY000: Invalid use of group function @@ -4048,25 +4048,25 @@ INSERT INTO t1 VALUES (3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY'); CREATE TABLE t2 (id int NOT NULL, INDEX idx(id)); INSERT INTO t2 VALUES (7), (5), (1), (3); -SELECT id, st FROM t1 +SELECT id, st FROM t1 WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id); id st 3 FL 1 GA 7 FL -SELECT id, st FROM t1 +SELECT id, st FROM t1 WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id) GROUP BY id; id st 1 GA 3 FL 7 FL -SELECT id, st FROM t1 +SELECT id, st FROM t1 WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id); id st 2 GA 4 FL -SELECT id, st FROM t1 +SELECT id, st FROM t1 WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id) GROUP BY id; id st @@ -4237,7 +4237,7 @@ a b DROP TABLE t1,t2; CREATE TABLE t1(a INT, b INT); INSERT INTO t1 VALUES (1,1), (1,2), (2,3), (2,4); -EXPLAIN +EXPLAIN SELECT a AS out_a, MIN(b) FROM t1 WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a) GROUP BY a; @@ -4246,7 +4246,7 @@ SELECT a AS out_a, MIN(b) FROM t1 WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a) GROUP BY a; ERROR 42S22: Unknown column 'out_a' in 'where clause' -EXPLAIN +EXPLAIN SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4277,16 +4277,16 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1003 select 2 AS `2` from `test`.`t1` where exists(select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) EXPLAIN EXTENDED -SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION +SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -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 'UNION +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 'UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a))' at line 2 DROP TABLE t1,t2; create table t1(f11 int, f12 int); create table t2(f21 int unsigned not null, f22 int, f23 varchar(10)); insert into t1 values(1,1),(2,2), (3, 3); set session sort_buffer_size= 33*1024; -select count(*) from t1 where f12 = +select count(*) from t1 where f12 = (select f22 from t2 where f22 = f12 order by f21 desc, f22, f23 limit 1); count(*) 3 @@ -4327,12 +4327,12 @@ IF( FROM t2 VPC, t4 a2, t2 a3 WHERE VPC.f4 = a2.f10 AND a3.f2 = a4 -LIMIT 1) IS NULL, -0, +LIMIT 1) IS NULL, +0, t3.f5 ) ) AS a6 -FROM +FROM t2, t3, t1 JOIN t2 a1 ON t1.f9 = a1.f4 GROUP BY a4; a4 f3 a6 @@ -4341,7 +4341,7 @@ a4 f3 a6 DROP TABLE t1, t2, t3, t4; create table t1 (a float(5,4) zerofill); create table t2 (a float(5,4),b float(2,0)); -select t1.a from t1 where +select t1.a from t1 where t1.a= (select b from t2 limit 1) and not t1.a= (select a from t2 limit 1) ; a @@ -4362,7 +4362,7 @@ Warnings: Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1)))) DROP TABLE t1; End of 5.0 tests. -CREATE TABLE t1 (a int, b int); +CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (2,22),(1,11),(2,22); SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; a @@ -4385,22 +4385,22 @@ WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; ERROR HY000: Invalid use of group function SET @@sql_mode=default; DROP TABLE t1; -CREATE TABLE t1 (s1 char(1)); +CREATE TABLE t1 (s1 CHAR(1)); INSERT INTO t1 VALUES ('a'); SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); s1 a DROP TABLE t1; -CREATE TABLE t1(c int, KEY(c)); -CREATE TABLE t2(a int, b int); +CREATE TABLE t1(c INT, KEY(c)); +CREATE TABLE t2(a INT, b INT); INSERT INTO t2 VALUES (1, 10), (2, NULL); INSERT INTO t1 VALUES (1), (3); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); a b DROP TABLE t1,t2; -CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a)); +CREATE TABLE t1(pk INT PRIMARY KEY, a INT, INDEX idx(a)); INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20); -CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a)); +CREATE TABLE t2(pk INT PRIMARY KEY, a INT, b INT, INDEX idxa(a)); INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100); SELECT * FROM t1 WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b); @@ -4409,36 +4409,36 @@ pk a 3 30 2 20 DROP TABLE t1,t2; -CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY b (b)); +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), KEY b (b)); INSERT INTO t1 VALUES (1,NULL), (9,NULL); CREATE TABLE t2 ( -a int, -b int, -c int, -d int, +a INT, +b INT, +c INT, +d INT, PRIMARY KEY (a), UNIQUE KEY b (b,c,d), KEY b_2 (b), KEY c (c), KEY d (d) ); -INSERT INTO t2 VALUES +INSERT INTO t2 VALUES (43, 2, 11 ,30), (44, 2, 12 ,30), (45, 1, 1 ,10000), (46, 1, 2 ,10000), (556,1, 32 ,10000); CREATE TABLE t3 ( -a int, -b int, -c int, +a INT, +b INT, +c INT, PRIMARY KEY (a), UNIQUE KEY b (b,c), KEY c (c), KEY b_2 (b) ); INSERT INTO t3 VALUES (1,1,1), (2,32,1); -explain +explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 index b,b_2 b 10 NULL 2 Using index @@ -4476,7 +4476,7 @@ DELETE FROM v3; DROP VIEW v1,v2,v3; DROP TABLE t1,t2; # -# BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result +# Bug#37822 Correlated subquery with IN and IS UNKNOWN provides wrong result # create table t1(id integer primary key, g integer, v integer, s char(1)); create table t2(id integer primary key, g integer, v integer, s char(1)); diff --git a/mysql-test/r/synchronization.result b/mysql-test/r/synchronization.result index 5d8585f1f88..3f6d16178dd 100644 --- a/mysql-test/r/synchronization.result +++ b/mysql-test/r/synchronization.result @@ -1,6 +1,6 @@ -drop table if exists t1,t2; -CREATE TABLE t1 (x1 int); -ALTER TABLE t1 CHANGE x1 x2 int; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (x1 INT); +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -8,7 +8,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -16,7 +16,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -24,7 +24,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -32,7 +32,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -40,7 +40,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -48,7 +48,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -56,7 +56,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -72,7 +72,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -80,7 +80,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -88,7 +88,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -96,7 +96,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -104,7 +104,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -112,7 +112,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -120,7 +120,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -128,7 +128,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -136,7 +136,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -144,7 +144,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x1 x2 int; +ALTER TABLE t1 CHANGE x1 x2 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table @@ -152,7 +152,7 @@ t2 CREATE TABLE `t2` ( `xx` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; -ALTER TABLE t1 CHANGE x2 x1 int; +ALTER TABLE t1 CHANGE x2 x1 INT; CREATE TABLE t2 LIKE t1; SHOW CREATE TABLE t2; Table Create Table diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 0106c9459e7..e252331cd1a 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -227,7 +227,7 @@ event CREATE TABLE `event` ( `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `originator` int(10) NOT NULL, + `originator` int(10) unsigned NOT NULL, `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, @@ -241,7 +241,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' @@ -257,7 +257,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show tables; diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result index 1609707fb09..2bcd919e0db 100644 --- a/mysql-test/r/trigger-compat.result +++ b/mysql-test/r/trigger-compat.result @@ -12,9 +12,7 @@ GRANT CREATE, TRIGGER ON mysqltest_db1.* TO mysqltest_dfn@localhost; ---> connection: wl2818_definer_con CREATE TABLE t1(num_value INT); CREATE TABLE t2(user_str TEXT); -CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 -FOR EACH ROW -INSERT INTO t2 VALUES(CURRENT_USER()); +CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER()); ---> patching t1.TRG... diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index a80adab1f87..d11ab236c34 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -891,11 +891,11 @@ CREATE TABLE b15776 (a year(-2)); 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))' at line 1 CREATE TABLE b15776 (a timestamp(4294967294)); Warnings: -Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead DROP TABLE b15776; CREATE TABLE b15776 (a timestamp(4294967295)); Warnings: -Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead DROP TABLE b15776; CREATE TABLE b15776 (a timestamp(4294967296)); ERROR 42000: Display width out of range for column 'a' (max = 4294967295) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 6a692ed58e4..b6281443751 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -619,3 +619,22 @@ ERROR 42000: Invalid default value for 'da' create table t1 (t time default '916:00:00 a'); ERROR 42000: Invalid default value for 't' set @@sql_mode= @org_mode; +SELECT CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7)); +CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7)) +20060810101112.0123450 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2006-08-10 10:11:12.0123450' +SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7)); +CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7)) +20060810101112.0123450 +Warnings: +Warning 1292 Truncated incorrect datetime value: '00000002006-000008-0000010 000010:0000011:00000012.0123450' +SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7)); +CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7)) +20060810101112.0123450 +SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)); +CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)) +20080729104251.1234560 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567' +End of 5.1 tests diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index d4cfd1c04ed..a3a13bb0435 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -385,12 +385,12 @@ Warning 1264 Out of range value for column 'f1' at row 1 Warning 1264 Out of range value for column 'f1' at row 2 select f1 + 0e0 from t1; f1 + 0e0 -1.0000000150475e+29 --1.0000000150475e+29 -1.0000000150475e+30 --1.0000000150475e+30 -1.0000000150475e+30 --1.0000000150475e+30 +1.00000001504747e+29 +-1.00000001504747e+29 +1.00000001504747e+30 +-1.00000001504747e+30 +1.00000001504747e+30 +-1.00000001504747e+30 drop table t1; create table t1(d double, u bigint unsigned); insert into t1(d) values (9.22337203685479e18), @@ -401,4 +401,10 @@ u 9223372036854790144 18400000000000000000 drop table t1; +CREATE TABLE t1 (f1 DOUBLE); +INSERT INTO t1 VALUES(-1.79769313486231e+308); +SELECT f1 FROM t1; +f1 +-1.79769313486231e+308 +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 91938771ee3..24cb725de9f 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), t14 timestamp(14)); Warnings: -Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead insert t1 values (0,0,0,0,0,0,0), ("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", diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index d3b3a6f2663..7c9a9145ad1 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -299,59 +299,107 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000; select ROUND(RAND(),5); ROUND(RAND(),5) 0.02887 -show variables like '%alloc%'; + +==+ Testing %alloc% system variables +== +==+ NOTE: These values *must* be a multiple of 1024 +== +==+ Other values will be rounded down to nearest multiple +== + +==+ Show initial values +== +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value query_alloc_block_size 8192 query_prealloc_size 8192 range_alloc_block_size 4096 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 -select * from information_schema.session_variables where variable_name like '%alloc%' order by 1; +==+ information_schema data +== +SELECT * FROM information_schema.session_variables +WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1; VARIABLE_NAME VARIABLE_VALUE QUERY_ALLOC_BLOCK_SIZE 8192 QUERY_PREALLOC_SIZE 8192 RANGE_ALLOC_BLOCK_SIZE 4096 TRANSACTION_ALLOC_BLOCK_SIZE 8192 TRANSACTION_PREALLOC_SIZE 4096 -set @@range_alloc_block_size=1024*16; +Testing values that are multiples of 1024 +set @@range_alloc_block_size=1024*15+1024; +set @@query_alloc_block_size=1024*15+1024*2; +set @@query_prealloc_size=1024*18-1024; +set @@transaction_alloc_block_size=1024*21-1024*1; +set @@transaction_prealloc_size=1024*21-2048; +==+ Check manipulated values ==+ +select @@query_alloc_block_size; +@@query_alloc_block_size +17408 +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); +Variable_name Value +query_alloc_block_size 17408 +query_prealloc_size 17408 +range_alloc_block_size 16384 +transaction_alloc_block_size 20480 +transaction_prealloc_size 19456 +==+ information_schema data +== +SELECT * FROM information_schema.session_variables +WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1; +VARIABLE_NAME VARIABLE_VALUE +QUERY_ALLOC_BLOCK_SIZE 17408 +QUERY_PREALLOC_SIZE 17408 +RANGE_ALLOC_BLOCK_SIZE 16384 +TRANSACTION_ALLOC_BLOCK_SIZE 20480 +TRANSACTION_PREALLOC_SIZE 19456 +==+ Manipulate variable values +== +Testing values that are not 1024 multiples +set @@range_alloc_block_size=1024*16+1023; set @@query_alloc_block_size=1024*17+2; -set @@query_prealloc_size=1024*18; +set @@query_prealloc_size=1024*18-1023; set @@transaction_alloc_block_size=1024*20-1; set @@transaction_prealloc_size=1024*21-1; select @@query_alloc_block_size; @@query_alloc_block_size 17408 -show variables like '%alloc%'; +==+ Check manipulated values ==+ +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value query_alloc_block_size 17408 -query_prealloc_size 18432 +query_prealloc_size 17408 range_alloc_block_size 16384 transaction_alloc_block_size 19456 transaction_prealloc_size 20480 -select * from information_schema.session_variables where variable_name like '%alloc%' order by 1; +==+ information_schema data +== +SELECT * FROM information_schema.session_variables +WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1; VARIABLE_NAME VARIABLE_VALUE QUERY_ALLOC_BLOCK_SIZE 17408 -QUERY_PREALLOC_SIZE 18432 +QUERY_PREALLOC_SIZE 17408 RANGE_ALLOC_BLOCK_SIZE 16384 TRANSACTION_ALLOC_BLOCK_SIZE 19456 TRANSACTION_PREALLOC_SIZE 20480 +==+ Set values back to the default values +== set @@range_alloc_block_size=default; set @@query_alloc_block_size=default, @@query_prealloc_size=default; set transaction_alloc_block_size=default, @@transaction_prealloc_size=default; -show variables like '%alloc%'; +==+ Check the values now that they are reset +== +SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size', +'query_alloc_block_size', 'query_prealloc_size', +'transaction_alloc_block_size', 'transaction_prealloc_size'); Variable_name Value query_alloc_block_size 8192 query_prealloc_size 8192 range_alloc_block_size 4096 transaction_alloc_block_size 8192 transaction_prealloc_size 4096 -select * from information_schema.session_variables where variable_name like '%alloc%' order by 1; -VARIABLE_NAME VARIABLE_VALUE -QUERY_ALLOC_BLOCK_SIZE 8192 -QUERY_PREALLOC_SIZE 8192 -RANGE_ALLOC_BLOCK_SIZE 4096 -TRANSACTION_ALLOC_BLOCK_SIZE 8192 -TRANSACTION_PREALLOC_SIZE 4096 SELECT @@version LIKE 'non-existent'; @@version LIKE 'non-existent' 0 @@ -705,7 +753,7 @@ VARIABLE_NAME VARIABLE_VALUE MYISAM_DATA_POINTER_SIZE 7 SET GLOBAL table_open_cache=-1; Warnings: -Warning 1292 Truncated incorrect table_open_cache value: '0' +Warning 1292 Truncated incorrect table_open_cache value: '-1' SHOW VARIABLES LIKE 'table_open_cache'; Variable_name Value table_open_cache 1 @@ -1341,3 +1389,75 @@ SET @@session.thread_stack= 7; ERROR HY000: Variable 'thread_stack' is a read only variable SET @@global.thread_stack= 7; ERROR HY000: Variable 'thread_stack' is a read only variable +SELECT @@global.expire_logs_days INTO @old_eld; +SET GLOBAL expire_logs_days = -1; +Warnings: +Warning 1292 Truncated incorrect expire_logs_days value: '-1' +needs to've been adjusted (0) +SELECT @@global.expire_logs_days; +@@global.expire_logs_days +0 +SET GLOBAL expire_logs_days = 11; +SET @old_mode=@@sql_mode; +SET SESSION sql_mode = 'TRADITIONAL'; +SET GLOBAL expire_logs_days = 100; +ERROR 42000: Variable 'expire_logs_days' can't be set to the value of '100' +needs to be unchanged (11) +SELECT @@global.expire_logs_days; +@@global.expire_logs_days +11 +SET SESSION sql_mode = @old_mode; +SET GLOBAL expire_logs_days = 100; +Warnings: +Warning 1292 Truncated incorrect expire_logs_days value: '100' +needs to've been adjusted (99) +SELECT @@global.expire_logs_days; +@@global.expire_logs_days +99 +SET GLOBAL expire_logs_days = 11; +SET GLOBAL expire_logs_days = 99; +needs to pass with no warnings (99) +SELECT @@global.expire_logs_days; +@@global.expire_logs_days +99 +SET GLOBAL expire_logs_days = @old_eld; +SET GLOBAL auto_increment_offset=-1; +Warnings: +Warning 1292 Truncated incorrect auto_increment_offset value: '-1' +SET GLOBAL auto_increment_offset=0; +Warnings: +Warning 1292 Truncated incorrect auto_increment_offset value: '0' +select @@storage_engine; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @@storage_engine 253 6 6 N 1 31 8 +@@storage_engine +MyISAM +SET @old_server_id = @@GLOBAL.server_id; +SET GLOBAL server_id = (1 << 32) - 1; +SELECT @@GLOBAL.server_id; +@@GLOBAL.server_id +4294967295 +SET GLOBAL server_id = (1 << 32); +Warnings: +Warning 1292 Truncated incorrect server_id value: '4294967296' +SELECT @@GLOBAL.server_id; +@@GLOBAL.server_id +4294967295 +SET GLOBAL server_id = (1 << 60); +Warnings: +Warning 1292 Truncated incorrect server_id value: '1152921504606846976' +SELECT @@GLOBAL.server_id; +@@GLOBAL.server_id +4294967295 +SET GLOBAL server_id = 0; +SELECT @@GLOBAL.server_id; +@@GLOBAL.server_id +0 +SET GLOBAL server_id = -1; +Warnings: +Warning 1292 Truncated incorrect server_id value: '-1' +SELECT @@GLOBAL.server_id; +@@GLOBAL.server_id +0 +SET GLOBAL server_id = @old_server_id; +End of 5.1 tests diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 38d05ae84fe..0905fc0109b 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1673,9 +1673,9 @@ INSERT INTO t2 VALUES (4,3,'n'); INSERT INTO t2 VALUES (6,1,'n'); INSERT INTO t2 VALUES (8,1,'y'); CREATE VIEW v1 AS SELECT * FROM t1; -SELECT a.col1,a.col2,b.col2,b.col3 +SELECT a.col1,a.col2,b.col2,b.col3 FROM t1 a LEFT JOIN t2 b ON a.col1=b.col1 -WHERE b.col2 IS NULL OR +WHERE b.col2 IS NULL OR b.col2=(SELECT MAX(col2) FROM t2 b WHERE b.col1=a.col1); col1 col2 col2 col3 1 trudy 2 y @@ -1687,9 +1687,9 @@ col1 col2 col2 col3 7 carsten NULL NULL 8 ranger 1 y 10 matt NULL NULL -SELECT a.col1,a.col2,b.col2,b.col3 +SELECT a.col1,a.col2,b.col2,b.col3 FROM v1 a LEFT JOIN t2 b ON a.col1=b.col1 -WHERE b.col2 IS NULL OR +WHERE b.col2 IS NULL OR b.col2=(SELECT MAX(col2) FROM t2 b WHERE b.col1=a.col1); col1 col2 col2 col3 1 trudy 2 y @@ -1743,7 +1743,7 @@ A A 2 2 3 3 create table t3 as select a a,a b from t2; -create view v2 as select * from t3 where +create view v2 as select * from t3 where a in (select * from t1) or b in (select * from t2); select * from v2 A, v2 B where A.a = B.b; a b a b @@ -1999,7 +1999,7 @@ dkjhgd drop view v1; create table t1 (f59 int, f60 int, f61 int); insert into t1 values (19,41,32); -create view v1 as select f59, f60 from t1 where f59 in +create view v1 as select f59, f60 from t1 where f59 in (select f59 from t1); update v1 set f60=2345; ERROR HY000: The target table v1 of the UPDATE is not updatable @@ -2115,7 +2115,7 @@ pid int NOT NULL INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d'); INSERT INTO t2 values (1,1), (2,1), (2,2); CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid; -SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2 +SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2 WHERE t1.aid = t2.aid GROUP BY pid; pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) 1 a b,c d @@ -2217,7 +2217,7 @@ group_name varchar(32) NOT NULL ) engine = InnoDB; create table t2 ( r_object_id char(16) NOT NULL, -i_position int(11) NOT NULL, +i_position int(11) NOT NULL, users_names varchar(32) default NULL ) Engine = InnoDB; create view v1 as select r_object_id, group_name from t1; @@ -2230,7 +2230,7 @@ insert into t1 values('120001a080000542','tstgroup1'); insert into t2 values('120001a080000542',-1, 'guser01'); insert into t2 values('120001a080000542',-2, 'guser02'); select v1.r_object_id, v2.users_names from v1, v2 -where (v1.group_name='tstgroup1') and v2.r_object_id=v1.r_object_id +where (v1.group_name='tstgroup1') and v2.r_object_id=v1.r_object_id order by users_names; r_object_id users_names 120001a080000542 guser01 @@ -2380,8 +2380,8 @@ create table t4 (x int, y int, z int); create view v1 as select t1.x from ( -(t1 join t2 on ((t1.y = t2.y))) -join +(t1 join t2 on ((t1.y = t2.y))) +join (t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z)) ); prepare stmt1 from "select count(*) from v1 where x = ?"; @@ -2557,12 +2557,12 @@ Warnings: Warning 1052 Column 'x' in group statement is ambiguous DROP VIEW v1; DROP TABLE t1; -drop table if exists t1; -drop view if exists v1; -create table t1 (id int); -create view v1 as select * from t1; -drop table t1; -show create view v1; +drop table if exists t1; +drop view if exists v1; +create table t1 (id int); +create view v1 as select * from t1; +drop table t1; +show create view v1; drop view v1; // View Create View character_set_client collation_connection @@ -2609,7 +2609,7 @@ DROP VIEW v2; DROP TABLE t1, t2; CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, td date DEFAULT NULL, KEY idx(td)); -INSERT INTO t1 VALUES +INSERT INTO t1 VALUES (1, '2005-01-01'), (2, '2005-01-02'), (3, '2005-01-02'), (4, '2005-01-03'), (5, '2005-01-04'), (6, '2005-01-05'), (7, '2005-01-05'), (8, '2005-01-05'), (9, '2005-01-06'); @@ -2973,10 +2973,10 @@ drop view v1; drop table t1; CREATE TABLE t1(pk int PRIMARY KEY); CREATE TABLE t2(pk int PRIMARY KEY, fk int, ver int, org int); -CREATE ALGORITHM=MERGE VIEW v1 AS +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT t1.* -FROM t1 JOIN t2 -ON t2.fk = t1.pk AND +FROM t1 JOIN t2 +ON t2.fk = t1.pk AND t2.ver = (SELECT MAX(t.ver) FROM t2 t WHERE t.org = t2.org); SHOW WARNINGS; Level Code Message @@ -3306,7 +3306,7 @@ name char(10) NOT NULL INSERT INTO t1 (lid, name) VALUES (1, 'YES'), (2, 'NO'); CREATE TABLE t2 ( -id int NOT NULL PRIMARY KEY, +id int NOT NULL PRIMARY KEY, gid int NOT NULL, lid int NOT NULL, dt date @@ -3405,8 +3405,8 @@ CREATE TABLE t1 (id int); CREATE TABLE t2 (id int, c int DEFAULT 0); INSERT INTO t1 (id) VALUES (1); INSERT INTO t2 (id) VALUES (1); -CREATE VIEW v1 AS -SELECT t2.c FROM t1, t2 +CREATE VIEW v1 AS +SELECT t2.c FROM t1, t2 WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; UPDATE v1 SET c=1; DROP VIEW v1; @@ -3514,7 +3514,7 @@ role_name varchar(100) default NULL, app_name varchar(40) NOT NULL, INDEX idx_app_name(app_name) ); -CREATE VIEW v1 AS +CREATE VIEW v1 AS SELECT profile.person_id AS person_id FROM t1 profile, t2 userrole, t3 role WHERE userrole.person_id = profile.person_id AND @@ -3526,7 +3526,7 @@ INSERT INTO t1 VALUES (-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0'); INSERT INTO t2 VALUES (1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10); -INSERT INTO t3 VALUES +INSERT INTO t3 VALUES (1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'), (3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'), (5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'), @@ -3552,7 +3552,7 @@ i 2 3 4 -select table_name, is_updatable from information_schema.views +select table_name, is_updatable from information_schema.views where table_name = 'v1'; table_name is_updatable v1 NO @@ -3598,8 +3598,8 @@ DROP VIEW v2; DROP VIEW v3; DROP TABLE t1; # -# Bug#29477: Not all fields of the target table were checked to have -# a default value when inserting into a view. +# Bug#29477 Not all fields of the target table were checked to have +# a default value when inserting into a view. # create table t1(f1 int, f2 int not null); create view v1 as select f1 from t1; @@ -3616,7 +3616,7 @@ drop table t1; create table t1 (a int, key(a)); create table t2 (c int); create view v1 as select a b from t1; -create view v2 as select 1 a from t2, v1 where c in +create view v2 as select 1 a from t2, v1 where c in (select 1 from t1 where b = a); insert into t1 values (1), (1); insert into t2 values (1), (1); @@ -3638,7 +3638,7 @@ MAX(a) COUNT(DISTINCT a) DROP VIEW v1; DROP TABLE t1; # ----------------------------------------------------------------- -# -- Bug#34337: Server crash when Altering a view using a table name. +# -- Bug#34337 Server crash when Altering a view using a table name. # ----------------------------------------------------------------- DROP TABLE IF EXISTS t1; @@ -3655,8 +3655,8 @@ DROP TABLE t1; # -- End of test case for Bug#34337. # ----------------------------------------------------------------- -# -- Bug#35193: VIEW query is rewritten without "FROM DUAL", -# -- causing syntax error +# -- Bug#35193 VIEW query is rewritten without "FROM DUAL", +# -- causing syntax error # ----------------------------------------------------------------- CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1; @@ -3723,7 +3723,7 @@ DROP DATABASE `d-1`; USE test; # -# Bug#26676: VIEW using old table schema in a session. +# Bug#26676 VIEW using old table schema in a session. # DROP VIEW IF EXISTS v1; @@ -3765,7 +3765,7 @@ DROP TABLE t1; # End of test case for Bug#26676. # ----------------------------------------------------------------- -# -- Bug#32538: View definition picks up character set, but not collation +# -- Bug#32538 View definition picks up character set, but not collation # ----------------------------------------------------------------- DROP VIEW IF EXISTS v1; diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 1821e50e294..7e280fa2fe5 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -28,7 +28,7 @@ create view v2 as select * from mysqltest.t2; ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2' show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci grant create view,drop,select on test.* to mysqltest_1@localhost; use test; alter view v1 as select * from mysqltest.t1; @@ -309,7 +309,7 @@ grant create view,select on test.* to mysqltest_1@localhost; create view v1 as select * from mysqltest.t1; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci revoke select on mysqltest.t1 from mysqltest_1@localhost; select * from v1; ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them @@ -646,7 +646,7 @@ CREATE DATABASE test2; CREATE TABLE test1.t0 (a VARCHAR(20)); CREATE TABLE test2.t1 (a VARCHAR(20)); CREATE VIEW test2.t3 AS SELECT * FROM test1.t0; -CREATE OR REPLACE VIEW test.v1 AS +CREATE OR REPLACE VIEW test.v1 AS SELECT ta.a AS col1, tb.a AS col2 FROM test2.t3 ta, test2.t1 tb; DROP VIEW test.v1; DROP VIEW test2.t3; @@ -790,7 +790,7 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI DROP USER u26813@localhost; DROP DATABASE db26813; # -# Bug#29908: A user can gain additional access through the ALTER VIEW. +# Bug#29908 A user can gain additional access through the ALTER VIEW. # CREATE DATABASE mysqltest_29908; USE mysqltest_29908; @@ -921,6 +921,32 @@ c4 DROP DATABASE mysqltest1; DROP DATABASE mysqltest2; DROP USER mysqltest_u1@localhost; +CREATE DATABASE db1; +USE db1; +CREATE TABLE t1(f1 INT, f2 INT); +CREATE VIEW v1 AS SELECT f1, f2 FROM t1; +GRANT SELECT (f1) ON t1 TO foo; +GRANT SELECT (f1) ON v1 TO foo; +USE db1; +SELECT f1 FROM t1; +f1 +SELECT f2 FROM t1; +ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 't1' +SELECT * FROM t1; +ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1' +SELECT f1 FROM v1; +f1 +SELECT f2 FROM v1; +ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 'v1' +SELECT * FROM v1; +ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'v1' +USE test; +REVOKE SELECT (f1) ON db1.t1 FROM foo; +REVOKE SELECT (f1) ON db1.v1 FROM foo; +DROP USER foo; +DROP VIEW db1.v1; +DROP TABLE db1.t1; +DROP DATABASE db1; End of 5.0 tests. DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; @@ -956,6 +982,27 @@ Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them DROP VIEW v1; DROP TABLE t1; +CREATE USER mysqluser1@localhost; +CREATE DATABASE mysqltest1; +USE mysqltest1; +CREATE TABLE t1 ( a INT ); +CREATE TABLE t2 ( b INT ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +GRANT CREATE VIEW ON mysqltest1.* TO mysqluser1@localhost; +GRANT SELECT ON t1 TO mysqluser1@localhost; +GRANT INSERT ON t2 TO mysqluser1@localhost; +This would lead to failed assertion. +CREATE VIEW v1 AS SELECT a, b FROM t1, t2; +SELECT * FROM v1; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1' +SELECT b FROM v1; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1' +DROP TABLE t1, t2; +DROP VIEW v1; +DROP DATABASE mysqltest1; +DROP USER mysqluser1@localhost; +USE test; End of 5.1 tests. CREATE USER mysqluser1@localhost; CREATE DATABASE mysqltest1; @@ -996,3 +1043,4 @@ DROP VIEW v1, v2; DROP DATABASE mysqltest1; DROP VIEW test.v3; DROP USER mysqluser1@localhost; +USE test; diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 19d95acd5c1..2e393aea9e4 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -168,7 +168,7 @@ max_error_count 10 drop table t1; set table_type=MYISAM; Warnings: -Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 5.2. Please use '@@storage_engine' instead +Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 6.0. Please use '@@storage_engine' instead create table t1 (a int); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); update t1 set a='abc'; diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result index d056bde4dca..4e0d73ea0eb 100644 --- a/mysql-test/r/windows.result +++ b/mysql-test/r/windows.result @@ -19,6 +19,24 @@ 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 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used DROP TABLE t1; +CREATE DATABASE `TESTDB`; +USE `TESTDB`; +CREATE FUNCTION test_fn() RETURNS INTEGER +BEGIN +DECLARE rId bigint; +RETURN rId; +END +// +CREATE FUNCTION test_fn2() RETURNS INTEGER +BEGIN +DECLARE rId bigint; +RETURN rId; +END +// +DROP FUNCTION `TESTDB`.`test_fn`; +DROP FUNCTION `testdb`.`test_fn2`; +USE test; +DROP DATABASE `TESTDB`; End of 5.0 tests. drop procedure if exists proc_1; create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll'; |