diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2010-11-18 15:01:50 +0300 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2010-11-18 15:01:50 +0300 |
commit | 3bae49d64ce0df04a85583b5dc680cda54760dbc (patch) | |
tree | 04b3b89fdd9cd8129c671253e6d65fe9be72ded2 /mysql-test/r | |
parent | 52e88852697896b7fd150faf28c60a56cda42ab8 (diff) | |
parent | c45458524cae4b500d1d1f043060cfe3bb376d7e (diff) | |
download | mariadb-git-3bae49d64ce0df04a85583b5dc680cda54760dbc.tar.gz |
Manual-merge from 5.5-bugfixing.
Diffstat (limited to 'mysql-test/r')
30 files changed, 967 insertions, 30 deletions
diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result index e8562662bfd..792d9eaf2f1 100644 --- a/mysql-test/r/1st.result +++ b/mysql-test/r/1st.result @@ -21,7 +21,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index bbd0273c1c6..b21956252d2 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -15,7 +15,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv @@ -49,7 +49,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv @@ -91,7 +91,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 0e8fe328589..d79265b29c7 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -1425,7 +1425,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varbinary(10) NOT NULL DEFAULT '' + `c1` varbinary(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index b1e9ff38d26..babed8951a2 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1507,7 +1507,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index c8182feaed2..facdc2d74d2 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -1844,7 +1844,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) NOT NULL DEFAULT '' + `c1` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index c2fb90ecfa6..1008f201366 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -2667,7 +2667,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 3982d09e64b..dd6f8665737 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -2071,6 +2071,20 @@ predicted_order hex(utf8_encoding) 100 E0B78AE2808DE0B6BA 101 E0B78AE2808DE0B6BB DROP TABLE t1; +SET NAMES utf8 COLLATE utf8_sinhala_ci; +CREATE TABLE t1 (s1 VARCHAR(10) COLLATE utf8_sinhala_ci); +INSERT INTO t1 VALUES ('a'),('ae'),('af'); +SELECT s1,hex(s1) FROM t1 ORDER BY s1; +s1 hex(s1) +a 61 +ae 6165 +af 6166 +SELECT * FROM t1 ORDER BY s1; +s1 +a +ae +af +DROP TABLE t1; End of 5.4 tests # # Start of 5.5 tests @@ -3542,7 +3556,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 3d247a242a3..e6a1b492b39 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -134,3 +134,15 @@ INSERT INTO t1 VALUES ('abc\0\0'); INSERT INTO t1 VALUES ('abc\0\0'); ERROR 23000: Duplicate entry 'abc\x00\x00' for key 'PRIMARY' DROP TABLE t1; +# +# Bug#57882: Item_func_conv_charset::val_str(String*): +# Assertion `fixed == 1' failed +# +SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),'')); +ERROR 22003: DOUBLE value is out of range in 'cot('v')' +SET NAMES utf8 COLLATE utf8_latvian_ci ; +SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null); +ERROR 22003: BIGINT value is out of range in '(-(73) * -(2465717823867977728))' +# +# End Bug#57882 +# diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 5b2f01969a6..ac9a22a0b82 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -619,3 +619,12 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821))) as foo; foo 2 +# +# Bug #58137 char(0) column cause: +# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed +# +CREATE TABLE t1(a char(0)); +INSERT INTO t1 (SELECT -pi()); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +DROP TABLE t1; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index f1b2196ebfa..0ed46ba270b 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1315,6 +1315,20 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a); 1 1 DROP TABLE t1; +# +# Bug #52160: crash and inconsistent results when grouping +# by a function and column +# +CREATE TABLE t1(a CHAR(10) NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); +COUNT(*) +2 +Warnings: +Warning 1292 Truncated incorrect time value: '' +Warning 1292 Truncated incorrect time value: '' +Warning 1292 Truncated incorrect time value: '' +DROP TABLE t1; End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result index 248b8d606dc..92408c439a5 100644 --- a/mysql-test/r/information_schema-big.result +++ b/mysql-test/r/information_schema-big.result @@ -30,6 +30,7 @@ FILES TABLE_SCHEMA GLOBAL_STATUS VARIABLE_NAME GLOBAL_VARIABLES VARIABLE_NAME KEY_COLUMN_USAGE CONSTRAINT_SCHEMA +PARAMETERS SPECIFIC_SCHEMA PARTITIONS TABLE_SCHEMA PLUGINS PLUGIN_NAME PROCESSLIST ID @@ -42,6 +43,7 @@ SESSION_STATUS VARIABLE_NAME SESSION_VARIABLES VARIABLE_NAME STATISTICS TABLE_SCHEMA TABLES TABLE_SCHEMA +TABLESPACES TABLESPACE_NAME TABLE_CONSTRAINTS CONSTRAINT_SCHEMA TABLE_PRIVILEGES TABLE_SCHEMA TRIGGERS TRIGGER_SCHEMA @@ -74,6 +76,7 @@ FILES TABLE_SCHEMA GLOBAL_STATUS VARIABLE_NAME GLOBAL_VARIABLES VARIABLE_NAME KEY_COLUMN_USAGE CONSTRAINT_SCHEMA +PARAMETERS SPECIFIC_SCHEMA PARTITIONS TABLE_SCHEMA PLUGINS PLUGIN_NAME PROCESSLIST ID @@ -86,6 +89,7 @@ SESSION_STATUS VARIABLE_NAME SESSION_VARIABLES VARIABLE_NAME STATISTICS TABLE_SCHEMA TABLES TABLE_SCHEMA +TABLESPACES TABLESPACE_NAME TABLE_CONSTRAINTS CONSTRAINT_SCHEMA TABLE_PRIVILEGES TABLE_SCHEMA TRIGGERS TRIGGER_SCHEMA diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index bab60774b32..1418af5b813 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -88,7 +88,7 @@ host plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result index 5f338ad6a62..58cb7430563 100644 --- a/mysql-test/r/keywords.result +++ b/mysql-test/r/keywords.result @@ -45,3 +45,227 @@ p1 max=1 drop procedure p1; drop table t1; +CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO slow(slow, general) VALUES (1,2), (5,6); +INSERT INTO slow(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM slow ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM slow ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM slow ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE slow; +CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO general(slow, general) VALUES (1,2), (5,6); +INSERT INTO general(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM general ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM general ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM general ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE general; +CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6); +INSERT INTO master_heartbeat_period(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM master_heartbeat_period ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM master_heartbeat_period ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE master_heartbeat_period; +CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6); +INSERT INTO ignore_server_ids(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM ignore_server_ids ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM ignore_server_ids ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE ignore_server_ids; +CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT); +INSERT INTO t1 VALUES (1,2,3,4); +CREATE PROCEDURE p1() +BEGIN +DECLARE slow INT; +DECLARE general INT; +DECLARE ignore_server_ids INT; +DECLARE master_heartbeat_period INT; +SELECT max(t1.slow) INTO slow FROM t1; +SELECT max(t1.general) INTO general FROM t1; +SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1; +SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1; +SELECT slow, general, ignore_server_ids, master_heartbeat_period; +END| +CREATE PROCEDURE p2() +BEGIN +DECLARE n INT DEFAULT 2; +general: WHILE n > 0 DO +SET n = n -1; +END WHILE general; +SET n = 2; +slow: WHILE n > 0 DO +SET n = n -1; +END WHILE slow; +SET n = 2; +ignore_server_ids: WHILE n > 0 DO +SET n = n -1; +END WHILE ignore_server_ids; +SET n = 2; +master_heartbeat_period: WHILE n > 0 DO +SET n = n -1; +END WHILE master_heartbeat_period; +END| +CALL p1(); +slow general ignore_server_ids master_heartbeat_period +1 2 3 4 +call p2(); +DROP PROCEDURE p1; +DROP PROCEDURE p2; +DROP TABLE t1; diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 1666d5e0297..f64894c9f10 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -896,6 +896,16 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1 TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2 DROP TABLE t1; TRUNCATE TABLE mysql.slow_log; +use mysql; +drop table if exists renamed_general_log; +drop table if exists renamed_slow_log; +RENAME TABLE general_log TO renamed_general_log; +ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log' +RENAME TABLE slow_log TO renamed_slow_log; +ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'slow_log' +use test; +flush tables with read lock; +unlock tables; SET @@session.long_query_time= @old_long_query_time; SET @@global.log_output= @old_log_output; SET @@global.slow_query_log= @old_slow_query_log; diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result index 13b08c2e771..7d15005e143 100644 --- a/mysql-test/r/log_tables_upgrade.result +++ b/mysql-test/r/log_tables_upgrade.result @@ -27,7 +27,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.renamed_general_log OK mysql.servers OK mysql.slow_log OK diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index f705db3e509..e36b4781ddf 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -15,7 +15,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -44,7 +44,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -73,7 +73,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -104,7 +104,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -139,7 +139,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -177,7 +177,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result index 694eb1e7d88..4cc8b6ab44b 100644 --- a/mysql-test/r/mysql_upgrade_ssl.result +++ b/mysql-test/r/mysql_upgrade_ssl.result @@ -17,7 +17,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 51fad679909..ce83fe5b79b 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -879,3 +879,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; End of 5.0 tests End of 5.1 tests +# Expect deprecation warning. +WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead. +# Expect deprecation warning again. +WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead. diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 241c92f0aa6..ef46eba5ccb 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -18,7 +18,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log note : The storage engine for the table doesn't support analyze @@ -46,7 +46,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log note : The storage engine for the table doesn't support optimize @@ -72,7 +72,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log note : The storage engine for the table doesn't support analyze @@ -98,7 +98,7 @@ mysql.ndb_binlog_index Table is already up to date mysql.plugin Table is already up to date mysql.proc Table is already up to date mysql.procs_priv Table is already up to date -mysql.proxy_priv Table is already up to date +mysql.proxies_priv Table is already up to date mysql.servers Table is already up to date mysql.slow_log note : The storage engine for the table doesn't support optimize diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 63e17e1c188..fc269e1dd82 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -19,6 +19,7 @@ The following options may be given as the first argument: --auto-increment-offset[=#] Offset added to Auto-increment columns. Used when auto-increment-increment != 1 + --autocommit Set default value for autocommit (0 or 1) --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index c5996981e92..c5d7bb458c3 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -19,6 +19,7 @@ The following options may be given as the first argument: --auto-increment-offset[=#] Offset added to Auto-increment columns. Used when auto-increment-increment != 1 + --autocommit Set default value for autocommit (0 or 1) --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result index fac38624695..ce229bf3e2e 100644 --- a/mysql-test/r/not_embedded_server.result +++ b/mysql-test/r/not_embedded_server.result @@ -14,3 +14,32 @@ flush privileges; ERROR HY000: Table 'host' was not locked with LOCK TABLES unlock tables; drop table t1; +# +# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN +# +CREATE USER nopriv_user@localhost; +connection: default +DROP TABLE IF EXISTS t1,t2,t3; +DROP FUNCTION IF EXISTS f; +CREATE TABLE t1 (key1 INT PRIMARY KEY); +CREATE TABLE t2 (key2 INT); +INSERT INTO t1 VALUES (1),(2); +CREATE FUNCTION f() RETURNS INT RETURN 1; +GRANT FILE ON *.* TO 'nopriv_user'@'localhost'; +FLUSH PRIVILEGES; +connection: con1 +SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest'; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +connection: default +DROP TABLE t1,t2; +DROP FUNCTION f; +DROP USER nopriv_user@localhost; +# +# End Bug#54812 +# diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 80676c0d324..a639f9e6b3b 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,5 +1,38 @@ drop table if exists t1, t2; # +# Bug#57778: failed primary key add to partitioned innodb table +# inconsistent and crashes +# +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL) +PARTITION BY KEY (a) PARTITIONS 2; +INSERT INTO t1 VALUES (0,1), (0,2); +ALTER TABLE t1 ADD PRIMARY KEY (a); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY KEY (a) +PARTITIONS 2 */ +SELECT * FROM t1; +a b +0 1 +0 2 +UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2; +ALTER TABLE t1 ADD PRIMARY KEY (a); +SELECT * FROM t1; +a b +1 1 +0 1 +ALTER TABLE t1 DROP PRIMARY KEY; +SELECT * FROM t1; +a b +1 1 +0 1 +DROP TABLE t1; +# # Bug#57113: ha_partition::extra(ha_extra_function): # Assertion `m_extra_cache' failed CREATE TABLE t1 diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 54467b78f19..7119ba11077 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -11,6 +11,26 @@ test_plugin_server plug_dest ## test plugin auth ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES) GRANT PROXY ON plug_dest TO plug; +test proxies_priv columns +SELECT * FROM mysql.proxies_priv; +Host User Proxied_host Proxied_user With_grant Grantor Timestamp +xx root 1 xx +xx root 1 xx +xx plug % plug_dest 0 root@localhost xx +test mysql.proxies_priv; +SHOW CREATE TABLE mysql.proxies_priv; +Table Create Table +proxies_priv CREATE TABLE `proxies_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges' select USER(),CURRENT_USER(); USER() CURRENT_USER() plug@localhost plug_dest@% @@ -146,8 +166,8 @@ Grants for test_drop@localhost GRANT USAGE ON *.* TO 'test_drop'@'localhost' GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost' DROP USER test_drop@localhost; -SELECT * FROM mysql.proxy_priv WHERE Host = 'test_drop' AND User = 'localhost'; -Host User Proxied_Host Proxied_User With_Grant +SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost'; +Host User Proxied_host Proxied_user With_grant Grantor Timestamp DROP USER proxy_admin; DROP USER grant_plug,grant_plug_dest,grant_plug_dest2; ## END GRANT PROXY tests diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 33282823931..17f639cdca3 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3202,6 +3202,510 @@ test1 DROP PROCEDURE p1; DROP PROCEDURE p2; +TINYINT + +CREATE PROCEDURE p1(OUT v TINYINT) +SET v = 127; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 127; +@a @a = 127 +127 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +SMALLINT + +CREATE PROCEDURE p1(OUT v SMALLINT) +SET v = 32767; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 32767; +@a @a = 32767 +32767 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +MEDIUMINT + +CREATE PROCEDURE p1(OUT v MEDIUMINT) +SET v = 8388607; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 8388607; +@a @a = 8388607 +8388607 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +INT + +CREATE PROCEDURE p1(OUT v INT) +SET v = 2147483647; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 2147483647; +@a @a = 2147483647 +2147483647 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BIGINT + +CREATE PROCEDURE p1(OUT v BIGINT) +SET v = 9223372036854775807; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 9223372036854775807; +@a @a = 9223372036854775807 +9223372036854775807 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BIT(11) + +CREATE PROCEDURE p1(OUT v BIT(11)) +SET v = b'10100100101'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = b'10100100101'; +@a @a = b'10100100101' +1317 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TIMESTAMP + +CREATE PROCEDURE p1(OUT v TIMESTAMP) +SET v = '2007-11-18 15:01:02'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '2007-11-18 15:01:02'; +@a @a = '2007-11-18 15:01:02' +2007-11-18 15:01:02 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DATETIME + +CREATE PROCEDURE p1(OUT v DATETIME) +SET v = '1234-11-12 12:34:59'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '1234-11-12 12:34:59'; +@a @a = '1234-11-12 12:34:59' +1234-11-12 12:34:59 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TIME + +CREATE PROCEDURE p1(OUT v TIME) +SET v = '123:45:01'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '123:45:01'; +@a @a = '123:45:01' +123:45:01 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DATE + +CREATE PROCEDURE p1(OUT v DATE) +SET v = '1234-11-12'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '1234-11-12'; +@a @a = '1234-11-12' +1234-11-12 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +YEAR + +CREATE PROCEDURE p1(OUT v YEAR) +SET v = 2010; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 2010; +@a @a = 2010 +2010 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +FLOAT(7, 4) + +CREATE PROCEDURE p1(OUT v FLOAT(7, 4)) +SET v = 123.4567; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a - 123.4567 < 0.00001; +@a @a - 123.4567 < 0.00001 +123.45670318603516 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DOUBLE(8, 5) + +CREATE PROCEDURE p1(OUT v DOUBLE(8, 5)) +SET v = 123.45678; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a - 123.45678 < 0.000001; +@a @a - 123.45678 < 0.000001 +123.45678 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DECIMAL(9, 6) + +CREATE PROCEDURE p1(OUT v DECIMAL(9, 6)) +SET v = 123.456789; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 123.456789; +@a @a = 123.456789 +123.456789 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +CHAR(32) + +CREATE PROCEDURE p1(OUT v CHAR(32)) +SET v = REPEAT('a', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('a', 16); +@a @a = REPEAT('a', 16) +aaaaaaaaaaaaaaaa 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +VARCHAR(32) + +CREATE PROCEDURE p1(OUT v VARCHAR(32)) +SET v = REPEAT('b', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('b', 16); +@a @a = REPEAT('b', 16) +bbbbbbbbbbbbbbbb 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TINYTEXT + +CREATE PROCEDURE p1(OUT v TINYTEXT) +SET v = REPEAT('c', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('c', 16); +@a @a = REPEAT('c', 16) +cccccccccccccccc 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TEXT + +CREATE PROCEDURE p1(OUT v TEXT) +SET v = REPEAT('d', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('d', 16); +@a @a = REPEAT('d', 16) +dddddddddddddddd 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +MEDIUMTEXT + +CREATE PROCEDURE p1(OUT v MEDIUMTEXT) +SET v = REPEAT('e', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('e', 16); +@a @a = REPEAT('e', 16) +eeeeeeeeeeeeeeee 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +LONGTEXT + +CREATE PROCEDURE p1(OUT v LONGTEXT) +SET v = REPEAT('f', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('f', 16); +@a @a = REPEAT('f', 16) +ffffffffffffffff 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BINARY(32) + +CREATE PROCEDURE p1(OUT v BINARY(32)) +SET v = REPEAT('g', 32); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('g', 32); +@a @a = REPEAT('g', 32) +gggggggggggggggggggggggggggggggg 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +VARBINARY(32) + +CREATE PROCEDURE p1(OUT v VARBINARY(32)) +SET v = REPEAT('h', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('h', 16); +@a @a = REPEAT('h', 16) +hhhhhhhhhhhhhhhh 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TINYBLOB + +CREATE PROCEDURE p1(OUT v TINYBLOB) +SET v = REPEAT('i', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('i', 16); +@a @a = REPEAT('i', 16) +iiiiiiiiiiiiiiii 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BLOB + +CREATE PROCEDURE p1(OUT v BLOB) +SET v = REPEAT('j', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('j', 16); +@a @a = REPEAT('j', 16) +jjjjjjjjjjjjjjjj 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +MEDIUMBLOB + +CREATE PROCEDURE p1(OUT v MEDIUMBLOB) +SET v = REPEAT('k', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('k', 16); +@a @a = REPEAT('k', 16) +kkkkkkkkkkkkkkkk 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +LONGBLOB + +CREATE PROCEDURE p1(OUT v LONGBLOB) +SET v = REPEAT('l', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('l', 16); +@a @a = REPEAT('l', 16) +llllllllllllllll 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +SET('aaa', 'bbb') + +CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb')) +SET v = 'aaa'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 'aaa'; +@a @a = 'aaa' +aaa 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +ENUM('aaa', 'bbb') + +CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb')) +SET v = 'aaa'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 'aaa'; +@a @a = 'aaa' +aaa 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + # End of WL#4435. # # WL#4284: Transactional DDL locking diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result index a88c89537e2..2425f40d9c2 100644 --- a/mysql-test/r/sp-bugs.result +++ b/mysql-test/r/sp-bugs.result @@ -75,4 +75,40 @@ CALL p1 (); ERROR HY000: Trigger does not exist DROP TABLE t1; DROP PROCEDURE p1; +# +# Bug#54375: Error in stored procedure leaves connection +# in different default schema +# +SET @@SQL_MODE = 'STRICT_ALL_TABLES'; +DROP DATABASE IF EXISTS db1; +CREATE DATABASE db1; +USE db1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY); +INSERT INTO t1 VALUES (1); +CREATE FUNCTION f1 ( +some_value int +) +RETURNS smallint +DETERMINISTIC +BEGIN +INSERT INTO t1 SET c1 = some_value; +RETURN(LAST_INSERT_ID()); +END$$ +DROP DATABASE IF EXISTS db2; +CREATE DATABASE db2; +USE db2; +SELECT DATABASE(); +DATABASE() +db2 +SELECT db1.f1(1); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +SELECT DATABASE(); +DATABASE() +db2 +USE test; +DROP FUNCTION db1.f1; +DROP TABLE db1.t1; +DROP DATABASE db1; +DROP DATABASE db2; End of 5.1 tests diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 13941b56040..3136b5dfcc0 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -5005,3 +5005,15 @@ SELECT * FROM t2 UNION SELECT * FROM t2 ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); DROP TABLE t1,t2; End of 5.1 tests +# +# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): +# Assertion `file' failed. +# +CREATE TABLE t1 (a INT); +SELECT 1 FROM +(SELECT ROW( +(SELECT 1 FROM t1 RIGHT JOIN +(SELECT 1 FROM t1, t1 t2) AS d ON 1), +1) FROM t1) AS e; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index e82cf229912..0028f2ce5c1 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -14,7 +14,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 78f31286ea7..e3363fcabf9 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -975,4 +975,14 @@ SELECT LENGTH(c) FROM t2; LENGTH(c) 65535 DROP TABLE t1, t2; +# Bug #52160: crash and inconsistent results when grouping +# by a function and column +CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1; +CREATE TABLE t1(a CHAR(1)); +INSERT INTO t1 VALUES ('0'), ('0'); +SELECT COUNT(*) FROM t1 GROUP BY f1(), a; +COUNT(*) +2 +DROP FUNCTION f1; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/variables-big.result b/mysql-test/r/variables-big.result index 960fc6d22f4..71b32393d82 100644 --- a/mysql-test/r/variables-big.result +++ b/mysql-test/r/variables-big.result @@ -1,20 +1,20 @@ SET SESSION transaction_prealloc_size=1024*1024*1024*1; SHOW PROCESSLIST; Id User Host db Command Time State Info -<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST +<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST SET SESSION transaction_prealloc_size=1024*1024*1024*2; SHOW PROCESSLIST; Id User Host db Command Time State Info -<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST +<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST SET SESSION transaction_prealloc_size=1024*1024*1024*3; SHOW PROCESSLIST; Id User Host db Command Time State Info -<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST +<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST SET SESSION transaction_prealloc_size=1024*1024*1024*4; SHOW PROCESSLIST; Id User Host db Command Time State Info -<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST +<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST SET SESSION transaction_prealloc_size=1024*1024*1024*5; SHOW PROCESSLIST; Id User Host db Command Time State Info -<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST +<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST |