diff options
Diffstat (limited to 'mysql-test')
79 files changed, 1803 insertions, 267 deletions
diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def index 555b7177228..e82ddcf92d1 100644 --- a/mysql-test/disabled.def +++ b/mysql-test/disabled.def @@ -11,9 +11,7 @@ ############################################################################## tablespace : disabled in MariaDB (no TABLESPACE table attribute) events_time_zone : Test is not predictable as it depends on precise timing. -lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists -archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 #show_explain : Psergey: random timeout in range-checked-for-each record query. diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index b8625f2f18a..dcaf47c55a2 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -1,3 +1,9 @@ +# ==== Usage ==== +# +# [--let $shutdown_timeout= 30] +# [--let $allow_rpl_inited= 1] +# --source include/restart_mysqld.inc + --source include/not_embedded.inc if ($rpl_inited) @@ -8,6 +14,16 @@ if ($rpl_inited) } } +--let $server_shutdown_timeout= 60 +if ($shutdown_timeout) +{ + --let $server_shutdown_timeout= $shutdown_timeout +} +if ($shutdown_timeout == 0) +{ + --let $server_shutdown_timeout= 0 +} + # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to --let $_server_id= `SELECT @@server_id` @@ -15,8 +31,8 @@ if ($rpl_inited) --exec echo "wait" > $_expect_file_name # Send shutdown to the connected server and give -# it 60 seconds to die before zapping it -shutdown_server 60; +# it 10 seconds to die before zapping it +shutdown_server $server_shutdown_timeout; # Write file to make mysql-test-run.pl start up the server again if ($restart_parameters) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 04a0887c624..2435137db6d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1060,7 +1060,6 @@ sub print_global_resfile { resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0); resfile_global("warnings", $opt_warnings ? 1 : 0); resfile_global("max-connections", $opt_max_connections); -# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0); resfile_global("product", "MySQL"); # Somewhat hacky code to convert numeric version back to dot notation my $v1= int($mysql_version_id / 10000); @@ -1218,7 +1217,6 @@ sub command_line_setup { 'stop-file=s' => \$opt_stop_file, 'stop-keep-alive=i' => \$opt_stop_keep_alive, 'max-connections=i' => \$opt_max_connections, - 'default-myisam!' => \&collect_option, 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'stress=s' => \$opt_stress, @@ -6216,9 +6214,6 @@ Misc options timediff With --timestamp, also print time passed since *previous* test started max-connections=N Max number of open connection to server in mysqltest - default-myisam Set default storage engine to MyISAM for non-innodb - tests. This is needed after switching default storage - engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. stress=ARGS Run stress test, providing options to diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result index 0eee7ee9b1e..5a6b9f841c2 100644 --- a/mysql-test/r/explain_non_select.result +++ b/mysql-test/r/explain_non_select.result @@ -232,3 +232,44 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE user index NULL PRIMARY 420 NULL 4 Using index DROP TABLE t1; DROP VIEW v1; +# +# MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT +# +CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM; +INSERT INTO t1 (i) VALUES (100),(200); +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (10),(20); +EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +INSERT INTO t1 (i) VALUES (300); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +# +# MDEV-8321: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status on EXPLAIN INSERT ... UNION +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (3),(4); +INSERT INTO t3 VALUES (5),(6); +EXPLAIN INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM t3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +2 UNION t3 ALL NULL NULL NULL NULL 2 +NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL +drop table t1,t2,t3; +# +# MDEV-6223: Assertion `! is_set()' fails in Diagnostics_area::set_eof_status on EXPLAIN INSERT executed as a PS +# +CREATE TABLE t1 (a INT) ENGINE = MyISAM; +CREATE TABLE t2 (b INT) ENGINE = MyISAM; +INSERT INTO t2 VALUES (1),(2); +PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2'; +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +drop table t1,t2; diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index c7f548ae2bc..637fd8cd2a2 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -234,3 +234,17 @@ SELECT if(1, NULL, (SELECT min('hello'))); if(1, NULL, (SELECT min('hello'))) NULL End of 5.2 tests +# +# MDEV-8663: IF Statement returns multiple values erroneously +# (or Assertion `!null_value' failed in Item::send(Protocol*, String*) +# +CREATE TABLE `t1` ( +`datas` VARCHAR(25) NOT NULL +) DEFAULT CHARSET=utf8; +INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4'); +SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`; +First Second Third +1.5 1 2 +2.0 1 2 +NULL 1 2 +drop table t1; diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index df69aff8b59..700fda2e182 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -373,6 +373,207 @@ NULL Warnings: Warning 1411 Incorrect timeout value: '-1' for function get_lock # +# MDEV-8624 MariaDB hangs on query with many logical condition +# +CREATE TABLE `t1` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`submitdate` datetime DEFAULT NULL, +`lastpage` int(11) DEFAULT NULL, +`startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL, +`token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, +`datestamp` datetime NOT NULL, +`startdate` datetime NOT NULL, +`ipaddr` text COLLATE utf8_unicode_ci, +`refurl` text COLLATE utf8_unicode_ci, +`57813X540X1723` text COLLATE utf8_unicode_ci, +`57813X540X1724` text COLLATE utf8_unicode_ci, +`57813X540X1725` text COLLATE utf8_unicode_ci, +`57813X540X1726` double DEFAULT NULL, +`57813X540X1909` double DEFAULT NULL, +`57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X541X17281` text COLLATE utf8_unicode_ci, +`57813X541X17282` text COLLATE utf8_unicode_ci, +`57813X541X17283` text COLLATE utf8_unicode_ci, +`57813X541X17284` text COLLATE utf8_unicode_ci, +`57813X541X17285` text COLLATE utf8_unicode_ci, +`57813X541X17286` text COLLATE utf8_unicode_ci, +`57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X542X18141` text COLLATE utf8_unicode_ci, +`57813X542X18142` text COLLATE utf8_unicode_ci, +`57813X542X18143` text COLLATE utf8_unicode_ci, +`57813X542X18144` text COLLATE utf8_unicode_ci, +`57813X542X18145` text COLLATE utf8_unicode_ci, +`57813X542X18146` text COLLATE utf8_unicode_ci, +`57813X542X18147` text COLLATE utf8_unicode_ci, +`57813X542X18148` text COLLATE utf8_unicode_ci, +`57813X542X18149` text COLLATE utf8_unicode_ci, +`57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X543X18461` text COLLATE utf8_unicode_ci, +`57813X543X18462` text COLLATE utf8_unicode_ci, +`57813X543X18463` text COLLATE utf8_unicode_ci, +`57813X543X18464` text COLLATE utf8_unicode_ci, +`57813X543X18465` text COLLATE utf8_unicode_ci, +`57813X543X18466` text COLLATE utf8_unicode_ci, +`57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X544X18721` text COLLATE utf8_unicode_ci, +`57813X544X18722` text COLLATE utf8_unicode_ci, +`57813X544X18723` text COLLATE utf8_unicode_ci, +`57813X544X18724` text COLLATE utf8_unicode_ci, +`57813X544X18725` text COLLATE utf8_unicode_ci, +`57813X544X18726` text COLLATE utf8_unicode_ci, +`57813X544X18727` text COLLATE utf8_unicode_ci, +`57813X544X18728` text COLLATE utf8_unicode_ci, +`57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, +`57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `lime_survey_57813_idx` (`token`), +KEY `57813X540X1723` (`57813X540X1723`(100)), +KEY `57813X540X1724` (`57813X540X1724`(100)), +KEY `57813X540X1726` (`57813X540X1726`), +KEY `57813X540X1725` (`57813X540X1725`(100)), +KEY `57813X546X1902` (`57813X546X1902`), +KEY `57813X546X1903` (`57813X546X1903`), +KEY `57813X546X1904` (`57813X546X1904`) +); +SELECT +COUNT(*) as `N`, +ROUND( +( +SUM( +( +( +IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + +IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) + +IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) + +IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) + +IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) + +IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) + +IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) + +IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) + +IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) + +IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) + +IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) + +IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) + +IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) + +IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) + +IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) + +IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) + +IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) + +IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) + +IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) + +IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) + +IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) + +IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) + +IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) + +IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) + +IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) + +IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) + +IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) + +IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) + +IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 ) +) +/ +( +IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) + +IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) + +IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) + +IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) + +IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) + +IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) + +IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) + +IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) + +IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) + +IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) + +IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) + +IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) + +IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) + +IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) + +IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) + +IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) + +IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) + +IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) + +IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) + +IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) + +IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) + +IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) + +IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) + +IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) + +IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) + +IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) + +IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) + +IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) + +IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 ) +) +) +) +/ COUNT(*) ), 4) as `AVG` +FROM `t1` +WHERE `submitdate` IS NOT NULL +AND ( +( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR +( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR +( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR +( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR +( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR +( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR +( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR +( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR +( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR +( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR +( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR +( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR +( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR +( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR +( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR +( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR +( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR +( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR +( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR +( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR +( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR +( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR +( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR +( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR +( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR +( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR +( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR +( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR +( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) ) +AND 57813X540X1723 = 'Test'; +N AVG +0 NULL +drop table t1; +# +# End of 5.5 tests +# +# # GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test # # IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired @@ -593,9 +794,6 @@ select is_free_lock(repeat('a', 193)); ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long select release_lock(repeat('a', 193)); ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long -# -# End of 5.5 tests -# # -- # -- WL#5787: IPv6-capable INET_ATON and INET_NTOA functions. diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result index f82301699a7..7e9bdd7088f 100644 --- a/mysql-test/r/information_schema2.result +++ b/mysql-test/r/information_schema2.result @@ -6,15 +6,15 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); variable_name BASEDIR -create table t1 (a char); -insert t1 values ('a'),('t'),('z'); -flush status; -select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; -a exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) -a 0 -t 1 -z 0 -show status like 'created_tmp_tables'; -Variable_name Value -Created_tmp_tables 43 -drop table t1; +create table t1 (x int); +create table t2 (x int); +create table t3 (x int); +create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ; +delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE'); +select * from t4; +table_name +t1 +t2 +t3 +t4 +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result index 7742f456252..1128caf9122 100644 --- a/mysql-test/r/loadxml.result +++ b/mysql-test/r/loadxml.result @@ -93,3 +93,30 @@ a b 216 !&bb b; 3 !b3 DROP TABLE t1; +# +# Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS +# +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4)); +LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3, col4; +col1 col2 col3 col4 +0bc def ghi jkl +1no NULL pqr stu +2BC DEF GHI JKL +3NO NULL PQR STU +4bc def ghi jkl +5no pqr stu vwx +6BC DEF NULL JKL +7NO PQR STU VWX +8bc def ghi NULL +9kl NULL mno pqr +ABC DEF NULL JKL +MNO NULL STU VWX +DROP TABLE t1; +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER); +LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3; +col1 col2 col3 +ABC DEF NULL +GHI NULL 123 +DROP TABLE t1; diff --git a/mysql-test/r/lowercase_fs_on.result b/mysql-test/r/lowercase_fs_on.result new file mode 100644 index 00000000000..a090f46cfbf --- /dev/null +++ b/mysql-test/r/lowercase_fs_on.result @@ -0,0 +1,3 @@ +# +# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS +# diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result deleted file mode 100644 index 22e80aaeb26..00000000000 --- a/mysql-test/r/lowercase_table3.result +++ /dev/null @@ -1,11 +0,0 @@ -call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); -DROP TABLE IF EXISTS t1,T1; -CREATE TABLE t1 (a INT); -SELECT * FROM T1; -a -FLUSH TABLES; -DROP TABLE t1; -CREATE TABLE bug29839 (a INT) ENGINE=INNODB; -SELECT * FROM BUG29839; -ERROR 42S02: Table 'test.BUG29839' doesn't exist -DROP TABLE bug29839; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index bbece88bb98..c6f7fdd7cca 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4292,7 +4292,6 @@ Abernathy aberrant aberration drop table words; -mysqlimport: Error: 1146, Table 'test.words' doesn't exist, when using table: words drop table t1; drop table t2; drop table words2; @@ -5287,6 +5286,35 @@ drop table t1, t2; # # End of 5.1 tests # +# +# Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS +# +CREATE DATABASE db_20772273; +USE db_20772273; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (3), (4); +SELECT * FROM t1; +a +1 +2 +SELECT * FROM t2; +a +3 +4 +SELECT * FROM t1; +a +1 +2 +SELECT * FROM t2; +a +3 +4 +DROP TABLE t1; +DROP TABLE t2; +DROP DATABASE db_20772273; +USE test; Usage: mysqldump [OPTIONS] database [tables] OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] OR mysqldump [OPTIONS] --all-databases [OPTIONS] diff --git a/mysql-test/r/partition_alter.result b/mysql-test/r/partition_alter.result new file mode 100644 index 00000000000..cbd90b5ba7c --- /dev/null +++ b/mysql-test/r/partition_alter.result @@ -0,0 +1,53 @@ +CREATE TABLE `test_data` ( +`hid` bigint(20) unsigned NOT NULL, +`itid` bigint(20) unsigned NOT NULL, +`clocktime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +`values` double(16,4) NOT NULL, +PRIMARY KEY (`hid`,`itid`,`clocktime`) +) ; +INSERT INTO `test_data` (`hid`, `itid`, `clocktime`, `values`) VALUES +(1, 1, '2015-03-10 06:25:16', 0.0000), +(1, 1, '2015-03-10 06:26:24', 0.0000), +(1, 1, '2015-03-10 06:27:32', 0.0000), +(1, 1, '2015-03-10 06:28:40', 0.0000), +(1, 1, '2015-03-10 06:29:49', 0.0000), +(1, 1, '2015-03-10 06:30:57', 0.0000), +(1, 1, '2015-03-10 06:32:05', 0.0000), +(1, 1, '2015-03-10 06:33:14', 0.0000), +(1, 1, '2015-03-10 06:34:22', 0.0000), +(1, 1, '2015-03-10 06:35:30', 0.0000), +(1, 1, '2015-03-10 06:36:39', 0.0000), +(1, 1, '2015-03-10 06:37:47', 0.0000), +(1, 1, '2015-03-10 06:38:55', 0.0000), +(1, 1, '2015-03-10 06:40:03', 0.0000), +(1, 1, '2015-03-10 06:41:09', 0.0000), +(1, 1, '2015-03-10 06:42:21', 0.0000), +(1, 1, '2015-03-10 06:43:29', 0.0000), +(1, 1, '2015-03-10 06:44:37', 0.0000), +(1, 1, '2015-03-10 06:45:46', 0.0000), +(1, 1, '2015-03-10 06:47:05', 0.0000), +(1, 1, '2015-03-10 06:48:21', 0.0000), +(1, 1, '2015-03-10 06:49:41', 0.0000), +(1, 1, '2015-03-10 06:50:58', 0.0000), +(1, 1, '2015-03-10 06:52:08', 0.0000), +(1, 1, '2015-03-10 06:53:17', 0.0000), +(1, 1, '2015-03-10 06:54:25', 0.0000), +(563, 1, '2015-03-17 14:28:28', 0.3125), +(563, 1, '2015-03-17 14:29:39', 0.2775), +(563, 1, '2015-03-17 14:30:49', 0.2675); +CREATE PROCEDURE `create_part_max`() +alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( +partition partMAX values less than MAXVALUE +); +call create_part_max(); +call create_part_max(); +drop procedure create_part_max; +prepare stmt from "alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( + partition partMAX values less than MAXVALUE + )"; +execute stmt; +execute stmt; +deallocate prepare stmt; +drop table test_data; diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 847af86913d..f05b145053d 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1099,7 +1099,7 @@ partition by key (a) subpartition by hash (sin(a+b)) (partition x1 (subpartition x11, subpartition x12), partition x2 (subpartition x21, subpartition x22)); -ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning +ERROR HY000: This partition function is not allowed select load_file('$MYSQLD_DATADIR/test/t1.par'); load_file('$MYSQLD_DATADIR/test/t1.par') NULL diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result index 2b557de8e05..ad6f3b7bf2e 100644 --- a/mysql-test/r/set_statement.result +++ b/mysql-test/r/set_statement.result @@ -1118,6 +1118,7 @@ set statement long_query_time=0.01 for select sleep(0.1) set global log_output= @save_log_output; set @@slow_query_log= @save_slow_query_log; set @@long_query_time= @save_long_query_time; +truncate table mysql.slow_log; set statement autocommit=default for select 1; ERROR 42000: The system variable autocommit cannot be set in SET STATEMENT. set statement tx_isolation=default for select 1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index c38107e5fc6..3f0e6955b67 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -81,7 +81,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3597,7 +3597,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7043,3 +7043,69 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result index b0ba19b315c..34c766ed9b3 100644 --- a/mysql-test/r/subselect_no_exists_to_in.result +++ b/mysql-test/r/subselect_no_exists_to_in.result @@ -85,7 +85,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3600,7 +3600,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7043,6 +7043,72 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set optimizer_switch=default; select @@optimizer_switch like '%exists_to_in=off%'; @@optimizer_switch like '%exists_to_in=off%' diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 3b999dbcbb6..de21a8dbd96 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -88,7 +88,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3600,7 +3600,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7036,6 +7036,72 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 5a48eaa863c..09d8328a639 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -84,7 +84,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3596,7 +3596,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7034,4 +7034,70 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index d5462f90708..a164ae98aa0 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -87,7 +87,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3603,7 +3603,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7049,6 +7049,72 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 288e8eee98e..d15a07fffa6 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -84,7 +84,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; ERROR 42S22: Unknown column 'a' in 'field list' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; @@ -3596,7 +3596,7 @@ delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; drop table t1, t2; CREATE TABLE t1 (a INT); CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); -ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); @@ -7034,5 +7034,71 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1)); exists(select 1 from t1 group by `c` in (select `c` from t1)) 0 drop table t1; +# +# MDEV-7565: Server crash with Signal 6 (part 2) +# +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +ControlRev +NULL +# +# MDEV-7445:Server crash with Signal 6 +# +CREATE PROCEDURE procedure2() +BEGIN +Select +(Select Sum(`TestCase`.Revenue) From mysql.slow_log E +Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) +) As `ControlRev` + From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; +END | +call procedure2(); +ControlRev +NULL +call procedure2(); +ControlRev +NULL +drop procedure procedure2; +SELECT +(SELECT user FROM mysql.user +WHERE h.host in (SELECT host FROM mysql.user) +) AS sq +FROM mysql.host h GROUP BY h.host; +sq +# +# MDEV-7846:Server crashes in Item_subselect::fix +#_fields or fails with Thread stack overrun +# +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1),(4); +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; +EXECUTE stmt; +sq +NULL +EXECUTE stmt; +sq +NULL +deallocate prepare stmt; +drop table t1,t2,t3,t4; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 9eaf1a46d89..db7c2380398 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -561,6 +561,21 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function DROP VIEW v1; DROP FUNCTION f1; DROP TABLE t1; +# Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT +# RESULTS +CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB; +INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string'); +UPDATE t1 SET b = a, a = 'inject'; +SELECT a, b FROM t1; +a b +inject start trail +UPDATE t1 SET b = c, c = 'inject'; +SELECT c, b FROM t1; +c b +inject even longer string +DROP TABLE t1; +# +# MDEV-3948 Assertion `records_are_comparable(table)' fails in compare_record(const TABLE*) on UPDATE with simple AND condition, index_merge+index_merge_intersection, InnoDB # # Verify that UPDATE does the same number of handler_update # operations, no matter if there is ORDER BY or not. diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index eaef3f96ee0..8a502a4a3ba 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4857,6 +4857,41 @@ View Create View character_set_client collation_connection v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci DROP VIEW v1, v2, v3, v4, v5; # +# BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION, +# IS REJECTED +# Without the patch, reports an error. +CREATE VIEW v1 (fld1, fld2) AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +# The column names are explicitly specified and not duplicates, hence +# succeeds. +CREATE VIEW v2 (fld1, fld2) AS +SELECT 1 AS a, 2 AS a +UNION ALL +SELECT 1 AS a, 1 AS a; +# The column name in the first SELECT are not duplicates, hence succeeds. +CREATE VIEW v3 AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +# Should report an error, since the explicitly specified column names are +# duplicates. +CREATE VIEW v4 (fld1, fld1) AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +ERROR 42S21: Duplicate column name 'fld1' +# Should report an error, since duplicate column name is specified in the +# First SELECT. +CREATE VIEW v4 AS +SELECT 1 AS a, 2 AS a +UNION ALL +SELECT 1 AS a, 1 AS a; +ERROR 42S21: Duplicate column name 'a' +# Cleanup +DROP VIEW v1, v2, v3; +# # lp:833600 Wrong result with view + outer join + uncorrelated subquery (non-semijoin) # CREATE TABLE t1 ( a int, b int ); diff --git a/mysql-test/std_data/bug16171518_1.dat b/mysql-test/std_data/bug16171518_1.dat new file mode 100644 index 00000000000..b65b9359ce1 --- /dev/null +++ b/mysql-test/std_data/bug16171518_1.dat @@ -0,0 +1,59 @@ +<test_rows> + <row> + <col1>0bc</col1> + <col2>def</col2> + <col3>ghi</col3> + <col4>jkl</col4> + </row> + <row> + <col1>1no</col1> + <col2/> + <col3>pqr</col3> + <col4>stu</col4> + </row> + + <row> + <col1>2BC</col1> + <col2>DEF</col2> + <col3>GHI</col3> + <col4>JKL</col4> + </row> + <row> + <col1>3NO</col1> + <col2 /> + <col3>PQR</col3> + <col4>STU</col4> + </row> + + <row col1="4bc" col2="def" col3="ghi" col4="jkl"/> + <row col1="5no" col2="pqr" col3="stu" col4="vwx" /> + + <row> + <field name='col1'>6BC</field> + <field name='col2'>DEF</field> + <field name='col3'></field> + <field name='col4'>JKL</field> + </row> + <row> + <field name='col1'>7NO</field> + <field name='col2'>PQR</field> + <field name='col3'>STU</field> + <field name='col4'>VWX</field> + </row> + + <row> + <col1>8bc</col1> + <col2>def</col2> + <col3>ghi</col3> + <col4 /> + </row> + <row> + <col1>9kl</col1> + <col2/> + <col3>mno</col3> + <col4>pqr</col4> + </row> + + <row col1="ABC" col2="DEF" col3="" col4="JKL"/> + <row col1="MNO" col2="" col3="STU" col4="VWX"/> +</test_rows> diff --git a/mysql-test/std_data/bug16171518_2.dat b/mysql-test/std_data/bug16171518_2.dat new file mode 100644 index 00000000000..8a483337a0f --- /dev/null +++ b/mysql-test/std_data/bug16171518_2.dat @@ -0,0 +1,12 @@ +<test_rows> + <row> + <col1>ABC</col1> + <col2>DEF</col2> + <col3 /> + </row> + <row> + <col1>GHI</col1> + <col2 /> + <col3>123</col3> + </row> +</test_rows> diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 5a8278e898c..a31825735fb 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -1521,7 +1521,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET -### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ +### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; @@ -1538,7 +1538,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET -### @1=-000000543.210000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ +### @1=-543.21000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; @@ -1555,7 +1555,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F ### DELETE FROM `test`.`t1` ### WHERE -### @1=000000124.450000000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ +### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */ # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index 76be60fba18..cf90289c7ca 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -2400,9 +2400,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2493,9 +2493,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2669,9 +2669,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2762,9 +2762,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2842,9 +2842,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2935,9 +2935,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3015,9 +3015,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3188,9 +3188,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3281,9 +3281,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3454,9 +3454,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3547,9 +3547,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3640,9 +3640,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index 72184c4a4f5..4d7cc8e9751 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -2400,9 +2400,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2496,9 +2496,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2674,9 +2674,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2769,9 +2769,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2849,9 +2849,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -2944,9 +2944,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3024,9 +3024,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3199,9 +3199,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3294,9 +3294,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3469,9 +3469,9 @@ BEGIN ### @22=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='9999:12:31' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='9999-12-31 23:59:59' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=2146522447 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3564,9 +3564,9 @@ BEGIN ### @22=-1.797... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=0 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000000 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=0 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='1000:01:01' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='1000-01-01 00:00:00' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=75601 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ @@ -3659,9 +3659,9 @@ BEGIN ### @22=-2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @23=2.225... /* DOUBLE meta=8 nullable=1 is_null=0 */ ### @24=1 /* DOUBLE meta=8 nullable=1 is_null=0 */ -### @25=-000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @26=000000009.999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ -### @27=000000001 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @25=-9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @26=9999999999 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ +### @27=1 /* DECIMAL(10,0) meta=2560 nullable=1 is_null=0 */ ### @28='2008:08:04' /* DATE meta=0 nullable=1 is_null=0 */ ### @29='2008-08-04 16:18:06' /* DATETIME(0) meta=0 nullable=1 is_null=0 */ ### @30=1217855904 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */ diff --git a/mysql-test/suite/innodb/r/innodb_bug68148.result b/mysql-test/suite/innodb/r/innodb_bug68148.result new file mode 100644 index 00000000000..88247053389 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug68148.result @@ -0,0 +1,36 @@ +set global innodb_file_per_table=1; +CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE `main` ( +`id` int(11) NOT NULL AUTO_INCREMENT, +`ref_id1` int(11) NOT NULL, +`ref_id2` int(11) NOT NULL, +PRIMARY KEY (`id`), +UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`), +KEY `FK_set_out_analysis_route_id` (`ref_id2`), +CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) , +CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`) +) ENGINE=InnoDB; +SET FOREIGN_KEY_CHECKS=0; +DROP INDEX `idx_1` ON `main`; +SHOW TABLES; +Tables_in_test +main +ref_table1 +ref_table2 +# restart and see if we can still access the main table +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`); +SHOW CREATE TABLE `main`; +Table Create Table +main CREATE TABLE `main` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ref_id1` int(11) NOT NULL, + `ref_id2` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `FK_set_out_analysis_route_id` (`ref_id2`), + KEY `idx_1` (`ref_id1`), + CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`), + CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE main, ref_table1, ref_table2; diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result index 1cb2cf77050..c2a8ba1f4db 100644 --- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result +++ b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result @@ -5,4 +5,4 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(m SET GLOBAL innodb_simulate_comp_failures = 25; SELECT COUNT(*) FROM t1; COUNT(*) -10000 +1500 diff --git a/mysql-test/suite/innodb/t/innodb_bug60229-master.opt b/mysql-test/suite/innodb/t/innodb_bug60229-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug60229-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/innodb/t/innodb_bug60229.test b/mysql-test/suite/innodb/t/innodb_bug60229.test index 8dcf15157d6..aee0b96a942 100644 --- a/mysql-test/suite/innodb/t/innodb_bug60229.test +++ b/mysql-test/suite/innodb/t/innodb_bug60229.test @@ -2,6 +2,10 @@ # Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE # WITH FOREIGN KEY CONSTRAINT. +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc -- source include/have_innodb.inc CREATE TABLE PERSON ( diff --git a/mysql-test/suite/innodb/t/innodb_bug68148.test b/mysql-test/suite/innodb/t/innodb_bug68148.test new file mode 100644 index 00000000000..531baa30e48 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug68148.test @@ -0,0 +1,41 @@ +-- source include/have_innodb.inc +-- source include/not_embedded.inc + +# +# Bug #68148: drop index on a foreign key column leads to missing table +# MDEV-8845: Table disappear after modifying FK +# + +set global innodb_file_per_table=1; + +CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; + +CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; + +CREATE TABLE `main` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ref_id1` int(11) NOT NULL, + `ref_id2` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_1` (`ref_id1`,`ref_id2`), + KEY `FK_set_out_analysis_route_id` (`ref_id2`), + CONSTRAINT `FK_1` FOREIGN KEY (`ref_id1`) REFERENCES `ref_table1` (`id`) , + CONSTRAINT `FK_2` FOREIGN KEY (`ref_id2`) REFERENCES `ref_table2` (`id`) +) ENGINE=InnoDB; + +SET FOREIGN_KEY_CHECKS=0; + +DROP INDEX `idx_1` ON `main`; +SHOW TABLES; + +--echo # restart and see if we can still access the main table +--source include/restart_mysqld.inc + +# This is required to access the table +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE `main` ADD INDEX `idx_1` (`ref_id1`); +SHOW CREATE TABLE `main`; + +DROP TABLE main, ref_table1, ref_table2; + + diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test index ae9e0a9b984..cf22935fad6 100644 --- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test +++ b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test @@ -1,8 +1,8 @@ --source include/big_test.inc # test takes too long with valgrind --source include/not_valgrind.inc ---let $num_inserts = 10000 ---let $num_ops = 10000 +--let $num_inserts = 1500 +--let $num_ops = 3500 --source suite/innodb/include/innodb_simulate_comp_failures.inc # clean exit --exit diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test index 837b33cb3c4..2c1034f3c4d 100644 --- a/mysql-test/suite/innodb/t/xa_recovery.test +++ b/mysql-test/suite/innodb/t/xa_recovery.test @@ -6,6 +6,12 @@ if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins wher # Embedded server does not support restarting. --source include/not_embedded.inc +# MDEV-8841 - close tables opened by previous tests, +# so they don't get marked crashed when the server gets crashed +--disable_query_log +FLUSH TABLES; +--enable_query_log + CREATE TABLE t1 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); connect (con1,localhost,root); diff --git a/mysql-test/suite/jp/t/jp_enum_sjis-master.opt b/mysql-test/suite/jp/t/jp_enum_sjis-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_sjis-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_sjis.test b/mysql-test/suite/jp/t/jp_enum_sjis.test index e1f22f6fe27..1060f83ec06 100644 --- a/mysql-test/suite/jp/t/jp_enum_sjis.test +++ b/mysql-test/suite/jp/t/jp_enum_sjis.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_sjis.inc --source include/have_innodb.inc --character_set sjis diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt b/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_ucs2-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2.test b/mysql-test/suite/jp/t/jp_enum_ucs2.test index a3d7c47705d..321f8952148 100644 --- a/mysql-test/suite/jp/t/jp_enum_ucs2.test +++ b/mysql-test/suite/jp/t/jp_enum_ucs2.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_ucs2.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/jp/t/jp_enum_ujis-master.opt b/mysql-test/suite/jp/t/jp_enum_ujis-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_ujis-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_ujis.test b/mysql-test/suite/jp/t/jp_enum_ujis.test index 17e41e0691e..10e8ad55a3c 100644 --- a/mysql-test/suite/jp/t/jp_enum_ujis.test +++ b/mysql-test/suite/jp/t/jp_enum_ujis.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_ujis.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/jp/t/jp_enum_utf8-master.opt b/mysql-test/suite/jp/t/jp_enum_utf8-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/suite/jp/t/jp_enum_utf8-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/suite/jp/t/jp_enum_utf8.test b/mysql-test/suite/jp/t/jp_enum_utf8.test index ff5978da69c..f67939bd02b 100644 --- a/mysql-test/suite/jp/t/jp_enum_utf8.test +++ b/mysql-test/suite/jp/t/jp_enum_utf8.test @@ -1,3 +1,7 @@ +#Server variable option 'lower_case_table_names' sets '0' as default value +#in case sensitive filesystem. Using 'lower_case_table_names=0' in case of +#insensitive filsystem is not allowed. +-- source include/have_case_sensitive_file_system.inc --source include/have_utf8.inc --source include/have_innodb.inc --disable_warnings diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result index a50c4ffa297..433d793909f 100644 --- a/mysql-test/suite/perfschema/r/misc.result +++ b/mysql-test/suite/perfschema/r/misc.result @@ -92,3 +92,18 @@ object_schema object_name index_name count_fetch count_insert count_update count test t_60905 i 2 0 0 1 test t_60905 NULL 5 5 0 1 DROP TABLE t_60905; +use test; +truncate performance_schema.events_statements_history; +truncate performance_schema.events_statements_history_long; +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist + +select mysql_errno, returned_sqlstate, message_text, errors, warnings +from performance_schema.events_statements_history where errors > 0; +mysql_errno returned_sqlstate message_text errors warnings +1146 42S02 Table 'test.t1' doesn't exist 1 0 + +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 diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result index 8786cd055ca..837c2573a72 100644 --- a/mysql-test/suite/perfschema/r/query_cache.result +++ b/mysql-test/suite/perfschema/r/query_cache.result @@ -38,7 +38,7 @@ spins NULL select * from performance_schema.setup_timers where name='wait'; NAME TIMER_NAME -wait CYCLE +wait {CYCLE_OR_NANOSECOND} show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 @@ -53,7 +53,7 @@ spins NULL select * from performance_schema.setup_timers where name='wait'; NAME TIMER_NAME -wait CYCLE +wait {CYCLE_OR_NANOSECOND} show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test index af19e8db51d..00b175ec391 100644 --- a/mysql-test/suite/perfschema/t/misc.test +++ b/mysql-test/suite/perfschema/t/misc.test @@ -169,3 +169,23 @@ SELECT object_schema, DROP TABLE t_60905; + +# +# Bug#11929832 - EVENTS_STATEMENTS_HISTORY HAS ERRORS=0 WHEN THERE ARE ERRORS +# +# Verify that SQL errors are properly counted. + +use test; +truncate performance_schema.events_statements_history; +truncate performance_schema.events_statements_history_long; + +--error ER_NO_SUCH_TABLE +select * from t1; + +--echo +select mysql_errno, returned_sqlstate, message_text, errors, warnings + from performance_schema.events_statements_history where errors > 0; + +--echo +select mysql_errno, returned_sqlstate, message_text, errors, warnings from + performance_schema.events_statements_history_long where errors > 0; diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test index 60d4a648222..802e574f89b 100644 --- a/mysql-test/suite/perfschema/t/query_cache.test +++ b/mysql-test/suite/perfschema/t/query_cache.test @@ -34,6 +34,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; +--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND} select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; @@ -42,6 +43,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; +--replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND} select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result index 278a0dbd49e..9fd488052e4 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_load.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result @@ -1,10 +1,13 @@ select plugin_status from information_schema.plugins where plugin_name='feedback'; plugin_status ACTIVE +SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +variable_value = @feedback_used + 1 +1 select * from information_schema.feedback where variable_name like 'feed%' - and variable_name not like '%_uid'; + and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'; VARIABLE_NAME VARIABLE_VALUE -FEEDBACK used 1 FEEDBACK version 1.1 FEEDBACK_HTTP_PROXY FEEDBACK_SEND_RETRY_WAIT 60 diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result index 57c12606149..df55c3fdedb 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_send.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result @@ -1,10 +1,13 @@ select plugin_status from information_schema.plugins where plugin_name='feedback'; plugin_status ACTIVE +SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +variable_value = @feedback_used + 1 +1 select * from information_schema.feedback where variable_name like 'feed%' - and variable_name not like '%_uid'; + and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'; VARIABLE_NAME VARIABLE_VALUE -FEEDBACK used 3 FEEDBACK version 1.1 FEEDBACK_HTTP_PROXY FEEDBACK_SEND_RETRY_WAIT 60 diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test index b1bcb2a6bbd..f2f8c1f97a7 100644 --- a/mysql-test/suite/plugins/t/feedback_plugin_load.test +++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test @@ -4,11 +4,27 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe } select plugin_status from information_schema.plugins where plugin_name='feedback'; + +# Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'. +# We cannot record the actual value, because the test can be executed more than once, +# but we can check that the value indeed increases as expected. +# There is still a room for some race condition, e.g. if at the very moment +# between first SELECT to store the value and the next SELECT to check that it increases, +# the feedback plugin is activated. But the probability of it is close to 0, +# so lets get back to it if it ever happens. + +# Lets say the plugin was used X times before this SELECT +SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; + +# Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT +SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; + +# Now when we are happy with 'FEEDBACK used', we can check everything else + --replace_result https http --sorted_result select * from information_schema.feedback where variable_name like 'feed%' - and variable_name not like '%_uid'; - + and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'; # Embedded server does not use the table mysqld.user and thus # does not automatically use latin1_bin on startup. Use it manually. diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test index 45b507f8e78..31542c33482 100644 --- a/mysql-test/suite/plugins/t/feedback_plugin_send.test +++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test @@ -14,6 +14,15 @@ if (!$MTR_FEEDBACK_PLUGIN) { # is doing some work in other workers. # sleep 310; + +# The test expects that the plugin will send a report at least 2 times, +# now (5 min after loading) and on server shutdown which happens below. +# Since we have already waited for 5 min, let's be generous +# and make sure the server has enough time to shut down properly. +# We won't lose anything if the shutdown is fast, but if it's slow, the plugin +# will still be able to finish the job and write about it in the error log. + +--let $shutdown_timeout= 60 source include/restart_mysqld.inc; replace_result https http; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result index cf488e889b4..be420cb021b 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result @@ -18,6 +18,7 @@ RESET MASTER; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; include/start_slave.inc INSERT INTO t1 VALUES (4); +include/save_master_gtid.inc SET sql_log_bin= 0; CALL mtr.add_suppression("The binlog on the master is missing the GTID"); SET sql_log_bin= 1; @@ -25,6 +26,7 @@ include/wait_for_slave_io_error.inc [errno=1236] STOP SLAVE SQL_THREAD; SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS'; include/start_slave.inc +include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index 1cf70ba7e67..33284ce58c6 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -47,7 +47,7 @@ include/start_slave.inc include/stop_slave.inc reset slave all; start slave; -ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO +ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_to_stmt.result b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result new file mode 100644 index 00000000000..2dfa82b0305 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result @@ -0,0 +1,28 @@ +include/master-slave.inc +[connection master] +use test; +create table t1 (a int primary key); +insert into t1 values (1),(2),(3),(4),(5); +update t1 set a=a*10; +use test; +select * from t1; +a +10 +20 +30 +40 +50 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; create table t1 (a int primary key) +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Gtid # # BEGIN GTID #-#-# +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result b/mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result deleted file mode 100644 index 96197393de9..00000000000 --- a/mysql-test/suite/rpl/r/rpl_row_triggers_sbr.result +++ /dev/null @@ -1,14 +0,0 @@ -include/master-slave.inc -[connection master] -set binlog_format = row; -create table t1 (i int); -create table t2 (i int); -SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr; -set global slave_run_triggers_for_rbr=YES; -create trigger tr_before before insert on t1 for each row -insert into t2 values (1); -insert into t1 values (1); -include/wait_for_slave_sql_error_and_skip.inc [errno=1666] -drop tables t1,t2; -SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr; -include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index e5870cec2c9..7eb29085099 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -47,7 +47,7 @@ include/start_slave.inc include/stop_slave.inc reset slave all; start slave; -ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO +ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test index 304816a65d1..7f4d851f95c 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test @@ -34,7 +34,7 @@ eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos'; --connection server_1 INSERT INTO t1 VALUES (4); ---save_master_pos +--source include/save_master_gtid.inc --connection server_2 SET sql_log_bin= 0; @@ -48,7 +48,7 @@ STOP SLAVE SQL_THREAD; eval SET GLOBAL gtid_slave_pos= '$old_gtid_pos'; --source include/start_slave.inc ---sync_with_master +--source include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; --source include/stop_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt new file mode 100644 index 00000000000..e6685732d90 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.opt @@ -0,0 +1 @@ +--innodb-flush-log-at-trx-commit=2 diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt b/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt new file mode 100644 index 00000000000..83ed8522e72 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt-master.opt @@ -0,0 +1 @@ +--binlog-format=row diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt b/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt new file mode 100644 index 00000000000..af3a211967b --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt-slave.opt @@ -0,0 +1 @@ +--binlog-format=statement diff --git a/mysql-test/suite/rpl/t/rpl_row_to_stmt.test b/mysql-test/suite/rpl/t/rpl_row_to_stmt.test new file mode 100644 index 00000000000..5ca583d881f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_to_stmt.test @@ -0,0 +1,23 @@ +# +# check that master starterd with log-format=ROW replication can replicate to +# slave started with log-format=STATEMENT +# + +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +use test; + +create table t1 (a int primary key); +insert into t1 values (1),(2),(3),(4),(5); +update t1 set a=a*10; + +sync_slave_with_master; +use test; +select * from t1; +source include/show_binlog_events.inc; + +connection master; +drop table t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test b/mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test deleted file mode 100644 index a801363b931..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_triggers_sbr.test +++ /dev/null @@ -1,43 +0,0 @@ ---source include/have_binlog_format_statement.inc ---source include/have_rbr_triggers.inc ---source include/master-slave.inc - ---disable_query_log -CALL mtr.add_suppression("Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -set binlog_format = row; - -create table t1 (i int); -create table t2 (i int); - ---sync_slave_with_master ---disable_query_log -CALL mtr.add_suppression("impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr; -set global slave_run_triggers_for_rbr=YES; - -create trigger tr_before before insert on t1 for each row - insert into t2 values (1); - ---connection master - -insert into t1 values (1); - ---connection slave - ---let $slave_sql_errno= 1666 ---source include/wait_for_slave_sql_error_and_skip.inc - ---connection master - -drop tables t1,t2; - ---sync_slave_with_master -SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr; - ---connection master - ---source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff index a775ef28ef3..91ebe8bd820 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff @@ -1221,8 +1221,8 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.26 -+GLOBAL_VALUE 5.6.25-73.1 +-GLOBAL_VALUE 5.6.27 ++GLOBAL_VALUE 5.6.26-74.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL 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 2d3a7c07467..74590d94d29 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -661,8 +661,8 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.26 -+GLOBAL_VALUE 5.6.25-73.1 +-GLOBAL_VALUE 5.6.27 ++GLOBAL_VALUE 5.6.26-74.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 1d7d52239ba..f59c821ae48 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -2331,7 +2331,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.26 +GLOBAL_VALUE 5.6.27 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test index e36fd518b61..d9ff0fb7245 100644 --- a/mysql-test/t/explain_non_select.test +++ b/mysql-test/t/explain_non_select.test @@ -208,3 +208,45 @@ INSERT INTO t1 VALUES (1),(2); EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1; DROP TABLE t1; DROP VIEW v1; + +--echo # +--echo # MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT +--echo # +CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM; +INSERT INTO t1 (i) VALUES (100),(200); + +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (10),(20); + +EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2; +INSERT INTO t1 (i) VALUES (300); +CHECK TABLE t1; + +DROP TABLE t1, t2; + +--echo # +--echo # MDEV-8321: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status on EXPLAIN INSERT ... UNION +--echo # + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); + +# Data is not necessary, tables can be empty as well +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (3),(4); +INSERT INTO t3 VALUES (5),(6); + +EXPLAIN INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM t3; +drop table t1,t2,t3; + +--echo # +--echo # MDEV-6223: Assertion `! is_set()' fails in Diagnostics_area::set_eof_status on EXPLAIN INSERT executed as a PS +--echo # +CREATE TABLE t1 (a INT) ENGINE = MyISAM; +CREATE TABLE t2 (b INT) ENGINE = MyISAM; +INSERT INTO t2 VALUES (1),(2); +PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2'; +EXECUTE stmt; +drop table t1,t2; + diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 2b89a618aa6..dc6749da26f 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -206,6 +206,20 @@ SELECT if(1, NULL, (SELECT min('hello'))); --echo End of 5.2 tests +--echo # +--echo # MDEV-8663: IF Statement returns multiple values erroneously +--echo # (or Assertion `!null_value' failed in Item::send(Protocol*, String*) +--echo # +CREATE TABLE `t1` ( +`datas` VARCHAR(25) NOT NULL +) DEFAULT CHARSET=utf8; + +INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4'); + +SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`; + +drop table t1; + --disable_query_log # Restore timezone to default set time_zone= @@global.time_zone; diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 364266d7f6f..47afb6664a5 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -398,6 +398,209 @@ SELECT GET_LOCK('ul1', NULL); SELECT GET_LOCK('ul1', -1); --echo # +--echo # MDEV-8624 MariaDB hangs on query with many logical condition +--echo # +CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `submitdate` datetime DEFAULT NULL, + `lastpage` int(11) DEFAULT NULL, + `startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, + `datestamp` datetime NOT NULL, + `startdate` datetime NOT NULL, + `ipaddr` text COLLATE utf8_unicode_ci, + `refurl` text COLLATE utf8_unicode_ci, + `57813X540X1723` text COLLATE utf8_unicode_ci, + `57813X540X1724` text COLLATE utf8_unicode_ci, + `57813X540X1725` text COLLATE utf8_unicode_ci, + `57813X540X1726` double DEFAULT NULL, + `57813X540X1909` double DEFAULT NULL, + `57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X541X17281` text COLLATE utf8_unicode_ci, + `57813X541X17282` text COLLATE utf8_unicode_ci, + `57813X541X17283` text COLLATE utf8_unicode_ci, + `57813X541X17284` text COLLATE utf8_unicode_ci, + `57813X541X17285` text COLLATE utf8_unicode_ci, + `57813X541X17286` text COLLATE utf8_unicode_ci, + `57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X542X18141` text COLLATE utf8_unicode_ci, + `57813X542X18142` text COLLATE utf8_unicode_ci, + `57813X542X18143` text COLLATE utf8_unicode_ci, + `57813X542X18144` text COLLATE utf8_unicode_ci, + `57813X542X18145` text COLLATE utf8_unicode_ci, + `57813X542X18146` text COLLATE utf8_unicode_ci, + `57813X542X18147` text COLLATE utf8_unicode_ci, + `57813X542X18148` text COLLATE utf8_unicode_ci, + `57813X542X18149` text COLLATE utf8_unicode_ci, + `57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X543X18461` text COLLATE utf8_unicode_ci, + `57813X543X18462` text COLLATE utf8_unicode_ci, + `57813X543X18463` text COLLATE utf8_unicode_ci, + `57813X543X18464` text COLLATE utf8_unicode_ci, + `57813X543X18465` text COLLATE utf8_unicode_ci, + `57813X543X18466` text COLLATE utf8_unicode_ci, + `57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X544X18721` text COLLATE utf8_unicode_ci, + `57813X544X18722` text COLLATE utf8_unicode_ci, + `57813X544X18723` text COLLATE utf8_unicode_ci, + `57813X544X18724` text COLLATE utf8_unicode_ci, + `57813X544X18725` text COLLATE utf8_unicode_ci, + `57813X544X18726` text COLLATE utf8_unicode_ci, + `57813X544X18727` text COLLATE utf8_unicode_ci, + `57813X544X18728` text COLLATE utf8_unicode_ci, + `57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, + `57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `lime_survey_57813_idx` (`token`), + KEY `57813X540X1723` (`57813X540X1723`(100)), + KEY `57813X540X1724` (`57813X540X1724`(100)), + KEY `57813X540X1726` (`57813X540X1726`), + KEY `57813X540X1725` (`57813X540X1725`(100)), + KEY `57813X546X1902` (`57813X546X1902`), + KEY `57813X546X1903` (`57813X546X1903`), + KEY `57813X546X1904` (`57813X546X1904`) +); + +SELECT +COUNT(*) as `N`, +ROUND( + ( + SUM( + ( + ( + IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + + IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) + + IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) + + IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) + + IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) + + IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) + + IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) + + IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) + + IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) + + IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) + + IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) + + IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) + + IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) + + IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) + + IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) + + IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) + + IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) + + IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) + + IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) + + IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) + + IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) + + IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) + + IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) + + IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) + + IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) + + IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) + + IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) + + IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) + + IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 ) + ) + / + ( + IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) + + IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) + + IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) + + IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) + + IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) + + IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) + + IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) + + IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) + + IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) + + IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) + + IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) + + IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) + + IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) + + IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) + + IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) + + IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) + + IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) + + IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) + + IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) + + IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) + + IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) + + IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) + + IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) + + IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) + + IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) + + IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) + + IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) + + IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) + + IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 ) + ) + ) + ) + / COUNT(*) ), 4) as `AVG` +FROM `t1` +WHERE `submitdate` IS NOT NULL +AND ( + ( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR + ( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR + ( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR + ( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR + ( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR + ( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR + ( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR + ( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR + ( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR + ( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR + ( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR + ( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR + ( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR + ( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR + ( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR + ( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR + ( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR + ( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR + ( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR + ( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR + ( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR + ( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR + ( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR + ( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR + ( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR + ( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR + ( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR + ( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR + ( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) ) +AND 57813X540X1723 = 'Test'; + +drop table t1; + +--echo # +--echo # End of 5.5 tests +--echo # + +--echo # --echo # GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test --echo # @@ -574,10 +777,6 @@ select is_free_lock(repeat('a', 193)); --error ER_TOO_LONG_IDENT select release_lock(repeat('a', 193)); ---echo # ---echo # End of 5.5 tests ---echo # - --echo --echo # -- diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test index d577cdc1e4d..9810c5a0aae 100644 --- a/mysql-test/t/information_schema2.test +++ b/mysql-test/t/information_schema2.test @@ -8,15 +8,12 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); # -# information_schema tables inside subqueries, they should not be re-populated -# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s -# table. if it's re-populated, it'll do that multiple times) +# MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows # -create table t1 (a char); -insert t1 values ('a'),('t'),('z'); -flush status; -select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; -# fix the result in ps-protocol ---replace_result 44 43 -show status like 'created_tmp_tables'; -drop table t1; +create table t1 (x int); +create table t2 (x int); +create table t3 (x int); +create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ; +delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE'); +select * from t4; +drop table t1, t2, t3, t4; diff --git a/mysql-test/t/loadxml.test b/mysql-test/t/loadxml.test index 6faf712b6ce..93e6e82189f 100644 --- a/mysql-test/t/loadxml.test +++ b/mysql-test/t/loadxml.test @@ -116,3 +116,17 @@ LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1 ROWS IDENTIFIED BY '<row>' (a,@b) SET b=concat('!',@b); SELECT * FROM t1 ORDER BY a; DROP TABLE t1; + + +--echo # +--echo # Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS +--echo # +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4)); +LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3, col4; +DROP TABLE t1; + +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER); +LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3; +DROP TABLE t1; diff --git a/mysql-test/t/lowercase_fs_on.test b/mysql-test/t/lowercase_fs_on.test new file mode 100644 index 00000000000..6da3ef32a0b --- /dev/null +++ b/mysql-test/t/lowercase_fs_on.test @@ -0,0 +1,38 @@ +# +# Specific tests for case-insensitive file systems +# i.e. lower_case_filesystem=ON +# +-- source include/have_case_insensitive_file_system.inc +# Embedded server does not support restarting. +--source include/not_embedded.inc + +--echo # +--echo # Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS +--echo # + +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err; + +--error 0,1 +--remove_file $SEARCH_FILE + +#Shutdown the server +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +#Start the server with --lower_case_table_names=0 in Windows. +--enable_reconnect +--error 1 +--exec $MYSQLD_CMD --lower_case_table_names=0 > $SEARCH_FILE 2>&1 + +#Search for the error messege in the server error log. +let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination\. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode\.; +--source include/search_pattern_in_file.inc + +#Restart the server +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/wait_until_connected_again.inc + +#Cleanup +--error 0,1 +--remove_file $SEARCH_FILE diff --git a/mysql-test/t/lowercase_table3-master.opt b/mysql-test/t/lowercase_table3-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/t/lowercase_table3-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test deleted file mode 100644 index f7ca8211288..00000000000 --- a/mysql-test/t/lowercase_table3.test +++ /dev/null @@ -1,37 +0,0 @@ -# -# Test of force of lower-case-table-names=0 -# (User has case insensitive file system and wants to preserve case of -# table names) -# - ---source include/have_innodb.inc ---source include/have_lowercase0.inc ---source include/have_case_insensitive_file_system.inc ---source include/not_windows.inc - -call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); - ---disable_warnings -DROP TABLE IF EXISTS t1,T1; ---enable_warnings - -# -# This is actually an error, but ok as the user has forced this -# by using --lower-case-table-names=0 -CREATE TABLE t1 (a INT); -SELECT * FROM T1; -FLUSH TABLES; -DROP TABLE t1; - -# -# InnoDB should in this case be case sensitive -# Note that this is not true on windows as no this OS, InnoDB is always -# storing things in lower case. -# - -CREATE TABLE bug29839 (a INT) ENGINE=INNODB; ---error ER_NO_SUCH_TABLE -SELECT * FROM BUG29839; -DROP TABLE bug29839; - -# End of 4.1 tests diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 11652b3bedf..2b9d1e78219 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -905,13 +905,8 @@ select * from t1; create view v1 as select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); -# Disable warnings since LIMIT warning for unsafe statement if -# binlog_format = STATEMENT. Note: after BUG#45832, the warning should -# not be issued. ---disable_warnings create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; ---enable_warnings --exec $MYSQL_DUMP --skip-comments test @@ -1781,7 +1776,7 @@ drop table words; --replace_regex /.*mysqlimport(\.exe)*/mysqlimport/ --replace_result mysqldump.exe mysqldump --error 1 ---exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat 2>&1 +--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat drop table t1; drop table t2; @@ -2460,6 +2455,36 @@ drop table t1, t2; --echo # End of 5.1 tests --echo # +--echo # +--echo # Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS +--echo # + +CREATE DATABASE db_20772273; +USE db_20772273; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (3), (4); + +SELECT * FROM t1; +SELECT * FROM t2; + +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273 +--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql +--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql + +# Test mysqlimport with multiple threads +--exec $MYSQL_IMPORT --silent --use-threads=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt + +SELECT * FROM t1; +SELECT * FROM t2; + +#Cleanup +DROP TABLE t1; +DROP TABLE t2; +DROP DATABASE db_20772273; +USE test; + # # MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server # diff --git a/mysql-test/t/partition_alter.test b/mysql-test/t/partition_alter.test new file mode 100644 index 00000000000..592d8fdaeaa --- /dev/null +++ b/mysql-test/t/partition_alter.test @@ -0,0 +1,66 @@ +--source include/have_partition.inc + +CREATE TABLE `test_data` ( + `hid` bigint(20) unsigned NOT NULL, + `itid` bigint(20) unsigned NOT NULL, + `clocktime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `values` double(16,4) NOT NULL, + PRIMARY KEY (`hid`,`itid`,`clocktime`) + ) ; + +INSERT INTO `test_data` (`hid`, `itid`, `clocktime`, `values`) VALUES + (1, 1, '2015-03-10 06:25:16', 0.0000), + (1, 1, '2015-03-10 06:26:24', 0.0000), + (1, 1, '2015-03-10 06:27:32', 0.0000), + (1, 1, '2015-03-10 06:28:40', 0.0000), + (1, 1, '2015-03-10 06:29:49', 0.0000), + (1, 1, '2015-03-10 06:30:57', 0.0000), + (1, 1, '2015-03-10 06:32:05', 0.0000), + (1, 1, '2015-03-10 06:33:14', 0.0000), + (1, 1, '2015-03-10 06:34:22', 0.0000), + (1, 1, '2015-03-10 06:35:30', 0.0000), + (1, 1, '2015-03-10 06:36:39', 0.0000), + (1, 1, '2015-03-10 06:37:47', 0.0000), + (1, 1, '2015-03-10 06:38:55', 0.0000), + (1, 1, '2015-03-10 06:40:03', 0.0000), + (1, 1, '2015-03-10 06:41:09', 0.0000), + (1, 1, '2015-03-10 06:42:21', 0.0000), + (1, 1, '2015-03-10 06:43:29', 0.0000), + (1, 1, '2015-03-10 06:44:37', 0.0000), + (1, 1, '2015-03-10 06:45:46', 0.0000), + (1, 1, '2015-03-10 06:47:05', 0.0000), + (1, 1, '2015-03-10 06:48:21', 0.0000), + (1, 1, '2015-03-10 06:49:41', 0.0000), + (1, 1, '2015-03-10 06:50:58', 0.0000), + (1, 1, '2015-03-10 06:52:08', 0.0000), + (1, 1, '2015-03-10 06:53:17', 0.0000), + (1, 1, '2015-03-10 06:54:25', 0.0000), + (563, 1, '2015-03-17 14:28:28', 0.3125), + (563, 1, '2015-03-17 14:29:39', 0.2775), + (563, 1, '2015-03-17 14:30:49', 0.2675); + + +CREATE PROCEDURE `create_part_max`() + alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( + partition partMAX values less than MAXVALUE + ); + +call create_part_max(); + +call create_part_max(); + +drop procedure create_part_max; + +prepare stmt from "alter table `test_data` + partition by range(unix_timestamp(clocktime)) ( + partition partMAX values less than MAXVALUE + )"; + +execute stmt; +execute stmt; + +deallocate prepare stmt; + +drop table test_data; + diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 5396b9e3543..858213b1e30 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -1157,7 +1157,7 @@ subpartition by hash (rand(a+b)); # # Subpartition by hash, wrong subpartition function # ---error ER_SUBPARTITION_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test index 13c6d08818b..5d6206335fb 100644 --- a/mysql-test/t/set_statement.test +++ b/mysql-test/t/set_statement.test @@ -1040,6 +1040,7 @@ select sql_text from mysql.slow_log; set global log_output= @save_log_output; set @@slow_query_log= @save_slow_query_log; set @@long_query_time= @save_long_query_time; +truncate table mysql.slow_log; # diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 8fb9658260b..0a542ac9888 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -53,7 +53,7 @@ SELECT 1 IN (SELECT 1); SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); -- error ER_WRONG_USAGE select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); --- error ER_WRONG_PARAMETERS_TO_PROCEDURE +-- error ER_PARSE_ERROR SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -- error ER_BAD_FIELD_ERROR SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; @@ -5892,3 +5892,77 @@ DROP TABLE t1,t2; create table t1 (c int); select exists(select 1 from t1 group by `c` in (select `c` from t1)); drop table t1; + +--echo # +--echo # MDEV-7565: Server crash with Signal 6 (part 2) +--echo # +Select + (Select Sum(`TestCase`.Revenue) From mysql.slow_log E + Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) + ) As `ControlRev` +From +(Select 3 as Revenue, 4 as TemplateID) As `TestCase` +Group By TestCase.Revenue, TestCase.TemplateID; + +--echo # +--echo # MDEV-7445:Server crash with Signal 6 +--echo # + +--delimiter | +CREATE PROCEDURE procedure2() +BEGIN + Select + (Select Sum(`TestCase`.Revenue) From mysql.slow_log E + Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2) + ) As `ControlRev` + From + (Select 3 as Revenue, 4 as TemplateID) As `TestCase` + Group By TestCase.Revenue, TestCase.TemplateID; + +END | +--delimiter ; +call procedure2(); +call procedure2(); + +drop procedure procedure2; + + +SELECT + (SELECT user FROM mysql.user + WHERE h.host in (SELECT host FROM mysql.user) + ) AS sq +FROM mysql.host h GROUP BY h.host; + + +--echo # +--echo # MDEV-7846:Server crashes in Item_subselect::fix +--echo #_fields or fails with Thread stack overrun +--echo # +CREATE TABLE t1 (column1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3),(9); + +CREATE TABLE t2 (column2 INT) ENGINE=MyISAM; + +INSERT INTO t2 VALUES (1),(4); + +CREATE TABLE t3 (column3 INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (6),(8); + +CREATE TABLE t4 (column4 INT) ENGINE=MyISAM; +INSERT INTO t4 VALUES (2),(5); + + +PREPARE stmt FROM " +SELECT ( + SELECT MAX( table1.column1 ) AS field1 + FROM t1 AS table1 + WHERE table3.column3 IN ( SELECT table2.column2 AS field2 FROM t2 AS table2 ) +) AS sq +FROM t3 AS table3, t4 AS table4 GROUP BY sq +"; + +EXECUTE stmt; +EXECUTE stmt; + +deallocate prepare stmt; +drop table t1,t2,t3,t4; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 09d32966c50..05f9ce39bec 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -506,6 +506,21 @@ DROP VIEW v1; DROP FUNCTION f1; DROP TABLE t1; +--echo # Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT +--echo # RESULTS + +CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB; + +INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string'); +UPDATE t1 SET b = a, a = 'inject'; +SELECT a, b FROM t1; +UPDATE t1 SET b = c, c = 'inject'; +SELECT c, b FROM t1; + +DROP TABLE t1; + +--echo # +--echo # MDEV-3948 Assertion `records_are_comparable(table)' fails in compare_record(const TABLE*) on UPDATE with simple AND condition, index_merge+index_merge_intersection, InnoDB --echo # --echo # Verify that UPDATE does the same number of handler_update --echo # operations, no matter if there is ORDER BY or not. diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index e221a836134..f57025bcccb 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4752,6 +4752,50 @@ SHOW CREATE VIEW v4; DROP VIEW v1, v2, v3, v4, v5; + +--echo # +--echo # BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION, +--echo # IS REJECTED + +--echo # Without the patch, reports an error. +CREATE VIEW v1 (fld1, fld2) AS + SELECT 1 AS a, 2 AS b + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # The column names are explicitly specified and not duplicates, hence +--echo # succeeds. +CREATE VIEW v2 (fld1, fld2) AS + SELECT 1 AS a, 2 AS a + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # The column name in the first SELECT are not duplicates, hence succeeds. +CREATE VIEW v3 AS + SELECT 1 AS a, 2 AS b + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # Should report an error, since the explicitly specified column names are +--echo # duplicates. +--error ER_DUP_FIELDNAME +CREATE VIEW v4 (fld1, fld1) AS + SELECT 1 AS a, 2 AS b + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # Should report an error, since duplicate column name is specified in the +--echo # First SELECT. +--error ER_DUP_FIELDNAME +CREATE VIEW v4 AS + SELECT 1 AS a, 2 AS a + UNION ALL + SELECT 1 AS a, 1 AS a; + +--echo # Cleanup +DROP VIEW v1, v2, v3; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc |