diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-07-17 21:24:29 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-07-17 21:24:29 +0200 |
commit | 97e640b9ae83e07b444fceede6b0524256c7a3cc (patch) | |
tree | 8f48fbfaf88ea7895ce59fd3ac2fbe6184334387 /mysql-test | |
parent | 2f6a2494a5eb2cf3ab06fbedd2584eca85d90230 (diff) | |
parent | c7973615e723b13c6457b494b72be2fac35bfd18 (diff) | |
download | mariadb-git-97e640b9ae83e07b444fceede6b0524256c7a3cc.tar.gz |
5.5 merge
Diffstat (limited to 'mysql-test')
132 files changed, 1532 insertions, 214 deletions
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 66ff188fe55..8f2f96f3320 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -35,6 +35,7 @@ log-bin-trust-function-creators=1 key_buffer_size= 1M sort_buffer= 256K max_heap_table_size= 1M +loose-aria-pagecache-buffer-size=8M loose-feedback-user-info= mysql-test diff --git a/mysql-test/include/have_perfschema.inc b/mysql-test/include/have_perfschema.inc index 6d52a53b6b1..6b558e07c20 100644 --- a/mysql-test/include/have_perfschema.inc +++ b/mysql-test/include/have_perfschema.inc @@ -11,7 +11,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA if (!`SELECT count(*) FROM information_schema.engines WHERE (support = 'YES' OR support = 'DEFAULT') AND diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc index ffe8d7f1eb1..7c9feea55c2 100644 --- a/mysql-test/include/icp_tests.inc +++ b/mysql-test/include/icp_tests.inc @@ -892,3 +892,24 @@ insert into t1 values ('',1); select 1 from t1 where b <= 1 and a <> ''; drop table t1; +--echo # +--echo # MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column +--echo # +CREATE TABLE t1 ( + c1 TEXT , + c2 VARCHAR(2) , + INDEX idx1 (c2,c1(2)), + INDEX idx2 (c2,c1(1)) +); + +INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y'); + +SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); + +EXPLAIN +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); + +SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); + +DROP TABLE t1; diff --git a/mysql-test/include/install_semisync.inc b/mysql-test/include/install_semisync.inc new file mode 100644 index 00000000000..368b7b7cb4a --- /dev/null +++ b/mysql-test/include/install_semisync.inc @@ -0,0 +1,39 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# +--let $include_filename= install_semisync.inc +--source include/begin_include_file.inc + +--source include/not_embedded.inc +--source include/have_semisync_plugin.inc + +--connection master + +--disable_query_log +--let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1) +if ($value == No such row) +{ + SET sql_log_bin = 0; + eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; + SET GLOBAL rpl_semi_sync_master_enabled = 1; + SET sql_log_bin = 1; +} +--enable_query_log + +--connection slave +--source include/stop_slave_io.inc + +--disable_query_log +--let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1) +if ($value == No such row) +{ + SET sql_log_bin = 0; + eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; + SET GLOBAL rpl_semi_sync_slave_enabled = 1; + SET sql_log_bin = 1; +} +START SLAVE IO_THREAD; +--source include/wait_for_slave_io_to_start.inc +--enable_query_log + +--source include/end_include_file.inc diff --git a/mysql-test/include/uninstall_semisync.inc b/mysql-test/include/uninstall_semisync.inc new file mode 100644 index 00000000000..11668d1db97 --- /dev/null +++ b/mysql-test/include/uninstall_semisync.inc @@ -0,0 +1,24 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# +--let $include_filename= uninstall_semisync.inc +--source include/begin_include_file.inc + +--disable_query_log +--connection slave +--source include/stop_slave_io.inc + +# Uninstall rpl_semi_sync_slave first +--disable_warnings +UNINSTALL PLUGIN rpl_semi_sync_slave; + +--connection master +UNINSTALL PLUGIN rpl_semi_sync_master; +--enable_warnings + +--connection slave +START SLAVE IO_THREAD; +--source include/wait_for_slave_io_to_start.inc +--enable_query_log + +--source include/end_include_file.inc diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm index 419a0e7f39f..0e90967ef95 100644 --- a/mysql-test/lib/My/CoreDump.pm +++ b/mysql-test/lib/My/CoreDump.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -255,13 +255,17 @@ EOF sub show { - my ($class, $core_name, $exe_mysqld)= @_; + my ($class, $core_name, $exe_mysqld, $parallel)= @_; $hint_mysqld= $exe_mysqld; # On Windows, rely on cdb to be there... if (IS_WINDOWS) { - _cdb($core_name); + # Starting cdb is unsafe when used with --parallel > 1 option + if ( $parallel < 2 ) + { + _cdb($core_name); + } return; } diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 95e23756c30..7d39129d0f5 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,6 +13,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +IF (NOT INSTALL_MYSQLTESTDIR) + RETURN() +ENDIF() + SET(INSTALL_ARGS DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test @@ -25,8 +29,16 @@ ELSE() MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS}) ENDIF() -INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) +INSTALL(TARGETS my_safe_process + DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test +) + IF(WIN32) - INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) + INSTALL(TARGETS my_safe_kill + DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test + ) ENDIF() -INSTALL(FILES Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) + +INSTALL(FILES Base.pm + DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test +) diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index f41a77ff6ac..007acf77617 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm index 28660f44bae..36c50ab91d1 100644 --- a/mysql-test/lib/My/SysInfo.pm +++ b/mysql-test/lib/My/SysInfo.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2008 MySQL AB, 2008 Sun Microsystems, Inc. +# Copyright (c) 2013 MySQL AB, 2008 Sun Microsystems, Inc. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify @@ -60,7 +60,7 @@ sub _cpuinfo { } # Make sure bogomips is set to some value - $cpuinfo->{bogomips} |= DEFAULT_BOGO_MIPS; + $cpuinfo->{bogomips} ||= DEFAULT_BOGO_MIPS; # Cpus reported once, but with 'cpu_count' set to the actual number my $cpu_count= $cpuinfo->{cpu_count} || 1; diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 4e1625db093..d63583b1634 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -133,7 +133,6 @@ our $path_timefile; our $path_snapshot; our $path_mysqltest_log; our $path_current_test_log; -our $path_my_basedir; our $opt_vardir; # A path but set directly on cmd line our $path_vardir_trace; # unix formatted opt_vardir for trace files @@ -779,8 +778,6 @@ sub command_line_setup () { $glob_mysql_bench_dir= undef unless -d $glob_mysql_bench_dir; - $path_my_basedir= - $source_dist ? $glob_mysql_test_dir : $glob_basedir; $glob_timers= mtr_init_timers(); @@ -3171,7 +3168,7 @@ sub install_db ($$) { mtr_init_args(\$args); mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--bootstrap"); - mtr_add_arg($args, "--basedir=%s", $path_my_basedir); + mtr_add_arg($args, "--basedir=%s", $glob_basedir); mtr_add_arg($args, "--datadir=%s", $data_dir); mtr_add_arg($args, "--loose-skip-ndbcluster"); mtr_add_arg($args, "--loose-skip-aria"); @@ -3333,7 +3330,7 @@ log = $instance->{path_datadir}/mysqld$server_id.log log-error = $instance->{path_datadir}/mysqld$server_id.err.log log-slow-queries = $instance->{path_datadir}/mysqld$server_id.slow.log character-sets-dir = $path_charsetsdir -basedir = $path_my_basedir +basedir = $glob_basedir server_id = $server_id shutdown-delay = 10 skip-stack-trace @@ -3942,7 +3939,7 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--no-defaults", $prefix); - mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); + mtr_add_arg($args, "%s--basedir=%s", $prefix, $glob_basedir); mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); if ( $mysql_version_id >= 50036) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2b102b8dfbf..107b78aa1f9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. -# Copyright (c) 2009, 2012, Monty Program Ab +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. +# Copyright (c) 2009, 2013, Monty Program Ab # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -691,7 +691,7 @@ sub run_test_server ($$$) { mtr_report(" - found '$core_name'", "($num_saved_cores/$opt_max_save_core)"); - My::CoreDump->show($core_file, $exe_mysqld); + My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel); if ($num_saved_cores >= $opt_max_save_core) { mtr_report(" - deleting it, already saved", diff --git a/mysql-test/purify.supp b/mysql-test/purify.supp index 74ed8c42181..230dae20140 100644 --- a/mysql-test/purify.supp +++ b/mysql-test/purify.supp @@ -12,8 +12,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm suppress UMR my_end; main diff --git a/mysql-test/r/adddate_454.result b/mysql-test/r/adddate_454.result index 0993cdce32c..8b7c17cd47e 100644 --- a/mysql-test/r/adddate_454.result +++ b/mysql-test/r/adddate_454.result @@ -4,6 +4,8 @@ select * from t1; d 2012-00-00 update t1 set d = adddate(d, interval 1 day); +Warnings: +Warning 1292 Incorrect datetime value: '2012-00-00' select * from t1; d NULL diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 625791a7c4b..6f6dde1e172 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -268,37 +268,37 @@ cast(010203101112.121314 as datetime) 0001-02-03 10:11:12 select cast(120010203101112.121314 as datetime); cast(120010203101112.121314 as datetime) -0000-00-00 00:00:00 +NULL Warnings: Warning 1292 Incorrect datetime value: '120010203101112.121314' select cast(cast(1.1 as decimal) as datetime); cast(cast(1.1 as decimal) as datetime) -0000-00-00 00:00:00 +NULL Warnings: Warning 1292 Incorrect datetime value: '1' select cast(cast(-1.1 as decimal) as datetime); cast(cast(-1.1 as decimal) as datetime) -0000-00-00 00:00:00 +NULL Warnings: Warning 1292 Incorrect datetime value: '-1' select cast('0' as date); cast('0' as date) -0000-00-00 +NULL Warnings: Warning 1292 Incorrect datetime value: '0' select cast('' as date); cast('' as date) -0000-00-00 +NULL Warnings: Warning 1292 Incorrect datetime value: '' select cast('0' as datetime); cast('0' as datetime) -0000-00-00 00:00:00 +NULL Warnings: Warning 1292 Incorrect datetime value: '0' select cast('' as datetime); cast('' as datetime) -0000-00-00 00:00:00 +NULL Warnings: Warning 1292 Incorrect datetime value: '' select cast('0' as time); @@ -306,7 +306,7 @@ cast('0' as time) 00:00:00 select cast('' as time); cast('' as time) -00:00:00 +NULL Warnings: Warning 1292 Truncated incorrect time value: '' select cast(NULL as DATE); @@ -323,13 +323,13 @@ cast(NULL as BINARY) NULL select cast(cast(120010203101112.121314 as double) as datetime); cast(cast(120010203101112.121314 as double) as datetime) -0000-00-00 00:00:00 +NULL select cast(cast(1.1 as double) as datetime); cast(cast(1.1 as double) as datetime) 0000-00-00 00:00:01 select cast(cast(-1.1 as double) as datetime); cast(cast(-1.1 as double) as datetime) -0000-00-00 00:00:00 +NULL explain extended select cast(10 as double(5,2)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used @@ -786,4 +786,10 @@ SELECT CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY; CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY NULL Warnings: -Warning 1292 Truncated incorrect date value: '0000-00-00' +Warning 1292 Incorrect datetime value: '0000-00-00' +SET SQL_MODE=ALLOW_INVALID_DATES; +SELECT DATE("foo"); +DATE("foo") +NULL +Warnings: +Warning 1292 Incorrect datetime value: 'foo' diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 3bbd25cbbcc..7f69fd1a5a4 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -521,7 +521,7 @@ TIME_FORMAT("25:00:00", '%l %p') 1 AM SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896); DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896) -1151414896 +NULL Warnings: Warning 1292 Incorrect datetime value: '%Y-%m-%d %H:%i:%s' select str_to_date('04 /30/2004', '%m /%d/%Y'); diff --git a/mysql-test/r/fulltext_derived_4257.result b/mysql-test/r/fulltext_derived_4257.result new file mode 100644 index 00000000000..8479baef388 --- /dev/null +++ b/mysql-test/r/fulltext_derived_4257.result @@ -0,0 +1,6 @@ +set optimizer_switch = 'derived_merge=on'; +create table t1 (c1 char(8), c2 char(8)) engine=myisam; +insert into t1 values ('test1','test2'),('test3','test4'); +select * from (select c1 from t1 where match (c2) against ('hello' in boolean mode)) as alias; +c1 +drop table t1; diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index 1f20ddc6cbb..72c7a5a128f 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -168,7 +168,7 @@ date("1997-12-31 23:59:59.000001") 1997-12-31 select date("1997-13-31 23:59:59.000001"); date("1997-13-31 23:59:59.000001") -0000-00-00 +NULL Warnings: Warning 1292 Incorrect datetime value: '1997-13-31 23:59:59.000001' select time("1997-12-31 23:59:59.000001"); @@ -176,7 +176,7 @@ time("1997-12-31 23:59:59.000001") 23:59:59.000001 select time("1997-12-31 25:59:59.000001"); time("1997-12-31 25:59:59.000001") -00:00:00 +NULL Warnings: Warning 1292 Truncated incorrect time value: '1997-12-31 25:59:59.000001' select microsecond("1997-12-31 23:59:59.000001"); @@ -250,8 +250,6 @@ a select microsecond(19971231235959.01) as a; a 10000 -Warnings: -Warning 1292 Truncated incorrect time value: '19971231235959.01' select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; a 1997-12-31 00:00:10.090000 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index e8526ae8f1f..f50458695a7 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1222,14 +1222,13 @@ DROP TABLE t1,t2; set time_zone= @@global.time_zone; select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE -NULL -Warnings: -Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date +22:10:00 select str_to_date("1997-00-04 22:23:00","%Y-%m-%D") + interval 10 minute; str_to_date("1997-00-04 22:23:00","%Y-%m-%D") + interval 10 minute NULL Warnings: -Warning 1411 Incorrect datetime value: '1997-00-04 22:23:00' for function str_to_date +Warning 1292 Truncated incorrect date value: '1997-00-04 22:23:00' +Warning 1292 Incorrect datetime value: '1997-00-04' create table t1 (field DATE); insert into t1 values ('2006-11-06'); select * from t1 where field < '2006-11-06 04:08:36.0'; @@ -1423,13 +1422,15 @@ MAKEDATE(11111111,1) NULL SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1); WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1) -0 +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' # # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0, # DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); Warnings: -Warning 1292 Incorrect datetime value: '0' +Warning 1292 Incorrect datetime value: '0000-00-00' # # BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY # SIMILAR TO '2009-10-00' @@ -1713,6 +1714,7 @@ min(timestampadd(month, 1>'', from_days('%Z'))) NULL Warnings: Warning 1292 Truncated incorrect INTEGER value: '%Z' +Warning 1292 Incorrect datetime value: '0000-00-00' create table t1(a time); insert into t1 values ('00:00:00'),('00:01:00'); select 1 from t1 where 1 < some (select cast(a as datetime) from t1); @@ -1781,7 +1783,7 @@ Warnings: Warning 1441 Datetime function: time field overflow select cast('131415.123e0' as time); cast('131415.123e0' as time) -00:00:00 +NULL Warnings: Warning 1292 Truncated incorrect time value: '131415.123e0' select cast('2010-01-02 03:04:05' as datetime) between null and '2010-01-02 03:04:04'; @@ -1801,12 +1803,12 @@ unix_timestamp(null) NULL select truncate(date('2010-40-10'), 6); truncate(date('2010-40-10'), 6) -0.000000 +NULL Warnings: Warning 1292 Incorrect datetime value: '2010-40-10' select extract(month from '2010-40-50'); extract(month from '2010-40-50') -0 +NULL Warnings: Warning 1292 Incorrect datetime value: '2010-40-50' select subtime('0000-00-10 10:10:10', '30 10:00:00'); @@ -1884,6 +1886,8 @@ insert into t1 values ('0000-00-00'); select timestampadd(week, 1, f1) from t1; timestampadd(week, 1, f1) NULL +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' select timestampadd(week, 1, date("0000-00-00")); timestampadd(week, 1, date("0000-00-00")) NULL @@ -1936,3 +1940,13 @@ SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12')); 1 SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12')); 1 +# +# MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y')) +# +SET TIME_ZONE='+02:00'; +SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y')); +UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y')) +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2020' for function str_to_date +SET TIME_ZONE=DEFAULT; diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result index ef92b62ab32..cca7825a07e 100644 --- a/mysql-test/r/grant_4332.result +++ b/mysql-test/r/grant_4332.result @@ -41,7 +41,7 @@ a17aaaaaaaaaaaaa0 localhost b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0 localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0 localhost select user,host from mysql.db; -ERROR 42000: SELECT command denied to user 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'@'localhost' for table 'db' +ERROR 42000: SELECT command denied to user 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0'@'localhost' for table 'db' select user(), current_user(); user() current_user() c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost @@ -54,15 +54,37 @@ user b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0 c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0 select user,host from mysql.tables_priv; -ERROR 42000: SELECT command denied to user 'c80ccccccccccccccccccccccccccccccccccccccccccccc'@'localhost' for column 'host' in table 'tables_priv' +ERROR 42000: SELECT command denied to user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' for column 'host' in table 'tables_priv' +use mtr; +ERROR 42000: Access denied for user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' to database 'mtr' +drop procedure mtr.add_suppression; +ERROR 42000: alter routine command denied to user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' for routine 'mtr.add_suppression' create procedure test.p1() select user(), current_user(), user from mysql.tables_priv; show create procedure test.p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 CREATE DEFINER=`c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0`@`localhost` PROCEDURE `p1`() select user(), current_user(), user from mysql.tables_priv latin1 latin1_swedish_ci latin1_swedish_ci +select definer from information_schema.routines; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost create table test.t1 (a text); create event e1 on schedule every 1 second do insert test.t1 values (concat(user(), ' ', current_user())); +select definer from information_schema.events; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost +create view v1 as select * from t1; +select definer from information_schema.views; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost +drop view v1; +create trigger tr1 before delete on t1 for each row set @a:=1; +select definer from information_schema.triggers; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost +drop trigger tr1; +connect(localhost,c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0,foobar,test,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' (using password: YES) call test.p1(); user() current_user() user root@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0 diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index cc7c9c4d364..229481f5ec8 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -3561,3 +3561,45 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range NULL PRIMARY 5 NULL 9 Using index for group-by (scanning) drop table t1; # End of test#50539. +# +# MDEV-4219 A simple select query returns random data (upstream bug#68473) +# +drop table if exists faulty; +CREATE TABLE faulty ( +a int(11) unsigned NOT NULL AUTO_INCREMENT, +b int(11) unsigned NOT NULL, +c datetime NOT NULL, +PRIMARY KEY (a), +UNIQUE KEY b_and_c (b,c) +); +INSERT INTO faulty (b, c) VALUES +(1801, '2013-02-15 09:00:00'), +(1802, '2013-02-28 09:00:00'), +(1802, '2013-03-01 09:00:00'), +(5, '1990-02-15 09:00:00'), +(5, '2013-02-15 09:00:00'), +(5, '2009-02-15 17:00:00'); +EXPLAIN +SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE faulty range b_and_c b_and_c 12 NULL 2 Using where; Using index for group-by; Using filesort +SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c; +b c +1802 2013-02-28 09:00:00 +1802 2013-03-01 09:00:00 +drop table faulty; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3); +INSERT INTO t1 SELECT a + 1, b FROM t1; +INSERT INTO t1 SELECT a + 2, b FROM t1; +CREATE INDEX break_it ON t1 (a, b); +EXPLAIN +SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range break_it break_it 10 NULL 2 Using where; Using index for group-by; Using filesort +SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; +a b +3 1 +3 2 +3 3 +drop table t1; diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index 0b6959d15a9..e771d48b6d2 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -1617,4 +1617,30 @@ GROUP BY 2; COUNT(DISTINCT t2.b) CONCAT(t1.c) 2 0 DROP TABLE t1,t2,t3; +# +# MDEV-4556 Server crashes in SEL_ARG::rb_insert with index_merge+index_merge_sort_union, FORCE INDEX +# +CREATE TABLE t1 ( +pk int, +code char(2), +population_rate int, +area_rate int, +primary key (pk), +index (code), +key (population_rate), +key (area_rate) +); +INSERT INTO t1 VALUES (1,'WI',20, 23), (2, 'WA', 13, 18); +EXPLAIN +SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code ) +WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL ) +AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge PRIMARY,code,population_rate,area_rate PRIMARY,population_rate,area_rate 4,5,5 NULL 2 Using sort_union(PRIMARY,population_rate,area_rate); Using where +SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code ) +WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL ) +AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX'); +pk code population_rate area_rate +1 WI 20 23 +DROP TABLE t1; set optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/r/information_schema_routines.result b/mysql-test/r/information_schema_routines.result index 36f8637faa9..b8f4fb9b1ef 100644 --- a/mysql-test/r/information_schema_routines.result +++ b/mysql-test/r/information_schema_routines.result @@ -30,7 +30,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', `ROUTINE_COMMENT` longtext NOT NULL, - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -587,14 +587,14 @@ ORDINAL_POSITION 28 COLUMN_DEFAULT IS_NULLABLE NO DATA_TYPE varchar -CHARACTER_MAXIMUM_LENGTH 77 -CHARACTER_OCTET_LENGTH 231 +CHARACTER_MAXIMUM_LENGTH 189 +CHARACTER_OCTET_LENGTH 567 NUMERIC_PRECISION NULL NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME utf8 COLLATION_NAME utf8_general_ci -COLUMN_TYPE varchar(77) +COLUMN_TYPE varchar(189) COLUMN_KEY EXTRA PRIVILEGES # @@ -688,7 +688,7 @@ CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO ROUTINE_COMMENT longtext NO NULL -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO diff --git a/mysql-test/r/innodb_icp,innodb_plugin.rdiff b/mysql-test/r/innodb_icp,innodb_plugin.rdiff index c74a8473486..3cb85b79ece 100644 --- a/mysql-test/r/innodb_icp,innodb_plugin.rdiff +++ b/mysql-test/r/innodb_icp,innodb_plugin.rdiff @@ -1,5 +1,5 @@ ---- r/innodb_icp.result 2012-02-25 17:31:11.000000000 +0100 -+++ /usr/home/serg/Abk/mysql/5.5-mtr/mysql-test/r/innodb_icp,innodb_plugin.reject 2012-02-25 22:32:18.000000000 +0100 +--- r/innodb_icp.result 2013-07-16 17:01:00.000000000 +0400 ++++ r/innodb_icp,innodb_plugin.reject 2013-07-16 17:16:53.000000000 +0400 @@ -213,7 +213,7 @@ EXPLAIN SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2; @@ -45,5 +45,14 @@ +Handler_icp_attempts 0 +Handler_icp_match 0 DROP TABLE t1; - # - # BUG#920132: Assert trx->n_active_thrs == 1 failed at que0que.c line 1050 + create table t1 (a int,b char(5),primary key (a), key (b(1))); + insert into t1 values ('a','b'); +@@ -868,7 +868,7 @@ + EXPLAIN + SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); + id select_type table type possible_keys key key_len ref rows Extra +-1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using index condition; Using where ++1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using where + SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); + c1 c2 + aa x diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result index 54ad9ecafad..07c75986392 100644 --- a/mysql-test/r/innodb_icp.result +++ b/mysql-test/r/innodb_icp.result @@ -852,6 +852,33 @@ select 1 from t1 where b <= 1 and a <> ''; 1 drop table t1; # +# MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column +# +CREATE TABLE t1 ( +c1 TEXT , +c2 VARCHAR(2) , +INDEX idx1 (c2,c1(2)), +INDEX idx2 (c2,c1(1)) +); +INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y'); +SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +EXPLAIN +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using index condition; Using where +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +DROP TABLE t1; +# # BUG#920132: Assert trx->n_active_thrs == 1 failed at que0que.c line 1050 # CREATE TABLE t1 ( a INT ) diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 1d045d0a58d..0e5b36acb10 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1472,6 +1472,11 @@ dog_id dog_id birthday dog_id t_id birthday dog_id t_id birthday a_id dog_id 5918 5918 2004-07-22 5918 N 2004-07-22 5918 N 2004-07-22 5992424 5918 SET optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2,t3,t4,t5; +# +# MDEV-4752: Segfault during parsing of illegal query +# +SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4); +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 ')' at line 1 SET optimizer_switch=@save_optimizer_switch; # # Bug #35268: Parser can't handle STRAIGHT_JOIN with USING diff --git a/mysql-test/r/mdev316.result b/mysql-test/r/mdev316.result index 78272549e81..43082769872 100644 --- a/mysql-test/r/mdev316.result +++ b/mysql-test/r/mdev316.result @@ -16,7 +16,7 @@ cast(convert(0x0030 using ucs2) as decimal(5.2)) cast(concat(convert(0x0030 usin 0 0 select cast(convert(_ucs2 0x0030 using latin1) as date), cast(concat(convert(_ucs2 0x0030 using latin1)) as date); cast(convert(_ucs2 0x0030 using latin1) as date) cast(concat(convert(_ucs2 0x0030 using latin1)) as date) -0000-00-00 0000-00-00 +NULL NULL Warnings: Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '0' diff --git a/mysql-test/r/mrr_derived_crash_4610.result b/mysql-test/r/mrr_derived_crash_4610.result new file mode 100644 index 00000000000..8dcdfda9276 --- /dev/null +++ b/mysql-test/r/mrr_derived_crash_4610.result @@ -0,0 +1,19 @@ +create table t1 (f1 char(4) primary key) engine=innodb charset=utf8 ; +insert into t1 values ('aaaa'); +create table t2 (f2 text, f3 char(4) not null) engine=innodb charset=utf8 ; +create table t3 (id int not null) engine=innodb charset=utf8 ; +create table t4 (val int not null) engine=innodb charset=utf8; +explain select 1 from +(select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top +join t1 on f1 = f3 where f3 = 'aaaa' order by val; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 const PRIMARY PRIMARY 12 const 1 Using index; Using filesort +1 PRIMARY <derived2> ref key0 key0 13 const 0 Using where +2 DERIVED t4 ALL NULL NULL NULL NULL 1 +2 DERIVED t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) +2 DERIVED t3 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) +select 1 from +(select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top +join t1 on f1 = f3 where f3 = 'aaaa' order by val; +1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/mrr_icp_extra.result b/mysql-test/r/mrr_icp_extra.result index 5e49fb6e956..f7adcfb19fd 100644 --- a/mysql-test/r/mrr_icp_extra.result +++ b/mysql-test/r/mrr_icp_extra.result @@ -105,7 +105,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range FieldKey FieldKey 38 NULL 4 Using index condition; Rowid-ordered scan; Using filesort EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range StringField StringField 38 NULL 4 Using index condition; Using filesort +1 SIMPLE t1 range StringField StringField 38 NULL 4 Using where; Using filesort SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal; FieldKey LongVal StringVal 3 1 2 diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result index bc7ebf9c439..2c157102270 100644 --- a/mysql-test/r/myisam_icp.result +++ b/mysql-test/r/myisam_icp.result @@ -211,7 +211,7 @@ c-1006=w EXPLAIN SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 range c1 c1 12 NULL 2 Using index condition; Using where +1 SIMPLE t3 range c1 c1 12 NULL 2 Using where SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2; c1 EXPLAIN @@ -855,6 +855,33 @@ insert into t1 values ('',1); select 1 from t1 where b <= 1 and a <> ''; 1 drop table t1; +# +# MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column +# +CREATE TABLE t1 ( +c1 TEXT , +c2 VARCHAR(2) , +INDEX idx1 (c2,c1(2)), +INDEX idx2 (c2,c1(1)) +); +INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y'); +SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +EXPLAIN +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using where +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +DROP TABLE t1; drop table if exists t0, t1, t1i, t1m; # # BUG#826935 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed diff --git a/mysql-test/r/mysql_binary_mode.result b/mysql-test/r/mysql_binary_mode.result new file mode 100644 index 00000000000..cb230037108 --- /dev/null +++ b/mysql-test/r/mysql_binary_mode.result @@ -0,0 +1,50 @@ +RESET MASTER; +# Bug#33048 Not able to recover binary/blob data correctly using mysqlbinlog +# -------------------------------------------------------------------------- +# The test verify that 0x00 and 0x0D0A sequence can be handled correctly by +# mysql + +CREATE TABLE `A
+B` (c1 CHAR(100)); +# It is a faked statement. ASCII 0 is in the original statement, it would +# make the test result to become a binary file which was difficult to get +# the diff result if the original query was logged in the result. +INSERT INTO `A\r\nB` VALUES("A\0B"); + +INSERT INTO `A
+B` VALUES("A
+B"); +SELECT HEX(c1) FROM `A
+B`; +HEX(c1) +410042 +410D0A42 + +FLUSH LOGS; +DROP TABLE `A
+B`; + +RESET MASTER; +# '--exec mysql ...' without --binary-mode option +# It creates the table with a wrong table name and generates an error. +# (error output was suppressed to make the test case platform agnostic) + +# It is not in binary_mode, so table name '0x410D0A42' can be translated to +# '0x410A42' by mysql depending on the OS - Windows or Unix-like. +DROP TABLE `TABLE_NAME_MASKED`; + +# In binary_mode, table name '0x410D0A42' and string '0x410042' can be +# handled correctly. +RESET MASTER; +SELECT HEX(c1) FROM `A
+B`; +HEX(c1) +410042 +410D0A42 + +DROP TABLE `A
+B`; +RESET MASTER; +include/assert.inc [Table and contents created through mysqltest match 0x610D0A62.] +include/assert.inc [Table and contents created while replaying binary log without --binary-mode set match 0x61(0D)0A62.] +include/assert.inc [Table and contents created while replaying binary log with --binary-mode set match 0x610D0A62.] diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index bb91d4f23c4..be51cf8ca11 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -121,7 +121,6 @@ Phase 3/3: Running 'mysql_fix_privilege_tables'... OK DROP USER mysqltest1@'%'; Run mysql_upgrade with a non existing server socket -Phase 1/3: Fixing table and database names mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect FATAL ERROR: Upgrade failed set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index ba79011f53e..e80851329a4 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -78,13 +78,13 @@ insert into t2 select * from t1; alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10)); explain select * from t1 where a is null and b = 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a is null and b = 2 and c=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a is null and b = 7 and c=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a=2 and b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a,b a 5 const 1 Using where @@ -93,25 +93,25 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 and c=0 limit 3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 5 NULL 5 Using index condition; Using where +1 SIMPLE t1 range a,b a 5 NULL 5 Using where explain select * from t1 where (a is null or a = 7) and b=7 and c=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using index condition; Using where +1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using where explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where +1 SIMPLE t1 ref a,b a 5 const 3 Using where explain select * from t1 where a > 1 and a < 3 limit 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 1 Using index condition +1 SIMPLE t1 range a a 5 NULL 1 Using where explain select * from t1 where a is null and b=7 or a > 1 and a < 3 limit 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 5 NULL 4 Using index condition; Using where +1 SIMPLE t1 range a,b a 5 NULL 4 Using where explain select * from t1 where a > 8 and a < 9; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 1 Using index condition +1 SIMPLE t1 range a a 5 NULL 1 Using where explain select * from t1 where b like "6%"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range b b 12 NULL 1 Using where diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 054dc9e4fc4..a8e610a561a 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -618,7 +618,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range FieldKey FieldKey 38 NULL 4 Using index condition; Using filesort EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range StringField StringField 38 NULL 4 Using index condition; Using filesort +1 SIMPLE t1 range StringField StringField 38 NULL 4 Using where; Using filesort SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal; FieldKey LongVal StringVal 3 1 2 diff --git a/mysql-test/r/outfile_loaddata.result b/mysql-test/r/outfile_loaddata.result index 36a72fd84ce..e91855b8dcd 100644 --- a/mysql-test/r/outfile_loaddata.result +++ b/mysql-test/r/outfile_loaddata.result @@ -143,15 +143,8 @@ TRUNCATE t2; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ъ'; Warnings: Warning 1638 Non-ASCII separator arguments are not fully supported -Warning 1265 Data truncated for column 'a' at row 1 -Warning 1261 Row 1 doesn't contain data for all columns -Warning 1261 Row 1 doesn't contain data for all columns -Warning 1265 Data truncated for column 'a' at row 2 -Warning 1261 Row 2 doesn't contain data for all columns -Warning 1261 Row 2 doesn't contain data for all columns SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; a b c -1 NULL NULL 1 ABC-АБВ DEF-ÂÃÄ 2 NULL NULL SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'ъ'; @@ -181,7 +174,6 @@ Warning 1638 Non-ASCII separator arguments are not fully supported SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; a b c 1 ABC-АБВ DEF-ÂÃÄ -1 ABC-АБВ DEF-ÂÃÄÑŠ2 2 NULL NULL # Default (binary) charset: SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FROM t1; diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 54378f16d49..e81eea6e887 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -555,14 +555,10 @@ ERROR 42000: Incorrect parameters in the call to native function 'atan' DROP TABLE IF EXISTS t1; SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE -NULL -Warnings: -Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date +22:10:00 SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE -NULL -Warnings: -Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date +22:01:00 SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; "1997-12-31 23:59:59" + INTERVAL 1 SECOND 1998-01-01 00:00:00 diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result index 8d72d8781ee..804d9dd1c34 100644 --- a/mysql-test/r/partition_datatype.result +++ b/mysql-test/r/partition_datatype.result @@ -699,6 +699,7 @@ a tz 2038-01-19 03:14:06 Moscow UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a); Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' Warning 1264 Out of range value for column 'a' at row 34 Warning 1264 Out of range value for column 'a' at row 35 SELECT MIN(a), MAX(a) FROM t2; @@ -780,6 +781,10 @@ a tz 2038-01-19 03:14:07 UTC 2011-10-30 00:00:02 Moscow UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a); +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' +Warning 1292 Incorrect datetime value: '0000-00-00' +Warning 1292 Incorrect datetime value: '0000-00-00' SELECT MIN(a), MAX(a) FROM t2; MIN(a) MAX(a) 1970-01-01 00:00:01 2038-01-19 03:14:06 @@ -1174,6 +1179,7 @@ a tz 2038-01-19 06:14:06 Moscow UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a); Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' Warning 1299 Invalid TIMESTAMP value in column 'a' at row 8 Warning 1299 Invalid TIMESTAMP value in column 'a' at row 9 Warning 1264 Out of range value for column 'a' at row 34 @@ -1258,6 +1264,9 @@ a tz 2011-10-30 03:00:02 Moscow UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a); Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' +Warning 1292 Incorrect datetime value: '0000-00-00' +Warning 1292 Incorrect datetime value: '0000-00-00' Warning 1299 Invalid TIMESTAMP value in column 'a' at row 18 Warning 1299 Invalid TIMESTAMP value in column 'a' at row 19 SELECT MIN(a), MAX(a) FROM t2; diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index f4d473c00d5..ec7fd798d4c 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -2235,10 +2235,9 @@ INSERT INTO t1 VALUES (1, '2009-01-01'), (2, NULL); # test with an invalid date, which lead to item->null_value is set. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p20090401 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: Warning 1292 Incorrect datetime value: '2009-04-99' -Warning 1292 Incorrect datetime value: '2009-04-99' DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 0eb49584c4a..fd46100b7ee 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -199,3 +199,24 @@ select 1; 1 1 UNINSTALL PLUGIN example; +UNINSTALL PLUGIN MyISAM; +ERROR HY000: Built-in plugins cannot be deleted +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +plugin_name +install soname 'ha_example'; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +plugin_name +EXAMPLE +UNUSABLE +uninstall plugin example; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +plugin_name +UNUSABLE +install soname 'ha_example'; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +plugin_name +EXAMPLE +UNUSABLE +uninstall soname 'ha_example'; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +plugin_name diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result new file mode 100644 index 00000000000..fc03f920533 --- /dev/null +++ b/mysql-test/r/processlist.result @@ -0,0 +1,15 @@ +SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time'; +SELECT 1; +SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed'; +SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL; +1 +1 +SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed'; +INFO TIME TIME_MS +NULL 0 0.000 +select sleep(5); +sleep(5) +0 +select command, time < 5 from information_schema.processlist where id != connection_id(); +command time < 5 +Sleep 1 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 809aef3ac99..44a37b9a9e5 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -998,7 +998,7 @@ def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 1 def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63 def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 567 14 N 1 0 33 def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 @@ -1042,7 +1042,7 @@ def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFER def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 567 14 N 1 0 33 TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost ---------------------------------------------------------------- @@ -1065,7 +1065,7 @@ def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33 def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33 def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33 -def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema VIEWS VIEWS DEFINER DEFINER 253 567 14 N 1 0 33 def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33 def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33 @@ -1123,7 +1123,7 @@ def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 -def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost ---------------------------------------------------------------- @@ -1178,7 +1178,7 @@ def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 -def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost ---------------------------------------------------------------- diff --git a/mysql-test/r/sp_missing_4665.result b/mysql-test/r/sp_missing_4665.result new file mode 100644 index 00000000000..47587c180c6 --- /dev/null +++ b/mysql-test/r/sp_missing_4665.result @@ -0,0 +1,6 @@ +create table t (a int); +create or replace view v as select 1 from t where a; +delete from v where (select g()); +ERROR 42000: FUNCTION test.g does not exist +drop view v; +drop table t; diff --git a/mysql-test/r/str_to_datetime_457.result b/mysql-test/r/str_to_datetime_457.result index 630be9ffbaa..4fd0d00691c 100644 --- a/mysql-test/r/str_to_datetime_457.result +++ b/mysql-test/r/str_to_datetime_457.result @@ -12,12 +12,12 @@ Warning 1292 Truncated incorrect datetime value: '2012103123595912' Warning 1292 Truncated incorrect datetime value: '20121031235959123' select cast(0 as date), cast('0000-00-00' as date), cast('0' as date); cast(0 as date) cast('0000-00-00' as date) cast('0' as date) -0000-00-00 0000-00-00 0000-00-00 +0000-00-00 0000-00-00 NULL Warnings: Warning 1292 Incorrect datetime value: '0' select extract(hour from '100000:02:03'), extract(hour from '100000:02:03 '); extract(hour from '100000:02:03') extract(hour from '100000:02:03 ') -0 0 +NULL NULL Warnings: Warning 1292 Truncated incorrect time value: '100000:02:03' Warning 1292 Truncated incorrect time value: '100000:02:03 ' diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index b1e4cb669ed..da3c658b5a4 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -206,7 +206,9 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y')); INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date +Warnings: +Note 1265 Data truncated for column 'col1' at row 1 +INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -221,8 +223,6 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR HY000: Incorrect datetime value: '00.00.0000' for function str_to_date -INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -238,7 +238,7 @@ ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_da INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR HY000: Incorrect datetime value: '00.00.0000' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date +ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index b3536661125..eac53365329 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -5173,9 +5173,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; 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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; -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 'ON 1' at line 1 +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 ') ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; -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 ') ON 1' at line 1 +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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_exists_to_in.result b/mysql-test/r/subselect_exists_to_in.result index 579277f11f9..a71e57b2566 100644 --- a/mysql-test/r/subselect_exists_to_in.result +++ b/mysql-test/r/subselect_exists_to_in.result @@ -5179,9 +5179,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; 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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; -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 'ON 1' at line 1 +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 ') ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; -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 ') ON 1' at line 1 +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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 0b339738432..a5800883711 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -450,4 +450,48 @@ a d2 select distinct (1 + (select 1 from `t2` where `a`)) `d2` from `t1`; d2 drop table t1,t2; +# +# MDEV-4042: Assertion `table->key_read == 0' fails in close_thread_table on EXPLAIN with GROUP BY and HAVING in EXISTS SQ, +# MDEV-4536: ...sql/sql_base.cc:1598: bool close_thread_table(THD*, TABLE**): Assertion `table->key_read == 0' failed. +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (b INT PRIMARY KEY, c INT) ENGINE=InnoDB; +CREATE TABLE t3 (d INT) ENGINE=InnoDB; +EXPLAIN +SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 index NULL PRIMARY 4 NULL 1 Using index; Using temporary; Using filesort +2 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) +SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 ); +a +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( +pk int auto_increment primary key, +col_int_key int(11), +key col_int_key (col_int_key),col_varchar_key varchar(128), +key (col_varchar_key) +) engine=innodb; +EXPLAIN +SELECT 1 FROM t1 AS alias1 +WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1 +FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN +t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key ) +) +GROUP BY SQ2_field1 +HAVING SQ2_alias1 . col_int_key >= 7 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY SQ2_alias2 index NULL col_int_key 5 NULL 1 Using index; Using temporary; Using filesort +2 SUBQUERY SQ2_alias1 ref col_int_key col_int_key 5 test.SQ2_alias2.col_int_key 1 Using where; Using index +SELECT 1 FROM t1 AS alias1 +WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1 +FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN +t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key ) +) +GROUP BY SQ2_field1 +HAVING SQ2_alias1 . col_int_key >= 7 +); +1 +drop table t1; set optimizer_switch=@subselect_innodb_tmp; diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index ce9a4ad444f..bf98b912a9e 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -5175,9 +5175,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; 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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; -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 'ON 1' at line 1 +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 ') ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; -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 ') ON 1' at line 1 +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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index e017e67cfe6..05f7a25e0ef 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -5171,9 +5171,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; 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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; -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 'ON 1' at line 1 +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 ') ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; -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 ') ON 1' at line 1 +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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 492321c5d81..ee84bfd1eca 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -5179,9 +5179,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; 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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; -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 'ON 1' at line 1 +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 ') ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; -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 ') ON 1' at line 1 +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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index eb92936e85d..5a7e303f4b9 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -5171,9 +5171,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; 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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; -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 'ON 1' at line 1 +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 ') ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; -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 ') ON 1' at line 1 +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 ')) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 56c3044c4e4..3fc91b452a5 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2884,4 +2884,40 @@ HAVING c <> ( SELECT MAX( c ) FROM t1 ) ORDER BY sm; c sm DROP TABLE t1,t2; +# +# mdev-4173 ignored duplicate value when converting heap to temp table +# could lead to extra rows in semijoin queries or missing row in union queries +# +CREATE TABLE t1 (i1 INT) engine=myisam; +INSERT INTO t1 VALUES +(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4); +CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam; +INSERT INTO t2 VALUES +(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4), +(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6); +CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam; +INSERT INTO t3 VALUES +(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1); +select @@max_heap_table_size into @tmp_max_heap_table_size; +select @@join_buffer_size into @tmp_join_buffer_size; +set max_heap_table_size=16*1024; +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +DROP TABLE t1, t2, t3; +set join_buffer_size = @tmp_join_buffer_size; +set max_heap_table_size = @tmp_max_heap_table_size; set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index c4b9933ae07..4f94f5a704c 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -1094,5 +1094,27 @@ COUNT(*) 3724 set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; +DROP TABLE IF EXISTS t1,t2,t3,t4; +# +# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin +# +CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English'); +CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB; +INSERT INTO t2 VALUES (86,'English'); +CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB; +INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron'); +create table t4 like t1; +insert into t4 select * from t1; +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); +t1_pk1 t1_pk2 t3_i t3_c +explain +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary +DROP TABLE t1,t2,t3,t4; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index d9b9815133c..e0c5864f1b3 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -1109,6 +1109,28 @@ COUNT(*) 3724 set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; +DROP TABLE IF EXISTS t1,t2,t3,t4; +# +# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin +# +CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English'); +CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB; +INSERT INTO t2 VALUES (86,'English'); +CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB; +INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron'); +create table t4 like t1; +insert into t4 select * from t1; +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); +t1_pk1 t1_pk2 t3_i t3_c +explain +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join) +1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 55:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join) +DROP TABLE t1,t2,t3,t4; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; # diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 1af507668da..fbe6db4edda 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1096,6 +1096,28 @@ COUNT(*) 3724 set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; +DROP TABLE IF EXISTS t1,t2,t3,t4; +# +# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin +# +CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English'); +CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB; +INSERT INTO t2 VALUES (86,'English'); +CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB; +INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron'); +create table t4 like t1; +insert into t4 select * from t1; +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); +t1_pk1 t1_pk2 t3_i t3_c +explain +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary +DROP TABLE t1,t2,t3,t4; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; set optimizer_switch=default; diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 7be29201c63..f18de3c4d0b 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -2898,6 +2898,42 @@ HAVING c <> ( SELECT MAX( c ) FROM t1 ) ORDER BY sm; c sm DROP TABLE t1,t2; +# +# mdev-4173 ignored duplicate value when converting heap to temp table +# could lead to extra rows in semijoin queries or missing row in union queries +# +CREATE TABLE t1 (i1 INT) engine=myisam; +INSERT INTO t1 VALUES +(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4); +CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam; +INSERT INTO t2 VALUES +(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4), +(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6); +CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam; +INSERT INTO t3 VALUES +(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1); +select @@max_heap_table_size into @tmp_max_heap_table_size; +select @@join_buffer_size into @tmp_join_buffer_size; +set max_heap_table_size=16*1024; +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +COUNT(*) +2834 +DROP TABLE t1, t2, t3; +set join_buffer_size = @tmp_join_buffer_size; +set max_heap_table_size = @tmp_max_heap_table_size; set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 2d4a290751f..af747dca562 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -136,7 +136,7 @@ select @d:=1311; 1311 select year(@d), month(@d), day(@d), cast(@d as date); year(@d) month(@d) day(@d) cast(@d as date) -0 0 0 0000-00-00 +NULL NULL NULL NULL Warnings: Warning 1292 Incorrect datetime value: '1311' Warning 1292 Incorrect datetime value: '1311' @@ -303,6 +303,17 @@ Warnings: Warning 1265 Data truncated for column 'f1' at row 1 drop table t1; # +# MDEV-4634 Crash in CONVERT_TZ +# +SELECT CONVERT_TZ(GREATEST(DATE('2021-00-00'),DATE('2022-00-00')),'+00:00','+7:5'); +CONVERT_TZ(GREATEST(DATE('2021-00-00'),DATE('2022-00-00')),'+00:00','+7:5') +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00' +# +# End of 5.3 tests +# +# # Bug #33629: last_day function can return null, but has 'not null' # flag set for result # diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index d6676bbf16b..1b53f92f82a 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -657,8 +657,8 @@ create table t1 (d date, t time) engine=myisam; insert into t1 values ('2000-12-03','22:55:23'),('2008-05-03','10:19:31'); select case when d = '2012-12-12' then d else t end as cond, group_concat( d ) from t1 group by cond; cond group_concat( d ) -0000-00-00 00:00:00 2000-12-03 -0000-00-00 00:00:00 2008-05-03 +NULL 2000-12-03 +NULL 2008-05-03 Warnings: Warning 1292 Incorrect datetime value: '22:55:23' Warning 1292 Incorrect datetime value: '10:19:31' @@ -681,6 +681,14 @@ c a b 1 1 0000-00-00 3 NULL NULL drop table t1,t2; +# +# MDEV-4634 Crash in CONVERT_TZ +# +SELECT CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5'); +CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5') +NULL +Warnings: +Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00' End of 5.3 tests # # Start of 5.5 tests diff --git a/mysql-test/r/type_datetime_hires.result b/mysql-test/r/type_datetime_hires.result index ba1fe4adedb..203e45b86cb 100644 --- a/mysql-test/r/type_datetime_hires.result +++ b/mysql-test/r/type_datetime_hires.result @@ -338,3 +338,15 @@ select * from t1; a b 2010-01-02 03:04:05.000000 2010-01-02 03:04:05 drop table t1; +# +# MDEV-4651 Crash in my_decimal2decimal in a ORDER BY query +# +SET @@time_zone='+00:00'; +CREATE TABLE t1 (a DATETIME(4) NOT NULL); +INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2000-00-00 00:00:00'); +SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY 1; +UNIX_TIMESTAMP(a) +NULL +978307200.0000 +DROP TABLE t1; +SET @@time_zone=DEFAULT; diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 7bc0327178b..4167cbbe252 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -174,6 +174,17 @@ select f1, f1 = '2010-10-11 23:38:57' from t1; f1 f1 = '2010-10-11 23:38:57' 23:38:57 0 drop table t1; +# +# MDEV-4634 Crash in CONVERT_TZ +# +SELECT CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5'); +CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5') +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' +# +# End of 5.3 tests +# CREATE TABLE t1 (f1 TIME); INSERT INTO t1 VALUES ('24:00:00'); SELECT '24:00:00' = (SELECT f1 FROM t1); diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 817c725f131..d907e18b932 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1487,7 +1487,7 @@ SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size; SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024; SELECT @@GLOBAL.max_binlog_cache_size; @@GLOBAL.max_binlog_cache_size -5368709120 +max_size SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; # # Bug #37168 : Missing variable - skip_name_resolve diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 576752f65c9..d6321cae92b 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4863,6 +4863,18 @@ a 1 drop view v1; drop table t1,t2; +# +# MDEV-4593: p_s: crash in simplify_joins with delete using subselect +# from view +# +create table `t1`(`a` int); +create table `t2`(`a` int); +create or replace view `v1` as select `a` from `t1`; +prepare s from "delete from `t2` order by (select 1 from `v1`)"; +execute s; +deallocate prepare s; +drop view v1; +drop tables t1,t2; # ----------------------------------------------------------------- # -- End of 5.3 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/suite/archive/repair.result b/mysql-test/suite/archive/repair.result new file mode 100644 index 00000000000..16f0f2c1608 --- /dev/null +++ b/mysql-test/suite/archive/repair.result @@ -0,0 +1,10 @@ +create table t1 (a int) engine=archive; +insert into t1 values (1); +select * from t1; +Got one of the listed errors +insert into t1 values (2); +ERROR HY000: Table 't1' is marked as crashed and should be repaired +repair table t1; +Table Op Msg_type Msg_text +test.t1 repair error Corrupt +drop table t1; diff --git a/mysql-test/suite/archive/repair.test b/mysql-test/suite/archive/repair.test new file mode 100644 index 00000000000..03946d31ead --- /dev/null +++ b/mysql-test/suite/archive/repair.test @@ -0,0 +1,17 @@ +# +# MDEV-4444 Server crashes with "safe_mutex: Trying to destroy a mutex share->mutex that was locked" on attempt to recover an archive table +# + +--source include/have_archive.inc + +--let $datadir = `SELECT @@datadir` + +create table t1 (a int) engine=archive; +insert into t1 values (1); +--remove_file $datadir/test/t1.ARZ +--error 13,1017 +select * from t1; +--error ER_CRASHED_ON_USAGE +insert into t1 values (2); +repair table t1; +drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result index 00e77dc0331..bf6e13d803d 100644 --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result @@ -447,6 +447,7 @@ BEGIN ### DELETE FROM `test1`.`t1` ### WHERE ### @1=3 /* INT meta=0 nullable=1 is_null=0 */ +'/*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; @@ -1111,6 +1112,7 @@ BEGIN ### DELETE FROM `test1`.`t1` ### WHERE ### @1=3 /* INT meta=0 nullable=1 is_null=0 */ +'/*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; diff --git a/mysql-test/suite/federated/federated.result b/mysql-test/suite/federated/federated.result index 49f9d338c6a..4d35550f210 100644 --- a/mysql-test/suite/federated/federated.result +++ b/mysql-test/suite/federated/federated.result @@ -7,6 +7,12 @@ Level Code Message Error 1 server name: 'non_existing' doesn't exist! Error 1 Can't create/write to file 'non_existing' (Errcode: 14 "Bad address") Error 1005 Can't create table `test`.`t1` (errno: 1 "Operation not permitted") +create table t1 (a int); +create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/t1'; +drop table t1; +select * from fed; +Got one of the listed errors +drop table fed; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/suite/federated/federated.test b/mysql-test/suite/federated/federated.test index 88d20817996..cb14dc2a239 100644 --- a/mysql-test/suite/federated/federated.test +++ b/mysql-test/suite/federated/federated.test @@ -8,5 +8,17 @@ connection master; CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='non_existing'; SHOW WARNINGS; +# +# MDEV-4468 Assertion `error != 0' fails or timeout occurs on select from a FEDERATED table which points at a non-existent table +# + +create table t1 (a int); +--replace_result $MASTER_MYPORT MASTER_PORT +eval create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1'; +drop table t1; +--error 1146,1431 +select * from fed; +drop table fed; + source include/federated_cleanup.inc; diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index 52a8fbaadc6..da1e59dba03 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -88,7 +88,7 @@ def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NUL def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select -def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema EVENTS DEFINER 4 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -267,7 +267,7 @@ def information_schema ROUTINES CREATED 24 0000-00-00 00:00:00 NO datetime NULL def information_schema ROUTINES DATABASE_COLLATION 31 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select -def information_schema ROUTINES DEFINER 28 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema ROUTINES DEFINER 28 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -378,7 +378,7 @@ def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL N def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select -def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema TRIGGERS DEFINER 19 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) select def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -417,7 +417,7 @@ def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select -def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema VIEWS DEFINER 7 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) select def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select @@ -570,7 +570,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi 3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema EVENTS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8) 1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext @@ -767,7 +767,7 @@ NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime 3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) 1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext -3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema ROUTINES DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -866,7 +866,7 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint( 3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime 3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) -3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema TRIGGERS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -903,7 +903,7 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL 1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8) 3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3) -3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema VIEWS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7) 3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 1fe4e2ebeb6..66c0f1c0622 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -89,7 +89,7 @@ def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NUL def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL 0 NULL NULL datetime def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema EVENTS DEFINER 4 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -268,7 +268,7 @@ def information_schema ROUTINES CREATED 24 0000-00-00 00:00:00 NO datetime NULL def information_schema ROUTINES DATABASE_COLLATION 31 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned -def information_schema ROUTINES DEFINER 28 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema ROUTINES DEFINER 28 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -379,7 +379,7 @@ def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL N def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema TRIGGERS DEFINER 19 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -418,7 +418,7 @@ def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema VIEWS DEFINER 7 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) @@ -575,7 +575,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi 3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema EVENTS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8) 1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext @@ -772,7 +772,7 @@ NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime 3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) 1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext -3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema ROUTINES DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -871,7 +871,7 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint( 3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime 3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) -3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema TRIGGERS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -908,7 +908,7 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL 1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8) 3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3) -3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema VIEWS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7) 3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 36c11c15c95..3e128da635d 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -81,7 +81,7 @@ def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL b def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI select,insert,update,references def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references -def mysql help_category url 4 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references +def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text select,insert,update,references def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references @@ -91,7 +91,7 @@ def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8 def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references -def mysql help_topic url 6 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references +def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text select,insert,update,references def mysql host Alter_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql host Create_priv 7 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -400,7 +400,7 @@ NULL mysql gtid_slave_pos seq_no bigint NULL NULL NULL NULL bigint(20) unsigned NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned -3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned 3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned @@ -410,7 +410,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text 1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text -3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text 3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index badf5a6811c..cea4fedbe40 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -81,7 +81,7 @@ def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL b def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned -def mysql help_category url 4 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128) +def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI @@ -91,7 +91,7 @@ def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8 def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) UNI -def mysql help_topic url 6 NULL NO char 128 384 NULL NULL NULL utf8 utf8_general_ci char(128) +def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_general_ci text def mysql host Alter_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql host Create_priv 7 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -400,7 +400,7 @@ NULL mysql gtid_slave_pos seq_no bigint NULL NULL NULL NULL bigint(20) unsigned NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned -3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned 3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned @@ -410,7 +410,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text 1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text -3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text 3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result index 7115b57fe47..79f60821347 100644 --- a/mysql-test/suite/funcs_1/r/is_events.result +++ b/mysql-test/suite/funcs_1/r/is_events.result @@ -31,7 +31,7 @@ Field Type Null Key Default Extra EVENT_CATALOG varchar(64) NO EVENT_SCHEMA varchar(64) NO EVENT_NAME varchar(64) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO TIME_ZONE varchar(64) NO EVENT_BODY varchar(8) NO EVENT_DEFINITION longtext NO NULL @@ -58,7 +58,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` ( `EVENT_CATALOG` varchar(64) NOT NULL DEFAULT '', `EVENT_SCHEMA` varchar(64) NOT NULL DEFAULT '', `EVENT_NAME` varchar(64) NOT NULL DEFAULT '', - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `TIME_ZONE` varchar(64) NOT NULL DEFAULT '', `EVENT_BODY` varchar(8) NOT NULL DEFAULT '', `EVENT_DEFINITION` longtext NOT NULL, @@ -85,7 +85,7 @@ Field Type Null Key Default Extra EVENT_CATALOG varchar(64) NO EVENT_SCHEMA varchar(64) NO EVENT_NAME varchar(64) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO TIME_ZONE varchar(64) NO EVENT_BODY varchar(8) NO EVENT_DEFINITION longtext NO NULL diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result index a1aa40a59c3..a062e2d7b8f 100644 --- a/mysql-test/suite/funcs_1/r/is_routines.result +++ b/mysql-test/suite/funcs_1/r/is_routines.result @@ -55,7 +55,7 @@ CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO ROUTINE_COMMENT longtext NO NULL -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO @@ -89,7 +89,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', `ROUTINE_COMMENT` longtext NOT NULL, - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -123,7 +123,7 @@ CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO ROUTINE_COMMENT longtext NO NULL -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result index fbbfc8cc0bc..c113e6d7fce 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result @@ -179,7 +179,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result index 637dcd7539e..10cdbe7a88c 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result @@ -179,7 +179,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -839,7 +839,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result index 8f07bca408a..53bb54aa0f2 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers.result +++ b/mysql-test/suite/funcs_1/r/is_triggers.result @@ -46,7 +46,7 @@ ACTION_REFERENCE_OLD_ROW varchar(3) NO ACTION_REFERENCE_NEW_ROW varchar(3) NO CREATED datetime YES NULL SQL_MODE varchar(8192) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO @@ -71,7 +71,7 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '', `CREATED` datetime DEFAULT NULL, `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -96,7 +96,7 @@ ACTION_REFERENCE_OLD_ROW varchar(3) NO ACTION_REFERENCE_NEW_ROW varchar(3) NO CREATED datetime YES NULL SQL_MODE varchar(8192) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result index 73d46b4d627..ebb0e1ac091 100644 --- a/mysql-test/suite/funcs_1/r/is_views.result +++ b/mysql-test/suite/funcs_1/r/is_views.result @@ -34,7 +34,7 @@ TABLE_NAME varchar(64) NO VIEW_DEFINITION longtext NO NULL CHECK_OPTION varchar(8) NO IS_UPDATABLE varchar(3) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO SECURITY_TYPE varchar(7) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO @@ -47,7 +47,7 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` ( `VIEW_DEFINITION` longtext NOT NULL, `CHECK_OPTION` varchar(8) NOT NULL DEFAULT '', `IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '', - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '' @@ -60,7 +60,7 @@ TABLE_NAME varchar(64) NO VIEW_DEFINITION longtext NO NULL CHECK_OPTION varchar(8) NO IS_UPDATABLE varchar(3) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO SECURITY_TYPE varchar(7) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO diff --git a/mysql-test/suite/handler/disconnect_4480.result b/mysql-test/suite/handler/disconnect_4480.result new file mode 100644 index 00000000000..d0a67c72c05 --- /dev/null +++ b/mysql-test/suite/handler/disconnect_4480.result @@ -0,0 +1,5 @@ +create temporary table t1 as select 1; +handler t1 open; +handler t1 read next; +1 +1 diff --git a/mysql-test/suite/handler/disconnect_4480.test b/mysql-test/suite/handler/disconnect_4480.test new file mode 100644 index 00000000000..507249bd8bc --- /dev/null +++ b/mysql-test/suite/handler/disconnect_4480.test @@ -0,0 +1,10 @@ +# +# MDEV-4480 Assertion `inited == NONE' fails on closing a connection with open handler on temporary table +# + +--connect (con1,localhost,root,,) +create temporary table t1 as select 1; +handler t1 open; +handler t1 read next; +--disconnect con1 + diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result index a8756a4a6f1..9552580bb88 100644 --- a/mysql-test/suite/maria/icp.result +++ b/mysql-test/suite/maria/icp.result @@ -213,7 +213,7 @@ c-1006=w EXPLAIN SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 range c1 c1 12 NULL 2 Using index condition; Using where +1 SIMPLE t3 range c1 c1 12 NULL 2 Using where SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2; c1 EXPLAIN @@ -857,5 +857,32 @@ insert into t1 values ('',1); select 1 from t1 where b <= 1 and a <> ''; 1 drop table t1; +# +# MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column +# +CREATE TABLE t1 ( +c1 TEXT , +c2 VARCHAR(2) , +INDEX idx1 (c2,c1(2)), +INDEX idx2 (c2,c1(1)) +); +INSERT INTO t1 (c1,c2) VALUES ('aa','x'), ('a' ,'y'); +SELECT * FROM t1 IGNORE INDEX(idx1,idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +EXPLAIN +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range idx1 idx1 10 NULL 2 Using where +SELECT * FROM t1 FORCE INDEX(idx1) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +SELECT * FROM t1 FORCE INDEX(idx2) WHERE (c1='aa' AND c2='x') OR (c1='a' AND c2='y'); +c1 c2 +aa x +a y +DROP TABLE t1; set storage_engine= @save_storage_engine; set optimizer_switch=@maria_icp_tmp; diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 189329fe5c8..2aad2f5cc75 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -312,7 +312,7 @@ aria_log_file_size 4294959104 aria_log_purge_type immediate aria_max_sort_file_size 9223372036853727232 aria_pagecache_age_threshold 300 -aria_pagecache_buffer_size 134217728 +aria_pagecache_buffer_size 8388608 aria_pagecache_division_limit 100 aria_page_checksum OFF aria_recover NORMAL diff --git a/mysql-test/suite/plugins/r/audit_null.result b/mysql-test/suite/plugins/r/audit_null.result index 5b657f98b83..07bc5b787c7 100644 --- a/mysql-test/suite/plugins/r/audit_null.result +++ b/mysql-test/suite/plugins/r/audit_null.result @@ -44,6 +44,7 @@ insert t2 values ('2020-10-09'); select * from t2; a 2020-10-09 +alter table t2 add column b int; drop table t2; explain select distinct * from t2; id select_type table type possible_keys key key_len ref rows Extra @@ -80,8 +81,8 @@ root[root] @ localhost [] mysql.table_stats : write root[root] @ localhost [] mysql.column_stats : write root[root] @ localhost [] mysql.index_stats : write root[root] @ localhost [] >> alter table t2 add column b int -root[root] @ localhost [] test.t2 : alter root[root] @ localhost [] test.t2 : read +root[root] @ localhost [] test.t2 : alter root[root] @ localhost [] >> create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy root[root] @ localhost [] test.t2 : read root[root] @ localhost [] test.t2 : read @@ -92,6 +93,7 @@ root[root] @ localhost [] >> drop view v1 root[root] @ localhost [] >> create temporary table t2 (a date) root[root] @ localhost [] >> insert t2 values ('2020-10-09') root[root] @ localhost [] >> select * from t2 +root[root] @ localhost [] >> alter table t2 add column b int root[root] @ localhost [] >> drop table t2 root[root] @ localhost [] >> explain select distinct * from t2 root[root] @ localhost [] test.t2 : read diff --git a/mysql-test/suite/plugins/r/fulltext_plugin.result b/mysql-test/suite/plugins/r/fulltext_plugin.result index 69ebbe07e9e..2c104c98676 100644 --- a/mysql-test/suite/plugins/r/fulltext_plugin.result +++ b/mysql-test/suite/plugins/r/fulltext_plugin.result @@ -3,3 +3,5 @@ CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser); ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser; DROP TABLE t1; UNINSTALL PLUGIN simple_parser; +show status like 'a%status'; +Variable_name Value diff --git a/mysql-test/suite/plugins/r/pam_cleartext.result b/mysql-test/suite/plugins/r/pam_cleartext.result new file mode 100644 index 00000000000..00e0e94618e --- /dev/null +++ b/mysql-test/suite/plugins/r/pam_cleartext.result @@ -0,0 +1,10 @@ +install plugin pam soname 'auth_pam.so'; +create user test_pam identified via pam using 'mariadb_mtr'; +create user pam_test; +grant proxy on pam_test to test_pam; +show variables like 'pam%'; +Variable_name Value +pam_use_cleartext_plugin ON +drop user test_pam; +drop user pam_test; +uninstall plugin pam; diff --git a/mysql-test/suite/plugins/t/audit_null.test b/mysql-test/suite/plugins/t/audit_null.test index 60883bbe4f9..3e32154ec3d 100644 --- a/mysql-test/suite/plugins/t/audit_null.test +++ b/mysql-test/suite/plugins/t/audit_null.test @@ -38,6 +38,7 @@ drop view v1; create temporary table t2 (a date); insert t2 values ('2020-10-09'); select * from t2; +alter table t2 add column b int; # MDEV-4565 ALTER on a temporary table generates an audit event drop table t2; # internal temp table generates no audit events diff --git a/mysql-test/suite/plugins/t/fulltext_plugin.test b/mysql-test/suite/plugins/t/fulltext_plugin.test index 0e2f53d5b15..e9b4343e0dc 100644 --- a/mysql-test/suite/plugins/t/fulltext_plugin.test +++ b/mysql-test/suite/plugins/t/fulltext_plugin.test @@ -9,3 +9,9 @@ CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser); ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser; DROP TABLE t1; UNINSTALL PLUGIN simple_parser; + +# +# Bug #69682 - mysqld crashes after uninstall of plugin with "first" status var +# +show status like 'a%status'; + diff --git a/mysql-test/suite/plugins/t/pam.test b/mysql-test/suite/plugins/t/pam.test index 68fa349a444..1871e5801a3 100644 --- a/mysql-test/suite/plugins/t/pam.test +++ b/mysql-test/suite/plugins/t/pam.test @@ -1,16 +1,5 @@ ---source include/not_embedded.inc - -if (!$AUTH_PAM_SO) { - skip No pam auth plugin; -} - -eval install plugin pam soname '$AUTH_PAM_SO'; -create user test_pam identified via pam using 'mariadb_mtr'; -create user pam_test; -grant proxy on pam_test to test_pam; - -let $plugindir=`SELECT @@global.plugin_dir`; +--source pam_init.inc --write_file $MYSQLTEST_VARDIR/tmp/pam_good.txt not very secret challenge diff --git a/mysql-test/suite/plugins/t/pam_cleartext.opt b/mysql-test/suite/plugins/t/pam_cleartext.opt new file mode 100644 index 00000000000..aa270885f0e --- /dev/null +++ b/mysql-test/suite/plugins/t/pam_cleartext.opt @@ -0,0 +1 @@ +--loose-pam-use-cleartext-plugin diff --git a/mysql-test/suite/plugins/t/pam_cleartext.test b/mysql-test/suite/plugins/t/pam_cleartext.test new file mode 100644 index 00000000000..e80cff5f476 --- /dev/null +++ b/mysql-test/suite/plugins/t/pam_cleartext.test @@ -0,0 +1,12 @@ + +--source pam_init.inc + +show variables like 'pam%'; + +--error 1 +--exec echo FAIL | $MYSQL_TEST -u test_pam --plugin-dir=$plugindir + +drop user test_pam; +drop user pam_test; +uninstall plugin pam; + diff --git a/mysql-test/suite/plugins/t/pam_init.inc b/mysql-test/suite/plugins/t/pam_init.inc new file mode 100644 index 00000000000..281666d51a6 --- /dev/null +++ b/mysql-test/suite/plugins/t/pam_init.inc @@ -0,0 +1,14 @@ + +--source include/not_embedded.inc + +if (!$AUTH_PAM_SO) { + skip No pam auth plugin; +} + +eval install plugin pam soname '$AUTH_PAM_SO'; +create user test_pam identified via pam using 'mariadb_mtr'; +create user pam_test; +grant proxy on pam_test to test_pam; + +let $plugindir=`SELECT @@global.plugin_dir`; + diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result index c34021b1fef..538592f0d43 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result @@ -33,5 +33,5 @@ SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result index aafd3c8bb5d..c2e7968aa38 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev382.result +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -313,7 +313,7 @@ CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; TRUNCATE `t``1`; -ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `INNODB_FOREIGN_KEY_NAME` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```)) +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `t``2_ibfk_1` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```)) DROP TABLE `t``2`; DROP TABLE `t``1`; *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test index 1fe9283ef44..b9dffa3fb80 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test @@ -44,7 +44,7 @@ SELECT COUNT(*) FROM mysqltest.t1; # Cleanup connection master; DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; sync_slave_with_master; # End of test diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test index d6e799d674c..784617bd198 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev382.test +++ b/mysql-test/suite/rpl/t/rpl_mdev382.test @@ -182,7 +182,6 @@ use `db1``; select 'oops!'`; CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; ---replace_regex /t@[0-9]+_ibfk_[0-9]+/INNODB_FOREIGN_KEY_NAME/ --error ER_TRUNCATE_ILLEGAL_FK TRUNCATE `t``1`; DROP TABLE `t``2`; diff --git a/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result index 5f481b0b134..94835829275 100644 --- a/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result @@ -1,20 +1,20 @@ select @@global.aria_pagecache_buffer_size; @@global.aria_pagecache_buffer_size -134217728 +8388608 select @@session.aria_pagecache_buffer_size; ERROR HY000: Variable 'aria_pagecache_buffer_size' is a GLOBAL variable show global variables like 'aria_pagecache_buffer_size'; Variable_name Value -aria_pagecache_buffer_size 134217728 +aria_pagecache_buffer_size 8388608 show session variables like 'aria_pagecache_buffer_size'; Variable_name Value -aria_pagecache_buffer_size 134217728 +aria_pagecache_buffer_size 8388608 select * from information_schema.global_variables where variable_name='aria_pagecache_buffer_size'; VARIABLE_NAME VARIABLE_VALUE -ARIA_PAGECACHE_BUFFER_SIZE 134217728 +ARIA_PAGECACHE_BUFFER_SIZE 8388608 select * from information_schema.session_variables where variable_name='aria_pagecache_buffer_size'; VARIABLE_NAME VARIABLE_VALUE -ARIA_PAGECACHE_BUFFER_SIZE 134217728 +ARIA_PAGECACHE_BUFFER_SIZE 8388608 set global aria_pagecache_buffer_size=1; ERROR HY000: Variable 'aria_pagecache_buffer_size' is a read only variable set session aria_pagecache_buffer_size=1; diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result index 915a2383435..d83caffb5be 100644 --- a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic.result @@ -59,7 +59,7 @@ Warnings: Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950' SELECT @@global.binlog_cache_size; @@global.binlog_cache_size -42949668864 +max_binlog_cache_size 'Bug: Errors are not coming on assigning invalid values to variable' SET @@global.binlog_cache_size = ON; ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result index 8f1e519dab4..94519d3cd23 100644 --- a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic.result @@ -59,7 +59,7 @@ Warnings: Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950' SELECT @@global.binlog_stmt_cache_size; @@global.binlog_stmt_cache_size -42949668864 +max_binlog_cache_size 'Bug: Errors are not coming on assigning invalid values to variable' SET @@global.binlog_stmt_cache_size = ON; ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result index b332d01f900..1b8e000ad81 100644 --- a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic.result @@ -64,7 +64,7 @@ SELECT @@session.bulk_insert_buffer_size; SET @@global.bulk_insert_buffer_size = 42949672950; SELECT @@global.bulk_insert_buffer_size; @@global.bulk_insert_buffer_size -42949672950 +max_bulk_insert_buffer_size SET @@global.bulk_insert_buffer_size = -1024; Warnings: Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-1024' @@ -80,7 +80,7 @@ ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' SET @@session.bulk_insert_buffer_size = 42949672950; SELECT @@session.bulk_insert_buffer_size; @@session.bulk_insert_buffer_size -42949672950 +max_bulk_insert_buffer_size SET @@session.bulk_insert_buffer_size = -2; Warnings: Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '-2' diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result index fda265910f9..2aa8b7dd80a 100644 --- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result @@ -73,17 +73,18 @@ Warnings: Warning 1292 Truncated incorrect join_buffer_size value: '42949672951' SELECT @@global.join_buffer_size; @@global.join_buffer_size -42949672832 +max_join_buffer_size +SET @@global.join_buffer_size = 1024*1024; SET @@global.join_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'join_buffer_size' SELECT @@global.join_buffer_size; @@global.join_buffer_size -42949672832 +1048576 SET @@global.join_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'join_buffer_size' SELECT @@global.join_buffer_size; @@global.join_buffer_size -42949672832 +1048576 SET @@session.join_buffer_size = 0; Warnings: Warning 1292 Truncated incorrect join_buffer_size value: '0' @@ -107,17 +108,18 @@ Warnings: Warning 1292 Truncated incorrect join_buffer_size value: '42949672951' SELECT @@session.join_buffer_size; @@session.join_buffer_size -42949672832 +max_join_buffer_size +SET @@session.join_buffer_size = 1024*1024; SET @@session.join_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'join_buffer_size' SELECT @@session.join_buffer_size; @@session.join_buffer_size -42949672832 +1048576 SET @@session.join_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'join_buffer_size' SELECT @@session.join_buffer_size; @@session.join_buffer_size -42949672832 +1048576 '#------------------FN_DYNVARS_053_06-----------------------#' SELECT @@global.join_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result index bb7492ee7ef..d6a7487c162 100644 --- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@global.max_binlog_cache_size; SELECT @start_value; @start_value -18446744073709547520 +max_binlog_cache_size '#--------------------FN_DYNVARS_072_01------------------------#' SET @@global.max_binlog_cache_size = 5000; Warnings: @@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_binlog_cache_size value: '5000' SET @@global.max_binlog_cache_size = DEFAULT; SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -18446744073709547520 +max_binlog_cache_size '#---------------------FN_DYNVARS_072_02-------------------------#' SET @@global.max_binlog_cache_size = @start_value; SELECT @@global.max_binlog_cache_size = 4294967295; @@ -56,12 +56,13 @@ Warnings: Warning 1292 Truncated incorrect max_binlog_cache_size value: '100000000000' SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -99999997952 +max_binlog_cache_size +SET @@global.max_binlog_cache_size = 1024*1024; SET @@global.max_binlog_cache_size = 10000.01; ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -99999997952 +1048576 SET @@global.max_binlog_cache_size = -1024; Warnings: Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1024' @@ -77,7 +78,7 @@ SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = 4294967296; SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -4294967296 +max_binlog_cache_size SET @@global.max_binlog_cache_size = 4095; Warnings: Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095' @@ -149,4 +150,4 @@ ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list' SET @@global.max_binlog_cache_size = @start_value; SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -18446744073709547520 +max_binlog_cache_size diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result index 0b2db8eef69..98e595cc4c3 100644 --- a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@global.max_binlog_stmt_cache_size; SELECT @start_value; @start_value -18446744073709547520 +max_binlog_stmt_cache_size '#--------------------FN_DYNVARS_072_01------------------------#' SET @@global.max_binlog_stmt_cache_size = 5000; Warnings: @@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000' SET @@global.max_binlog_stmt_cache_size = DEFAULT; SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -18446744073709547520 +max_binlog_stmt_cache_size '#---------------------FN_DYNVARS_072_02-------------------------#' SET @@global.max_binlog_stmt_cache_size = @start_value; SELECT @@global.max_binlog_stmt_cache_size = 4294967295; @@ -56,12 +56,13 @@ Warnings: Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '100000000000' SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -99999997952 +max_binlog_stmt_cache_size +SET @@global.max_binlog_stmt_cache_size = 1024*1024; SET @@global.max_binlog_stmt_cache_size = 10000.01; ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size' SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -99999997952 +1048576 SET @@global.max_binlog_stmt_cache_size = -1024; Warnings: Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1024' @@ -77,7 +78,7 @@ SELECT @@global.max_binlog_stmt_cache_size; SET @@global.max_binlog_stmt_cache_size = 4294967296; SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -4294967296 +max_binlog_stmt_cache_size SET @@global.max_binlog_stmt_cache_size = 4095; Warnings: Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4095' @@ -149,4 +150,4 @@ ERROR 42S22: Unknown column 'max_binlog_stmt_cache_size' in 'field list' SET @@global.max_binlog_stmt_cache_size = @start_value; SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -18446744073709547520 +max_binlog_stmt_cache_size diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result index b492a343a9b..04e1514dd13 100644 --- a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic.result @@ -66,17 +66,18 @@ SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = 4294967296; SELECT @@global.sort_buffer_size; @@global.sort_buffer_size -4294967296 +max_sort_buffer_size +SET @@global.sort_buffer_size = 1024*1024; SET @@global.sort_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' SELECT @@global.sort_buffer_size; @@global.sort_buffer_size -4294967296 +1048576 SET @@global.sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' SELECT @@global.sort_buffer_size; @@global.sort_buffer_size -4294967296 +1048576 SET @@session.sort_buffer_size = 32775; SELECT @@session.sort_buffer_size; @@session.sort_buffer_size @@ -87,10 +88,10 @@ SELECT @@session.sort_buffer_size; 1024 SET @@session.sort_buffer_size = 65530.34; ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' -SET @@session.sort_buffer_size = 4294967296; +SET @@session.sort_buffer_size = 4294967295; SELECT @@session.sort_buffer_size; @@session.sort_buffer_size -4294967296 +4294967295 SET @@session.sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' '#------------------FN_DYNVARS_151_06-----------------------#' diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test index 323e19c4d66..57822ef0b48 100644 --- a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test +++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic.test @@ -81,6 +81,7 @@ SET @@global.binlog_cache_size = 10000.01; SET @@global.binlog_cache_size = -1024; SELECT @@global.binlog_cache_size; SET @@global.binlog_cache_size = 42949672950; +--replace_result 4294963200 max_binlog_cache_size 42949668864 max_binlog_cache_size SELECT @@global.binlog_cache_size; echo 'Bug: Errors are not coming on assigning invalid values to variable'; diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test index f5df54b7acd..ecde1723c11 100644 --- a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test +++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic.test @@ -81,6 +81,7 @@ SET @@global.binlog_stmt_cache_size = 10000.01; SET @@global.binlog_stmt_cache_size = -1024; SELECT @@global.binlog_stmt_cache_size; SET @@global.binlog_stmt_cache_size = 42949672950; +--replace_result 4294963200 max_binlog_cache_size 42949668864 max_binlog_cache_size SELECT @@global.binlog_stmt_cache_size; echo 'Bug: Errors are not coming on assigning invalid values to variable'; diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test index a9580028c7e..5796db32565 100644 --- a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic.test @@ -99,7 +99,10 @@ SELECT @@session.bulk_insert_buffer_size; # Change the value of bulk_insert_buffer_size to an invalid value # ################################################################### +--disable_warnings SET @@global.bulk_insert_buffer_size = 42949672950; +--enable_warnings +--replace_result 4294967295 max_bulk_insert_buffer_size 42949672950 max_bulk_insert_buffer_size SELECT @@global.bulk_insert_buffer_size; SET @@global.bulk_insert_buffer_size = -1024; SELECT @@global.bulk_insert_buffer_size; @@ -111,7 +114,10 @@ SET @@global.bulk_insert_buffer_size = ON; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.bulk_insert_buffer_size = 429496.10; +--disable_warnings SET @@session.bulk_insert_buffer_size = 42949672950; +--enable_warnings +--replace_result 4294967295 max_bulk_insert_buffer_size 42949672950 max_bulk_insert_buffer_size SELECT @@session.bulk_insert_buffer_size; SET @@session.bulk_insert_buffer_size = -2; SELECT @@session.bulk_insert_buffer_size; diff --git a/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test index 618b70f3ac3..6ebaa14ab92 100644 --- a/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/join_buffer_size_basic.test @@ -88,7 +88,9 @@ SELECT @@global.join_buffer_size; SET @@global.join_buffer_size = 127; SELECT @@global.join_buffer_size; SET @@global.join_buffer_size = 42949672951; +--replace_result 42949672832 max_join_buffer_size 4294967168 max_join_buffer_size SELECT @@global.join_buffer_size; +SET @@global.join_buffer_size = 1024*1024; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.join_buffer_size = 65530.34; @@ -104,7 +106,9 @@ SELECT @@session.join_buffer_size; SET @@session.join_buffer_size = 127; SELECT @@session.join_buffer_size; SET @@session.join_buffer_size = 42949672951; +--replace_result 42949672832 max_join_buffer_size 4294967168 max_join_buffer_size SELECT @@session.join_buffer_size; +SET @@session.join_buffer_size = 1024*1024; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.join_buffer_size = 65530.34; diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test index 158c21a9489..710299f053c 100644 --- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test +++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic.test @@ -38,6 +38,7 @@ ######################################################################## SET @start_value = @@global.max_binlog_cache_size; +--replace_result 18446744073709547520 max_binlog_cache_size 4294963200 max_binlog_cache_size SELECT @start_value; @@ -48,6 +49,7 @@ SELECT @start_value; SET @@global.max_binlog_cache_size = 5000; SET @@global.max_binlog_cache_size = DEFAULT; +--replace_result 18446744073709547520 max_binlog_cache_size 4294963200 max_binlog_cache_size SELECT @@global.max_binlog_cache_size; @@ -84,7 +86,9 @@ SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = -1; SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = 100000000000; +--replace_result 99999997952 max_binlog_cache_size 4294963200 max_binlog_cache_size SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 1024*1024; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_binlog_cache_size = 10000.01; SELECT @@global.max_binlog_cache_size; @@ -92,7 +96,10 @@ SET @@global.max_binlog_cache_size = -1024; SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = 1024; SELECT @@global.max_binlog_cache_size; +--disable_warnings SET @@global.max_binlog_cache_size = 4294967296; +--enable_warnings +--replace_result 4294963200 max_binlog_cache_size 4294967296 max_binlog_cache_size SELECT @@global.max_binlog_cache_size; SET @@global.max_binlog_cache_size = 4095; SELECT @@global.max_binlog_cache_size; @@ -175,6 +182,7 @@ SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; ############################## SET @@global.max_binlog_cache_size = @start_value; +--replace_result 4294963200 max_binlog_cache_size 18446744073709547520 max_binlog_cache_size SELECT @@global.max_binlog_cache_size; diff --git a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test index 07a030c35a7..3c2f6f6d391 100644 --- a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test +++ b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test @@ -39,6 +39,7 @@ ############################################################################## SET @start_value = @@global.max_binlog_stmt_cache_size; +--replace_result 18446744073709547520 max_binlog_stmt_cache_size 4294963200 max_binlog_stmt_cache_size SELECT @start_value; @@ -49,6 +50,7 @@ SELECT @start_value; SET @@global.max_binlog_stmt_cache_size = 5000; SET @@global.max_binlog_stmt_cache_size = DEFAULT; +--replace_result 18446744073709547520 max_binlog_stmt_cache_size 4294963200 max_binlog_stmt_cache_size SELECT @@global.max_binlog_stmt_cache_size; @@ -85,7 +87,9 @@ SELECT @@global.max_binlog_stmt_cache_size; SET @@global.max_binlog_stmt_cache_size = -1; SELECT @@global.max_binlog_stmt_cache_size; SET @@global.max_binlog_stmt_cache_size = 100000000000; +--replace_result 99999997952 max_binlog_stmt_cache_size 4294963200 max_binlog_stmt_cache_size SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 1024*1024; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.max_binlog_stmt_cache_size = 10000.01; SELECT @@global.max_binlog_stmt_cache_size; @@ -93,7 +97,10 @@ SET @@global.max_binlog_stmt_cache_size = -1024; SELECT @@global.max_binlog_stmt_cache_size; SET @@global.max_binlog_stmt_cache_size = 1024; SELECT @@global.max_binlog_stmt_cache_size; +--disable_warnings SET @@global.max_binlog_stmt_cache_size = 4294967296; +--enable_warnings +--replace_result 4294963200 max_binlog_stmt_cache_size 4294967296 max_binlog_stmt_cache_size SELECT @@global.max_binlog_stmt_cache_size; SET @@global.max_binlog_stmt_cache_size = 4095; SELECT @@global.max_binlog_stmt_cache_size; @@ -176,6 +183,7 @@ SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size; ############################## SET @@global.max_binlog_stmt_cache_size = @start_value; +--replace_result 4294963200 max_binlog_stmt_cache_size 18446744073709547520 max_binlog_stmt_cache_size SELECT @@global.max_binlog_stmt_cache_size; diff --git a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test index a88ad65a076..cf3a13dea94 100644 --- a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic.test @@ -120,7 +120,10 @@ SET @@global.sort_buffer_size = -1024; eval SELECT @@global.sort_buffer_size; SET @@global.sort_buffer_size = 4294967296; +--replace_result 4294967296 max_sort_buffer_size 4294967295 max_sort_buffer_size SELECT @@global.sort_buffer_size; +SET @@global.sort_buffer_size = 1024*1024; + --Error ER_WRONG_TYPE_FOR_VAR SET @@global.sort_buffer_size = 65530.34; SELECT @@global.sort_buffer_size; @@ -136,7 +139,7 @@ eval SELECT @@session.sort_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.sort_buffer_size = 65530.34; -SET @@session.sort_buffer_size = 4294967296; +SET @@session.sort_buffer_size = 4294967295; SELECT @@session.sort_buffer_size; --Error ER_WRONG_TYPE_FOR_VAR diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 14467b2d630..4929eabb2e9 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -187,7 +187,11 @@ ts TIMESTAMP, tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL ) ENGINE=MyISAM; INSERT INTO t1 (tsv) VALUES (DEFAULT); +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT); +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' FLUSH TABLES; SELECT COUNT(*) FROM t1; COUNT(*) diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 64e8225530b..b7630348c93 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -450,3 +450,6 @@ drop table t1; # SELECT CAST(TIME('10:20:30') AS DATE) + INTERVAL 1 DAY; +SET SQL_MODE=ALLOW_INVALID_DATES; +SELECT DATE("foo"); + diff --git a/mysql-test/t/fulltext_derived_4257.test b/mysql-test/t/fulltext_derived_4257.test new file mode 100644 index 00000000000..07626b8b557 --- /dev/null +++ b/mysql-test/t/fulltext_derived_4257.test @@ -0,0 +1,6 @@ +set optimizer_switch = 'derived_merge=on'; +create table t1 (c1 char(8), c2 char(8)) engine=myisam; +insert into t1 values ('test1','test2'),('test3','test4'); +select * from (select c1 from t1 where match (c2) against ('hello' in boolean mode)) as alias; +drop table t1; + diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 7a72c21d0ff..6f9359e6095 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1186,3 +1186,11 @@ SELECT 1 FROM DUAL WHERE DAYOFMONTH(TIMEDIFF(NULL, '12:12:12')); SELECT 1 FROM DUAL WHERE HOUR(TIMEDIFF(NULL, '12:12:12')); SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12')); SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12')); + + +--echo # +--echo # MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y')) +--echo # +SET TIME_ZONE='+02:00'; +SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y')); +SET TIME_ZONE=DEFAULT; diff --git a/mysql-test/t/grant_4332.test b/mysql-test/t/grant_4332.test index f77d3be350f..302624e3873 100644 --- a/mysql-test/t/grant_4332.test +++ b/mysql-test/t/grant_4332.test @@ -58,16 +58,38 @@ select user from mysql.tables_priv; --error ER_COLUMNACCESS_DENIED_ERROR select user,host from mysql.tables_priv; +--error ER_DBACCESS_DENIED_ERROR +use mtr; + +--error ER_PROCACCESS_DENIED_ERROR +drop procedure mtr.add_suppression; + create procedure test.p1() select user(), current_user(), user from mysql.tables_priv; show create procedure test.p1; +select definer from information_schema.routines; + create table test.t1 (a text); create event e1 on schedule every 1 second do insert test.t1 values (concat(user(), ' ', current_user())); +select definer from information_schema.events; + +create view v1 as select * from t1; +select definer from information_schema.views; +drop view v1; + +create trigger tr1 before delete on t1 for each row set @a:=1; +select definer from information_schema.triggers; +drop trigger tr1; + connection default; +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_ACCESS_DENIED_ERROR +connect (c80bad,localhost,c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0,foobar,); + call test.p1(); disconnect a17; diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index 82097c53fe0..034da4eb925 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -1400,3 +1400,50 @@ explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; drop table t1; --echo # End of test#50539. + +--echo # +--echo # MDEV-4219 A simple select query returns random data (upstream bug#68473) +--echo # + +--disable_warnings +drop table if exists faulty; +--enable_warnings + +# MySQL's test case + +CREATE TABLE faulty ( +a int(11) unsigned NOT NULL AUTO_INCREMENT, +b int(11) unsigned NOT NULL, +c datetime NOT NULL, +PRIMARY KEY (a), +UNIQUE KEY b_and_c (b,c) +); + +INSERT INTO faulty (b, c) VALUES +(1801, '2013-02-15 09:00:00'), +(1802, '2013-02-28 09:00:00'), +(1802, '2013-03-01 09:00:00'), +(5, '1990-02-15 09:00:00'), +(5, '2013-02-15 09:00:00'), +(5, '2009-02-15 17:00:00'); + +EXPLAIN +SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c; +SELECT DISTINCT b, c FROM faulty WHERE b='1802' ORDER BY c; + +drop table faulty; + +# MariaDB test case + +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3); +INSERT INTO t1 SELECT a + 1, b FROM t1; +INSERT INTO t1 SELECT a + 2, b FROM t1; + +CREATE INDEX break_it ON t1 (a, b); + +EXPLAIN +SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; +SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; + +drop table t1; diff --git a/mysql-test/t/index_merge_myisam.test b/mysql-test/t/index_merge_myisam.test index 614c6595d61..07f83fa6713 100644 --- a/mysql-test/t/index_merge_myisam.test +++ b/mysql-test/t/index_merge_myisam.test @@ -149,5 +149,32 @@ GROUP BY 2; DROP TABLE t1,t2,t3; +--echo # +--echo # MDEV-4556 Server crashes in SEL_ARG::rb_insert with index_merge+index_merge_sort_union, FORCE INDEX +--echo # +CREATE TABLE t1 ( + pk int, + code char(2), + population_rate int, + area_rate int, + primary key (pk), + index (code), + key (population_rate), + key (area_rate) +); + +INSERT INTO t1 VALUES (1,'WI',20, 23), (2, 'WA', 13, 18); + +EXPLAIN +SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code ) +WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL ) +AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX'); + +SELECT * FROM t1 FORCE INDEX ( PRIMARY, population_rate, area_rate, code ) +WHERE pk = 1 OR population_rate = 1 OR ( area_rate IN ( 1,2 ) OR area_rate IS NULL ) +AND (population_rate = 25 OR area_rate BETWEEN 2 AND 25 OR code BETWEEN 'MA' AND 'TX'); + +DROP TABLE t1; + set optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 33289f77c13..73b40715676 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -1135,6 +1135,13 @@ SET optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2,t3,t4,t5; +--echo # +--echo # MDEV-4752: Segfault during parsing of illegal query +--echo # +--error ER_PARSE_ERROR +SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4); + + SET optimizer_switch=@save_optimizer_switch; --echo # diff --git a/mysql-test/t/mrr_derived_crash_4610.test b/mysql-test/t/mrr_derived_crash_4610.test new file mode 100644 index 00000000000..88882b57cf7 --- /dev/null +++ b/mysql-test/t/mrr_derived_crash_4610.test @@ -0,0 +1,16 @@ +# +# MDEV-4610 SQL query crashes MariaDB with derived_with_keys +# +--source include/have_innodb.inc +create table t1 (f1 char(4) primary key) engine=innodb charset=utf8 ; +insert into t1 values ('aaaa'); +create table t2 (f2 text, f3 char(4) not null) engine=innodb charset=utf8 ; +create table t3 (id int not null) engine=innodb charset=utf8 ; +create table t4 (val int not null) engine=innodb charset=utf8; +explain select 1 from + (select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top + join t1 on f1 = f3 where f3 = 'aaaa' order by val; +select 1 from + (select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top + join t1 on f1 = f3 where f3 = 'aaaa' order by val; +drop table t1, t2, t3, t4; diff --git a/mysql-test/t/mysql_binary_mode.test b/mysql-test/t/mysql_binary_mode.test new file mode 100644 index 00000000000..d454bfb7624 --- /dev/null +++ b/mysql-test/t/mysql_binary_mode.test @@ -0,0 +1,169 @@ +source include/have_binlog_format_mixed_or_statement.inc; +RESET MASTER; + +--echo # Bug#33048 Not able to recover binary/blob data correctly using mysqlbinlog +--echo # -------------------------------------------------------------------------- +--echo # The test verify that 0x00 and 0x0D0A sequence can be handled correctly by +--echo # mysql +--echo + +# zero => 0x00, newline => 0x0D0A, A => 0x41, B => 0x42 + +# 0x410D0A42 => 'A\r\nB' +let $table_name_right= `SELECT 0x410D0A42`; + +# 0x410A42 => 'A\nB' +let $table_name_wrong= `SELECT 0x410A42`; + +# 0x410042 => 'A\0B' +let $char0= `SELECT 0x410042`; + +eval CREATE TABLE `$table_name_right` (c1 CHAR(100)); + +--echo # It is a faked statement. ASCII 0 is in the original statement, it would +--echo # make the test result to become a binary file which was difficult to get +--echo # the diff result if the original query was logged in the result. +--echo INSERT INTO `A\r\nB` VALUES("A\0B"); +--echo +--disable_query_log +eval INSERT INTO `$table_name_right` VALUES("$char0"); +--enable_query_log + +let $char0= $table_name_right; +eval INSERT INTO `$table_name_right` VALUES("$char0"); + +eval SELECT HEX(c1) FROM `$table_name_right`; + +--echo +let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); +FLUSH LOGS; +eval DROP TABLE `$table_name_right`; + +--echo +let $MYSQLD_DATADIR= `SELECT @@datadir`; +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQLTEST_VARDIR/tmp/my.sql +RESET MASTER; + +--echo # '--exec mysql ...' without --binary-mode option +--echo # It creates the table with a wrong table name and generates an error. +--echo # (error output was suppressed to make the test case platform agnostic) + +## disabling result log because the error message has the +## table name in the output which is one byte different ('\r') +## on unixes and windows. +--disable_result_log +--error 1 +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/my.sql 2>&1 +--enable_result_log + +--echo +--echo # It is not in binary_mode, so table name '0x410D0A42' can be translated to +--echo # '0x410A42' by mysql depending on the OS - Windows or Unix-like. +--replace_result $table_name_wrong TABLE_NAME_MASKED $table_name_right TABLE_NAME_MASKED +if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) +{ + eval DROP TABLE `$table_name_right`; +} + +if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) +{ + eval DROP TABLE `$table_name_wrong`; +} + +--echo +--echo # In binary_mode, table name '0x410D0A42' and string '0x410042' can be +--echo # handled correctly. +RESET MASTER; +--exec $MYSQL --binary-mode test < $MYSQLTEST_VARDIR/tmp/my.sql +eval SELECT HEX(c1) FROM `$table_name_right`; + +--echo +eval DROP TABLE `$table_name_right`; + +# +# BUG#12794048 - MAIN.MYSQL_BINARY_MODE FAILS ON WINDOWS RELEASE BUILD +# +RESET MASTER; + +# +# This test case tests if the table names and their values +# are handled properly. For that we check +# + +# 0x610D0A62 => 'a\r\nb' +let $tbl= `SELECT 0x610D0A62`; + +--disable_result_log +--disable_query_log + +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + +#### case #1: mysqltest +#### CREATE table and insert value through regular mysqltest session + +--eval CREATE TABLE `$tbl` (c1 CHAR(100)) +--eval INSERT INTO `$tbl` VALUES ("$tbl") + +--let $table_name=`SELECT table_name FROM information_schema.tables WHERE table_schema='test'` +--let $tbl0= `SELECT HEX(table_name) FROM information_schema.tables WHERE table_schema='test'` +--let $val0= `SELECT HEX(c1) FROM `$table_name` LIMIT 1` + +FLUSH LOGS; + +--eval DROP TABLE `$table_name`; + +#### case #2: mysql --binlog-mode=0 +#### Replay through regular mysql client non-interactive mode + +--let $MYSQLD_DATADIR= `SELECT @@datadir` +--let $prefix=`SELECT UUID()` +--let $binlog_uuid_filename= $MYSQLTEST_VARDIR/tmp/$prefix-bin.log +--copy_file $MYSQLD_DATADIR/$binlog_file $binlog_uuid_filename +RESET MASTER; + +--exec $MYSQL_BINLOG $binlog_uuid_filename | $MYSQL + +--let $table_name=`SELECT table_name FROM information_schema.tables WHERE table_schema='test'` +--let $tbl1= `SELECT hex(table_name) FROM information_schema.tables WHERE table_schema='test'` +--let $val1= `SELECT HEX(c1) FROM `$table_name` LIMIT 1` + +--eval DROP TABLE `$table_name`; + +#### case #3: mysql --binlog-mode=1 +#### Replay through regular mysql client non-interactive mode and with binary mode set + +RESET MASTER; +--exec $MYSQL_BINLOG $binlog_uuid_filename | $MYSQL --binary-mode + +--let $table_name=`SELECT table_name FROM information_schema.tables WHERE table_schema='test'` +--let $tbl2= `SELECT hex(table_name) FROM information_schema.tables WHERE table_schema='test'` +--let $val2= `SELECT HEX(c1) FROM `$table_name` LIMIT 1` + +--eval DROP TABLE `$table_name`; + +--enable_result_log +--disable_query_log + +##### OUTCOME + +--let $assert_text= Table and contents created through mysqltest match 0x610D0A62. +--let $assert_cond= "$tbl0" = "610D0A62" AND "$val0" = "610D0A62" +--source include/assert.inc + +--let $assert_text= Table and contents created while replaying binary log without --binary-mode set match 0x61(0D)0A62. +if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) +{ + --let $assert_cond= "$tbl1" = "610D0A62" AND "$val1" = "610D0A62" +} +if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) +{ + --let $assert_cond= "$tbl1" = "610A62" AND "$val1" = "610A62" +} +--source include/assert.inc + +--let $assert_text= Table and contents created while replaying binary log with --binary-mode set match 0x610D0A62. +--let $assert_cond= "$tbl2" = "610D0A62" AND "$val2" = "610D0A62" +--source include/assert.inc + +RESET MASTER; +--remove_file $binlog_uuid_filename diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index 78d439d5d52..2018861b2da 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -49,7 +49,9 @@ DROP USER mysqltest1@'%'; --replace_result $MYSQLTEST_VARDIR var --replace_regex /.*mysqlcheck.*: Got/mysqlcheck: Got/ /\([0-9|-]*\)/(errno)/ --error 1 ---exec $MYSQL_UPGRADE --force --host=not_existing_host 2>&1 +# NC: Added --skip-version-check, as the version check would fail when +# mysql_upgrade tries to get the server version. +--exec $MYSQL_UPGRADE --verbose --force --host=not_existing_host --skip-version-check 2>&1 # # Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 602b2e3c5c9..94030670d9f 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -174,3 +174,24 @@ SET @@SQL_MODE=@OLD_SQL_MODE; # select 1; UNINSTALL PLUGIN example; + +# +# MDEV-4573 UNINSTALL PLUGIN misleading error message for non-dynamic plugins +# +--error ER_PLUGIN_DELETE_BUILTIN +UNINSTALL PLUGIN MyISAM; + +# +# MDEV-4529 Assertion `tmp->state == 4' fails on mix of INSTALL SONAME / UNINSTALL PLUGIN +# + +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +install soname 'ha_example'; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +uninstall plugin example; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +install soname 'ha_example'; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; +uninstall soname 'ha_example'; +select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; + diff --git a/mysql-test/t/processlist.test b/mysql-test/t/processlist.test new file mode 100644 index 00000000000..c7b775cf992 --- /dev/null +++ b/mysql-test/t/processlist.test @@ -0,0 +1,35 @@ +# +# MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647) +# + +source include/have_debug_sync.inc; + +SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time'; +send SELECT 1; + +connect (con1,localhost,root,,); + +SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed'; +send SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL; + +connection default; +reap; +SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed'; + +connection con1; +reap; +connection default; + +# +# MDEV-4683 query start_time not reset when going to sleep +# + +connection con1; +select sleep(5); #run a query that will take some time +connection default; + +# verify that the time in COM_SLEEP doesn't include the query run time +select command, time < 5 from information_schema.processlist where id != connection_id(); + +disconnect con1; + diff --git a/mysql-test/t/sp_missing_4665.test b/mysql-test/t/sp_missing_4665.test new file mode 100644 index 00000000000..19e845e58c7 --- /dev/null +++ b/mysql-test/t/sp_missing_4665.test @@ -0,0 +1,9 @@ +# +# MDEV-4665 crash when referencing missing function in a subquery +# +create table t (a int); +create or replace view v as select 1 from t where a; +--error ER_SP_DOES_NOT_EXIST +delete from v where (select g()); +drop view v; +drop table t; diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index f6080de6c2c..c429e9cfe5b 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -188,13 +188,15 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y')); INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); +# Zero year is not a problem for DATE/DATETIME +INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); +INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); + ## Test INSERT with STR_TO_DATE into DATE # All test cases expected to fail should return # SQLSTATE 22007 <invalid date value> --error 1411 -INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); ---error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -214,8 +216,6 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); # SQLSTATE 22007 <invalid datetime value> --error 1411 -INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); ---error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -234,7 +234,7 @@ INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); # All test cases expected to fail should return # SQLSTATE 22007 <invalid datetime value> ---error 1411 +--error 1292 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); --error 1411 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index fc07a088a15..bd4f3a3c2d8 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -439,4 +439,45 @@ select distinct (1 + (select 1 from `t2` where `a`)) `d2` from `t1`; drop table t1,t2; +--echo # +--echo # MDEV-4042: Assertion `table->key_read == 0' fails in close_thread_table on EXPLAIN with GROUP BY and HAVING in EXISTS SQ, +--echo # MDEV-4536: ...sql/sql_base.cc:1598: bool close_thread_table(THD*, TABLE**): Assertion `table->key_read == 0' failed. +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (b INT PRIMARY KEY, c INT) ENGINE=InnoDB; +CREATE TABLE t3 (d INT) ENGINE=InnoDB; + +EXPLAIN +SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 ); +SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 ); + +DROP TABLE t1,t2,t3; + +CREATE TABLE t1 ( + pk int auto_increment primary key, + col_int_key int(11), + key col_int_key (col_int_key),col_varchar_key varchar(128), + key (col_varchar_key) +) engine=innodb; + +EXPLAIN +SELECT 1 FROM t1 AS alias1 +WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1 + FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN + t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key ) + ) + GROUP BY SQ2_field1 + HAVING SQ2_alias1 . col_int_key >= 7 + ); + +SELECT 1 FROM t1 AS alias1 +WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1 + FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN + t1 AS SQ2_alias2 ON (SQ2_alias2 . col_int_key = SQ2_alias1 . col_int_key ) + ) + GROUP BY SQ2_field1 + HAVING SQ2_alias1 . col_int_key >= 7 + ); +drop table t1; + + set optimizer_switch=@subselect_innodb_tmp; diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index bfdc6335f1d..cde8d5d0e19 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2584,5 +2584,43 @@ ORDER BY sm; DROP TABLE t1,t2; +--echo # +--echo # mdev-4173 ignored duplicate value when converting heap to temp table +--echo # could lead to extra rows in semijoin queries or missing row in union queries +--echo # +CREATE TABLE t1 (i1 INT) engine=myisam; +INSERT INTO t1 VALUES +(4),(8),(0),(0),(0),(7),(7),(5),(3),(4),(9),(6),(1),(5),(6),(2),(4),(4); + +CREATE TABLE t2 (i2 INT, j2 INT) engine=myisam; +INSERT INTO t2 VALUES +(7,1),(0,7),(9,4),(3,7),(4,0),(2,2),(5,9),(3,4), +(1,0),(3,9),(5,8),(1,8),(204,18),(224,84),(9,6); + +CREATE TABLE t3 (i3 INT, KEY(i3)) engine=myisam; +INSERT INTO t3 VALUES +(0),(8),(1),(8),(9),(24),(6),(1),(6),(2),(4),(2),(1); + +select @@max_heap_table_size into @tmp_max_heap_table_size; +select @@join_buffer_size into @tmp_join_buffer_size; +set max_heap_table_size=16*1024; + +--disable_query_log +let $n = 8; +while ($n) { + eval set join_buffer_size= 128 + 128*$n; + SELECT COUNT(*) FROM t1 outer_t1, t2 outer_t2, t3 + WHERE outer_t1.i1 IN ( + SELECT j2 FROM t2 LEFT JOIN t3 ON ( i3 = j2 ) + WHERE i2 <> outer_t2.j2 + ); + dec $n; +} +--enable_query_log + +DROP TABLE t1, t2, t3; +set join_buffer_size = @tmp_join_buffer_size; +set max_heap_table_size = @tmp_max_heap_table_size; + # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index 92fc500cf55..0f701cf9624 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1225,5 +1225,34 @@ WHERE alias3.d IN ( set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; + +--source include/have_innodb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2,t3,t4; +--enable_warnings + +--echo # +--echo # MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin +--echo # +CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English'); + +CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB; +INSERT INTO t2 VALUES (86,'English'); + +CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB; +INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron'); + +create table t4 like t1; +insert into t4 select * from t1; + +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); + +explain +SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); + +DROP TABLE t1,t2,t3,t4; + --echo # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 3129863ab9b..af8681abff3 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -295,6 +295,15 @@ insert t1 values ('2010-10-10 15:foobar'); drop table t1; --echo # +--echo # MDEV-4634 Crash in CONVERT_TZ +--echo # +SELECT CONVERT_TZ(GREATEST(DATE('2021-00-00'),DATE('2022-00-00')),'+00:00','+7:5'); + +--echo # +--echo # End of 5.3 tests +--echo # + +--echo # --echo # Bug #33629: last_day function can return null, but has 'not null' --echo # flag set for result --echo # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 05bc72291cd..a1c0509666a 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -486,6 +486,11 @@ select * from t2 left join t1 on t1.a=t2.c where t1.b is null; drop table t1,t2; +--echo # +--echo # MDEV-4634 Crash in CONVERT_TZ +--echo # +SELECT CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+7:5'); + --echo End of 5.3 tests --echo # diff --git a/mysql-test/t/type_datetime_hires.test b/mysql-test/t/type_datetime_hires.test index 74f686d4157..a62c227f563 100644 --- a/mysql-test/t/type_datetime_hires.test +++ b/mysql-test/t/type_datetime_hires.test @@ -69,3 +69,12 @@ alter table t1 modify b datetime, modify a datetime(6); select * from t1; drop table t1; +--echo # +--echo # MDEV-4651 Crash in my_decimal2decimal in a ORDER BY query +--echo # +SET @@time_zone='+00:00'; +CREATE TABLE t1 (a DATETIME(4) NOT NULL); +INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2000-00-00 00:00:00'); +SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY 1; +DROP TABLE t1; +SET @@time_zone=DEFAULT; diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 2ddb6f9dffc..19e0c45fbc0 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -123,6 +123,15 @@ insert into t1 values ('23:38:57'); select f1, f1 = '2010-10-11 23:38:57' from t1; drop table t1; +--echo # +--echo # MDEV-4634 Crash in CONVERT_TZ +--echo # +SELECT CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5'); + +--echo # +--echo # End of 5.3 tests +--echo # + # # Bug#42664 - Sign ignored for TIME types when not comparing as longlong # diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 244c5f039fa..21112cd7130 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1212,7 +1212,10 @@ SET GLOBAL server_id = @old_server_id; SET @old_max_binlog_cache_size = @@GLOBAL.max_binlog_cache_size; --echo # Set the max_binlog_cache_size to size more than 4GB. +--disable_warnings SET GLOBAL max_binlog_cache_size = 5 * 1024 * 1024 * 1024; +--enable_warnings +--replace_result 5368709120 max_size 4294963200 max_size SELECT @@GLOBAL.max_binlog_cache_size; SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 8b10e53f06d..404780a3368 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4794,6 +4794,20 @@ WHERE a = alias.a ); drop view v1; drop table t1,t2; +--echo # +--echo # MDEV-4593: p_s: crash in simplify_joins with delete using subselect +--echo # from view +--echo # + +create table `t1`(`a` int); +create table `t2`(`a` int); +create or replace view `v1` as select `a` from `t1`; +prepare s from "delete from `t2` order by (select 1 from `v1`)"; +execute s; +deallocate prepare s; +drop view v1; +drop tables t1,t2; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- |