diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-21 21:24:22 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-21 21:24:22 +0100 |
commit | a2bcee626d4ef2836e38e4932305871390164644 (patch) | |
tree | b41e357427318bad8985078b91bbd2b0360defc8 /mysql-test | |
parent | 1788bfe93a745582d938a608d5959b7d2e6b2f23 (diff) | |
parent | 4fdf25afa8188905653a83e08fc387243e584600 (diff) | |
download | mariadb-git-a2bcee626d4ef2836e38e4932305871390164644.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysql-test')
86 files changed, 1255 insertions, 152 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test index 210aee025d0..b674b76dfdf 100644 --- a/mysql-test/extra/rpl_tests/rpl_record_compare.test +++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test @@ -62,24 +62,3 @@ UPDATE t1 SET c1= 0; DROP TABLE t1; -- sync_slave_with_master -# -# BUG#11766865: 60091: RBR + NO PK + UPDATE NULL VALUE --> SLAVE BREAK WITH ERROR HA_ERR_END_OF_ -# - ---connection master ---source include/rpl_reset.inc ---connection master - ---eval CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=$engine DEFAULT CHARSET=latin1 - -INSERT INTO t1 VALUES (1,2,NULL); -UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); - ---sync_slave_with_master - ---let $diff_tables=master:test.t1, slave:test.t1 ---source include/diff_tables.inc - ---connection master -DROP TABLE t1; ---sync_slave_with_master diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 8ce45505c46..da8787d22f2 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -440,7 +440,7 @@ INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); connection slave; # 1677 = ER_SLAVE_CONVERSION_FAILED ---let $slave_sql_errno= 1677 +--let $slave_sql_errno= 1677 --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc @@ -453,7 +453,7 @@ INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); connection slave; # 1677 = ER_SLAVE_CONVERSION_FAILED ---let $slave_sql_errno= 1677 +--let $slave_sql_errno= 1677 --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc diff --git a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test index c6e91449fb3..6edbbf68266 100644 --- a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test +++ b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test @@ -13,7 +13,8 @@ eval CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=$engine_type; INSERT INTO t1 SET name='Andy', age=31; INSERT INTO t1 SET name='Jacob', age=2; INSERT INTO t1 SET name='Caleb', age=1; -ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY; +ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY, + ALGORITHM=COPY; SELECT * FROM t1 ORDER BY id; sync_slave_with_master; SELECT * FROM t1 ORDER BY id; diff --git a/mysql-test/include/check_slave_param.inc b/mysql-test/include/check_slave_param.inc index 243e87a9b65..7f9971d63ea 100644 --- a/mysql-test/include/check_slave_param.inc +++ b/mysql-test/include/check_slave_param.inc @@ -28,7 +28,7 @@ if ($_param_value != $slave_param_value) { --source include/show_rpl_debug_info.inc --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value' - --die Wrong value for slave parameter + --die Wrong value for slave parameter $slave_param } diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index 5b0bc0fd856..8b997e8b096 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -274,6 +274,7 @@ if (IS_WINDOWS) # my @client_rules= ( + { 'character-sets-dir' => \&fix_charset_dir }, ); @@ -296,7 +297,6 @@ my @mysqltest_rules= # my @mysqlbinlog_rules= ( - { 'character-sets-dir' => \&fix_charset_dir }, ); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c03232264cb..2db4fc71544 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5993,10 +5993,10 @@ Options to control what engine/variation to run: non-blocking-api Use the non-blocking client API compress Use the compressed protocol between client and server ssl Use ssl protocol between client and server - skip-ssl Dont start server with support for ssl connections + skip-ssl Don't start server with support for ssl connections vs-config Visual Studio configuration used to create executables (default: MTR_VS_CONFIG environment variable) - parallel=# How many parallell test should be run + parallel=# How many parallel test should be run defaults-file=<config template> Use fixed config template for all tests defaults-extra-file=<config template> Extra config template to add to @@ -6126,7 +6126,7 @@ Options for debugging the product up disks for heavily crashing server). Defaults to $opt_max_save_datadir, set to 0 for no limit. Set it's default with MTR_MAX_SAVE_DATADIR - max-test-fail Limit the number of test failurs before aborting + max-test-fail Limit the number of test failures before aborting the current test run. Defaults to $opt_max_test_fail, set to 0 for no limit. Set it's default with MTR_MAX_TEST_FAIL @@ -6173,7 +6173,7 @@ Misc options --mysqld (if any) wait-all If --start or --start-dirty option is used, wait for all servers to exit before finishing the process - fast Run as fast as possible, dont't wait for servers + fast Run as fast as possible, don't wait for servers to shutdown etc. parallel=N Run tests in N parallel threads (default 1) Use parallel=auto for auto-setting of N @@ -6207,7 +6207,7 @@ Misc options actions. Disable facility with NUM=0. gcov Collect coverage information after the test. The result is a gcov file per source and header file. - gcov-src-dir=subdir Colllect coverage only within the given subdirectory. + gcov-src-dir=subdir Collect coverage only within the given subdirectory. For example, if you're only developing the SQL layer, it makes sense to use --gcov-src-dir=sql gprof Collect profiling information using gprof. diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 5fc06e4362e..6f664d306a1 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1883,5 +1883,11 @@ t1 CREATE TABLE `t1` ( `c` char(32) AS (convert(cast(n as char), char)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +set @@session.collation_server=filename; +create table t1(a enum('','')); +Warnings: +Note 1291 Column 'a' has duplicated value '' in ENUM +drop table t1; +set @@session.collation_server=default; create table t1; ERROR 42000: A table must have at least 1 column diff --git a/mysql-test/r/ctype_filename.result b/mysql-test/r/ctype_filename.result index 12cc8afcbd2..c6d7d1e39b9 100644 --- a/mysql-test/r/ctype_filename.result +++ b/mysql-test/r/ctype_filename.result @@ -11,6 +11,9 @@ create table com1 (a int); drop table com1; create table `clock$` (a int); drop table `clock$`; +select convert(convert(',' using filename) using binary); +convert(convert(',' using filename) using binary) +@002c # # MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 66db7df555f..364640210c9 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -6155,6 +6155,33 @@ SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); ERROR 21000: Subquery returns more than 1 row DROP TABLE t1, t2; # +# MDEV-8630 Datetime value dropped in "INSERT ... SELECT ... ON DUPLICATE KEY" +# +SET NAMES utf8; +CREATE TABLE t1 (id2 int, ts timestamp); +INSERT INTO t1 VALUES (1,'2012-06-11 15:17:34'),(2,'2012-06-11 15:18:24'); +CREATE TABLE t2 AS SELECT +COALESCE(ts, 0) AS c0, +GREATEST(COALESCE(ts, 0), COALESCE(ts, 0)) AS c1, +GREATEST(CASE WHEN 1 THEN ts ELSE 0 END, CASE WHEN 1 THEN ts ELSE 0 END) AS c2, +GREATEST(IFNULL(ts,0), IFNULL(ts,0)) AS c3, +GREATEST(IF(1,ts,0), IF(1,ts,0)) AS c4 +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c0` varchar(19) CHARACTER SET utf8 NOT NULL, + `c1` varchar(19) CHARACTER SET utf8 NOT NULL, + `c2` varchar(19) CHARACTER SET utf8 NOT NULL, + `c3` varchar(19) CHARACTER SET utf8 NOT NULL, + `c4` varchar(19) CHARACTER SET utf8 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t2; +c0 c1 c2 c3 c4 +2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 +2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 +DROP TABLE t2, t1; +# # End of 5.5 tests # # diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 62e3b1c7331..b0d28a81043 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -6,16 +6,16 @@ hex(COLUMN_CREATE(1, NULL AS char character set utf8)) 000000 select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)); hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)) -0001000100030861666166 +0001000100032161666166 select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)); hex(COLUMN_CREATE(1, 1212 AS char character set utf8)) -0001000100030831323132 +0001000100032131323132 select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)); hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)) -0001000100030831322E3132 +0001000100032131322E3132 select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)); hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)) -000100010003083939393939393939393939393939393939393939393939393939393939 +000100010003213939393939393939393939393939393939393939393939393939393939 select hex(COLUMN_CREATE(1, NULL AS unsigned int)); hex(COLUMN_CREATE(1, NULL AS unsigned int)) 000000 @@ -144,7 +144,7 @@ hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, 6, "2011-04-05" AS date, 7, "- 0:45:49.000001" AS time, 8, "2011-04-05 0:45:49.000001" AS datetime)) -01080001000300020029000300380004004A0005008C000600AE000700C7000800F5000861666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000 +01080001000300020029000300380004004A0005008C000600AE000700C7000800F5002161666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000 explain extended select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, 2, 1212 AS unsigned int, @@ -1693,10 +1693,10 @@ ERROR 22007: Illegal value used as argument of dynamic column function # select column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" AS datetime, "date", "2011-04-05" AS date)); column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" -{"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":"1.2e50","string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"} +{"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":1.23444e50,"string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"} select column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date)); column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date)) -{"1":-1212,"2":12334,"3":23.344,"4":"1.2e50","5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"} +{"1":-1212,"2":12334,"3":23.344,"4":1.23444e50,"5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"} # # CHECK test # @@ -1820,5 +1820,58 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1')); COLUMN_JSON(COLUMN_CREATE('a',1,'b','1')) {"a":1,"b":"1"} # +# MDEV-8401: COLUMN_CREATE(name, value as DOUBLE) results in string +# +SELECT COLUMN_JSON( +COLUMN_CREATE( +'one', 123.456, +'two', 123.456 as DOUBLE +) +); +COLUMN_JSON( +COLUMN_CREATE( +'one', 123.456, +'two', 123.456 as DOUBLE +) +) +{"one":123.456,"two":123.456} +# +# MDEV-8521: Drastic loss of precision in COLUMN_JSON() on DOUBLEs +# +select column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double); +column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double) +1.23456789012345e100 +select column_json(column_create('float', 1.23456789012345E+100 as double)); +column_json(column_create('float', 1.23456789012345E+100 as double)) +{"float":1.23456789012345e100} +select column_json(column_create('float', 1.23456789012345E+10 as double)); +column_json(column_create('float', 1.23456789012345E+10 as double)) +{"float":12345678901.2345} +# +# MDEV-9147: Character set is ignored in Dynamic Column for saved string +# +SET NAMES utf8; +SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET latin1), 1 AS CHAR CHARACTER SET utf8) AS a; +a +¢ +SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET utf8), 1 AS CHAR CHARACTER SET utf8) AS a; +a +¢ +# +# MDEV-9167: COLUMN_CHECK fails on valid decimal data +# +SELECT COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)) +1 +SELECT COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)) +1 +SELECT COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)) +{"a":0,"b":1} +SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)) +{"a":1,"b":1} +# # end of 10.0 tests # diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result index 637cd26b79a..153137bc4f9 100644 --- a/mysql-test/r/events_1.result +++ b/mysql-test/r/events_1.result @@ -115,8 +115,7 @@ create table t_event3 (a int, b float); drop event if exists event3; Warnings: Note 1305 Event event3 does not exist -create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20251010", interval 5 day) -comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); +create event event3 on schedule every 50 + 10 minute starts date_add(curdate(), interval 5 minute) ends date_add(curdate(), interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); select count(*) from t_event3; count(*) 0 diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 4c67ab5693a..5678f0f3968 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -393,3 +393,17 @@ Warnings: Note 1003 select NULL AS `a` from (select NULL AS `a` from `test`.`t1` where 0) `t` set optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2; +# +# MDEV-7215: EXPLAIN REPLACE produces an error: +# Column count doesn't match value count +# +create table t1 (a int); +insert into t1 values (1); +create table t2 (b int, c int); +replace into t2 select 100, (select a from t1); +explain replace into t2 select 100, (select a from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 system NULL NULL NULL NULL 1 +drop table t1, t2; +# End of 10.1 tests diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 0cac910886b..8bf948e0d72 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -551,7 +551,7 @@ MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) 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 +ERROR HY000: Incorrect arguments to MATCH DROP TABLE t1; CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a)); INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd'); diff --git a/mysql-test/r/mysql_plugin.result b/mysql-test/r/mysql_plugin.result index 636b039047e..0bcb47e4a10 100644 --- a/mysql-test/r/mysql_plugin.result +++ b/mysql-test/r/mysql_plugin.result @@ -102,7 +102,7 @@ ERROR: Missing --plugin_dir option. # Show the help. # mysql_plugin Ver V.V.VV Distrib XX.XX.XX -Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. Enable or disable plugins. diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 673c241de11..d10e042729f 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -46,7 +46,7 @@ Phase 6/6: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade -Force should run it regardless of wether it's been run before +Force should run it regardless of whether it has been run before Phase 1/6: Checking and upgrading mysql database Processing databases mysql @@ -394,6 +394,13 @@ test Phase 6/6: Running 'FLUSH PRIVILEGES' OK # +# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR +# +Run mysql_upgrade with unauthorized access +Version check failed. Got the following error when calling the 'mysql' command line client +ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) +FATAL ERROR: Upgrade failed +# # MDEV-4332 Increase username length from 16 characters # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names # diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 7d646dce596..033b4086985 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -347,6 +347,9 @@ CREATE TABLE test.`t.1` (id int); mysqlcheck test t.1 test.t.1 OK drop table test.`t.1`; +# +# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such +# create view v1 as select 1; mysqlcheck --process-views test test.v1 OK @@ -361,6 +364,9 @@ test.v1 OK mysqlcheck --process-views --check-upgrade test test.v1 OK drop view v1; +# +# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views +# create table t1(a int); mysqlcheck --process-views --check-upgrade --auto-repair test test.t1 OK @@ -370,3 +376,16 @@ Repairing views test.v1 OK drop view v1; drop table t1; +# +#MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck +# +create table t1(a int); +insert into t1 (a) values (1), (2), (3); +select * from mysql.column_stats; +db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram +test.t1 Engine-independent statistics collected +status : OK +select * from mysql.column_stats where db_name = 'test' and table_name = 't1'; +db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram +test t1 a 1 3 0.0000 4.0000 1.0000 0 NULL NULL +drop table t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index bcf099a9a46..3646618cb1d 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5320,6 +5320,33 @@ OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] OR mysqldump [OPTIONS] --all-databases [OPTIONS] For more options, use mysqldump --help # +# MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine +# +CREATE DATABASE `a\"'``b`; +USE `a\"'``b`; +CREATE PROCEDURE p1() BEGIN END; +ALTER DATABASE `a\"'``b` COLLATE utf8_general_ci; +ALTER DATABASE `a\"'``b` CHARACTER SET latin1 COLLATE latin1_swedish_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +BEGIN END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE `a\"'``b` CHARACTER SET utf8 COLLATE utf8_general_ci ; +DROP DATABASE `a\"'``b`; +use test; +# # Test mysqldump with --disable-query-logs # create table t1 (a int); diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index a7fb28c988a..a0e44f91d44 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2100,6 +2100,19 @@ count(*) 40960 drop table t1; set names default; +create table t2 (a int, b int, c int, d int, key x(a, b)); +insert into t2 values (2, 2, 2, 2), (3, 3, 3, 3), (4, 4, 4, 4), (5, 5, 5, 5), +(6, 6, 6, 6), (7, 7, 7, 7), (8, 8, 8, 8), (9, 9, 9, 9); +insert into t2 select * from t2; +insert into t2 values (0, 0, 0, 0), (1, 1, 1, 1); +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select a, b from t2 where (a, b) in ((0, 0), (1, 1)); +a b +0 0 +1 1 +drop table t2; # # BUG#13731380: RANGE OPTIMIZER CALLS RECORDS_IN_RANGE() FOR OPEN RANGE # diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index 54dd3008c7a..c16d3b4adae 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2102,6 +2102,19 @@ count(*) 40960 drop table t1; set names default; +create table t2 (a int, b int, c int, d int, key x(a, b)); +insert into t2 values (2, 2, 2, 2), (3, 3, 3, 3), (4, 4, 4, 4), (5, 5, 5, 5), +(6, 6, 6, 6), (7, 7, 7, 7), (8, 8, 8, 8), (9, 9, 9, 9); +insert into t2 select * from t2; +insert into t2 values (0, 0, 0, 0), (1, 1, 1, 1); +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select a, b from t2 where (a, b) in ((0, 0), (1, 1)); +a b +0 0 +1 1 +drop table t2; # # BUG#13731380: RANGE OPTIMIZER CALLS RECORDS_IN_RANGE() FOR OPEN RANGE # diff --git a/mysql-test/r/show_row_order-9226.result b/mysql-test/r/show_row_order-9226.result new file mode 100644 index 00000000000..b8c8de647ef --- /dev/null +++ b/mysql-test/r/show_row_order-9226.result @@ -0,0 +1,80 @@ +create table test_table ( +column_number_1 enum('1','2') not null, +column_number_2 enum('1','2','3','4','5','6','7','8','9','10','11','12') not null, +column_number_3 varchar(10) not null, +column_number_4 varchar(10) not null, +column_number_5 enum( +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52' + ) not null, +column_number_6 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','121','122','123','124','125','126','127','128','129','130','131') not null, +column_number_7 enum('1','2','3','4','5','6','7') not null, +column_number_8 enum('8') not null, +column_number_9 enum('9') not null, +column_number_10 varchar(10) not null, +column_number_11 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49') not null +) default charset=utf8mb4; +show columns from test_table; +Field Type Null Key Default Extra +column_number_1 enum('1','2') NO NULL +column_number_2 enum('1','2','3','4','5','6','7','8','9','10','11','12') NO NULL +column_number_3 varchar(10) NO NULL +column_number_4 varchar(10) NO NULL +column_number_5 enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa01','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa02','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa03','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa04','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52') NO NULL +column_number_6 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','121','122','123','124','125','126','127','128','129','130','131') NO NULL +column_number_7 enum('1','2','3','4','5','6','7') NO NULL +column_number_8 enum('8') NO NULL +column_number_9 enum('9') NO NULL +column_number_10 varchar(10) NO NULL +column_number_11 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49') NO NULL +drop table test_table; diff --git a/mysql-test/r/udf_notembedded.result b/mysql-test/r/udf_notembedded.result new file mode 100644 index 00000000000..3fdcdbbe9d3 --- /dev/null +++ b/mysql-test/r/udf_notembedded.result @@ -0,0 +1,6 @@ +create function sequence returns integer soname "UDF_EXAMPLE_LIB"; +create table t1 (n int key not null auto_increment, msg int as (sequence()) virtual); +select * from t1; +n msg +drop table t1; +drop function sequence; diff --git a/mysql-test/suite/federated/error_on_close-8313.result b/mysql-test/suite/federated/error_on_close-8313.result new file mode 100644 index 00000000000..93b0edb4e49 --- /dev/null +++ b/mysql-test/suite/federated/error_on_close-8313.result @@ -0,0 +1,27 @@ +CREATE DATABASE federated; +CREATE DATABASE federated; +connection slave; +create table t1 (foo int, bar int); +connection master; +create server 's1' foreign data wrapper 'mysql' options +(HOST 'localhost', +DATABASE 'test', +USER 'root', +PASSWORD '', +SOCKET 'SLAVE_MYSOCK'); +create table t1 (foo integer, bar integer) engine=federated +connection='s1'; +select * from t1; +foo bar +connection slave; +connection master; +drop table t1; +drop server s1; +connection slave; +drop table t1; +connection master; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +connection slave; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/suite/federated/error_on_close-8313.test b/mysql-test/suite/federated/error_on_close-8313.test new file mode 100644 index 00000000000..b0b12861a66 --- /dev/null +++ b/mysql-test/suite/federated/error_on_close-8313.test @@ -0,0 +1,38 @@ +# +# MDEV-8313 Got an error writing communication packets +# +source include/federated.inc; + +enable_connect_log; + +connection slave; +create table t1 (foo int, bar int); + +connection master; + +--replace_result $SLAVE_MYSOCK SLAVE_MYSOCK +eval create server 's1' foreign data wrapper 'mysql' options + (HOST 'localhost', + DATABASE 'test', + USER 'root', + PASSWORD '', + SOCKET '$SLAVE_MYSOCK'); + + +eval create table t1 (foo integer, bar integer) engine=federated + connection='s1'; + +select * from t1; + +connection slave; +source include/restart_mysqld.inc; + +connection master; +drop table t1; +drop server s1; + +connection slave; +drop table t1; + +source include/federated_cleanup.inc; + diff --git a/mysql-test/suite/innodb/r/dropdb.result b/mysql-test/suite/innodb/r/dropdb.result new file mode 100644 index 00000000000..6b11b5e5205 --- /dev/null +++ b/mysql-test/suite/innodb/r/dropdb.result @@ -0,0 +1,9 @@ +# +# Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE +# +set session default_storage_engine=innodb; +create database `b`; +use `b`; +create table `#mysql50#q.q` select 1; +ERROR 42000: Incorrect table name '#mysql50#q.q' +drop database `b`; diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index 6ac8bb53c66..ddca4685e05 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -567,7 +567,7 @@ Variable_name Value auto_increment_increment 65535 auto_increment_offset 65535 INSERT INTO t1 VALUES (NULL),(NULL); -ERROR 22003: Out of range value for column 'c1' at row 1 +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 @@ -641,6 +641,18 @@ 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'); +SELECT * FROM t2; +m n o +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 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -648,7 +660,7 @@ t2 CREATE TABLE `t2` ( `n` int(10) unsigned NOT NULL, `o` enum('FALSE','TRUE') DEFAULT NULL, PRIMARY KEY (`m`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/innodb/r/innodb-dict.result b/mysql-test/suite/innodb/r/innodb-dict.result new file mode 100644 index 00000000000..e3b2f0d5288 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-dict.result @@ -0,0 +1,40 @@ +CREATE TABLE t1 (D INT) ENGINE=innodb; +INSERT INTO t1 VALUES (10); +ALTER TABLE t1 MODIFY COLUMN d INT; +ALTER TABLE t1 ADD INDEX my_d (d); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d` int(11) DEFAULT NULL, + KEY `my_d` (`d`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +EXPLAIN SELECT d FROM t1 WHERE d = 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref my_d my_d 5 const 128 Using index +EXPLAIN SELECT D FROM t1 WHERE D = 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref my_d my_d 5 const 128 Using index +ALTER TABLE t1 DROP INDEX my_d; +ALTER TABLE t1 MODIFY COLUMN D INT; +ALTER TABLE t1 ADD INDEX my_d (D); +EXPLAIN SELECT d FROM t1 WHERE d = 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref my_d my_d 5 const 128 Using index +EXPLAIN SELECT D FROM t1 WHERE D = 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref my_d my_d 5 const 128 Using index +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `D` int(11) DEFAULT NULL, + KEY `my_d` (`D`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-get-fk.result b/mysql-test/suite/innodb/r/innodb-get-fk.result new file mode 100644 index 00000000000..0dca82c2d10 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-get-fk.result @@ -0,0 +1,71 @@ +CREATE SCHEMA `repro`; +CREATE TABLE `repro`.`crew` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`code` varchar(50) NOT NULL, +`name` varchar(50) NOT NULL, +`created_at` timestamp NULL DEFAULT NULL, +`updated_at` timestamp NULL DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `code` (`code`) +) ENGINE=InnoDB; +CREATE TABLE `repro`.`pilot` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`code` varchar(50) NOT NULL, +`name` varchar(50) NOT NULL, +`created_at` timestamp NULL DEFAULT NULL, +`updated_at` timestamp NULL DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `code` (`code`) +) ENGINE=InnoDB; +CREATE TABLE `repro`.`crew_role_assigned` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`crew_id` int(11) NOT NULL, +`role_code` varchar(50) NOT NULL, +PRIMARY KEY (`id`), +KEY `fk_crewRoleAssigned_roleCode` (`role_code`), +CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, +CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB COMMENT="This is a comment about tables"; +# Restart mysqld --innodb_read_only_mode=1 +SHOW CREATE TABLE `repro`.`crew_role_assigned`; +Table Create Table +crew_role_assigned CREATE TABLE `crew_role_assigned` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `crew_id` int(11) NOT NULL, + `role_code` varchar(50) NOT NULL, + PRIMARY KEY (`id`), + KEY `fk_crewRoleAssigned_roleCode` (`role_code`), + KEY `fk_crewRoleAssigned_pilotId` (`crew_id`), + CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a comment about tables' +ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables"; +SHOW CREATE TABLE `repro`.`crew_role_assigned`; +Table Create Table +crew_role_assigned CREATE TABLE `crew_role_assigned` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `crew_id` int(11) NOT NULL, + `role_code` varchar(50) NOT NULL, + PRIMARY KEY (`id`), + KEY `fk_crewRoleAssigned_roleCode` (`role_code`), + KEY `fk_crewRoleAssigned_pilotId` (`crew_id`), + CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables' +# Restart mysqld --innodb_read_only_mode=1 +SHOW CREATE TABLE `repro`.`crew_role_assigned`; +Table Create Table +crew_role_assigned CREATE TABLE `crew_role_assigned` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `crew_id` int(11) NOT NULL, + `role_code` varchar(50) NOT NULL, + PRIMARY KEY (`id`), + KEY `fk_crewRoleAssigned_roleCode` (`role_code`), + KEY `fk_crewRoleAssigned_pilotId` (`crew_id`), + CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables' +DROP TABLE `repro`.`crew_role_assigned`; +DROP TABLE `repro`.`pilot`; +DROP TABLE `repro`.`crew`; +DROP SCHEMA `repro`; diff --git a/mysql-test/suite/innodb/r/innodb-stats-modified-counter.result b/mysql-test/suite/innodb/r/innodb-stats-modified-counter.result new file mode 100644 index 00000000000..db56c6ba81a --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-stats-modified-counter.result @@ -0,0 +1,20 @@ +set global innodb_stats_auto_recalc=off; +CREATE TABLE t1 (i int) ENGINE=InnoDB; +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; +NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER +test/t1 Initialized 0 0 +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; +NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER +test/t1 Initialized 2 2 +DELETE FROM t1 WHERE i = 1; +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; +NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER +test/t1 Initialized 1 3 +UPDATE t1 SET i = 4 WHERE i = 2; +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; +NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER +test/t1 Initialized 1 4 +DROP TABLE t1; +set global innodb_stats_auto_recalc=default; diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result index 54af78047dd..878450144a2 100644 --- a/mysql-test/suite/innodb/r/innodb_bug56947.result +++ b/mysql-test/suite/innodb/r/innodb_bug56947.result @@ -2,7 +2,7 @@ SET GLOBAL innodb_file_per_table=0; create table bug56947(a int not null) engine = innodb; SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename'; alter table bug56947 add unique index (a); -ERROR HY000: Got error 11 "Resource temporarily unavailable" from storage engine InnoDB +ERROR HY000: Got error 11 "xxx" from storage engine InnoDB SET DEBUG_DBUG='-d,ib_rebuild_cannot_rename'; check table bug56947; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/innodb/r/innodb_information_schema_tables.result b/mysql-test/suite/innodb/r/innodb_information_schema_tables.result new file mode 100644 index 00000000000..ea713ea6f6a --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_information_schema_tables.result @@ -0,0 +1,2 @@ +CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/dropdb.test b/mysql-test/suite/innodb/t/dropdb.test new file mode 100644 index 00000000000..7f5ac809d7c --- /dev/null +++ b/mysql-test/suite/innodb/t/dropdb.test @@ -0,0 +1,12 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE +--echo # + +set session default_storage_engine=innodb; +create database `b`; +use `b`; +--error ER_WRONG_TABLE_NAME +create table `#mysql50#q.q` select 1; +drop database `b`; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index ab708e8762c..dd4c4ae8603 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -349,7 +349,7 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; SHOW VARIABLES LIKE "auto_inc%"; ---error 167 +--error 1467 INSERT INTO t1 VALUES (NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; @@ -401,6 +401,7 @@ CREATE TABLE t2 ( 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'); +SELECT * FROM t2; SHOW CREATE TABLE t2; INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-dict.test b/mysql-test/suite/innodb/t/innodb-dict.test new file mode 100644 index 00000000000..25a284569db --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-dict.test @@ -0,0 +1,31 @@ +--source include/have_innodb.inc + +# +# Fix MySQL Bug#20755615: InnoDB compares column names case sensitively, +# while according to Storage Engine API column names should be compared +# case insensitively. This can cause FRM and InnoDB data dictionary to +# go out of sync: +# + +CREATE TABLE t1 (D INT) ENGINE=innodb; +INSERT INTO t1 VALUES (10); +ALTER TABLE t1 MODIFY COLUMN d INT; +ALTER TABLE t1 ADD INDEX my_d (d); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +EXPLAIN SELECT d FROM t1 WHERE d = 5; +EXPLAIN SELECT D FROM t1 WHERE D = 5; +ALTER TABLE t1 DROP INDEX my_d; +ALTER TABLE t1 MODIFY COLUMN D INT; +ALTER TABLE t1 ADD INDEX my_d (D); +EXPLAIN SELECT d FROM t1 WHERE d = 5; +EXPLAIN SELECT D FROM t1 WHERE D = 5; +SHOW CREATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-get-fk.test b/mysql-test/suite/innodb/t/innodb-get-fk.test new file mode 100644 index 00000000000..4245bef289f --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-get-fk.test @@ -0,0 +1,61 @@ +-- source include/have_innodb.inc +# need to restart server +-- source include/not_embedded.inc +CREATE SCHEMA `repro`; + +CREATE TABLE `repro`.`crew` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`code` varchar(50) NOT NULL, +`name` varchar(50) NOT NULL, +`created_at` timestamp NULL DEFAULT NULL, +`updated_at` timestamp NULL DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `code` (`code`) +) ENGINE=InnoDB; + +CREATE TABLE `repro`.`pilot` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`code` varchar(50) NOT NULL, +`name` varchar(50) NOT NULL, +`created_at` timestamp NULL DEFAULT NULL, +`updated_at` timestamp NULL DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `code` (`code`) +) ENGINE=InnoDB; + +CREATE TABLE `repro`.`crew_role_assigned` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`crew_id` int(11) NOT NULL, +`role_code` varchar(50) NOT NULL, +PRIMARY KEY (`id`), +KEY `fk_crewRoleAssigned_roleCode` (`role_code`), +CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, +CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB COMMENT="This is a comment about tables"; + +--echo # Restart mysqld --innodb_read_only_mode=1 +-- let $restart_parameters=--innodb-read-only-mode=1 +-- source include/restart_mysqld.inc + +SHOW CREATE TABLE `repro`.`crew_role_assigned`; + +-- source include/restart_mysqld.inc + +ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables"; +SHOW CREATE TABLE `repro`.`crew_role_assigned`; + +--echo # Restart mysqld --innodb_read_only_mode=1 +-- let $restart_parameters=--innodb-read-only-mode=1 +-- source include/restart_mysqld.inc + +# +# Below create table should contain also fk definitions +# +SHOW CREATE TABLE `repro`.`crew_role_assigned`; + +-- source include/restart_mysqld.inc + +DROP TABLE `repro`.`crew_role_assigned`; +DROP TABLE `repro`.`pilot`; +DROP TABLE `repro`.`crew`; +DROP SCHEMA `repro`; diff --git a/mysql-test/suite/innodb/t/innodb-stats-modified-counter.opt b/mysql-test/suite/innodb/t/innodb-stats-modified-counter.opt new file mode 100644 index 00000000000..3e5b41c6db9 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-stats-modified-counter.opt @@ -0,0 +1 @@ +--loose-innodb-sys-tablestats diff --git a/mysql-test/suite/innodb/t/innodb-stats-modified-counter.test b/mysql-test/suite/innodb/t/innodb-stats-modified-counter.test new file mode 100644 index 00000000000..b3e45002768 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-stats-modified-counter.test @@ -0,0 +1,28 @@ +-- source include/have_innodb.inc + +# +# MDEV-8297: information_schema.innodb_sys_tablestats.modified_counter doesn't change on UPDATE +# + +set global innodb_stats_auto_recalc=off; + +CREATE TABLE t1 (i int) ENGINE=InnoDB; + +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; + +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); + +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; + +DELETE FROM t1 WHERE i = 1; + +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; + +UPDATE t1 SET i = 4 WHERE i = 2; + +SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; + +DROP TABLE t1; + +set global innodb_stats_auto_recalc=default; diff --git a/mysql-test/suite/innodb/t/innodb_bug56947.test b/mysql-test/suite/innodb/t/innodb_bug56947.test index 4cefeb391cf..7883cafe291 100644 --- a/mysql-test/suite/innodb/t/innodb_bug56947.test +++ b/mysql-test/suite/innodb/t/innodb_bug56947.test @@ -8,6 +8,7 @@ SET GLOBAL innodb_file_per_table=0; create table bug56947(a int not null) engine = innodb; SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename'; +--replace_regex /"[^"]*"/"xxx"/ --error ER_GET_ERRNO alter table bug56947 add unique index (a); SET DEBUG_DBUG='-d,ib_rebuild_cannot_rename'; diff --git a/mysql-test/suite/innodb/t/innodb_information_schema_tables.opt b/mysql-test/suite/innodb/t/innodb_information_schema_tables.opt new file mode 100644 index 00000000000..9f30d81ef9c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_information_schema_tables.opt @@ -0,0 +1,29 @@ +--loose-innodb_trx +--loose-innodb_locks +--loose-innodb_lock_waits +--loose-innodb_cmp +--loose-innodb_cmp_reset +--loose-innodb_cmp_per_index +--loose-innodb_cmp_per_index_reset +--loose-innodb_cmpmem +--loose-innodb_cmpmem_reset +--loose-innodb_buffer_page +--loose-innodb_buffer_page_lru +--loose-innodb_buffer_stats +--loose-innodb_sys_tables +--loose-innodb_sys_tablestats +--loose-innodb_sys_indexes +--loose-innodb_sys_columns +--loose-innodb_sys_fields +--loose-innodb_sys_foreign +--loose-innodb_sys_foreign_cols +--loose-innodb_changed_pages +--loose-innodb_rseg +--loose-innodb_undo_logs +--loose-innodb_sys_stats +--loose-innodb_table_stats +--loose-innodb_index_stats +--loose-innodb_admin_command +--loose-innodb_buffer_pool_pages +--loose-innodb_buffer_pool_pages_index +--loose-innodb_buffer_pool_pages_blob diff --git a/mysql-test/suite/innodb/t/innodb_information_schema_tables.test b/mysql-test/suite/innodb/t/innodb_information_schema_tables.test new file mode 100644 index 00000000000..15b3bf4f561 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_information_schema_tables.test @@ -0,0 +1,64 @@ +-- source include/have_innodb.inc +-- source include/not_embedded.inc + +# +# MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730 +# +# Make sure that all supported information_schema tables are readable +# (actual result sets are not important). +# +CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic; + +--disable_query_log +--disable_result_log +BEGIN; +SELECT * FROM t1 FOR UPDATE; +SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX; +SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; +SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS; +SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP; +SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET; +SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM; +SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET; +SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE; +SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_STATS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_UNDO_LOGS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_ADMIN_COMMAND; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB; +--error 0,1109 +SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES; +COMMIT; +--enable_query_log +--enable_result_log +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result index dd8412c6651..1cdce29cdf9 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext.result +++ b/mysql-test/suite/innodb_fts/r/fulltext.result @@ -498,7 +498,7 @@ MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) DROP TABLE t1; CREATE TABLE t1(a TEXT) ENGINE = InnoDB; SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE); -ERROR HY000: Incorrect arguments to AGAINST +ERROR HY000: Incorrect arguments to MATCH DROP TABLE t1; CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a)) ENGINE = InnoDB; INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd'); diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result index 3668df4c2f0..470d06c341d 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result +++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result @@ -1,4 +1,4 @@ -CREATE TABLE `CC` ( +CREATE TABLE `t2` ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_key` int(11) DEFAULT NULL, `date_nokey` date DEFAULT NULL, @@ -8,9 +8,9 @@ KEY `int_key` (`int_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1; Warnings: -Note 1831 Duplicate index 'varchar_key' defined on the table 'test.CC'. This is deprecated and will be disallowed in a future release. -INSERT INTO `CC` VALUES (10,8,NULL,'2002-02-26 06:14:37'),(11,9,'2006-06-14','1900-01-01 00:00:00'),(12,9,'2002-09-12','2006-12-03 09:37:26'),(13,186,'2005-02-15','2008-05-26 12:27:10'),(14,NULL,NULL,'2004-12-14 16:37:30'),(15,2,'2008-11-04','2003-02-11 21:19:41'),(16,3,'2004-09-04','2009-10-18 02:27:49'),(17,0,'2006-06-05','2000-09-26 07:45:57'),(18,133,'1900-01-01',NULL),(19,1,'1900-01-01','2005-11-10 12:40:29'),(20,8,'1900-01-01','2009-04-25 00:00:00'),(21,5,'2005-01-13','2002-11-27 00:00:00'),(22,5,'2006-05-21','2004-01-26 20:32:32'),(23,8,'2003-09-08','2007-10-26 11:41:40'),(24,6,'2006-12-23','2005-10-07 00:00:00'),(25,51,'2006-10-15','2000-07-15 05:00:34'),(26,4,'2005-04-06','2000-04-03 16:33:32'),(27,7,'2008-04-07',NULL),(28,6,'2006-10-10','2001-04-25 01:26:12'),(29,4,'1900-01-01','2000-12-27 00:00:00'); -CREATE TABLE `C` ( +Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release. +INSERT INTO `t2` VALUES (10,8,NULL,'2002-02-26 06:14:37'),(11,9,'2006-06-14','1900-01-01 00:00:00'),(12,9,'2002-09-12','2006-12-03 09:37:26'),(13,186,'2005-02-15','2008-05-26 12:27:10'),(14,NULL,NULL,'2004-12-14 16:37:30'),(15,2,'2008-11-04','2003-02-11 21:19:41'),(16,3,'2004-09-04','2009-10-18 02:27:49'),(17,0,'2006-06-05','2000-09-26 07:45:57'),(18,133,'1900-01-01',NULL),(19,1,'1900-01-01','2005-11-10 12:40:29'),(20,8,'1900-01-01','2009-04-25 00:00:00'),(21,5,'2005-01-13','2002-11-27 00:00:00'),(22,5,'2006-05-21','2004-01-26 20:32:32'),(23,8,'2003-09-08','2007-10-26 11:41:40'),(24,6,'2006-12-23','2005-10-07 00:00:00'),(25,51,'2006-10-15','2000-07-15 05:00:34'),(26,4,'2005-04-06','2000-04-03 16:33:32'),(27,7,'2008-04-07',NULL),(28,6,'2006-10-10','2001-04-25 01:26:12'),(29,4,'1900-01-01','2000-12-27 00:00:00'); +CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_key` int(11) DEFAULT NULL, `date_nokey` date DEFAULT NULL, @@ -20,13 +20,13 @@ KEY `int_key` (`int_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1; Warnings: -Note 1831 Duplicate index 'varchar_key' defined on the table 'test.C'. This is deprecated and will be disallowed in a future release. -INSERT INTO `C` VALUES (1,2,NULL,'2004-10-11 18:13:16'),(2,9,'2001-09-19',NULL),(3,3,'2004-09-12','1900-01-01 00:00:00'),(4,9,NULL,'2009-07-25 00:00:00'),(5,NULL,'2002-07-19',NULL),(6,9,'2002-12-16','2008-07-27 00:00:00'),(7,3,'2006-02-08','2002-11-13 16:37:31'),(8,8,'2006-08-28','1900-01-01 00:00:00'),(9,8,'2001-04-14','2003-12-10 00:00:00'),(10,53,'2000-01-05','2001-12-21 22:38:22'),(11,0,'2003-12-06','2008-12-13 23:16:44'),(12,5,'1900-01-01','2005-08-15 12:39:41'),(13,166,'2002-11-27',NULL),(14,3,NULL,'2006-09-11 12:06:14'),(15,0,'2003-05-27','2007-12-15 12:39:34'),(16,1,'2005-05-03','2005-08-09 00:00:00'),(17,9,'2001-04-18','2001-09-02 22:50:02'),(18,5,'2005-12-27','2005-12-16 22:58:11'),(19,6,'2004-08-20','2007-04-19 00:19:53'),(20,2,'1900-01-01','1900-01-01 00:00:00'); +Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release. +INSERT INTO t1 VALUES (1,2,NULL,'2004-10-11 18:13:16'),(2,9,'2001-09-19',NULL),(3,3,'2004-09-12','1900-01-01 00:00:00'),(4,9,NULL,'2009-07-25 00:00:00'),(5,NULL,'2002-07-19',NULL),(6,9,'2002-12-16','2008-07-27 00:00:00'),(7,3,'2006-02-08','2002-11-13 16:37:31'),(8,8,'2006-08-28','1900-01-01 00:00:00'),(9,8,'2001-04-14','2003-12-10 00:00:00'),(10,53,'2000-01-05','2001-12-21 22:38:22'),(11,0,'2003-12-06','2008-12-13 23:16:44'),(12,5,'1900-01-01','2005-08-15 12:39:41'),(13,166,'2002-11-27',NULL),(14,3,NULL,'2006-09-11 12:06:14'),(15,0,'2003-05-27','2007-12-15 12:39:34'),(16,1,'2005-05-03','2005-08-09 00:00:00'),(17,9,'2001-04-18','2001-09-02 22:50:02'),(18,5,'2005-12-27','2005-12-16 22:58:11'),(19,6,'2004-08-20','2007-04-19 00:19:53'),(20,2,'1900-01-01','1900-01-01 00:00:00'); SELECT `pk` -FROM C OUTR +FROM t1 OUTR WHERE `pk` IN ( SELECT `int_key` -FROM CC +FROM t2 WHERE `date_nokey` < `datetime_nokey` XOR OUTR .`date_nokey` ) ; pk 9 @@ -34,10 +34,10 @@ pk 5 6 SELECT `pk` -FROM C +FROM t1 WHERE `pk` IN ( SELECT `int_key` -FROM CC +FROM t2 WHERE `date_nokey` < `datetime_nokey` XOR '2009-11-25' ) ; pk 2 @@ -62,9 +62,9 @@ Warning 1292 Truncated incorrect INTEGER value: '2009-11-25' Warning 1292 Truncated incorrect INTEGER value: '2009-11-25' Warning 1292 Truncated incorrect INTEGER value: '2009-11-25' Warning 1292 Truncated incorrect INTEGER value: '2009-11-25' -DROP TABLE CC; -DROP TABLE C; -CREATE TABLE `CC` ( +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE `t2` ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_nokey` int(11) DEFAULT NULL, `int_key` int(11) DEFAULT NULL, @@ -77,9 +77,9 @@ KEY `datetime_key` (`datetime_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1; Warnings: -Note 1831 Duplicate index 'varchar_key' defined on the table 'test.CC'. This is deprecated and will be disallowed in a future release. -INSERT INTO `CC` VALUES (10,7,8,NULL,'2002-02-26 06:14:37','2002-02-26 06:14:37'),(11,1,9,'2006-06-14','1900-01-01 00:00:00','1900-01-01 00:00:00'),(12,5,9,'2002-09-12','2006-12-03 09:37:26','2006-12-03 09:37:26'),(13,3,186,'2005-02-15','2008-05-26 12:27:10','2008-05-26 12:27:10'),(14,6,NULL,NULL,'2004-12-14 16:37:30','2004-12-14 16:37:30'),(15,92,2,'2008-11-04','2003-02-11 21:19:41','2003-02-11 21:19:41'),(16,7,3,'2004-09-04','2009-10-18 02:27:49','2009-10-18 02:27:49'),(17,NULL,0,'2006-06-05','2000-09-26 07:45:57','2000-09-26 07:45:57'),(18,3,133,'1900-01-01',NULL,NULL),(19,5,1,'1900-01-01','2005-11-10 12:40:29','2005-11-10 12:40:29'),(20,1,8,'1900-01-01','2009-04-25 00:00:00','2009-04-25 00:00:00'),(21,2,5,'2005-01-13','2002-11-27 00:00:00','2002-11-27 00:00:00'),(22,NULL,5,'2006-05-21','2004-01-26 20:32:32','2004-01-26 20:32:32'),(23,1,8,'2003-09-08','2007-10-26 11:41:40','2007-10-26 11:41:40'),(24,0,6,'2006-12-23','2005-10-07 00:00:00','2005-10-07 00:00:00'),(25,210,51,'2006-10-15','2000-07-15 05:00:34','2000-07-15 05:00:34'),(26,8,4,'2005-04-06','2000-04-03 16:33:32','2000-04-03 16:33:32'),(27,7,7,'2008-04-07',NULL,NULL),(28,5,6,'2006-10-10','2001-04-25 01:26:12','2001-04-25 01:26:12'),(29,NULL,4,'1900-01-01','2000-12-27 00:00:00','2000-12-27 00:00:00'); -CREATE TABLE `C` ( +Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release. +INSERT INTO `t2` VALUES (10,7,8,NULL,'2002-02-26 06:14:37','2002-02-26 06:14:37'),(11,1,9,'2006-06-14','1900-01-01 00:00:00','1900-01-01 00:00:00'),(12,5,9,'2002-09-12','2006-12-03 09:37:26','2006-12-03 09:37:26'),(13,3,186,'2005-02-15','2008-05-26 12:27:10','2008-05-26 12:27:10'),(14,6,NULL,NULL,'2004-12-14 16:37:30','2004-12-14 16:37:30'),(15,92,2,'2008-11-04','2003-02-11 21:19:41','2003-02-11 21:19:41'),(16,7,3,'2004-09-04','2009-10-18 02:27:49','2009-10-18 02:27:49'),(17,NULL,0,'2006-06-05','2000-09-26 07:45:57','2000-09-26 07:45:57'),(18,3,133,'1900-01-01',NULL,NULL),(19,5,1,'1900-01-01','2005-11-10 12:40:29','2005-11-10 12:40:29'),(20,1,8,'1900-01-01','2009-04-25 00:00:00','2009-04-25 00:00:00'),(21,2,5,'2005-01-13','2002-11-27 00:00:00','2002-11-27 00:00:00'),(22,NULL,5,'2006-05-21','2004-01-26 20:32:32','2004-01-26 20:32:32'),(23,1,8,'2003-09-08','2007-10-26 11:41:40','2007-10-26 11:41:40'),(24,0,6,'2006-12-23','2005-10-07 00:00:00','2005-10-07 00:00:00'),(25,210,51,'2006-10-15','2000-07-15 05:00:34','2000-07-15 05:00:34'),(26,8,4,'2005-04-06','2000-04-03 16:33:32','2000-04-03 16:33:32'),(27,7,7,'2008-04-07',NULL,NULL),(28,5,6,'2006-10-10','2001-04-25 01:26:12','2001-04-25 01:26:12'),(29,NULL,4,'1900-01-01','2000-12-27 00:00:00','2000-12-27 00:00:00'); +CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_nokey` int(11) DEFAULT NULL, `int_key` int(11) DEFAULT NULL, @@ -92,17 +92,17 @@ KEY `datetime_key` (`datetime_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1; Warnings: -Note 1831 Duplicate index 'varchar_key' defined on the table 'test.C'. This is deprecated and will be disallowed in a future release. -INSERT INTO `C` VALUES (1,NULL,2,NULL,'2004-10-11 18:13:16','2004-10-11 18:13:16'),(2,7,9,'2001-09-19',NULL,NULL),(3,9,3,'2004-09-12','1900-01-01 00:00:00','1900-01-01 00:00:00'),(4,7,9,NULL,'2009-07-25 00:00:00','2009-07-25 00:00:00'),(5,4,NULL,'2002-07-19',NULL,NULL),(6,2,9,'2002-12-16','2008-07-27 00:00:00','2008-07-27 00:00:00'),(7,6,3,'2006-02-08','2002-11-13 16:37:31','2002-11-13 16:37:31'),(8,8,8,'2006-08-28','1900-01-01 00:00:00','1900-01-01 00:00:00'),(9,NULL,8,'2001-04-14','2003-12-10 00:00:00','2003-12-10 00:00:00'),(10,5,53,'2000-01-05','2001-12-21 22:38:22','2001-12-21 22:38:22'),(11,NULL,0,'2003-12-06','2008-12-13 23:16:44','2008-12-13 23:16:44'),(12,6,5,'1900-01-01','2005-08-15 12:39:41','2005-08-15 12:39:41'),(13,188,166,'2002-11-27',NULL,NULL),(14,2,3,NULL,'2006-09-11 12:06:14','2006-09-11 12:06:14'),(15,1,0,'2003-05-27','2007-12-15 12:39:34','2007-12-15 12:39:34'),(16,1,1,'2005-05-03','2005-08-09 00:00:00','2005-08-09 00:00:00'),(17,0,9,'2001-04-18','2001-09-02 22:50:02','2001-09-02 22:50:02'),(18,9,5,'2005-12-27','2005-12-16 22:58:11','2005-12-16 22:58:11'),(19,NULL,6,'2004-08-20','2007-04-19 00:19:53','2007-04-19 00:19:53'),(20,4,2,'1900-01-01','1900-01-01 00:00:00','1900-01-01 00:00:00'); +Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release. +INSERT INTO t1 VALUES (1,NULL,2,NULL,'2004-10-11 18:13:16','2004-10-11 18:13:16'),(2,7,9,'2001-09-19',NULL,NULL),(3,9,3,'2004-09-12','1900-01-01 00:00:00','1900-01-01 00:00:00'),(4,7,9,NULL,'2009-07-25 00:00:00','2009-07-25 00:00:00'),(5,4,NULL,'2002-07-19',NULL,NULL),(6,2,9,'2002-12-16','2008-07-27 00:00:00','2008-07-27 00:00:00'),(7,6,3,'2006-02-08','2002-11-13 16:37:31','2002-11-13 16:37:31'),(8,8,8,'2006-08-28','1900-01-01 00:00:00','1900-01-01 00:00:00'),(9,NULL,8,'2001-04-14','2003-12-10 00:00:00','2003-12-10 00:00:00'),(10,5,53,'2000-01-05','2001-12-21 22:38:22','2001-12-21 22:38:22'),(11,NULL,0,'2003-12-06','2008-12-13 23:16:44','2008-12-13 23:16:44'),(12,6,5,'1900-01-01','2005-08-15 12:39:41','2005-08-15 12:39:41'),(13,188,166,'2002-11-27',NULL,NULL),(14,2,3,NULL,'2006-09-11 12:06:14','2006-09-11 12:06:14'),(15,1,0,'2003-05-27','2007-12-15 12:39:34','2007-12-15 12:39:34'),(16,1,1,'2005-05-03','2005-08-09 00:00:00','2005-08-09 00:00:00'),(17,0,9,'2001-04-18','2001-09-02 22:50:02','2001-09-02 22:50:02'),(18,9,5,'2005-12-27','2005-12-16 22:58:11','2005-12-16 22:58:11'),(19,NULL,6,'2004-08-20','2007-04-19 00:19:53','2007-04-19 00:19:53'),(20,4,2,'1900-01-01','1900-01-01 00:00:00','1900-01-01 00:00:00'); SELECT OUTR . `pk` AS X -FROM C AS OUTR +FROM t1 AS OUTR WHERE OUTR . `pk` IN ( SELECT INNR . `int_key` AS Y -FROM CC AS INNR +FROM t2 AS INNR WHERE INNR . `date_nokey` < INNR . `datetime_nokey` XOR OUTR . `date_nokey` BETWEEN '2004-07-10' AND '2009-11-25' ORDER BY INNR . `int_nokey` ) AND ( OUTR . `datetime_key` BETWEEN '2000-05-25' AND '2004-08-07' OR OUTR . `datetime_nokey` = '2007-10-24' ) ORDER BY OUTR . `int_key` , OUTR . `pk`; X 9 -DROP TABLE CC; -DROP TABLE C; +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug45221.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug45221.test index aab93a72725..f8c6b9104fb 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug45221.test +++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug45221.test @@ -1,4 +1,4 @@ -# test for BUG#45221 "Query "SELECT pk FROM C WHERE pk IN (SELECT +# test for BUG#45221 "Query "SELECT pk FROM t1 WHERE pk IN (SELECT # int_key)" failing" --source include/have_debug.inc @@ -13,7 +13,7 @@ #/* Begin test case for query 0 */ -CREATE TABLE `CC` ( +CREATE TABLE `t2` ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_key` int(11) DEFAULT NULL, `date_nokey` date DEFAULT NULL, @@ -22,8 +22,8 @@ CREATE TABLE `CC` ( KEY `int_key` (`int_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1; -INSERT INTO `CC` VALUES (10,8,NULL,'2002-02-26 06:14:37'),(11,9,'2006-06-14','1900-01-01 00:00:00'),(12,9,'2002-09-12','2006-12-03 09:37:26'),(13,186,'2005-02-15','2008-05-26 12:27:10'),(14,NULL,NULL,'2004-12-14 16:37:30'),(15,2,'2008-11-04','2003-02-11 21:19:41'),(16,3,'2004-09-04','2009-10-18 02:27:49'),(17,0,'2006-06-05','2000-09-26 07:45:57'),(18,133,'1900-01-01',NULL),(19,1,'1900-01-01','2005-11-10 12:40:29'),(20,8,'1900-01-01','2009-04-25 00:00:00'),(21,5,'2005-01-13','2002-11-27 00:00:00'),(22,5,'2006-05-21','2004-01-26 20:32:32'),(23,8,'2003-09-08','2007-10-26 11:41:40'),(24,6,'2006-12-23','2005-10-07 00:00:00'),(25,51,'2006-10-15','2000-07-15 05:00:34'),(26,4,'2005-04-06','2000-04-03 16:33:32'),(27,7,'2008-04-07',NULL),(28,6,'2006-10-10','2001-04-25 01:26:12'),(29,4,'1900-01-01','2000-12-27 00:00:00'); -CREATE TABLE `C` ( +INSERT INTO `t2` VALUES (10,8,NULL,'2002-02-26 06:14:37'),(11,9,'2006-06-14','1900-01-01 00:00:00'),(12,9,'2002-09-12','2006-12-03 09:37:26'),(13,186,'2005-02-15','2008-05-26 12:27:10'),(14,NULL,NULL,'2004-12-14 16:37:30'),(15,2,'2008-11-04','2003-02-11 21:19:41'),(16,3,'2004-09-04','2009-10-18 02:27:49'),(17,0,'2006-06-05','2000-09-26 07:45:57'),(18,133,'1900-01-01',NULL),(19,1,'1900-01-01','2005-11-10 12:40:29'),(20,8,'1900-01-01','2009-04-25 00:00:00'),(21,5,'2005-01-13','2002-11-27 00:00:00'),(22,5,'2006-05-21','2004-01-26 20:32:32'),(23,8,'2003-09-08','2007-10-26 11:41:40'),(24,6,'2006-12-23','2005-10-07 00:00:00'),(25,51,'2006-10-15','2000-07-15 05:00:34'),(26,4,'2005-04-06','2000-04-03 16:33:32'),(27,7,'2008-04-07',NULL),(28,6,'2006-10-10','2001-04-25 01:26:12'),(29,4,'1900-01-01','2000-12-27 00:00:00'); +CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_key` int(11) DEFAULT NULL, `date_nokey` date DEFAULT NULL, @@ -32,29 +32,29 @@ CREATE TABLE `C` ( KEY `int_key` (`int_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1; -INSERT INTO `C` VALUES (1,2,NULL,'2004-10-11 18:13:16'),(2,9,'2001-09-19',NULL),(3,3,'2004-09-12','1900-01-01 00:00:00'),(4,9,NULL,'2009-07-25 00:00:00'),(5,NULL,'2002-07-19',NULL),(6,9,'2002-12-16','2008-07-27 00:00:00'),(7,3,'2006-02-08','2002-11-13 16:37:31'),(8,8,'2006-08-28','1900-01-01 00:00:00'),(9,8,'2001-04-14','2003-12-10 00:00:00'),(10,53,'2000-01-05','2001-12-21 22:38:22'),(11,0,'2003-12-06','2008-12-13 23:16:44'),(12,5,'1900-01-01','2005-08-15 12:39:41'),(13,166,'2002-11-27',NULL),(14,3,NULL,'2006-09-11 12:06:14'),(15,0,'2003-05-27','2007-12-15 12:39:34'),(16,1,'2005-05-03','2005-08-09 00:00:00'),(17,9,'2001-04-18','2001-09-02 22:50:02'),(18,5,'2005-12-27','2005-12-16 22:58:11'),(19,6,'2004-08-20','2007-04-19 00:19:53'),(20,2,'1900-01-01','1900-01-01 00:00:00'); +INSERT INTO t1 VALUES (1,2,NULL,'2004-10-11 18:13:16'),(2,9,'2001-09-19',NULL),(3,3,'2004-09-12','1900-01-01 00:00:00'),(4,9,NULL,'2009-07-25 00:00:00'),(5,NULL,'2002-07-19',NULL),(6,9,'2002-12-16','2008-07-27 00:00:00'),(7,3,'2006-02-08','2002-11-13 16:37:31'),(8,8,'2006-08-28','1900-01-01 00:00:00'),(9,8,'2001-04-14','2003-12-10 00:00:00'),(10,53,'2000-01-05','2001-12-21 22:38:22'),(11,0,'2003-12-06','2008-12-13 23:16:44'),(12,5,'1900-01-01','2005-08-15 12:39:41'),(13,166,'2002-11-27',NULL),(14,3,NULL,'2006-09-11 12:06:14'),(15,0,'2003-05-27','2007-12-15 12:39:34'),(16,1,'2005-05-03','2005-08-09 00:00:00'),(17,9,'2001-04-18','2001-09-02 22:50:02'),(18,5,'2005-12-27','2005-12-16 22:58:11'),(19,6,'2004-08-20','2007-04-19 00:19:53'),(20,2,'1900-01-01','1900-01-01 00:00:00'); SELECT `pk` -FROM C OUTR +FROM t1 OUTR WHERE `pk` IN ( SELECT `int_key` -FROM CC +FROM t2 WHERE `date_nokey` < `datetime_nokey` XOR OUTR .`date_nokey` ) ; SELECT `pk` -FROM C +FROM t1 WHERE `pk` IN ( SELECT `int_key` -FROM CC +FROM t2 WHERE `date_nokey` < `datetime_nokey` XOR '2009-11-25' ) ; -DROP TABLE CC; -DROP TABLE C; +DROP TABLE t2; +DROP TABLE t1; #/* End of test case for query 0 */ #/* Begin test case for query 1 */ -CREATE TABLE `CC` ( +CREATE TABLE `t2` ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_nokey` int(11) DEFAULT NULL, `int_key` int(11) DEFAULT NULL, @@ -66,8 +66,8 @@ CREATE TABLE `CC` ( KEY `datetime_key` (`datetime_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1; -INSERT INTO `CC` VALUES (10,7,8,NULL,'2002-02-26 06:14:37','2002-02-26 06:14:37'),(11,1,9,'2006-06-14','1900-01-01 00:00:00','1900-01-01 00:00:00'),(12,5,9,'2002-09-12','2006-12-03 09:37:26','2006-12-03 09:37:26'),(13,3,186,'2005-02-15','2008-05-26 12:27:10','2008-05-26 12:27:10'),(14,6,NULL,NULL,'2004-12-14 16:37:30','2004-12-14 16:37:30'),(15,92,2,'2008-11-04','2003-02-11 21:19:41','2003-02-11 21:19:41'),(16,7,3,'2004-09-04','2009-10-18 02:27:49','2009-10-18 02:27:49'),(17,NULL,0,'2006-06-05','2000-09-26 07:45:57','2000-09-26 07:45:57'),(18,3,133,'1900-01-01',NULL,NULL),(19,5,1,'1900-01-01','2005-11-10 12:40:29','2005-11-10 12:40:29'),(20,1,8,'1900-01-01','2009-04-25 00:00:00','2009-04-25 00:00:00'),(21,2,5,'2005-01-13','2002-11-27 00:00:00','2002-11-27 00:00:00'),(22,NULL,5,'2006-05-21','2004-01-26 20:32:32','2004-01-26 20:32:32'),(23,1,8,'2003-09-08','2007-10-26 11:41:40','2007-10-26 11:41:40'),(24,0,6,'2006-12-23','2005-10-07 00:00:00','2005-10-07 00:00:00'),(25,210,51,'2006-10-15','2000-07-15 05:00:34','2000-07-15 05:00:34'),(26,8,4,'2005-04-06','2000-04-03 16:33:32','2000-04-03 16:33:32'),(27,7,7,'2008-04-07',NULL,NULL),(28,5,6,'2006-10-10','2001-04-25 01:26:12','2001-04-25 01:26:12'),(29,NULL,4,'1900-01-01','2000-12-27 00:00:00','2000-12-27 00:00:00'); -CREATE TABLE `C` ( +INSERT INTO `t2` VALUES (10,7,8,NULL,'2002-02-26 06:14:37','2002-02-26 06:14:37'),(11,1,9,'2006-06-14','1900-01-01 00:00:00','1900-01-01 00:00:00'),(12,5,9,'2002-09-12','2006-12-03 09:37:26','2006-12-03 09:37:26'),(13,3,186,'2005-02-15','2008-05-26 12:27:10','2008-05-26 12:27:10'),(14,6,NULL,NULL,'2004-12-14 16:37:30','2004-12-14 16:37:30'),(15,92,2,'2008-11-04','2003-02-11 21:19:41','2003-02-11 21:19:41'),(16,7,3,'2004-09-04','2009-10-18 02:27:49','2009-10-18 02:27:49'),(17,NULL,0,'2006-06-05','2000-09-26 07:45:57','2000-09-26 07:45:57'),(18,3,133,'1900-01-01',NULL,NULL),(19,5,1,'1900-01-01','2005-11-10 12:40:29','2005-11-10 12:40:29'),(20,1,8,'1900-01-01','2009-04-25 00:00:00','2009-04-25 00:00:00'),(21,2,5,'2005-01-13','2002-11-27 00:00:00','2002-11-27 00:00:00'),(22,NULL,5,'2006-05-21','2004-01-26 20:32:32','2004-01-26 20:32:32'),(23,1,8,'2003-09-08','2007-10-26 11:41:40','2007-10-26 11:41:40'),(24,0,6,'2006-12-23','2005-10-07 00:00:00','2005-10-07 00:00:00'),(25,210,51,'2006-10-15','2000-07-15 05:00:34','2000-07-15 05:00:34'),(26,8,4,'2005-04-06','2000-04-03 16:33:32','2000-04-03 16:33:32'),(27,7,7,'2008-04-07',NULL,NULL),(28,5,6,'2006-10-10','2001-04-25 01:26:12','2001-04-25 01:26:12'),(29,NULL,4,'1900-01-01','2000-12-27 00:00:00','2000-12-27 00:00:00'); +CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, `int_nokey` int(11) DEFAULT NULL, `int_key` int(11) DEFAULT NULL, @@ -79,19 +79,19 @@ CREATE TABLE `C` ( KEY `datetime_key` (`datetime_key`), KEY `varchar_key` (`int_key`) ) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1; -INSERT INTO `C` VALUES (1,NULL,2,NULL,'2004-10-11 18:13:16','2004-10-11 18:13:16'),(2,7,9,'2001-09-19',NULL,NULL),(3,9,3,'2004-09-12','1900-01-01 00:00:00','1900-01-01 00:00:00'),(4,7,9,NULL,'2009-07-25 00:00:00','2009-07-25 00:00:00'),(5,4,NULL,'2002-07-19',NULL,NULL),(6,2,9,'2002-12-16','2008-07-27 00:00:00','2008-07-27 00:00:00'),(7,6,3,'2006-02-08','2002-11-13 16:37:31','2002-11-13 16:37:31'),(8,8,8,'2006-08-28','1900-01-01 00:00:00','1900-01-01 00:00:00'),(9,NULL,8,'2001-04-14','2003-12-10 00:00:00','2003-12-10 00:00:00'),(10,5,53,'2000-01-05','2001-12-21 22:38:22','2001-12-21 22:38:22'),(11,NULL,0,'2003-12-06','2008-12-13 23:16:44','2008-12-13 23:16:44'),(12,6,5,'1900-01-01','2005-08-15 12:39:41','2005-08-15 12:39:41'),(13,188,166,'2002-11-27',NULL,NULL),(14,2,3,NULL,'2006-09-11 12:06:14','2006-09-11 12:06:14'),(15,1,0,'2003-05-27','2007-12-15 12:39:34','2007-12-15 12:39:34'),(16,1,1,'2005-05-03','2005-08-09 00:00:00','2005-08-09 00:00:00'),(17,0,9,'2001-04-18','2001-09-02 22:50:02','2001-09-02 22:50:02'),(18,9,5,'2005-12-27','2005-12-16 22:58:11','2005-12-16 22:58:11'),(19,NULL,6,'2004-08-20','2007-04-19 00:19:53','2007-04-19 00:19:53'),(20,4,2,'1900-01-01','1900-01-01 00:00:00','1900-01-01 00:00:00'); +INSERT INTO t1 VALUES (1,NULL,2,NULL,'2004-10-11 18:13:16','2004-10-11 18:13:16'),(2,7,9,'2001-09-19',NULL,NULL),(3,9,3,'2004-09-12','1900-01-01 00:00:00','1900-01-01 00:00:00'),(4,7,9,NULL,'2009-07-25 00:00:00','2009-07-25 00:00:00'),(5,4,NULL,'2002-07-19',NULL,NULL),(6,2,9,'2002-12-16','2008-07-27 00:00:00','2008-07-27 00:00:00'),(7,6,3,'2006-02-08','2002-11-13 16:37:31','2002-11-13 16:37:31'),(8,8,8,'2006-08-28','1900-01-01 00:00:00','1900-01-01 00:00:00'),(9,NULL,8,'2001-04-14','2003-12-10 00:00:00','2003-12-10 00:00:00'),(10,5,53,'2000-01-05','2001-12-21 22:38:22','2001-12-21 22:38:22'),(11,NULL,0,'2003-12-06','2008-12-13 23:16:44','2008-12-13 23:16:44'),(12,6,5,'1900-01-01','2005-08-15 12:39:41','2005-08-15 12:39:41'),(13,188,166,'2002-11-27',NULL,NULL),(14,2,3,NULL,'2006-09-11 12:06:14','2006-09-11 12:06:14'),(15,1,0,'2003-05-27','2007-12-15 12:39:34','2007-12-15 12:39:34'),(16,1,1,'2005-05-03','2005-08-09 00:00:00','2005-08-09 00:00:00'),(17,0,9,'2001-04-18','2001-09-02 22:50:02','2001-09-02 22:50:02'),(18,9,5,'2005-12-27','2005-12-16 22:58:11','2005-12-16 22:58:11'),(19,NULL,6,'2004-08-20','2007-04-19 00:19:53','2007-04-19 00:19:53'),(20,4,2,'1900-01-01','1900-01-01 00:00:00','1900-01-01 00:00:00'); SELECT OUTR . `pk` AS X -FROM C AS OUTR +FROM t1 AS OUTR WHERE OUTR . `pk` IN ( SELECT INNR . `int_key` AS Y -FROM CC AS INNR +FROM t2 AS INNR WHERE INNR . `date_nokey` < INNR . `datetime_nokey` XOR OUTR . `date_nokey` BETWEEN '2004-07-10' AND '2009-11-25' ORDER BY INNR . `int_nokey` ) AND ( OUTR . `datetime_key` BETWEEN '2000-05-25' AND '2004-08-07' OR OUTR . `datetime_nokey` = '2007-10-24' ) ORDER BY OUTR . `int_key` , OUTR . `pk`; -DROP TABLE CC; -DROP TABLE C; +DROP TABLE t2; +DROP TABLE t1; #/* End of test case for query 1 */ diff --git a/mysql-test/suite/parts/inc/partition_binary.inc b/mysql-test/suite/parts/inc/partition_binary.inc index 08db71b6483..21e9635c036 100644 --- a/mysql-test/suite/parts/inc/partition_binary.inc +++ b/mysql-test/suite/parts/inc/partition_binary.inc @@ -8,11 +8,13 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); +--sorted_result select hex(a) from t1; select a from t1 where substr(a,1,2)='b\0'; update t1 set a='cc' where substr(a,1,2)= 'b\0'; select a from t1 where substr(a,1,1)='c'; delete from t1 where substr(a,1,2)='cc'; +--sorted_result select hex(a) from t1; drop table t1; @@ -33,6 +35,7 @@ inc $letter; commit; --enable_query_log select count(*) from t2; +--sorted_result select hex(a) from t2; drop table t2; diff --git a/mysql-test/suite/parts/inc/partition_char.inc b/mysql-test/suite/parts/inc/partition_char.inc index 0fa28370c83..d28ed3158c5 100644 --- a/mysql-test/suite/parts/inc/partition_char.inc +++ b/mysql-test/suite/parts/inc/partition_char.inc @@ -8,10 +8,12 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); +--sorted_result select * from t1; select * from t1 where a='b'; update t1 set a='bb' where a='b'; delete from t1 where a='bb'; +--sorted_result select * from t1; drop table t1; @@ -32,6 +34,7 @@ inc $letter; commit; --enable_query_log select count(*) from t2; +--sorted_result select * from t2; drop table t2; diff --git a/mysql-test/suite/parts/inc/partition_enum.inc b/mysql-test/suite/parts/inc/partition_enum.inc index a545d7fd8c7..87e88983055 100644 --- a/mysql-test/suite/parts/inc/partition_enum.inc +++ b/mysql-test/suite/parts/inc/partition_enum.inc @@ -8,11 +8,13 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values ('A'),('D'),('L'),('G'); +--sorted_result select * from t1; select * from t1 where a='A'; update t1 set a='E' where a='L'; select * from t1; delete from t1 where a='E'; +--sorted_result select * from t1; drop table t1; @@ -37,6 +39,7 @@ commit; --enable_query_log insert into t2 values ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('0'); select count(*) from t2; +--sorted_result select * from t2; drop table t2; diff --git a/mysql-test/suite/parts/inc/partition_varbinary.inc b/mysql-test/suite/parts/inc/partition_varbinary.inc index 04ba66d87ea..292407cd525 100644 --- a/mysql-test/suite/parts/inc/partition_varbinary.inc +++ b/mysql-test/suite/parts/inc/partition_varbinary.inc @@ -8,10 +8,12 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); +--sorted_result select * from t1; select * from t1 where a='b'; update t1 set a='bb' where a='b'; delete from t1 where a='bb'; +--sorted_result select * from t1; drop table t1; @@ -32,6 +34,7 @@ inc $letter; commit; --enable_query_log select count(*) from t2; +--sorted_result select * from t2; drop table t2; diff --git a/mysql-test/suite/parts/inc/partition_varchar.inc b/mysql-test/suite/parts/inc/partition_varchar.inc index 33c61034a52..257c122ddf2 100644 --- a/mysql-test/suite/parts/inc/partition_varchar.inc +++ b/mysql-test/suite/parts/inc/partition_varchar.inc @@ -8,10 +8,12 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); +--sorted_result select * from t1; select * from t1 where a='b'; update t1 set a='bb' where a='b'; delete from t1 where a='bb'; +--sorted_result select * from t1; drop table t1; @@ -32,6 +34,7 @@ inc $letter; commit; --enable_query_log select count(*) from t2; +--sorted_result select * from t2; drop table t2; diff --git a/mysql-test/suite/parts/r/partition_char_innodb.result b/mysql-test/suite/parts/r/partition_char_innodb.result Binary files differindex 6f4a107f840..bb99e89b022 100644 --- a/mysql-test/suite/parts/r/partition_char_innodb.result +++ b/mysql-test/suite/parts/r/partition_char_innodb.result diff --git a/mysql-test/suite/parts/r/partition_char_myisam.result b/mysql-test/suite/parts/r/partition_char_myisam.result Binary files differindex 913a874b646..9936f3ec0f4 100644 --- a/mysql-test/suite/parts/r/partition_char_myisam.result +++ b/mysql-test/suite/parts/r/partition_char_myisam.result diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result index 433d793909f..2adf2cba851 100644 --- a/mysql-test/suite/perfschema/r/misc.result +++ b/mysql-test/suite/perfschema/r/misc.result @@ -107,3 +107,14 @@ select mysql_errno, returned_sqlstate, message_text, errors, warnings from performance_schema.events_statements_history_long where errors > 0; mysql_errno returned_sqlstate message_text errors warnings 1146 42S02 Table 'test.t1' doesn't exist 1 0 +use performance_schema; +truncate performance_schema.events_statements_history; +select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +select _utf8mb4 'ваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑ' as B; +B +васвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвасвас +select count(*) from events_statements_history where sql_text like "%..."; +count(*) +2 diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test index 00b175ec391..bf3e8afffdc 100644 --- a/mysql-test/suite/perfschema/t/misc.test +++ b/mysql-test/suite/perfschema/t/misc.test @@ -4,6 +4,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc --source include/have_innodb.inc +--source include/no_protocol.inc # # Bug#12790483 OBJECTS_SUMMARY_GLOBAL_BY_TYPE AND RENAME TABLE @@ -189,3 +190,20 @@ select mysql_errno, returned_sqlstate, message_text, errors, warnings --echo select mysql_errno, returned_sqlstate, message_text, errors, warnings from performance_schema.events_statements_history_long where errors > 0; + +# +# Bug#20519832 - TRUNCATED SQL_TEXT values are not suffixed with '...' +# +# Verify that truncated SQL statements are suffixed with '...' + +use performance_schema; +truncate performance_schema.events_statements_history; + +# Should truncate at 1024 bytes (1024 characters) +select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' AS A; + +# Should truncate at 1024 bytes (487 characters) + +select _utf8mb4 'ваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑваÑÑ' as B; + +select count(*) from events_statements_history where sql_text like "%..."; diff --git a/mysql-test/suite/plugins/r/auth_v0100.result b/mysql-test/suite/plugins/r/auth_v0100.result index 6b5f5c917f3..325d3dd882c 100644 --- a/mysql-test/suite/plugins/r/auth_v0100.result +++ b/mysql-test/suite/plugins/r/auth_v0100.result @@ -1,9 +1,8 @@ install soname 'auth_0x0100'; -select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name; +select plugin_name, plugin_type_version from information_schema.plugins where +plugin_type='authentication' and plugin_library is not null order by plugin_name; plugin_name plugin_type_version auth_0x0100 1.0 -mysql_native_password 2.0 -mysql_old_password 2.0 create user tt identified via auth_0x0100; create user zzzzzzzzzzzzzzzz; grant select on test.* to zzzzzzzzzzzzzzzz; diff --git a/mysql-test/suite/plugins/t/auth_v0100.test b/mysql-test/suite/plugins/t/auth_v0100.test index 51f8d8941ef..5d0f6f40be9 100644 --- a/mysql-test/suite/plugins/t/auth_v0100.test +++ b/mysql-test/suite/plugins/t/auth_v0100.test @@ -6,7 +6,8 @@ if (!$AUTH_0X0100_SO) { install soname 'auth_0x0100'; -select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name; +select plugin_name, plugin_type_version from information_schema.plugins where +plugin_type='authentication' and plugin_library is not null order by plugin_name; create user tt identified via auth_0x0100; create user zzzzzzzzzzzzzzzz; diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result index 4f10ac50f9a..ebce070190d 100644 --- a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result @@ -7,7 +7,8 @@ CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=InnoDB; INSERT INTO t1 SET name='Andy', age=31; INSERT INTO t1 SET name='Jacob', age=2; INSERT INTO t1 SET name='Caleb', age=1; -ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY; +ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY, +ALGORITHM=COPY; SELECT * FROM t1 ORDER BY id; name age id Andy 31 00000001 diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result index 4c1a50b2f33..b2fc0f715ea 100644 --- a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result @@ -7,7 +7,8 @@ CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=MyISAM; INSERT INTO t1 SET name='Andy', age=31; INSERT INTO t1 SET name='Jacob', age=2; INSERT INTO t1 SET name='Caleb', age=1; -ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY; +ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY, +ALGORITHM=COPY; SELECT * FROM t1 ORDER BY id; name age id Andy 31 00000001 diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index 70148afcacb..1035df2456c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -493,13 +493,13 @@ include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); -include/wait_for_slave_sql_error.inc [errno=1677 ] +include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'' include/rpl_reset.inc [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); -include/wait_for_slave_sql_error.inc [errno=1677 ] +include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'' include/rpl_reset.inc [expecting slave to replicate correctly] diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index 89557b554d0..0c12eb544a5 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -496,13 +496,13 @@ include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); -include/wait_for_slave_sql_error.inc [errno=1677 ] +include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'' include/rpl_reset.inc [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); -include/wait_for_slave_sql_error.inc [errno=1677 ] +include/wait_for_slave_sql_error.inc [errno=1677] Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'' include/rpl_reset.inc [expecting slave to replicate correctly] diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result index 523564a222e..d9ebb52493b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result @@ -25,10 +25,4 @@ INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; -include/rpl_reset.inc -CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES (1,2,NULL); -UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); -include/diff_tables.inc [master:test.t1, slave:test.t1] -DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result index 4dc7c0bc7a3..1ec98a81a8b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result @@ -34,10 +34,4 @@ INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; -include/rpl_reset.inc -CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES (1,2,NULL); -UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3); -include/diff_tables.inc [master:test.t1, slave:test.t1] -DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result index 7344acec4ec..b6cbdc9686b 100644 --- a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result @@ -8,4 +8,6 @@ set @time_after_kill := (select CURRENT_TIMESTAMP); [Time after the query] [Killing of the slave IO thread was successful] START SLAVE IO_THREAD; +create table t1 (a int primary key); +drop table t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test index e270d81a5e5..d3412c3cd52 100644 --- a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test +++ b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test @@ -3,6 +3,7 @@ # tables. Specifically when drop temporary tables and create temporary tables # are used. ################################################################################### +--source include/big_test.inc --source include/have_binlog_format_mixed.inc --source include/have_innodb.inc --source include/master-slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test index ab388f3eebc..a38ac8fc6a1 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -53,5 +53,12 @@ if(`select TIMESTAMPDIFF(SECOND,@time_after_kill, @time_before_kill) > 60`) START SLAVE IO_THREAD; +# Ensure that the slave io thread started properly +connection master; +create table t1 (a int primary key); +sync_slave_with_master; +connection master; +drop table t1; + # End of test --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test index 6e3dabf6e32..7770fc77748 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test +++ b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test @@ -3,6 +3,7 @@ # tables. Specifically when drop temporary tables and create temporary tables # are used. ################################################################################### +--source include/big_test.inc --source include/have_binlog_format_statement.inc --source include/master-slave.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test index 772a36b5632..daf3d2f8571 100644 --- a/mysql-test/suite/rpl/t/semisync_future-7591.test +++ b/mysql-test/suite/rpl/t/semisync_future-7591.test @@ -27,5 +27,7 @@ reset slave; set global rpl_semi_sync_slave_enabled = OFF; --connection master drop table t1; +--sync_slave_with_master +--connection master set global rpl_semi_sync_master_enabled = OFF; --source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index b812a5dbee3..1bd4e394f6a 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -10,11 +10,5 @@ there should be *no* long test name listed below: select distinct variable_name as `there should be *no* variables listed below:` from t2 left join t1 on variable_name=test_name where test_name is null; there should be *no* variables listed below: -encrypt_tmp_files -innodb_default_encryption_key_id -max_digest_length -strict_password_validation -wsrep_patch_version -pfs_max_digest_length drop table t1; drop table t2; diff --git a/mysql-test/suite/sys_vars/r/max_digest_length_basic.result b/mysql-test/suite/sys_vars/r/max_digest_length_basic.result new file mode 100644 index 00000000000..1a733273614 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_digest_length_basic.result @@ -0,0 +1,23 @@ +select @@global.max_digest_length; +@@global.max_digest_length +1024 +select @@session.max_digest_length; +ERROR HY000: Variable 'max_digest_length' is a GLOBAL variable +show global variables like 'max_digest_length'; +Variable_name Value +max_digest_length 1024 +show session variables like 'max_digest_length'; +Variable_name Value +max_digest_length 1024 +select * from information_schema.global_variables +where variable_name='max_digest_length'; +VARIABLE_NAME VARIABLE_VALUE +MAX_DIGEST_LENGTH 1024 +select * from information_schema.session_variables +where variable_name='max_digest_length'; +VARIABLE_NAME VARIABLE_VALUE +MAX_DIGEST_LENGTH 1024 +set global max_digest_length=1; +ERROR HY000: Variable 'max_digest_length' is a read only variable +set session max_digest_length=1; +ERROR HY000: Variable 'max_digest_length' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result new file mode 100644 index 00000000000..12e48ee50ba --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_digest_length; +@@global.performance_schema_max_digest_length +1024 +select @@session.performance_schema_max_digest_length; +ERROR HY000: Variable 'performance_schema_max_digest_length' is a GLOBAL variable +show global variables like 'performance_schema_max_digest_length'; +Variable_name Value +performance_schema_max_digest_length 1024 +show session variables like 'performance_schema_max_digest_length'; +Variable_name Value +performance_schema_max_digest_length 1024 +select * from information_schema.global_variables +where variable_name='performance_schema_max_digest_length'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH 1024 +select * from information_schema.session_variables +where variable_name='performance_schema_max_digest_length'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH 1024 +set global performance_schema_max_digest_length=1; +ERROR HY000: Variable 'performance_schema_max_digest_length' is a read only variable +set session performance_schema_max_digest_length=1; +ERROR HY000: Variable 'performance_schema_max_digest_length' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff index 74590d94d29..520728d3def 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -21,7 +21,7 @@ VARIABLE_NAME INNODB_ADAPTIVE_MAX_SLEEP_DELAY SESSION_VALUE NULL GLOBAL_VALUE 150000 -@@ -341,6 +355,20 @@ +@@ -355,6 +369,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -32,7 +32,7 @@ +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN -+VARIABLE_COMMENT Preallocate (pre-fault) the page frames required for the mapping established by the buffer pool memory region. Disabled by default. ++VARIABLE_COMMENT Depricated. This option is temporary alias of --innodb-numa-interleave. +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL @@ -42,7 +42,7 @@ VARIABLE_NAME INNODB_BUFFER_POOL_SIZE SESSION_VALUE NULL GLOBAL_VALUE 8388608 -@@ -432,7 +460,7 @@ +@@ -446,7 +474,7 @@ DEFAULT_VALUE ON VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -51,7 +51,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -453,6 +481,104 @@ +@@ -467,6 +495,104 @@ ENUM_VALUE_LIST CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -156,7 +156,7 @@ VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -551,6 +677,20 @@ +@@ -565,6 +691,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -177,7 +177,7 @@ VARIABLE_NAME INNODB_DATA_FILE_PATH SESSION_VALUE NULL GLOBAL_VALUE ibdata1:12M:autoextend -@@ -747,6 +887,20 @@ +@@ -761,6 +901,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT OPTIONAL @@ -198,7 +198,7 @@ VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE SESSION_VALUE NULL GLOBAL_VALUE 1 -@@ -817,6 +971,20 @@ +@@ -831,6 +985,20 @@ ENUM_VALUE_LIST OFF,ON,FORCE READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -219,7 +219,7 @@ VARIABLE_NAME INNODB_FAST_SHUTDOWN SESSION_VALUE NULL GLOBAL_VALUE 1 -@@ -944,11 +1112,11 @@ +@@ -958,11 +1126,11 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_FLUSH_LOG_AT_TRX_COMMIT @@ -233,7 +233,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Controls the durability/speed trade-off for commits. Set to 0 (write and flush redo log to disk only once per second), 1 (flush to disk at each commit), 2 (write to log at commit but flush to disk only once per second) or 3 (flush to disk at prepare and at commit, slower and usually redundant). 1 and 3 guarantees that after a crash, committed transactions will not be lost and will be consistent with the binlog and other transactional engines. 2 can get inconsistent and lose transactions if there is a power failure or kernel crash but not if mysqld crashes. 0 has no guarantees in case of crash. 0 and 2 can be faster than 1 or 3. NUMERIC_MIN_VALUE 0 -@@ -1041,6 +1209,20 @@ +@@ -1055,6 +1223,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED @@ -254,7 +254,7 @@ VARIABLE_NAME INNODB_FT_AUX_TABLE SESSION_VALUE NULL GLOBAL_VALUE -@@ -1279,6 +1461,20 @@ +@@ -1293,6 +1475,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -275,7 +275,7 @@ VARIABLE_NAME INNODB_LARGE_PREFIX SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1307,6 +1503,20 @@ +@@ -1321,6 +1517,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -296,7 +296,7 @@ VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1335,6 +1545,62 @@ +@@ -1349,6 +1559,62 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -359,7 +359,7 @@ VARIABLE_NAME INNODB_LOG_BUFFER_SIZE SESSION_VALUE NULL GLOBAL_VALUE 1048576 -@@ -1363,6 +1629,20 @@ +@@ -1377,6 +1643,20 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -380,7 +380,7 @@ VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1433,6 +1713,34 @@ +@@ -1447,6 +1727,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -415,7 +415,7 @@ VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT SESSION_VALUE NULL GLOBAL_VALUE 75.000000 -@@ -1699,6 +2007,62 @@ +@@ -1713,6 +2021,62 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -478,7 +478,7 @@ VARIABLE_NAME INNODB_PURGE_BATCH_SIZE SESSION_VALUE NULL GLOBAL_VALUE 300 -@@ -1867,6 +2231,48 @@ +@@ -1881,6 +2245,48 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -527,7 +527,7 @@ VARIABLE_NAME INNODB_SCRUB_LOG SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -1895,6 +2301,34 @@ +@@ -1909,6 +2315,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL @@ -562,7 +562,7 @@ VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES SESSION_VALUE NULL GLOBAL_VALUE 0 -@@ -1958,7 +2392,7 @@ +@@ -1972,7 +2406,7 @@ DEFAULT_VALUE nulls_equal VARIABLE_SCOPE GLOBAL VARIABLE_TYPE ENUM @@ -571,7 +571,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2189,6 +2623,34 @@ +@@ -2203,6 +2637,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -606,7 +606,7 @@ VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2266,7 +2728,7 @@ +@@ -2280,7 +2742,7 @@ DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -615,7 +615,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2287,6 +2749,20 @@ +@@ -2301,6 +2763,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -636,7 +636,7 @@ VARIABLE_NAME INNODB_USE_MTFLUSH SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2301,6 +2777,20 @@ +@@ -2315,6 +2791,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -657,12 +657,12 @@ VARIABLE_NAME INNODB_USE_SYS_MALLOC SESSION_VALUE NULL GLOBAL_VALUE ON -@@ -2331,12 +2821,12 @@ +@@ -2345,12 +2835,12 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.27 -+GLOBAL_VALUE 5.6.26-74.0 ++GLOBAL_VALUE 5.6.26-76.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/t/max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test new file mode 100644 index 00000000000..b5e1d834d7e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test @@ -0,0 +1,46 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc + +# +# Only global +# + +select @@global.max_digest_length; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.max_digest_length; + +show global variables like 'max_digest_length'; + +show session variables like 'max_digest_length'; + +select * from information_schema.global_variables + where variable_name='max_digest_length'; + +select * from information_schema.session_variables + where variable_name='max_digest_length'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global max_digest_length=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session max_digest_length=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt b/mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt new file mode 100644 index 00000000000..a98eb86d2e6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt @@ -0,0 +1,2 @@ +--loose-enable-performance-schema +--loose-performance-schema-max_digest_length=1024 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test new file mode 100644 index 00000000000..5c89dbda07f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_digest_length; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_digest_length; + +show global variables like 'performance_schema_max_digest_length'; + +show session variables like 'performance_schema_max_digest_length'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_digest_length'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_digest_length'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_digest_length=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_digest_length=1; + diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 279777b8b36..451898aa972 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -322,6 +322,14 @@ drop table t1; create table t1 (a int, b int as (b is null) virtual); ERROR HY000: A computed column cannot be based on a computed column # end of 5.3 tests +create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=latin1_general_ci; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v1` varchar(255) AS (c1) PERSISTENT, + `c1` varchar(50) COLLATE latin1_general_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +drop table t1; # # Start of 10.1 tests # diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index c5b534fe200..c78093bce0f 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -284,6 +284,13 @@ create table t1 (a int, b int as (b is null) virtual); --echo # end of 5.3 tests +# +# MDEV-7655 SHOW CREATE TABLE returns invalid DDL when using virtual columns along with a table collation +# +create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=latin1_general_ci; +show create table t1; +drop table t1; + --echo # --echo # Start of 10.1 tests diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 4d0675ee9a1..6751c92f0be 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1730,6 +1730,14 @@ show create table t1; drop table t1; # +# MDEV-7050: MySQL#74603 - Assertion `comma_length > 0' failed in mysql_prepare_create_table +# +set @@session.collation_server=filename; +create table t1(a enum('','')); +drop table t1; +set @@session.collation_server=default; + +# # MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS # --error ER_TABLE_MUST_HAVE_COLUMNS diff --git a/mysql-test/t/ctype_filename.test b/mysql-test/t/ctype_filename.test index bb1b25619c6..7ec07293a2b 100644 --- a/mysql-test/t/ctype_filename.test +++ b/mysql-test/t/ctype_filename.test @@ -20,6 +20,8 @@ drop table com1; create table `clock$` (a int); drop table `clock$`; +select convert(convert(',' using filename) using binary); + --echo # --echo # MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member --echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 639f6d48e6a..b791f78fc21 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1650,6 +1650,22 @@ INSERT INTO t2 VALUES ('aaa'); SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); DROP TABLE t1, t2; +--echo # +--echo # MDEV-8630 Datetime value dropped in "INSERT ... SELECT ... ON DUPLICATE KEY" +--echo # +SET NAMES utf8; +CREATE TABLE t1 (id2 int, ts timestamp); +INSERT INTO t1 VALUES (1,'2012-06-11 15:17:34'),(2,'2012-06-11 15:18:24'); +CREATE TABLE t2 AS SELECT + COALESCE(ts, 0) AS c0, + GREATEST(COALESCE(ts, 0), COALESCE(ts, 0)) AS c1, + GREATEST(CASE WHEN 1 THEN ts ELSE 0 END, CASE WHEN 1 THEN ts ELSE 0 END) AS c2, + GREATEST(IFNULL(ts,0), IFNULL(ts,0)) AS c3, + GREATEST(IF(1,ts,0), IF(1,ts,0)) AS c4 +FROM t1; +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index ac55fec3e2b..03e2345ba1c 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -884,5 +884,42 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',0,'b','1')); SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1')); --echo # +--echo # MDEV-8401: COLUMN_CREATE(name, value as DOUBLE) results in string +--echo # +SELECT COLUMN_JSON( + COLUMN_CREATE( + 'one', 123.456, + 'two', 123.456 as DOUBLE + ) +); + +--echo # +--echo # MDEV-8521: Drastic loss of precision in COLUMN_JSON() on DOUBLEs +--echo # + +select column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double); +select column_json(column_create('float', 1.23456789012345E+100 as double)); +select column_json(column_create('float', 1.23456789012345E+10 as double)); + +--echo # +--echo # MDEV-9147: Character set is ignored in Dynamic Column for saved string +--echo # +SET NAMES utf8; +SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET latin1), 1 AS CHAR CHARACTER SET utf8) AS a; +SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET utf8), 1 AS CHAR CHARACTER SET utf8) AS a; + +--echo # +--echo # MDEV-9167: COLUMN_CHECK fails on valid decimal data +--echo # + +SELECT COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)); + +SELECT COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); + +SELECT COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)); + +SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); + +--echo # --echo # end of 10.0 tests --echo # diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test index badcfe4624f..88120b0cd4f 100644 --- a/mysql-test/t/events_1.test +++ b/mysql-test/t/events_1.test @@ -127,8 +127,7 @@ drop event existant; create table t_event3 (a int, b float); drop event if exists event3; -create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20251010", interval 5 day) - comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); +create event event3 on schedule every 50 + 10 minute starts date_add(curdate(), interval 5 minute) ends date_add(curdate(), interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); let $wait_condition=SELECT count(*)=0 from t_event3; --source include/wait_condition.inc select count(*) from t_event3; diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index 9b9e65d7b51..d5be354c852 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -317,3 +317,19 @@ SELECT * FROM ( SELECT t1.a FROM t1,t2 WHERE t2.a = t1.a ) AS t; set optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2; + +--echo # +--echo # MDEV-7215: EXPLAIN REPLACE produces an error: +--echo # Column count doesn't match value count +--echo # +create table t1 (a int); +insert into t1 values (1); +create table t2 (b int, c int); + +replace into t2 select 100, (select a from t1); +explain replace into t2 select 100, (select a from t1); +#analyze replace into t2 select 100, (select a from t1); + +drop table t1, t2; + +--echo # End of 10.1 tests diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index 0c20ffc36ce..9d33dd70e3a 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -22,7 +22,7 @@ file_exists $MYSQLD_DATADIR/mysql_upgrade_info; # It should have created a file in the MySQL Servers datadir file_exists $MYSQLD_DATADIR/mysql_upgrade_info; ---echo Force should run it regardless of wether it's been run before +--echo Force should run it regardless of whether it has been run before --exec $MYSQL_UPGRADE --force 2>&1 # It should have created a file in the MySQL Servers datadir @@ -133,6 +133,14 @@ let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/mysql_upgrade_info --echo # +--echo # Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR +--echo # + +--echo Run mysql_upgrade with unauthorized access +--error 1 +--exec $MYSQL_UPGRADE --skip-verbose --user=root --password=wrong_password 2>&1 + +--echo # --echo # MDEV-4332 Increase username length from 16 characters --echo # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names --echo # diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 6cd0265f89a..88f0d034bf0 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -319,9 +319,9 @@ CREATE TABLE test.`t.1` (id int); drop table test.`t.1`; -# -# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such -# +--echo # +--echo # MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such +--echo # create view v1 as select 1; --echo mysqlcheck --process-views test --exec $MYSQL_CHECK --process-views test @@ -340,12 +340,22 @@ create view v1 as select 1; drop view v1; -# -# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views -# +--echo # +--echo # MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views +--echo # create table t1(a int); --copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm --echo mysqlcheck --process-views --check-upgrade --auto-repair test --exec $MYSQL_CHECK --process-views --check-upgrade --auto-repair test drop view v1; drop table t1; + +--echo # +--echo #MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck +--echo # +create table t1(a int); +insert into t1 (a) values (1), (2), (3); +select * from mysql.column_stats; +--exec $MYSQL_CHECK --analyze test t1 --persistent +select * from mysql.column_stats where db_name = 'test' and table_name = 't1'; +drop table t1; diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test index 3ffcd31092d..2ddb58e6de4 100644 --- a/mysql-test/t/mysqld--help.test +++ b/mysql-test/t/mysqld--help.test @@ -30,8 +30,8 @@ perl; thread-concurrency super-large-pages mutex-deadlock-detector connect null-audit aria oqgraph sphinx thread-handling test-sql-discovery rpl-semi-sync query-cache-info - query-response-time metadata-lock-info locales wsrep - file-key-management/; + query-response-time metadata-lock-info locales unix-socket + wsrep file-key-management/; # And substitute the content some environment variables with their # names: diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 684e3ec691a..e5ae109088c 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2500,6 +2500,23 @@ USE test; --exec $MYSQL_DUMP --help > $MYSQLTEST_VARDIR/tmp/bug6056.out --echo # +--echo # MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine +--echo # +CREATE DATABASE `a\"'``b`; +USE `a\"'``b`; +CREATE PROCEDURE p1() BEGIN END; +ALTER DATABASE `a\"'``b` COLLATE utf8_general_ci; +--let shell_ready_db_name="a\\\\\\"'`b" +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`) +{ + --let shell_ready_db_name=a\\\\\\"\\'\\`b +} +--exec $MYSQL_DUMP --routines --compact $shell_ready_db_name +DROP DATABASE `a\"'``b`; +#" +use test; + +--echo # --echo # Test mysqldump with --disable-query-logs --echo # diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 9ce050c2da3..ba4928faffb 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -1678,6 +1678,18 @@ select count(*) from t1 ignore index (ix_fd) where fd <'😁'; drop table t1; set names default; +# +# Bug#17755540 VALGRIND ERROR WHEN SETTING UP ROW COMPARATORS +# +create table t2 (a int, b int, c int, d int, key x(a, b)); +insert into t2 values (2, 2, 2, 2), (3, 3, 3, 3), (4, 4, 4, 4), (5, 5, 5, 5), + (6, 6, 6, 6), (7, 7, 7, 7), (8, 8, 8, 8), (9, 9, 9, 9); +insert into t2 select * from t2; +insert into t2 values (0, 0, 0, 0), (1, 1, 1, 1); +analyze table t2; +select a, b from t2 where (a, b) in ((0, 0), (1, 1)); +drop table t2; + --echo # --echo # BUG#13731380: RANGE OPTIMIZER CALLS RECORDS_IN_RANGE() FOR OPEN RANGE --echo # diff --git a/mysql-test/t/show_row_order-9226.test b/mysql-test/t/show_row_order-9226.test new file mode 100644 index 00000000000..06df24061ec --- /dev/null +++ b/mysql-test/t/show_row_order-9226.test @@ -0,0 +1,73 @@ +# +# MDEV-9226 SHOW COLUMNS returns wrong column order for tables with large ENUMs +# +create table test_table ( + column_number_1 enum('1','2') not null, + column_number_2 enum('1','2','3','4','5','6','7','8','9','10','11','12') not null, + column_number_3 varchar(10) not null, + column_number_4 varchar(10) not null, + column_number_5 enum( +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa01', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa02', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa03', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa04', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa05', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa06', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa07', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa08', +'aaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52' + ) not null, + column_number_6 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','121','122','123','124','125','126','127','128','129','130','131') not null, + column_number_7 enum('1','2','3','4','5','6','7') not null, + column_number_8 enum('8') not null, + column_number_9 enum('9') not null, + column_number_10 varchar(10) not null, + column_number_11 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49') not null +) default charset=utf8mb4; +# SHOW command must list columns in the table order +# (SELECT isn't required to do it, though) +show columns from test_table; +drop table test_table; diff --git a/mysql-test/t/udf_notembedded.test b/mysql-test/t/udf_notembedded.test new file mode 100644 index 00000000000..bf54af7256c --- /dev/null +++ b/mysql-test/t/udf_notembedded.test @@ -0,0 +1,14 @@ +--source include/not_embedded.inc +--source include/have_udf.inc + +# +# MDEV-8644 Using a UDF in a virtual column causes a crash when stopping the server +# +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +eval create function sequence returns integer soname "$UDF_EXAMPLE_SO"; +create table t1 (n int key not null auto_increment, msg int as (sequence()) virtual); +select * from t1; +source include/restart_mysqld.inc; +drop table t1; +drop function sequence; + |