summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-11-21 19:13:14 +0200
committerMichael Widenius <monty@askmonty.org>2011-11-21 19:13:14 +0200
commita8d03ab23519d4afc288a6490676ddb8745e3e72 (patch)
treee55f53ff3cc4b044769ca269561a933e3c93f05f /mysql-test
parent04f3ecf632816a940e2838949e0216d638436fd8 (diff)
parent13fefeb04ade34418cd9d99aa93bffb69fdae27e (diff)
downloadmariadb-git-a8d03ab23519d4afc288a6490676ddb8745e3e72.tar.gz
Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am3
-rw-r--r--mysql-test/collections/default.experimental22
-rw-r--r--mysql-test/include/default_my.cnf15
-rw-r--r--mysql-test/include/default_mysqld.cnf15
-rw-r--r--mysql-test/include/mtr_check.sql25
-rw-r--r--mysql-test/include/mtr_warnings.sql15
-rw-r--r--mysql-test/include/set_binlog_format_mixed.sql16
-rw-r--r--mysql-test/include/set_binlog_format_row.sql16
-rw-r--r--mysql-test/include/set_binlog_format_statement.sql16
-rw-r--r--mysql-test/lib/My/Config.pm15
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm8
-rw-r--r--mysql-test/lib/My/CoreDump.pm3
-rw-r--r--mysql-test/lib/My/File/Path.pm3
-rw-r--r--mysql-test/lib/My/Find.pm2
-rw-r--r--mysql-test/lib/My/Handles.pm3
-rw-r--r--mysql-test/lib/My/Platform.pm3
-rw-r--r--mysql-test/lib/My/SafeProcess/Base.pm3
-rw-r--r--mysql-test/lib/My/SafeProcess/Makefile.am5
-rwxr-xr-xmysql-test/lib/My/SafeProcess/safe_kill_win.cc6
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc5
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.pl19
-rwxr-xr-xmysql-test/lib/My/SafeProcess/safe_process_win.cc6
-rw-r--r--mysql-test/lib/My/SysInfo.pm3
-rw-r--r--mysql-test/lib/My/Test.pm3
-rw-r--r--mysql-test/lib/mtr_cases.pm24
-rw-r--r--mysql-test/lib/mtr_gcov.pl3
-rw-r--r--mysql-test/lib/mtr_gprof.pl2
-rw-r--r--mysql-test/lib/mtr_io.pl3
-rw-r--r--mysql-test/lib/mtr_process.pl2
-rw-r--r--mysql-test/lib/mtr_stress.pl3
-rw-r--r--mysql-test/lib/mtr_unique.pm3
-rw-r--r--mysql-test/lib/t/Base.t17
-rw-r--r--mysql-test/lib/t/Find.t17
-rw-r--r--mysql-test/lib/t/Options.t18
-rw-r--r--mysql-test/lib/t/Platform.t17
-rw-r--r--mysql-test/lib/t/SafeProcess.t16
-rwxr-xr-xmysql-test/lib/t/SafeProcessStress.pl16
-rw-r--r--mysql-test/lib/t/copytree.t16
-rw-r--r--mysql-test/lib/t/dummyd.pl16
-rw-r--r--mysql-test/lib/t/rmtree.t16
-rwxr-xr-xmysql-test/lib/t/testMyConfig.t16
-rwxr-xr-xmysql-test/lib/t/testMyConfigFactory.t16
-rwxr-xr-xmysql-test/lib/t/test_child.pl16
-rw-r--r--mysql-test/lib/v1/My/Config.pm16
-rw-r--r--mysql-test/lib/v1/mtr_cases.pl3
-rw-r--r--mysql-test/lib/v1/mtr_gcov.pl3
-rw-r--r--mysql-test/lib/v1/mtr_gprof.pl3
-rw-r--r--mysql-test/lib/v1/mtr_im.pl3
-rw-r--r--mysql-test/lib/v1/mtr_io.pl3
-rw-r--r--mysql-test/lib/v1/mtr_match.pl3
-rw-r--r--mysql-test/lib/v1/mtr_misc.pl3
-rw-r--r--mysql-test/lib/v1/mtr_process.pl3
-rw-r--r--mysql-test/lib/v1/mtr_report.pl3
-rw-r--r--mysql-test/lib/v1/mtr_stress.pl3
-rw-r--r--mysql-test/lib/v1/mtr_timer.pl3
-rw-r--r--mysql-test/lib/v1/mtr_unique.pl3
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl17
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/r/alter_table.result29
-rw-r--r--mysql-test/r/archive.result16
-rw-r--r--mysql-test/r/archive_debug.result12
-rw-r--r--mysql-test/r/cast.result17
-rw-r--r--mysql-test/r/events_1.result106
-rw-r--r--mysql-test/r/events_bugs.result56
-rw-r--r--mysql-test/r/events_restart.result3
-rw-r--r--mysql-test/r/explain.result11
-rw-r--r--mysql-test/r/func_math.result6
-rw-r--r--mysql-test/r/func_time.result15
-rw-r--r--mysql-test/r/gis-rtree.result27
-rw-r--r--mysql-test/r/gis.result35
-rw-r--r--mysql-test/r/group_by.result32
-rw-r--r--mysql-test/r/implicit_char_to_num_conversion.result366
-rw-r--r--mysql-test/r/merge.result29
-rw-r--r--mysql-test/r/mysqlbinlog_base64.result10
-rw-r--r--mysql-test/r/partition.result29
-rw-r--r--mysql-test/r/partition_myisam.result (renamed from mysql-test/r/partition_not_embedded.result)9
-rw-r--r--mysql-test/r/secure_file_priv_win.result38
-rw-r--r--mysql-test/r/sp-security.result25
-rw-r--r--mysql-test/r/sp.result19
-rw-r--r--mysql-test/r/sp_sync.result14
-rw-r--r--mysql-test/r/sp_trans.result46
-rw-r--r--mysql-test/r/subselect.result26
-rw-r--r--mysql-test/r/trigger-compat.result98
-rw-r--r--mysql-test/r/trigger.result4
-rw-r--r--mysql-test/r/type_newdecimal.result24
-rw-r--r--mysql-test/std_data/checkDBI_DBD-mysql.pl2
-rw-r--r--mysql-test/std_data/latin1.xml5
-rw-r--r--mysql-test/suite/binlog/r/binlog_reset_master.result1
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug23533.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_reset_master.test26
-rw-r--r--mysql-test/suite/binlog/t/disabled.def4
-rw-r--r--mysql-test/suite/funcs_1/t/disabled.def2
-rw-r--r--mysql-test/suite/funcs_2/t/disabled.def8
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59410.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59641.result57
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result55
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59410.test24
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59641.test66
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test25
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-index.result67
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-zip.result114
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug59410.result17
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug59641.result57
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_mysql.result54
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-index.test94
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-zip.test20
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug59410.test24
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug59641.test70
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_mysql.test63
-rw-r--r--mysql-test/suite/ndb/t/disabled.def2
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2.test1
-rw-r--r--mysql-test/suite/ndb_team/t/disabled.def4
-rw-r--r--mysql-test/suite/parts/t/disabled.def4
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayspace.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_corruption.result49
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result2
-rw-r--r--mysql-test/suite/rpl/t/disabled.def4
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_corruption.test115
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test2
-rw-r--r--mysql-test/suite/rpl_ndb/t/disabled.def2
-rw-r--r--mysql-test/suite/sys_vars/t/disabled.def4
-rw-r--r--mysql-test/t/alter_table.test27
-rw-r--r--mysql-test/t/archive.test15
-rw-r--r--mysql-test/t/archive_debug.test13
-rw-r--r--mysql-test/t/cast.test14
-rw-r--r--mysql-test/t/disabled.def8
-rw-r--r--mysql-test/t/events_1.test109
-rw-r--r--mysql-test/t/events_bugs.test67
-rw-r--r--mysql-test/t/events_restart.test2
-rw-r--r--mysql-test/t/explain.test9
-rw-r--r--mysql-test/t/func_math.test6
-rw-r--r--mysql-test/t/func_time.test13
-rw-r--r--mysql-test/t/gis-rtree.test28
-rw-r--r--mysql-test/t/gis.test50
-rw-r--r--mysql-test/t/group_by.test14
-rw-r--r--mysql-test/t/implicit_char_to_num_conversion.test174
-rw-r--r--mysql-test/t/merge.test45
-rw-r--r--mysql-test/t/mysqlbinlog_base64.test29
-rw-r--r--mysql-test/t/parser_stack.test4
-rw-r--r--mysql-test/t/partition.test31
-rw-r--r--mysql-test/t/partition_myisam.test (renamed from mysql-test/t/partition_not_embedded.test)11
-rw-r--r--mysql-test/t/secure_file_priv_win-master.opt1
-rw-r--r--mysql-test/t/secure_file_priv_win.test79
-rw-r--r--mysql-test/t/sp-security.test37
-rw-r--r--mysql-test/t/sp.test27
-rw-r--r--mysql-test/t/sp_sync.test31
-rw-r--r--mysql-test/t/sp_trans.test33
-rw-r--r--mysql-test/t/subselect.test33
-rw-r--r--mysql-test/t/trigger-compat.test174
-rw-r--r--mysql-test/t/type_newdecimal.test28
-rw-r--r--mysql-test/valgrind.supp4
154 files changed, 3620 insertions, 267 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index c163c0a4f0c..d99da446fb9 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+# Copyright (c) 2000, 2011, Oracle and/or its affiliates.
# Copyright (c) 2009-2011, Monty Program Ab
#
# This program is free software; you can redistribute it and/or
@@ -82,7 +82,6 @@ TEST_DIRS = t r include std_data std_data/parts collections \
std_data/funcs_1 \
extra/binlog_tests/ extra/rpl_tests \
suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
- suite/bugs suite/bugs/data suite/bugs/t suite/bugs/r \
suite/federated \
suite/funcs_1 suite/funcs_1/bitdata \
suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index fb8c6845a5f..961a93b8741 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -2,7 +2,6 @@
# in alphabetical order. This also helps with merge conflict resolution.
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
-binlog.binlog_bug23533 # skozlov: BUG#12371924
funcs_1.charset_collation_1 # depends on compile-time decisions
@@ -14,21 +13,23 @@ funcs_1.ndb* # joro : NDB tests marked as experiment
funcs_2.ndb_charset # joro : NDB tests marked as experimental as agreed with bochklin
-innodb_plugin.* @solaris # Bug#56063 InnoDB Plugin mysql-tests fail on Solaris
+innodb_plugin.* @solaris # Bug#11763366 InnoDB Plugin mysql-tests fail on Solaris
+
+main.ctype_gbk_binlog @solaris # Bug#11754407: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
+main.func_str @solaris # joro: Bug#11750406
+main.sp @solaris # joro : Bug#11761625
+main.query_cache_28249 # Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically
-main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
-main.func_str @solaris # joro: Bug#40928
-main.sp @solaris # joro : Bug#54138
-main.outfile_loaddata @solaris # joro : Bug #46895
ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
-rpl.rpl_innodb_bug28430 @solaris # Bug#46029
-rpl.rpl_row_sp011 @solaris # Joro : Bug #45445
+rpl.rpl_innodb_bug28430 # Bug#11754425
+rpl.rpl_insert # Sven: BUG#12764817
+rpl.rpl_row_sp011 @solaris # Joro : Bug #11753919
rpl.rpl_stop_slave # Sven : BUG#12345981
rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
-rpl_ndb.rpl_ndb_log # Bug#38998
+rpl_ndb.rpl_ndb_log # Bug#11749433
stress.ddl_ndb # joro : NDB tests marked as experimental as agreed with bochklin
@@ -46,6 +47,3 @@ parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experiment
parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin
parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin
parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-main.gis-rtree # svoj: due to BUG#38965
-main.type_float # svoj: due to BUG#38965
-main.type_newdecimal # svoj: due to BUG#38965
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index 17a418ff7b5..6fd7a082f05 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -1,3 +1,18 @@
+# Copyright (c) 2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# Use default setting for mysqld processes
!include default_mysqld.cnf
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index a1b477c51dd..921f3c4b009 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -1,3 +1,18 @@
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# Default values that applies to all MySQL Servers
[mysqld]
open-files-limit= 1024
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index fcd5eebc269..014584bbf90 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -1,3 +1,18 @@
+-- Copyright (c) 2008, 2010, Oracle and/or its affiliates
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; version 2 of the License.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software Foundation,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
delimiter ||;
use mtr||
@@ -61,3 +76,13 @@ BEGIN
mysql.user;
END||
+
+--
+-- Procedure used by test case used to force all
+-- servers to restart after testcase and thus skipping
+-- check test case after test
+--
+CREATE DEFINER=root@localhost PROCEDURE force_restart()
+BEGIN
+ SELECT 1 INTO OUTFILE 'force_restart';
+END||
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 9a8152afd4d..b8b4f60224c 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -1,3 +1,18 @@
+-- Copyright (c) 2008, 2011, Oracle and/or its affiliates
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; version 2 of the License.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software Foundation,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
delimiter ||;
use mtr||
diff --git a/mysql-test/include/set_binlog_format_mixed.sql b/mysql-test/include/set_binlog_format_mixed.sql
index 836992d1080..65c779ef141 100644
--- a/mysql-test/include/set_binlog_format_mixed.sql
+++ b/mysql-test/include/set_binlog_format_mixed.sql
@@ -1,2 +1,18 @@
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
SET GLOBAL BINLOG_FORMAT=MIXED;
SET SESSION BINLOG_FORMAT=MIXED;
diff --git a/mysql-test/include/set_binlog_format_row.sql b/mysql-test/include/set_binlog_format_row.sql
index 49f34c8ccd1..0400ed48be9 100644
--- a/mysql-test/include/set_binlog_format_row.sql
+++ b/mysql-test/include/set_binlog_format_row.sql
@@ -1,2 +1,18 @@
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
SET GLOBAL BINLOG_FORMAT=ROW;
SET SESSION BINLOG_FORMAT=ROW;
diff --git a/mysql-test/include/set_binlog_format_statement.sql b/mysql-test/include/set_binlog_format_statement.sql
index ed286e7e3cc..b582230e648 100644
--- a/mysql-test/include/set_binlog_format_statement.sql
+++ b/mysql-test/include/set_binlog_format_statement.sql
@@ -1,2 +1,18 @@
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
SET GLOBAL BINLOG_FORMAT=STATEMENT;
SET SESSION BINLOG_FORMAT=STATEMENT;
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
index bf6629754a1..1823ed59e02 100644
--- a/mysql-test/lib/My/Config.pm
+++ b/mysql-test/lib/My/Config.pm
@@ -1,5 +1,20 @@
# -*- cperl -*-
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
package My::Config::Option;
use strict;
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index 414a80aaedf..94ed75648b5 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -137,7 +137,11 @@ sub fix_tmpdir {
sub fix_log_error {
my ($self, $config, $group_name, $group)= @_;
my $dir= $self->{ARGS}->{vardir};
- return "$dir/log/$group_name.err";
+ if ( $::opt_valgrind and $::opt_debug ) {
+ return "$dir/log/$group_name.trace";
+ } else {
+ return "$dir/log/$group_name.err";
+ }
}
sub fix_log {
diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm
index c0f6535b96e..0954602f1d4 100644
--- a/mysql-test/lib/My/CoreDump.pm
+++ b/mysql-test/lib/My/CoreDump.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/My/File/Path.pm b/mysql-test/lib/My/File/Path.pm
index 14fb43e8d98..1b7982d6b36 100644
--- a/mysql-test/lib/My/File/Path.pm
+++ b/mysql-test/lib/My/File/Path.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm
index 8e6cd0c651d..5dea0537bc6 100644
--- a/mysql-test/lib/My/Find.pm
+++ b/mysql-test/lib/My/Find.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates.
#
# 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
diff --git a/mysql-test/lib/My/Handles.pm b/mysql-test/lib/My/Handles.pm
index 66ee22b403f..00cd3126174 100644
--- a/mysql-test/lib/My/Handles.pm
+++ b/mysql-test/lib/My/Handles.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm
index cbe8f929d71..483bf0bd4f3 100644
--- a/mysql-test/lib/My/Platform.pm
+++ b/mysql-test/lib/My/Platform.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm
index c0c70e48082..0e8c191c440 100644
--- a/mysql-test/lib/My/SafeProcess/Base.pm
+++ b/mysql-test/lib/My/SafeProcess/Base.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am
index 2a2f2d47345..f9ee35ea28c 100644
--- a/mysql-test/lib/My/SafeProcess/Makefile.am
+++ b/mysql-test/lib/My/SafeProcess/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
@@ -11,7 +12,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 St, Fifth Floor, Boston, MA 02110-1301 USA
testroot = $(prefix)
safedir = $(testroot)/mysql-test/lib/My/SafeProcess
diff --git a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
index 9b013b960bf..f69c1a109a9 100755
--- a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2007, 2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
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
@@ -11,7 +12,8 @@
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 St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index 0ff3a818d2d..4aedba3f3c1 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates
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
@@ -11,7 +11,8 @@
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 St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.pl b/mysql-test/lib/My/SafeProcess/safe_process.pl
index e3114a749d3..de844e010a1 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.pl
+++ b/mysql-test/lib/My/SafeProcess/safe_process.pl
@@ -1,6 +1,21 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use warnings;
@@ -94,7 +109,7 @@ eval {
local $SIG{INT}= \&handle_signal;
local $SIG{CHLD}= sub {
message("Got signal @_");
- kill(9, -$child_pid);
+ kill('KILL', -$child_pid);
my $ret= waitpid($child_pid, 0);
if ($? & 127){
exit(65); # Killed by signal
@@ -134,7 +149,7 @@ if ( $@ ) {
# Use negative pid in order to kill the whole
# process group
#
-my $ret= kill(9, -$child_pid);
+my $ret= kill('KILL', -$child_pid);
message("Killed child: $child_pid, ret: $ret");
if ($ret > 0) {
message("Killed child: $child_pid");
diff --git a/mysql-test/lib/My/SafeProcess/safe_process_win.cc b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
index 931705e1911..a8d519fe8e3 100755
--- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2007, 2008 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
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
@@ -11,7 +12,8 @@
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 St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index b8569e415e8..28660f44bae 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm
index 07f2697d6fe..012e5f6d81e 100644
--- a/mysql-test/lib/My/Test.pm
+++ b/mysql-test/lib/My/Test.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index b8ee485278d..4bbe85239f2 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates
#
# 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
@@ -331,10 +331,30 @@ sub collect_one_suite
my %disabled;
if ( open(DISABLED, "$testdir/disabled.def" ) )
{
+ # $^O on Windows considered not generic enough
+ my $plat= (IS_WINDOWS) ? 'windows' : $^O;
+
while ( <DISABLED> )
{
chomp;
- if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
+ #diasble the test case if platform matches
+ if ( /\@/ )
+ {
+ if ( /\@$plat/ )
+ {
+ /^\s*(\S+)\s*\@$plat.*:\s*(.*?)\s*$/ ;
+ $disabled{$1}= $2;
+ }
+ elsif ( /\@!(\S*)/ )
+ {
+ if ( $1 ne $plat)
+ {
+ /^\s*(\S+)\s*\@!.*:\s*(.*?)\s*$/ ;
+ $disabled{$1}= $2;
+ }
+ }
+ }
+ elsif ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
{
$disabled{$1}= $2;
}
diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl
index b4fdcd2e04c..3bdfb9857e2 100644
--- a/mysql-test/lib/mtr_gcov.pl
+++ b/mysql-test/lib/mtr_gcov.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2004, 2006, 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl
index a5e05b28723..34e722a251f 100644
--- a/mysql-test/lib/mtr_gprof.pl
+++ b/mysql-test/lib/mtr_gprof.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates
#
# 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
diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl
index 6a6b3a3d028..8c2803f0427 100644
--- a/mysql-test/lib/mtr_io.pl
+++ b/mysql-test/lib/mtr_io.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+# Copyright (c) 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 3c8a938ae54..b669612f858 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates
#
# 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
diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl
index ab4214791d0..6ab607e6439 100644
--- a/mysql-test/lib/mtr_stress.pl
+++ b/mysql-test/lib/mtr_stress.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/mtr_unique.pm b/mysql-test/lib/mtr_unique.pm
index 506af448266..8d719786283 100644
--- a/mysql-test/lib/mtr_unique.pm
+++ b/mysql-test/lib/mtr_unique.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2006, 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/t/Base.t b/mysql-test/lib/t/Base.t
index 6ca7657d421..b540944f3a1 100644
--- a/mysql-test/lib/t/Base.t
+++ b/mysql-test/lib/t/Base.t
@@ -1,4 +1,21 @@
# -*- cperl -*-
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/Find.t b/mysql-test/lib/t/Find.t
index 90489ba06dd..d609fd86dd9 100644
--- a/mysql-test/lib/t/Find.t
+++ b/mysql-test/lib/t/Find.t
@@ -1,4 +1,21 @@
# -*- cperl -*-
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/Options.t b/mysql-test/lib/t/Options.t
index 7012f3da8de..1ae1bc5f28b 100644
--- a/mysql-test/lib/t/Options.t
+++ b/mysql-test/lib/t/Options.t
@@ -1,5 +1,21 @@
-
# -*- cperl -*-
+
+# Copyright (c) 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/Platform.t b/mysql-test/lib/t/Platform.t
index a8cb7751925..c78c22ddb5a 100644
--- a/mysql-test/lib/t/Platform.t
+++ b/mysql-test/lib/t/Platform.t
@@ -1,4 +1,21 @@
# -*- cperl -*-
+
+# Copyright (c) 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/SafeProcess.t b/mysql-test/lib/t/SafeProcess.t
index d4a62ff8cca..0fab69b9088 100644
--- a/mysql-test/lib/t/SafeProcess.t
+++ b/mysql-test/lib/t/SafeProcess.t
@@ -1,5 +1,21 @@
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use FindBin;
use IO::File;
diff --git a/mysql-test/lib/t/SafeProcessStress.pl b/mysql-test/lib/t/SafeProcessStress.pl
index 0f7a59d67f0..a5dbeecfb4b 100755
--- a/mysql-test/lib/t/SafeProcessStress.pl
+++ b/mysql-test/lib/t/SafeProcessStress.pl
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007, 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use FindBin;
use My::SafeProcess;
diff --git a/mysql-test/lib/t/copytree.t b/mysql-test/lib/t/copytree.t
index 15e4d1a7b1b..cdb99b851c4 100644
--- a/mysql-test/lib/t/copytree.t
+++ b/mysql-test/lib/t/copytree.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use My::File::Path;
diff --git a/mysql-test/lib/t/dummyd.pl b/mysql-test/lib/t/dummyd.pl
index 07336e3c2d2..fae747354d7 100644
--- a/mysql-test/lib/t/dummyd.pl
+++ b/mysql-test/lib/t/dummyd.pl
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use Getopt::Long;
use IO::File;
diff --git a/mysql-test/lib/t/rmtree.t b/mysql-test/lib/t/rmtree.t
index 08c9077d001..8c9863a1edd 100644
--- a/mysql-test/lib/t/rmtree.t
+++ b/mysql-test/lib/t/rmtree.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use My::File::Path;
diff --git a/mysql-test/lib/t/testMyConfig.t b/mysql-test/lib/t/testMyConfig.t
index da08cb8b4d1..f79e8776676 100755
--- a/mysql-test/lib/t/testMyConfig.t
+++ b/mysql-test/lib/t/testMyConfig.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use warnings;
use File::Temp qw / tempdir /;
diff --git a/mysql-test/lib/t/testMyConfigFactory.t b/mysql-test/lib/t/testMyConfigFactory.t
index 16fdd9db539..d3f3c9b67df 100755
--- a/mysql-test/lib/t/testMyConfigFactory.t
+++ b/mysql-test/lib/t/testMyConfigFactory.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use warnings;
diff --git a/mysql-test/lib/t/test_child.pl b/mysql-test/lib/t/test_child.pl
index 99f4e68003d..38d9f906738 100755
--- a/mysql-test/lib/t/test_child.pl
+++ b/mysql-test/lib/t/test_child.pl
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use Getopt::Long;
diff --git a/mysql-test/lib/v1/My/Config.pm b/mysql-test/lib/v1/My/Config.pm
index 5491e341ddc..cc4c34b2d62 100644
--- a/mysql-test/lib/v1/My/Config.pm
+++ b/mysql-test/lib/v1/My/Config.pm
@@ -1,5 +1,21 @@
# -*- cperl -*-
+# Copyright (c) 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
package My::Config::Option;
use strict;
diff --git a/mysql-test/lib/v1/mtr_cases.pl b/mysql-test/lib/v1/mtr_cases.pl
index 288e8c22b44..baeab24f519 100644
--- a/mysql-test/lib/v1/mtr_cases.pl
+++ b/mysql-test/lib/v1/mtr_cases.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2005-2006 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_gcov.pl b/mysql-test/lib/v1/mtr_gcov.pl
index a2de1fcbdff..56942be72a8 100644
--- a/mysql-test/lib/v1/mtr_gcov.pl
+++ b/mysql-test/lib/v1/mtr_gcov.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004, 2006 MySQL AB
+# Copyright (c) 2004, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_gprof.pl b/mysql-test/lib/v1/mtr_gprof.pl
index f6615301dd7..04c6eced28a 100644
--- a/mysql-test/lib/v1/mtr_gprof.pl
+++ b/mysql-test/lib/v1/mtr_gprof.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004 MySQL AB
+# Copyright (c) 2004 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_im.pl b/mysql-test/lib/v1/mtr_im.pl
index c8e332498d7..c34acc9c82f 100644
--- a/mysql-test/lib/v1/mtr_im.pl
+++ b/mysql-test/lib/v1/mtr_im.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_io.pl b/mysql-test/lib/v1/mtr_io.pl
index aa671c0f4f7..ebd50ad2212 100644
--- a/mysql-test/lib/v1/mtr_io.pl
+++ b/mysql-test/lib/v1/mtr_io.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_match.pl b/mysql-test/lib/v1/mtr_match.pl
index 96aa43f4fa2..5cc74efb8c9 100644
--- a/mysql-test/lib/v1/mtr_match.pl
+++ b/mysql-test/lib/v1/mtr_match.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_misc.pl b/mysql-test/lib/v1/mtr_misc.pl
index 0173e8b8572..39d27a33248 100644
--- a/mysql-test/lib/v1/mtr_misc.pl
+++ b/mysql-test/lib/v1/mtr_misc.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_process.pl b/mysql-test/lib/v1/mtr_process.pl
index 33a39d1f0b6..f86f9e5dec0 100644
--- a/mysql-test/lib/v1/mtr_process.pl
+++ b/mysql-test/lib/v1/mtr_process.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl
index 7daf6743b03..51527dc9d20 100644
--- a/mysql-test/lib/v1/mtr_report.pl
+++ b/mysql-test/lib/v1/mtr_report.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_stress.pl b/mysql-test/lib/v1/mtr_stress.pl
index 40800c9729b..7f92c417271 100644
--- a/mysql-test/lib/v1/mtr_stress.pl
+++ b/mysql-test/lib/v1/mtr_stress.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_timer.pl b/mysql-test/lib/v1/mtr_timer.pl
index 326fbea74ec..4fc68afa364 100644
--- a/mysql-test/lib/v1/mtr_timer.pl
+++ b/mysql-test/lib/v1/mtr_timer.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2005-2006 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mtr_unique.pl b/mysql-test/lib/v1/mtr_unique.pl
index a668fc097c7..4e4e720e689 100644
--- a/mysql-test/lib/v1/mtr_unique.pl
+++ b/mysql-test/lib/v1/mtr_unique.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# 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
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index de8759a490a..0e47ec885bd 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -1,7 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
-#
+# Copyright (c) 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
##############################################################################
#
# mysql-test-run.pl
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index e480fcfd5fc..a6e4b2c92ca 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -261,7 +261,7 @@ my $opt_strace_client;
our $opt_user = "root";
-my $opt_valgrind= 0;
+our $opt_valgrind= 0;
my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args;
our $opt_valgrind_mysqld= 0;
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 728e0f8f0e7..ce78e377102 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1252,4 +1252,33 @@ DROP TABLE t1;
CREATE TABLE t1 (a TEXT, id INT, b INT);
ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
+#
+# Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION
+# FIRST CAN CAUSE DATA TO BE CORRUPTED".
+#
+drop table if exists t1;
+# Use MyISAM engine as the fact that InnoDB doesn't support
+# in-place ALTER TABLE in cases when columns are being renamed
+# hides some bugs.
+create table t1 (i int, j int) engine=myisam;
+insert into t1 value (1, 2);
+# First, test for original problem described in the bug report.
+select * from t1;
+i j
+1 2
+# Change of column order by the below ALTER TABLE statement should
+# affect both column names and column contents.
+alter table t1 modify column j int first;
+select * from t1;
+j i
+2 1
+# Now test for similar problem with the same root.
+# The below ALTER TABLE should change not only the name but
+# also the value for the last column of the table.
+alter table t1 drop column i, add column k int default 0;
+select * from t1;
+j k
+2 0
+# Clean-up.
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 73a9090b1e3..347635abb82 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12766,3 +12766,19 @@ select sum(length(a)),sum(b) from t1;
sum(length(a)) sum(b)
8670 187
drop table t1;
+#
+# BUG#57162 - valgrind errors, random data when returning
+# ordered data from archive tables
+#
+SET sort_buffer_size=32804;
+CREATE TABLE t1(a INT, b CHAR(255), c CHAR(255), d CHAR(255),
+e CHAR(255), f INT) ENGINE=ARCHIVE DEFAULT CHARSET utf8;
+INSERT INTO t1 VALUES(-1,'b','c','d','e',1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6;
+SELECT * FROM t1 ORDER BY f LIMIT 1;
+a b c d e f
+-1 b c d e 1
+DROP TABLE t1;
+SET sort_buffer_size=DEFAULT;
diff --git a/mysql-test/r/archive_debug.result b/mysql-test/r/archive_debug.result
new file mode 100644
index 00000000000..cc5a3761a99
--- /dev/null
+++ b/mysql-test/r/archive_debug.result
@@ -0,0 +1,12 @@
+#
+# BUG#12402794 - 60976: CRASH, VALGRIND WARNING AND MEMORY LEAK
+# WITH PARTITIONED ARCHIVE TABLES
+#
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+INSERT INTO t1 VALUES(1);
+SET SESSION debug='d,simulate_archive_open_failure';
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check error Corrupt
+SET SESSION debug=DEFAULT;
+DROP TABLE t1;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index dd61396e485..44d57055e7f 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -451,4 +451,21 @@ SELECT CONVERT(t2.a USING UTF8) FROM t1, t1 t2 LIMIT 1
1
1
DROP TABLE t1;
+#
+# Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING
+# DOESN'T ADHERE TO MAX_ALLOWED_PACKET
+SET @@GLOBAL.max_allowed_packet=2048;
+Warnings:
+Warning 1105 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SELECT CONVERT('a', BINARY(2049));
+CONVERT('a', BINARY(2049))
+NULL
+Warnings:
+Warning 1301 Result of cast_as_binary() was larger than max_allowed_packet (2048) - truncated
+SELECT CONVERT('a', CHAR(2049));
+CONVERT('a', CHAR(2049))
+NULL
+Warnings:
+Warning 1301 Result of cast_as_char() was larger than max_allowed_packet (2048) - truncated
+SET @@GLOBAL.max_allowed_packet=default;
End of 5.1 tests
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index e7b645f5556..e0c137ea877 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
drop database if exists events_test;
drop database if exists db_x;
drop database if exists mysqltest_db2;
@@ -259,33 +260,36 @@ events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLE
Try to alter mysql.event: the server should fail to load
event information after mysql.event was tampered with.
-First, let's add a column to the end and make sure everything
-works as before
+First, let's add a column to the end and check the error is emitted.
ALTER TABLE mysql.event ADD dummy INT;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
-events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+ERROR HY000: Failed to open mysql.event
SELECT event_name FROM INFORMATION_SCHEMA.events;
-event_name
-intact_check
+ERROR HY000: Failed to open mysql.event
SHOW CREATE EVENT intact_check;
-Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
+ERROR HY000: Failed to open mysql.event
DROP EVENT no_such_event;
-ERROR HY000: Unknown event 'no_such_event'
+ERROR HY000: Failed to open mysql.event
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_1;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_2;
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check;
+ERROR HY000: Failed to open mysql.event
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1545 Failed to open mysql.event
SELECT @@event_scheduler;
@@event_scheduler
OFF
@@ -294,6 +298,7 @@ Variable_name Value
event_scheduler OFF
SET GLOBAL event_scheduler=OFF;
ALTER TABLE mysql.event DROP dummy;
+DROP EVENT intact_check;
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
Now let's add a column to the first position: the server
@@ -301,30 +306,32 @@ expects to see event schema name there
ALTER TABLE mysql.event ADD dummy INT FIRST;
SHOW EVENTS;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SELECT event_name FROM INFORMATION_SCHEMA.events;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SHOW CREATE EVENT intact_check;
-ERROR HY000: Unknown event 'intact_check'
+ERROR HY000: Failed to open mysql.event
DROP EVENT no_such_event;
-ERROR HY000: Unknown event 'no_such_event'
+ERROR HY000: Failed to open mysql.event
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
-ERROR HY000: Failed to store event name. Error code 2 from storage engine.
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_1;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_2;
-ERROR HY000: Unknown event 'intact_check_2'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check;
-ERROR HY000: Unknown event 'intact_check'
+ERROR HY000: Failed to open mysql.event
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1545 Failed to open mysql.event
SELECT @@event_scheduler;
@@event_scheduler
OFF
@@ -345,29 +352,32 @@ Drop some columns and try more checks.
ALTER TABLE mysql.event DROP comment, DROP starts;
SHOW EVENTS;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SHOW CREATE EVENT intact_check;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
DROP EVENT no_such_event;
-ERROR HY000: Unknown event 'no_such_event'
+ERROR HY000: Failed to open mysql.event
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
-ERROR HY000: Column count of mysql.event is wrong. Expected 22, found 20. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_1;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_2;
-ERROR HY000: Unknown event 'intact_check_2'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check;
+ERROR HY000: Failed to open mysql.event
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1545 Failed to open mysql.event
SELECT @@event_scheduler;
@@event_scheduler
OFF
@@ -425,4 +435,42 @@ CREATE TABLE mysql.event like event_like;
DROP TABLE event_like;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+#
+# Bug#12394306: the sever may crash if mysql.event is corrupted
+#
+
+CREATE EVENT ev1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ALTER EVENT ev1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+
+CREATE TABLE event_original LIKE mysql.event;
+INSERT INTO event_original SELECT * FROM mysql.event;
+
+ALTER TABLE mysql.event MODIFY modified CHAR(1);
+Warnings:
+Warning 1265 Data truncated for column 'modified' at row 1
+
+SHOW EVENTS;
+ERROR HY000: Failed to open mysql.event
+
+SELECT event_name, created, last_altered FROM information_schema.events;
+ERROR HY000: Failed to open mysql.event
+
+CREATE EVENT ev2 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ERROR HY000: Failed to open mysql.event
+
+ALTER EVENT ev1 ON SCHEDULE EVERY 9 HOUR DO SELECT 9;
+ERROR HY000: Failed to open mysql.event
+
+DROP TABLE mysql.event;
+RENAME TABLE event_original TO mysql.event;
+
+DROP EVENT ev1;
+
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+#
+# End of tests
+#
drop database events_test;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index dfb8f008c5a..8a34a1366b9 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -419,7 +419,7 @@ SET TIME_ZONE= '+04:00';
ALTER EVENT e1 DO SELECT 2;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
-events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT e1;
SET TIME_ZONE='+05:00';
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
@@ -535,6 +535,7 @@ DROP EVENT e3;
DROP EVENT e2;
DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
+SET TIMESTAMP=DEFAULT;
drop event if exists new_event;
CREATE EVENT new_event ON SCHEDULE EVERY 0 SECOND DO SELECT 1;
ERROR HY000: INTERVAL is either not positive or too big
@@ -756,6 +757,59 @@ SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
DROP DATABASE event_test1;
DROP DATABASE event_test12;
+#
+# Bug#12546938 (formerly known as bug#61005):
+# CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
+#
+USE events_test;
+SET GLOBAL event_scheduler = ON;
+DROP TABLE IF EXISTS table_bug12546938;
+DROP EVENT IF EXISTS event_Bug12546938;
+CREATE TABLE table_bug12546938 (i INT);
+# Create an event which will be executed with a small delay
+# and won't be automatically dropped after that.
+CREATE EVENT event_Bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+INSERT INTO table_bug12546938 VALUES(1);
+END
+|
+# Now try to create the same event using CREATE EVENT IF NOT EXISTS.
+# A warning should be emitted. A new event should not be created nor
+# the old event should be re-executed.
+CREATE EVENT IF NOT EXISTS event_bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+INSERT INTO table_bug12546938 VALUES (1);
+END
+|
+Warnings:
+Note 1537 Event 'event_bug12546938' already exists
+# Wait until at least one instance of event is executed.
+# Check that only one instance of our event was executed.
+SELECT COUNT(*) FROM table_bug12546938;
+COUNT(*)
+1
+# Clean-up.
+DROP EVENT IF EXISTS event_Bug12546938;
+DROP TABLE table_bug12546938;
+SET GLOBAL EVENT_SCHEDULER = OFF;
+DROP DATABASE IF EXISTS event_test11764334;
+CREATE DATABASE event_test11764334;
+USE event_test11764334;
+CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 3 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+ALTER EVENT ev1 ON SCHEDULE EVERY 4 SECOND;
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 4 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP EVENT ev1;
+DROP DATABASE event_test11764334;
+USE test;
DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON';
SET @@global.concurrent_insert= @concurrent_insert;
diff --git a/mysql-test/r/events_restart.result b/mysql-test/r/events_restart.result
index 4db61d357ce..6a751fa29f8 100644
--- a/mysql-test/r/events_restart.result
+++ b/mysql-test/r/events_restart.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
set global event_scheduler=off;
drop database if exists events_test;
create database events_test;
@@ -52,6 +53,8 @@ Warnings:
Note 1008 Can't drop database 'mysqltest_database_not_exists'; database doesn't exist
create database mysqltest_db1;
drop database mysqltest_db1;
+Warnings:
+Error 1545 Failed to open mysql.event
Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 0ce2e7b85dc..92e5bcfce6f 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -176,11 +176,12 @@ SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
EXPLAIN EXTENDED SELECT 1 FROM t1
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
-SHOW WARNINGS;
-Level Code Message
-Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
-Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
+2 SUBQUERY t system NULL NULL NULL NULL 0 0.00 const row not found
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1` where 0
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
End of 5.0 tests.
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index b9118feab1a..4e3608240d4 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -540,4 +540,10 @@ ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'))
-4939092.0000
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
+#
+# Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
+#
+SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
+SUM(DISTINCT (TRUNCATE((.1), NULL)))
+NULL
End of 5.1 tests
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index fcf5b9301c6..a9612228172 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1417,4 +1417,19 @@ NULL
SELECT DATE_FORMAT('0000-00-11', '%w');
DATE_FORMAT('0000-00-11', '%w')
NULL
+#
+# Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
+#
+SELECT MAKEDATE(11111111,1);
+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)
+NULL
+#
+# 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'
End of 5.1 tests
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index a28f537b2de..6db63a6ada0 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -1099,3 +1099,30 @@ HANDLER t1 READ a NEXT;
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.0 tests.
+#
+# Bug #57323/11764487: myisam corruption with insert ignore
+# and invalid spatial data
+#
+CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL,
+SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=NULL;
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+SELECT ASTEXT(a), ASTEXT(b) FROM t1;
+ASTEXT(a) ASTEXT(b)
+POINT(0 0) POINT(1 1)
+DROP TABLE t1;
+CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
+KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
+INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+INSERT IGNORE INTO t1 SET a=1, b=NULL;
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+SELECT a, ASTEXT(b) FROM t1;
+a ASTEXT(b)
+0 POINT(1 1)
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index d82a86a6423..acb55d225a7 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1040,6 +1040,39 @@ drop table t1;
#
create table t1(a char(32) not null) engine=myisam;
create spatial index i on t1 (a);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 140)
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
drop table t1;
+CREATE TABLE t0 (a BINARY(32) NOT NULL);
+CREATE SPATIAL INDEX i on t0 (a);
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
+INSERT INTO t0 VALUES (1);
+CREATE TABLE t1(
+col0 BINARY NOT NULL,
+col2 TIMESTAMP,
+SPATIAL INDEX i1 (col0)
+) ENGINE=MyISAM;
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
+CREATE TABLE t1 (
+col0 BINARY NOT NULL,
+col2 TIMESTAMP
+) ENGINE=MyISAM;
+CREATE SPATIAL INDEX idx0 ON t1(col0);
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
+ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0);
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
+CREATE TABLE t2 (
+col0 INTEGER NOT NULL,
+col1 POINT,
+col2 POINT
+);
+CREATE SPATIAL INDEX idx0 ON t2 (col1, col2);
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
+CREATE TABLE t3 (
+col0 INTEGER NOT NULL,
+col1 POINT,
+col2 LINESTRING,
+SPATIAL INDEX i1 (col1, col2)
+);
+ERROR HY000: Incorrect arguments to SPATIAL INDEX
+DROP TABLE t0, t1, t2;
End of 5.1 tests
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index e8124855007..820a828d604 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1908,4 +1908,36 @@ a AVG(t1.b) t11c t12c
1 4.0000 6 6
2 2.0000 7 7
DROP TABLE t1;
+#
+# Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
+# by functions
+#
+SET SQL_BIG_TABLES=1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0),(0);
+SELECT 1 FROM t1 GROUP BY IF(`a`,'','');
+1
+1
+SELECT 1 FROM t1 GROUP BY TRIM(LEADING RAND() FROM '');
+1
+1
+SELECT 1 FROM t1 GROUP BY SUBSTRING('',SLEEP(0),'');
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<');
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'K'
+Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
+Warning 1292 Truncated incorrect INTEGER value: 'K'
+Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
+Warning 1292 Truncated incorrect INTEGER value: 'K'
+Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
+DROP TABLE t1;
+SET SQL_BIG_TABLES=0;
# End of 5.1 tests
diff --git a/mysql-test/r/implicit_char_to_num_conversion.result b/mysql-test/r/implicit_char_to_num_conversion.result
new file mode 100644
index 00000000000..8f24a6b293c
--- /dev/null
+++ b/mysql-test/r/implicit_char_to_num_conversion.result
@@ -0,0 +1,366 @@
+DROP TABLE IF EXISTS t5;
+CREATE TABLE t5(c1 BIT(2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (0), (1), (2);
+SELECT HEX(c1) FROM t5 ORDER BY c1;
+HEX(c1)
+0
+1
+2
+SELECT HEX(c1) FROM t5 WHERE c1 = b'1' ORDER BY c1;
+HEX(c1)
+1
+SELECT HEX(c1) FROM t5 WHERE c1 <=> b'1' ORDER BY c1;
+HEX(c1)
+1
+SELECT HEX(c1) FROM t5 WHERE c1 != b'1' ORDER BY c1;
+HEX(c1)
+0
+2
+SELECT HEX(c1) FROM t5 WHERE c1 >= '1' ORDER BY c1;
+HEX(c1)
+1
+2
+SELECT HEX(c1) FROM t5 WHERE c1 <= '1' ORDER BY c1;
+HEX(c1)
+0
+1
+SELECT HEX(c1) FROM t5 WHERE c1 < '1' ORDER BY c1;
+HEX(c1)
+0
+SELECT HEX(c1) FROM t5 WHERE c1 > '0' ORDER BY c1;
+HEX(c1)
+1
+2
+DROP TABLE t5;
+CREATE TABLE t5(c1 FLOAT(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (-10.10), (1), (0);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-10.10
+0.00
+1.00
+95.95
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+c1
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '10.10' ORDER BY c1;
+c1
+-10.10
+0.00
+1.00
+SELECT c1 FROM t5 WHERE c1 != '1' ORDER BY c1;
+c1
+-10.10
+0.00
+95.95
+SELECT c1 FROM t5 WHERE c1 < '1' ORDER BY c1;
+c1
+-10.10
+0.00
+SELECT c1 FROM t5 WHERE c1 > '0' ORDER BY c1;
+c1
+1.00
+95.95
+DROP TABLE t5;
+CREATE TABLE t5(c1 TINYINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95), (10),(11),(-8);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-8
+10
+11
+95
+SELECT c1 FROM t5 WHERE c1 = '10' ORDER BY c1;
+c1
+10
+SELECT c1 FROM t5 WHERE c1 <=> '10' ORDER BY c1;
+c1
+10
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+c1
+95
+SELECT c1 FROM t5 WHERE c1 <= '11' ORDER BY c1;
+c1
+-8
+10
+11
+SELECT c1 FROM t5 WHERE c1 != '-8' ORDER BY c1;
+c1
+10
+11
+95
+SELECT c1 FROM t5 WHERE c1 < '11' ORDER BY c1;
+c1
+-8
+10
+SELECT c1 FROM t5 WHERE c1 > '10' ORDER BY c1;
+c1
+11
+95
+DROP TABLE t5;
+CREATE TABLE t5(c1 SMALLINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (395), (-200), (100), (111);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-200
+100
+111
+395
+SELECT c1 FROM t5 WHERE c1 = '100' ORDER BY c1;
+c1
+100
+SELECT c1 FROM t5 WHERE c1 <=> '100' ORDER BY c1;
+c1
+100
+SELECT c1 FROM t5 WHERE c1 >= '395' ORDER BY c1;
+c1
+395
+SELECT c1 FROM t5 WHERE c1 <= '-200' ORDER BY c1;
+c1
+-200
+SELECT c1 FROM t5 WHERE c1 != '100' ORDER BY c1;
+c1
+-200
+111
+395
+SELECT c1 FROM t5 WHERE c1 < '111' ORDER BY c1;
+c1
+-200
+100
+SELECT c1 FROM t5 WHERE c1 > '111' ORDER BY c1;
+c1
+395
+DROP TABLE t5;
+CREATE TABLE t5(c1 MEDIUMINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (-8388607), (311),(215),(88608);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-8388607
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 = '311' ORDER BY c1;
+c1
+311
+SELECT c1 FROM t5 WHERE c1 <=> '311' ORDER BY c1;
+c1
+311
+SELECT c1 FROM t5 WHERE c1 >= '215' ORDER BY c1;
+c1
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 <= '88608' ORDER BY c1;
+c1
+-8388607
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 != '-8388607' ORDER BY c1;
+c1
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 < '215' ORDER BY c1;
+c1
+-8388607
+SELECT c1 FROM t5 WHERE c1 > '215' ORDER BY c1;
+c1
+311
+88608
+DROP TABLE t5;
+CREATE TABLE t5(c1 INT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (-2147483647), (1011),(15),(9388607);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-2147483647
+15
+1011
+9388607
+SELECT c1 FROM t5 WHERE c1 = '9388607' ORDER BY c1;
+c1
+9388607
+SELECT c1 FROM t5 WHERE c1 <=> '9388607' ORDER BY c1;
+c1
+9388607
+SELECT c1 FROM t5 WHERE c1 >= '15' ORDER BY c1;
+c1
+15
+1011
+9388607
+SELECT c1 FROM t5 WHERE c1 <= '1011' ORDER BY c1;
+c1
+-2147483647
+15
+1011
+SELECT c1 FROM t5 WHERE c1 != '-2147483647' ORDER BY c1;
+c1
+15
+1011
+9388607
+SELECT c1 FROM t5 WHERE c1 < '15' ORDER BY c1;
+c1
+-2147483647
+SELECT c1 FROM t5 WHERE c1 > '15' ORDER BY c1;
+c1
+1011
+9388607
+DROP TABLE t5;
+CREATE TABLE t5(c1 BIGINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (-9223372036854775807), (12011),(500),(3372036854775808);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-9223372036854775807
+500
+12011
+3372036854775808
+SELECT c1 FROM t5 WHERE c1 = '-9223372036854775807' ORDER BY c1;
+c1
+-9223372036854775807
+SELECT c1 FROM t5 WHERE c1 <=> '-9223372036854775807' ORDER BY c1;
+c1
+-9223372036854775807
+SELECT c1 FROM t5 WHERE c1 >= '12011' ORDER BY c1;
+c1
+12011
+3372036854775808
+SELECT c1 FROM t5 WHERE c1 <= '500' ORDER BY c1;
+c1
+-9223372036854775807
+500
+SELECT c1 FROM t5 WHERE c1 != '3372036854775808' ORDER BY c1;
+c1
+-9223372036854775807
+500
+12011
+SELECT c1 FROM t5 WHERE c1 < '12011' ORDER BY c1;
+c1
+-9223372036854775807
+500
+SELECT c1 FROM t5 WHERE c1 > '12011' ORDER BY c1;
+c1
+3372036854775808
+DROP TABLE t5;
+CREATE TABLE t5(c1 DOUBLE(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+DROP TABLE t5;
+CREATE TABLE t5(c1 NUMERIC(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+DROP TABLE t5;
+CREATE TABLE t5(c1 DECIMAL(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+DROP TABLE t5;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 289be98c1b5..937fa77a885 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2339,4 +2339,33 @@ REPAIR TABLE m1;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
DROP TABLE m1, t1;
+#
+# BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD
+# CRASHES SERVER
+#
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE TABLE t3(a INT, b INT);
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+# Test reopen merge parent failure
+LOCK TABLES m1 READ;
+# Remove 'm1' table using file operations.
+FLUSH TABLES;
+ERROR 42S02: Table 'test.m1' doesn't exist
+UNLOCK TABLES;
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+# Test reopen merge child failure
+LOCK TABLES m1 READ;
+# Remove 't1' table using file operations.
+FLUSH TABLES;
+ERROR 42S02: Table 'test.t1' doesn't exist
+UNLOCK TABLES;
+CREATE TABLE t1(a INT);
+# Test reattach merge failure
+LOCK TABLES m1 READ;
+# Replace 't1' with 't3' table using file operations.
+FLUSH TABLES;
+ERROR HY000: Can't reopen table: 'm1'
+UNLOCK TABLES;
+DROP TABLE t1, t2, t3, m1;
End of 5.1 tests
diff --git a/mysql-test/r/mysqlbinlog_base64.result b/mysql-test/r/mysqlbinlog_base64.result
index c5e1e2f8ca1..72d49c16cc8 100644
--- a/mysql-test/r/mysqlbinlog_base64.result
+++ b/mysql-test/r/mysqlbinlog_base64.result
@@ -109,3 +109,13 @@ count(*)
35840
drop table t1;
drop table t2;
+RESET MASTER;
+USE test;
+SET @old_binlog_format= @@binlog_format;
+SET SESSION binlog_format=ROW;
+CREATE TABLE t1(c1 INT);
+INSERT INTO t1 VALUES (1);
+FLUSH LOGS;
+DROP TABLE t1;
+SET SESSION binlog_format= @old_binlog_format;
+RESET MASTER;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 138264fd4e1..379f7499e11 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,5 +1,34 @@
drop table if exists t1, t2;
#
+# Bug#11765667: bug#58655: ASSERTION FAILED,
+# SERVER CRASHES WITH MYSQLD GOT SIGNAL 6
+#
+CREATE TABLE t1 (
+id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt DATE, st VARCHAR(255), uid INT,
+id2nd LONGBLOB, filler VARCHAR(255), PRIMARY KEY(id, dt)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+('1991-03-14', 'Initial Insert', 200, 1234567, 'No Data'),
+('1991-02-26', 'Initial Insert', 201, 1234567, 'No Data'),
+('1992-03-16', 'Initial Insert', 234, 1234567, 'No Data'),
+('1992-07-02', 'Initial Insert', 287, 1234567, 'No Data'),
+('1991-05-26', 'Initial Insert', 256, 1234567, 'No Data'),
+('1991-04-25', 'Initial Insert', 222, 1234567, 'No Data'),
+('1993-03-12', 'Initial Insert', 267, 1234567, 'No Data'),
+('1993-03-14', 'Initial Insert', 291, 1234567, 'No Data'),
+('1991-12-20', 'Initial Insert', 298, 1234567, 'No Data'),
+('1994-10-31', 'Initial Insert', 220, 1234567, 'No Data');
+ALTER TABLE t1 PARTITION BY LIST (YEAR(dt)) (
+PARTITION d1 VALUES IN (1991, 1994),
+PARTITION d2 VALUES IN (1993),
+PARTITION d3 VALUES IN (1992, 1995, 1996)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+('1991-07-14', 'After Partitioning Insert', 299, 1234567, 'Insert row');
+UPDATE t1 SET filler='Updating the row' WHERE uid=298;
+DROP TABLE t1;
+#
# Bug#59297: Can't find record in 'tablename' on update inner join
#
CREATE TABLE t1 (
diff --git a/mysql-test/r/partition_not_embedded.result b/mysql-test/r/partition_myisam.result
index c942189a956..1995c87eff2 100644
--- a/mysql-test/r/partition_not_embedded.result
+++ b/mysql-test/r/partition_myisam.result
@@ -79,3 +79,12 @@ a
DROP TABLE t1;
# Should not be any files left here
# End of bug#30102 test.
+# Test of post-push fix for bug#11766249/59316
+CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100,
+PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100,
+PARTITION pMax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1, "Partition p1, first row");
+DROP TABLE t1;
diff --git a/mysql-test/r/secure_file_priv_win.result b/mysql-test/r/secure_file_priv_win.result
new file mode 100644
index 00000000000..d6636aad5d4
--- /dev/null
+++ b/mysql-test/r/secure_file_priv_win.result
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (c1 longtext);
+INSERT INTO t1 values ('a');
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR/B11764517.tmp';
+show global variables like 'secure_file_priv';
+Variable_name Value
+secure_file_priv MYSQL_TMP_DIR/
+SELECT load_file('MYSQL_TMP_DIR\\B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR_UCASE/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR_LCASE/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517.tmp') AS x;
+x
+NULL
+LOAD DATA INFILE 'MYSQL_TMP_DIR\\B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR_UCASE/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE "MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517.tmp" into table t1;
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517-2.tmp';
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR\\B11764517-2.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR/B11764517-3.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR_UCASE/B11764517-4.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR_LCASE/B11764517-5.tmp';
+DROP TABLE t1;
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index c45ada2047a..39e39f2db5e 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -567,3 +567,28 @@ DROP USER 'tester';
DROP USER 'Tester';
DROP DATABASE B48872;
End of 5.0 tests.
+#
+# Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
+# DEFINITION OF ANY ROUTINE.
+#
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SELECT 1;
+CREATE USER user2@localhost IDENTIFIED BY '';
+GRANT SELECT(db) ON mysql.proc TO user2@localhost;
+# Connection con2 as user2
+# The statement below before disclosed info from body_utf8 column.
+SHOW CREATE PROCEDURE db1.p1;
+ERROR 42000: PROCEDURE p1 does not exist
+# Check that SHOW works with SELECT grant on whole table
+# Connection default
+GRANT SELECT ON mysql.proc TO user2@localhost;
+# Connection con2
+# This should work
+SHOW CREATE PROCEDURE db1.p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+# Connection default
+DROP USER user2@localhost;
+DROP DATABASE db1;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 2180a23b91a..1ce14d38166 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -7053,6 +7053,25 @@ init_connect
SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
+#
+# Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
+#
+CREATE TABLE t1 (a INT, b INT, KEY(b));
+CREATE TABLE t2 (c INT, d INT, KEY(c));
+INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
+INSERT INTO t2 VALUES (1,1),(1,2);
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+DECLARE a int;
+-- SQL statement inside
+SELECT 1 INTO a;
+RETURN a;
+END $
+SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1();
+COUNT(DISTINCT d)
+2
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/r/sp_sync.result b/mysql-test/r/sp_sync.result
index afa37e70531..17292f4c1a8 100644
--- a/mysql-test/r/sp_sync.result
+++ b/mysql-test/r/sp_sync.result
@@ -1,4 +1,4 @@
-Tests of syncronization of stored procedure execution.
+Tests of synchronization of stored procedure execution.
#
# Bug#48157: crash in Item_field::used_tables
#
@@ -20,4 +20,16 @@ SET DEBUG_SYNC = 'now SIGNAL go';
# code, this test statement will hang.
DROP TABLE t1, t2;
DROP PROCEDURE p1;
+#
+# test for bug#11756013
+#
+DROP SCHEMA IF EXISTS s1;
+CREATE SCHEMA s1;
+CREATE PROCEDURE s1.p1() BEGIN END;
+SET DEBUG_SYNC='before_db_dir_check SIGNAL check_db WAIT_FOR dropped_schema';
+CALL s1.p1;
+SET DEBUG_SYNC='now WAIT_FOR check_db';
+DROP SCHEMA s1;
+SET DEBUG_SYNC='now SIGNAL dropped_schema';
+ERROR 42000: Unknown database 's1'
SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index a64f53efde7..dec37db652a 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -556,3 +556,49 @@ f1 bug13575(f1)
3 ccc
drop function bug13575|
drop table t3|
+SELECT @@GLOBAL.storage_engine INTO @old_engine|
+SET @@GLOBAL.storage_engine=InnoDB|
+SET @@SESSION.storage_engine=InnoDB|
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine InnoDB
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine InnoDB
+CREATE PROCEDURE bug11758414()
+BEGIN
+SET @@GLOBAL.storage_engine="MyISAM";
+SET @@SESSION.storage_engine="MyISAM";
+# show defaults at execution time / that setting them worked
+SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+SHOW SESSION VARIABLES LIKE 'storage_engine';
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int) ENGINE=InnoDB;
+# show we're heeding the default (at run-time, not parse-time!)
+ SHOW CREATE TABLE t1;
+ # show that we didn't break explicit override with ENGINE=...
+SHOW CREATE TABLE t2;
+END;
+|
+CALL bug11758414|
+Variable_name Value
+storage_engine MyISAM
+Variable_name Value
+storage_engine MyISAM
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine MyISAM
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine MyISAM
+DROP PROCEDURE bug11758414|
+DROP TABLE t1, t2|
+SET @@GLOBAL.storage_engine=@old_engine|
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 87f76b5a9ad..909af13b6c6 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4435,6 +4435,32 @@ pk int_key
3 3
7 3
DROP TABLE t1,t2;
+#
+# Bug#12329653
+# EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
+#
+CREATE TABLE t1(a1 int);
+INSERT INTO t1 VALUES (1),(2);
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1);
+1
+1
+1
+PREPARE stmt FROM
+'SELECT 1 UNION ALL
+SELECT 1 FROM t1
+ORDER BY
+(SELECT 1 FROM t1 AS t1_0
+ WHERE 1 < SOME (SELECT a1 FROM t1)
+)' ;
+EXECUTE stmt ;
+ERROR 21000: Subquery returns more than 1 row
+EXECUTE stmt ;
+ERROR 21000: Subquery returns more than 1 row
+SET SESSION sql_mode=@old_sql_mode;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.0 tests.
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index 2bcd919e0db..d456ce8253f 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -43,3 +43,101 @@ DROP TABLE t2;
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
DROP DATABASE mysqltest_db1;
+USE test;
+#
+# Bug#45235: 5.1 does not support 5.0-only syntax triggers in any way
+#
+DROP TABLE IF EXISTS t1, t2, t3;
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t3 VALUES (1), (2), (3);
+# We simulate importing a trigger from 5.0 by writing a .TRN file for
+# each trigger plus a .TRG file the way MySQL 5.0 would have done it,
+# with syntax allowed in 5.0 only.
+#
+# Note that in 5.0 the following lines are missing from t1.TRG:
+#
+# client_cs_names='latin1'
+# connection_cl_names='latin1_swedish_ci'
+# db_cl_names='latin1_swedish_ci'
+# We will get parse errors for most DDL and DML statements when the table
+# has broken triggers. The parse error refers to the first broken
+# trigger.
+CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a USING t1 a' at line 1'
+CREATE TRIGGER tr22 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM non_existing_table;
+ERROR 42000: Unknown trigger has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Not allowed syntax here, and trigger name cant be extracted either.' at line 1'
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+tr11 INSERT t1 DELETE FROM t3 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr12 INSERT t1 DELETE FROM t3 AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr14 DELETE t1 DELETE FROM non_existing_table AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+Warning 1603 Triggers for table `test`.`t2` have no creation context
+INSERT INTO t1 VALUES (1);
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a USING t1 a' at line 1'
+INSERT INTO t2 VALUES (1);
+ERROR 42000: Unknown trigger has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Not allowed syntax here, and trigger name cant be extracted either.' at line 1'
+DELETE FROM t1;
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a USING t1 a' at line 1'
+UPDATE t1 SET a = 1 WHERE a = 1;
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a USING t1 a' at line 1'
+SELECT * FROM t1;
+a
+1
+2
+3
+RENAME TABLE t1 TO t1_2;
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a USING t1 a' at line 1'
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+tr11 INSERT t1 DELETE FROM t3 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr12 INSERT t1 DELETE FROM t3 AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr14 DELETE t1 DELETE FROM non_existing_table AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+DROP TRIGGER tr11;
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+DROP TRIGGER tr12;
+DROP TRIGGER tr13;
+DROP TRIGGER tr14;
+DROP TRIGGER tr15;
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+# Make sure there is no trigger file left.
+# We write the same trigger files one more time to test DROP TABLE.
+DROP TABLE t1;
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+DROP TABLE t2;
+Warnings:
+Warning 1603 Triggers for table `test`.`t2` have no creation context
+DROP TABLE t3;
+# Make sure there is no trigger file left.
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+# We write three trigger files. First trigger is syntaxically incorrect, next trigger is correct
+# and last trigger is broken.
+# Next we try to execute SHOW CREATE TRGGIR command for broken trigger and then try to drop one.
+FLUSH TABLE t1;
+SHOW CREATE TRIGGER tr12;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+tr12 CREATE DEFINER=`root`@`localhost` TRIGGER tr12 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t2 latin1 latin1_swedish_ci latin1_swedish_ci
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+SHOW CREATE TRIGGER tr11;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+tr11 CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a latin1 latin1_swedish_ci latin1_swedish_ci
+DROP TRIGGER tr12;
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+DROP TRIGGER tr11;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 089845560ed..f5763057bb7 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -2107,10 +2107,8 @@ CREATE TRIGGER trg1 BEFORE INSERT ON t2 FOR EACH ROW INSERT/*!INTO*/t1 VALUES (1
# Used to crash
SHOW TRIGGERS IN db1;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-Warnings:
-Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1
INSERT INTO t2 VALUES (1);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1
+ERROR 42000: Trigger 'trg1' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1'
SELECT * FROM t1;
b
# Work around Bug#45235
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 70ee3a56cf3..0c6c1333e9b 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1913,4 +1913,28 @@ group by PAY.id + 1;
mult v_net_with_discount v_total
1.0000 27.18 27.180000
DROP TABLE currencies, payments, sub_tasks;
+#
+# Bug#55436: buffer overflow in debug binary of dbug_buff in
+# Field_new_decimal::store_value
+#
+SET SQL_MODE='';
+CREATE TABLE t1(f1 DECIMAL(44,24)) ENGINE=MYISAM;
+INSERT INTO t1 SET f1 = -64878E-85;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 FROM t1;
+f1
+0.000000000000000000000000
+DROP TABLE IF EXISTS t1;
End of 5.1 tests
+#
+# BUG#12911710 - VALGRIND FAILURE IN
+# ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
+#
+CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
+d2 DECIMAL(60,0) NOT NULL);
+INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
+SELECT d1 * d2 FROM t1;
+d1 * d2
+0
+DROP TABLE t1;
diff --git a/mysql-test/std_data/checkDBI_DBD-mysql.pl b/mysql-test/std_data/checkDBI_DBD-mysql.pl
index f001e471081..d62d2f8bfc0 100644
--- a/mysql-test/std_data/checkDBI_DBD-mysql.pl
+++ b/mysql-test/std_data/checkDBI_DBD-mysql.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Oracle and/or its affiliates
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
diff --git a/mysql-test/std_data/latin1.xml b/mysql-test/std_data/latin1.xml
index 458b1c34da1..5884416c30e 100644
--- a/mysql-test/std_data/latin1.xml
+++ b/mysql-test/std_data/latin1.xml
@@ -3,7 +3,8 @@
<charsets>
<copyright>
- Copyright (C) 2009 Sun Microsystems, Inc
+ Copyright (c) 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
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
@@ -16,7 +17,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 St, Fifth Floor, Boston, MA 02110-1301 USA
</copyright>
<charset name="latin1">
diff --git a/mysql-test/suite/binlog/r/binlog_reset_master.result b/mysql-test/suite/binlog/r/binlog_reset_master.result
new file mode 100644
index 00000000000..b3d605560ff
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_reset_master.result
@@ -0,0 +1 @@
+RESET MASTER;
diff --git a/mysql-test/suite/binlog/t/binlog_bug23533.test b/mysql-test/suite/binlog/t/binlog_bug23533.test
index c05abe788c6..ca610e399e4 100644
--- a/mysql-test/suite/binlog/t/binlog_bug23533.test
+++ b/mysql-test/suite/binlog/t/binlog_bug23533.test
@@ -35,7 +35,7 @@ connect(default,localhost,root,,test);
# Copied data from t1 into t2 large than max_binlog_cache_size
START TRANSACTION;
---error 1197
+--error ER_TRANS_CACHE_FULL
CREATE TABLE t2 SELECT * FROM t1;
COMMIT;
SHOW TABLES LIKE 't%';
diff --git a/mysql-test/suite/binlog/t/binlog_reset_master.test b/mysql-test/suite/binlog/t/binlog_reset_master.test
new file mode 100644
index 00000000000..b7ad69da3ea
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_reset_master.test
@@ -0,0 +1,26 @@
+# ==== Purpose ====
+#
+# Test bugs in RESET MASTER.
+
+--source include/have_debug.inc
+--source include/have_log_bin.inc
+
+#######################################################################
+# BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
+# Problem: MYSQL_BIN_LOG::reset_logs acquired LOCK_thread_count and
+# LOCK_log in the wrong order. This could cause a deadlock when
+# RESET MASTER was run concurrently with a disconnecting thread.
+#######################################################################
+
+# We use sleep, not debug_sync, because the sync point needs to be in
+# the thread shut down code after the debug sync facility has been
+# shut down.
+--let $write_var= SET DEBUG="+d,sleep_after_lock_thread_count_before_delete_thd"; CREATE TEMPORARY TABLE test.t1 (a INT);
+--let $write_to_file= GENERATE
+--disable_query_log
+--source include/write_var_to_file.inc
+--enable_query_log
+
+--exec $MYSQL < $write_to_file
+RESET MASTER;
+--remove_file $write_to_file
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
index 85313982869..0c8884488cc 100644
--- a/mysql-test/suite/binlog/t/disabled.def
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -9,5 +9,5 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
-binlog_row_failure_mixing_engines : BUG#58416 2010-11-23 ramil Fails on win x86 debug_max
+binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
+binlog_row_failure_mixing_engines : BUG#11765446 2010-11-23 ramil Fails on win x86 debug_max
diff --git a/mysql-test/suite/funcs_1/t/disabled.def b/mysql-test/suite/funcs_1/t/disabled.def
index 3f260ca49ba..032a8f59d2e 100644
--- a/mysql-test/suite/funcs_1/t/disabled.def
+++ b/mysql-test/suite/funcs_1/t/disabled.def
@@ -10,4 +10,4 @@
#
##############################################################################
-ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
+ndb_trig_1011ext: Bug#11747493 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
diff --git a/mysql-test/suite/funcs_2/t/disabled.def b/mysql-test/suite/funcs_2/t/disabled.def
index da6230bd7ed..50c65c30ed0 100644
--- a/mysql-test/suite/funcs_2/t/disabled.def
+++ b/mysql-test/suite/funcs_2/t/disabled.def
@@ -1,6 +1,6 @@
# Disabled by hhunger (2008-03-03) due to WL4204
-innodb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
-myisam_charset : Bug#20447 Problem with prefix keys with contractions and expansions
-memory_charset : Bug#20447 Problem with prefix keys with contractions and expansions
-ndb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+innodb_charset : Bug#11745840 Problem with prefix keys with contractions and expansions
+myisam_charset : Bug#11745840 Problem with prefix keys with contractions and expansions
+memory_charset : Bug#11745840 Problem with prefix keys with contractions and expansions
+ndb_charset : Bug#11745840 Problem with prefix keys with contractions and expansions
diff --git a/mysql-test/suite/innodb/r/innodb_bug59410.result b/mysql-test/suite/innodb/r/innodb_bug59410.result
new file mode 100644
index 00000000000..494d601ba4f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59410.result
@@ -0,0 +1,17 @@
+create table `bug59410_1`(`a` int)engine=innodb;
+insert into `bug59410_1` values (1),(2),(3);
+select 1 from `bug59410_1` where `a` <> any (
+select 1 from `bug59410_1` where `a` <> 1 for update)
+for update;
+1
+1
+1
+drop table bug59410_1;
+create table bug59410_2(`a` char(1),`b` int)engine=innodb;
+insert into bug59410_2 values('0',0);
+set transaction isolation level read uncommitted;
+start transaction;
+set @a=(select b from bug59410_2 where
+(select 1 from bug59410_2 where a group by @a=b)
+group by @a:=b);
+drop table bug59410_2;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59641.result b/mysql-test/suite/innodb/r/innodb_bug59641.result
new file mode 100644
index 00000000000..361172aa82b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59641.result
@@ -0,0 +1,57 @@
+CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
+INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
+COMMIT;
+XA START '123';
+INSERT INTO t VALUES(1,1);
+XA END '123';
+XA PREPARE '123';
+XA START '456';
+INSERT INTO t VALUES(3,47),(5,67);
+UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
+XA END '456';
+XA PREPARE '456';
+XA START '789';
+UPDATE t SET b=4*a WHERE a=32;
+XA END '789';
+XA PREPARE '789';
+call mtr.add_suppression("Found 3 prepared XA transactions");
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+a b
+1 1
+2 2
+3 47
+4 4
+5 134
+8 16
+16 16
+32 128
+COMMIT;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+a b
+1 1
+2 2
+3 47
+4 4
+5 134
+8 16
+16 16
+32 128
+COMMIT;
+XA RECOVER;
+formatID gtrid_length bqual_length data
+1 3 0 789
+1 3 0 456
+1 3 0 123
+XA ROLLBACK '123';
+XA ROLLBACK '456';
+XA COMMIT '789';
+SELECT * FROM t;
+a b
+2 2
+4 4
+8 8
+16 16
+32 128
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 491ca585add..df2fb3f34cf 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -2624,6 +2624,44 @@ insert into t1 values (1,1),(2,1);
alter ignore table t1 add unique `main` (b);
drop table t1;
End of 5.1 tests
+CREATE TABLE t1 (
+pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a int,
+b int,
+INDEX idx(a))
+ENGINE=INNODB;
+INSERT INTO t1(a,b) VALUES
+(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
+(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
+(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
+(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
+INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1 VALUES (1000000, 0, 0);
+SET SESSION sort_buffer_size = 1024*36;
+EXPLAIN
+SELECT COUNT(*) FROM
+(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 3537 Using sort_union(idx,PRIMARY); Using where
+SELECT COUNT(*) FROM
+(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+COUNT(*)
+1537
+SET SESSION sort_buffer_size = DEFAULT;
+DROP TABLE t1;
#
# Test for bug #39932 "create table fails if column for FK is in different
# case than in corr index".
@@ -2652,3 +2690,20 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT, INDEX(a)) engine=innodb;
ALTER TABLE t1 RENAME TO t2, DISABLE KEYS;
DROP TABLE IF EXISTS t1, t2;
+#
+# Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
+# UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
+#
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+LOCK TABLES t1 READ;
+# Even though temporary table was locked for READ we
+# still allow writes to it to be compatible with MyISAM.
+# This is possible since due to fact that temporary tables
+# are specific to connection and therefore locking for them
+# is irrelevant.
+UPDATE t1 SET c = 5;
+UNLOCK TABLES;
+DROP TEMPORARY TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/suite/innodb/t/innodb_bug59410.test b/mysql-test/suite/innodb/t/innodb_bug59410.test
new file mode 100644
index 00000000000..30bb0642679
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59410.test
@@ -0,0 +1,24 @@
+#
+# Bug#59410 read uncommitted: unlock row could not find a 3 mode lock on the record
+#
+-- source include/have_innodb.inc
+
+# only interested that the following do not produce something like
+# InnoDB: Error: unlock row could not find a 2 mode lock on the record
+# in the error log
+
+create table `bug59410_1`(`a` int)engine=innodb;
+insert into `bug59410_1` values (1),(2),(3);
+select 1 from `bug59410_1` where `a` <> any (
+select 1 from `bug59410_1` where `a` <> 1 for update)
+for update;
+drop table bug59410_1;
+
+create table bug59410_2(`a` char(1),`b` int)engine=innodb;
+insert into bug59410_2 values('0',0);
+set transaction isolation level read uncommitted;
+start transaction;
+set @a=(select b from bug59410_2 where
+(select 1 from bug59410_2 where a group by @a=b)
+group by @a:=b);
+drop table bug59410_2;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59641.test b/mysql-test/suite/innodb/t/innodb_bug59641.test
new file mode 100644
index 00000000000..0237673061c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59641.test
@@ -0,0 +1,66 @@
+# Bug #59641 Prepared XA transaction causes shutdown hang after a crash
+
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
+INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
+COMMIT;
+XA START '123';
+INSERT INTO t VALUES(1,1);
+XA END '123';
+XA PREPARE '123';
+
+CONNECT (con1,localhost,root,,);
+CONNECTION con1;
+
+XA START '456';
+INSERT INTO t VALUES(3,47),(5,67);
+UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
+XA END '456';
+XA PREPARE '456';
+
+CONNECT (con2,localhost,root,,);
+CONNECTION con2;
+
+XA START '789';
+UPDATE t SET b=4*a WHERE a=32;
+XA END '789';
+XA PREPARE '789';
+
+# The server would issue this warning on restart.
+call mtr.add_suppression("Found 3 prepared XA transactions");
+
+# Kill the server without sending a shutdown command
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 0
+-- source include/wait_until_disconnected.inc
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+COMMIT;
+
+# Shut down the server. This would hang because of the bug.
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server
+-- source include/wait_until_disconnected.inc
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+COMMIT;
+XA RECOVER;
+XA ROLLBACK '123';
+XA ROLLBACK '456';
+XA COMMIT '789';
+SELECT * FROM t;
+
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index 039284438c7..9fc812c2d07 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -849,9 +849,6 @@ insert into t1 values (1,1),(2,1);
alter ignore table t1 add unique `main` (b);
drop table t1;
---echo End of 5.1 tests
-
-
--echo #
--echo # Test for bug #39932 "create table fails if column for FK is in different
--echo # case than in corr index".
@@ -881,3 +878,25 @@ CREATE TABLE t1 (a INT, INDEX(a)) engine=innodb;
ALTER TABLE t1 RENAME TO t2, DISABLE KEYS;
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
+
+
+--echo #
+--echo # Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
+--echo # UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+LOCK TABLES t1 READ;
+--echo # Even though temporary table was locked for READ we
+--echo # still allow writes to it to be compatible with MyISAM.
+--echo # This is possible since due to fact that temporary tables
+--echo # are specific to connection and therefore locking for them
+--echo # is irrelevant.
+UPDATE t1 SET c = 5;
+UNLOCK TABLES;
+DROP TEMPORARY TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/suite/innodb_plugin/r/innodb-index.result b/mysql-test/suite/innodb_plugin/r/innodb-index.result
index f86fcd4a8ef..5be1460d2b7 100644
--- a/mysql-test/suite/innodb_plugin/r/innodb-index.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-index.result
@@ -1,3 +1,46 @@
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+set global innodb_file_per_table=0;
+set global innodb_file_format=Antelope;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
commit;
@@ -967,6 +1010,29 @@ ERROR HY000: Too big row
alter table t1 row_format=compact;
create index t1u on t1 (u(1));
drop table t1;
+SET @r=REPEAT('a',500);
+CREATE TABLE t1(a INT,
+v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t1(a,v1);
+INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t1 SET a=1000;
+DELETE FROM t1;
+DROP TABLE t1;
+CREATE TABLE bug12547647(
+a INT NOT NULL, b BLOB NOT NULL, c TEXT,
+PRIMARY KEY (b(10), a), INDEX (c(10))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));
+COMMIT;
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+DROP TABLE bug12547647;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
set global innodb_file_format_check=Antelope;
@@ -1170,3 +1236,4 @@ a b
3 a
3 b
DROP TABLE t1;
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb-zip.result b/mysql-test/suite/innodb_plugin/r/innodb-zip.result
index fc35143b305..16947bf16dc 100644
--- a/mysql-test/suite/innodb_plugin/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-zip.result
@@ -62,42 +62,42 @@ row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t0 Compact
-test t00 Compact
-test t1 Compact
-test t10 Dynamic
-test t11 Compressed
-test t12 Compressed
-test t13 Compressed
-test t14 Compact
-test t2 Redundant
-test t3 Compact
-test t4 Compact
-test t5 Redundant
-test t6 Redundant
-test t7 Redundant
-test t8 Compact
-test t9 Compact
+table_schema table_name row_format data_length index_length
+test t0 Compact 16384 0
+test t00 Compact 16384 0
+test t1 Compact 16384 0
+test t10 Dynamic 16384 0
+test t11 Compressed 1024 0
+test t12 Compressed 1024 0
+test t13 Compressed 8192 0
+test t14 Compact 16384 0
+test t2 Redundant 16384 0
+test t3 Compact 16384 0
+test t4 Compact 16384 0
+test t5 Redundant 16384 0
+test t6 Redundant 16384 0
+test t7 Redundant 16384 0
+test t8 Compact 16384 0
+test t9 Compact 16384 0
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Dynamic
+table_schema table_name row_format data_length index_length
+test t1 Dynamic 16384 0
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
+table_schema table_name row_format data_length index_length
+test t1 Compact 16384 0
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Redundant
+table_schema table_name row_format data_length index_length
+test t1 Redundant 16384 0
drop table t1;
create table t1(a int not null, b text, index(b(10))) engine=innodb
key_block_size=1;
@@ -114,11 +114,11 @@ rollback;
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t2 Compact
+table_schema table_name row_format data_length index_length
+test t1 Compressed 2048 1024
+test t2 Compact 16384 0
drop table t1,t2;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
@@ -206,19 +206,19 @@ create table t8 (id int primary key) engine = innodb row_format = compressed;
create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
-test t10 Compact
-test t11 Redundant
-test t3 Compressed
-test t4 Compressed
-test t5 Compressed
-test t6 Compressed
-test t7 Compressed
-test t8 Compressed
-test t9 Dynamic
+table_schema table_name row_format data_length index_length
+test t1 Compact 16384 0
+test t10 Compact 16384 0
+test t11 Redundant 16384 0
+test t3 Compressed 1024 0
+test t4 Compressed 2048 0
+test t5 Compressed 4096 0
+test t6 Compressed 8192 0
+test t7 Compressed 16384 0
+test t8 Compressed 8192 0
+test t9 Dynamic 16384 0
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed;
@@ -245,11 +245,11 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t5 Compressed
+table_schema table_name row_format data_length index_length
+test t1 Compressed 8192 0
+test t5 Compressed 8192 0
drop table t1, t5;
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
@@ -275,9 +275,9 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
+table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
@@ -323,11 +323,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
+table_schema table_name row_format data_length index_length
+test t8 Compact 16384 0
+test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table = on;
set global innodb_file_format = `0`;
@@ -375,11 +375,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
+table_schema table_name row_format data_length index_length
+test t8 Compact 16384 0
+test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug59410.result b/mysql-test/suite/innodb_plugin/r/innodb_bug59410.result
new file mode 100644
index 00000000000..494d601ba4f
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug59410.result
@@ -0,0 +1,17 @@
+create table `bug59410_1`(`a` int)engine=innodb;
+insert into `bug59410_1` values (1),(2),(3);
+select 1 from `bug59410_1` where `a` <> any (
+select 1 from `bug59410_1` where `a` <> 1 for update)
+for update;
+1
+1
+1
+drop table bug59410_1;
+create table bug59410_2(`a` char(1),`b` int)engine=innodb;
+insert into bug59410_2 values('0',0);
+set transaction isolation level read uncommitted;
+start transaction;
+set @a=(select b from bug59410_2 where
+(select 1 from bug59410_2 where a group by @a=b)
+group by @a:=b);
+drop table bug59410_2;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug59641.result b/mysql-test/suite/innodb_plugin/r/innodb_bug59641.result
new file mode 100644
index 00000000000..361172aa82b
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug59641.result
@@ -0,0 +1,57 @@
+CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
+INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
+COMMIT;
+XA START '123';
+INSERT INTO t VALUES(1,1);
+XA END '123';
+XA PREPARE '123';
+XA START '456';
+INSERT INTO t VALUES(3,47),(5,67);
+UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
+XA END '456';
+XA PREPARE '456';
+XA START '789';
+UPDATE t SET b=4*a WHERE a=32;
+XA END '789';
+XA PREPARE '789';
+call mtr.add_suppression("Found 3 prepared XA transactions");
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+a b
+1 1
+2 2
+3 47
+4 4
+5 134
+8 16
+16 16
+32 128
+COMMIT;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+a b
+1 1
+2 2
+3 47
+4 4
+5 134
+8 16
+16 16
+32 128
+COMMIT;
+XA RECOVER;
+formatID gtrid_length bqual_length data
+1 3 0 789
+1 3 0 456
+1 3 0 123
+XA ROLLBACK '123';
+XA ROLLBACK '456';
+XA COMMIT '789';
+SELECT * FROM t;
+a b
+2 2
+4 4
+8 8
+16 16
+32 128
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_mysql.result b/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
index 1aee85b5288..407e56e4aef 100644
--- a/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
@@ -2410,4 +2410,58 @@ PACK_KEYS=0;
CREATE INDEX a ON t1 (a);
CREATE INDEX c on t1 (c);
DROP TABLE t1;
+CREATE TABLE t1 (
+pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a int,
+b int,
+INDEX idx(a))
+ENGINE=INNODB;
+INSERT INTO t1(a,b) VALUES
+(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
+(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
+(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
+(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
+INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1 VALUES (1000000, 0, 0);
+SET SESSION sort_buffer_size = 1024*36;
+EXPLAIN
+SELECT COUNT(*) FROM
+(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 3537 Using sort_union(idx,PRIMARY); Using where
+SELECT COUNT(*) FROM
+(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+COUNT(*)
+1537
+SET SESSION sort_buffer_size = DEFAULT;
+DROP TABLE t1;
+#
+# Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
+# UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
+#
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+LOCK TABLES t1 READ;
+# Even though temporary table was locked for READ we
+# still allow writes to it to be compatible with MyISAM.
+# This is possible since due to fact that temporary tables
+# are specific to connection and therefore locking for them
+# is irrelevant.
+UPDATE t1 SET c = 5;
+UNLOCK TABLES;
+DROP TEMPORARY TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/suite/innodb_plugin/t/innodb-index.test b/mysql-test/suite/innodb_plugin/t/innodb-index.test
index 717c7d4e032..b4e2aae09e9 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb-index.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-index.test
@@ -4,6 +4,65 @@ let $MYSQLD_DATADIR= `select @@datadir`;
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
+let $per_table=`select @@innodb_file_per_table`;
+let $format=`select @@innodb_file_format`;
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+
+# Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure (Bug #12429576)
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+
+eval set global innodb_file_per_table=$per_table;
+eval set global innodb_file_format=$format;
+
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
commit;
@@ -360,8 +419,6 @@ disconnect b;
drop table t1;
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
set global innodb_file_per_table=on;
set global innodb_file_format='Barracuda';
# Test creating a table that could lead to undo log overflow.
@@ -404,6 +461,38 @@ alter table t1 row_format=compact;
create index t1u on t1 (u(1));
drop table t1;
+
+# Bug#12637786
+SET @r=REPEAT('a',500);
+CREATE TABLE t1(a INT,
+ v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+ v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+ v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+ v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+ v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+ v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t1(a,v1);
+INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t1 SET a=1000;
+DELETE FROM t1;
+# Let the purge thread clean up this file.
+-- sleep 10
+DROP TABLE t1;
+
+# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
+CREATE TABLE bug12547647(
+a INT NOT NULL, b BLOB NOT NULL, c TEXT,
+PRIMARY KEY (b(10), a), INDEX (c(10))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));
+COMMIT;
+# The following used to cause infinite undo log allocation.
+--error ER_TOO_BIG_ROWSIZE
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+DROP TABLE bug12547647;
+
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format=$format;
eval set global innodb_file_format_check=$format;
@@ -541,6 +630,7 @@ disconnect a;
disconnect b;
DROP TABLE t1;
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
#
# restore environment to the state it was before this test execution
diff --git a/mysql-test/suite/innodb_plugin/t/innodb-zip.test b/mysql-test/suite/innodb_plugin/t/innodb-zip.test
index 8c1ef1f5467..5ed101b7f20 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb-zip.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-zip.test
@@ -36,19 +36,19 @@ create table t13(a int primary key) engine=innodb
row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1;
@@ -81,7 +81,7 @@ connection default;
disconnect a;
disconnect b;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1,t2;
@@ -192,7 +192,7 @@ create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
@@ -218,7 +218,7 @@ show warnings;
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t5;
@@ -238,7 +238,7 @@ create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
show warnings;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
#test valid values with innodb_file_per_table unset
@@ -268,7 +268,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
@@ -300,7 +300,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug59410.test b/mysql-test/suite/innodb_plugin/t/innodb_bug59410.test
new file mode 100644
index 00000000000..6eabe0a8403
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug59410.test
@@ -0,0 +1,24 @@
+#
+# Bug#59410 read uncommitted: unlock row could not find a 3 mode lock on the record
+#
+-- source include/have_innodb_plugin.inc
+
+# only interested that the following do not produce something like
+# InnoDB: Error: unlock row could not find a 2 mode lock on the record
+# in the error log
+
+create table `bug59410_1`(`a` int)engine=innodb;
+insert into `bug59410_1` values (1),(2),(3);
+select 1 from `bug59410_1` where `a` <> any (
+select 1 from `bug59410_1` where `a` <> 1 for update)
+for update;
+drop table bug59410_1;
+
+create table bug59410_2(`a` char(1),`b` int)engine=innodb;
+insert into bug59410_2 values('0',0);
+set transaction isolation level read uncommitted;
+start transaction;
+set @a=(select b from bug59410_2 where
+(select 1 from bug59410_2 where a group by @a=b)
+group by @a:=b);
+drop table bug59410_2;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug59641.test b/mysql-test/suite/innodb_plugin/t/innodb_bug59641.test
new file mode 100644
index 00000000000..0fb24e47a54
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug59641.test
@@ -0,0 +1,70 @@
+# Bug #59641 Prepared XA transaction causes shutdown hang after a crash
+
+-- source include/not_embedded.inc
+-- source include/have_innodb_plugin.inc
+
+let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
+
+CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
+INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
+COMMIT;
+XA START '123';
+INSERT INTO t VALUES(1,1);
+XA END '123';
+XA PREPARE '123';
+
+CONNECT (con1,localhost,root,,);
+CONNECTION con1;
+
+XA START '456';
+INSERT INTO t VALUES(3,47),(5,67);
+UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
+XA END '456';
+XA PREPARE '456';
+
+CONNECT (con2,localhost,root,,);
+CONNECTION con2;
+
+XA START '789';
+UPDATE t SET b=4*a WHERE a=32;
+XA END '789';
+XA PREPARE '789';
+
+# The server would issue this warning on restart.
+call mtr.add_suppression("Found 3 prepared XA transactions");
+
+# Kill the server without sending a shutdown command
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 0
+-- source include/wait_until_disconnected.inc
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+COMMIT;
+
+# Shut down the server. This would hang because of the bug.
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server
+-- source include/wait_until_disconnected.inc
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+COMMIT;
+XA RECOVER;
+XA ROLLBACK '123';
+XA ROLLBACK '456';
+XA COMMIT '789';
+SELECT * FROM t;
+
+DROP TABLE t;
+--disable_query_log
+eval set global innodb_file_format_check=$innodb_file_format_check_orig;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_mysql.test b/mysql-test/suite/innodb_plugin/t/innodb_mysql.test
index 32bbdfa10b4..1cdc1b4e2fe 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_mysql.test
@@ -647,4 +647,67 @@ CREATE INDEX c on t1 (c);
DROP TABLE t1;
+#
+# Bug#56862 Execution of a query that uses index merge returns a wrong result
+#
+
+CREATE TABLE t1 (
+ pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ a int,
+ b int,
+ INDEX idx(a))
+ENGINE=INNODB;
+
+INSERT INTO t1(a,b) VALUES
+ (11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
+ (3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
+ (6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
+ (13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
+INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1 VALUES (1000000, 0, 0);
+
+SET SESSION sort_buffer_size = 1024*36;
+
+EXPLAIN
+SELECT COUNT(*) FROM
+ (SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+
+SELECT COUNT(*) FROM
+ (SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+
+SET SESSION sort_buffer_size = DEFAULT;
+
+DROP TABLE t1;
+
+
+--echo #
+--echo # Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
+--echo # UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+LOCK TABLES t1 READ;
+--echo # Even though temporary table was locked for READ we
+--echo # still allow writes to it to be compatible with MyISAM.
+--echo # This is possible since due to fact that temporary tables
+--echo # are specific to connection and therefore locking for them
+--echo # is irrelevant.
+UPDATE t1 SET c = 5;
+UNLOCK TABLES;
+DROP TEMPORARY TABLE t1;
--echo End of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
index 0fc9a5d3ad6..1b730642235 100644
--- a/mysql-test/suite/ndb/t/disabled.def
+++ b/mysql-test/suite/ndb/t/disabled.def
@@ -10,6 +10,6 @@
#
##############################################################################
-ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
+ndb_partition_error2 : Bug#11750448 ndb_partition_error2 needs maintenance
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
diff --git a/mysql-test/suite/ndb/t/ndb_partition_error2.test b/mysql-test/suite/ndb/t/ndb_partition_error2.test
index afedd0e3c5c..58c38f2dd37 100644
--- a/mysql-test/suite/ndb/t/ndb_partition_error2.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_error2.test
@@ -1,3 +1,4 @@
+-- source include/have_ndb.inc
disable_query_log;
--require r/true.require
select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
diff --git a/mysql-test/suite/ndb_team/t/disabled.def b/mysql-test/suite/ndb_team/t/disabled.def
index 714f1014a10..e70e23b8303 100644
--- a/mysql-test/suite/ndb_team/t/disabled.def
+++ b/mysql-test/suite/ndb_team/t/disabled.def
@@ -9,8 +9,8 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
-ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+ndb_autodiscover : BUG#11745709 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+ndb_autodiscover2 : BUG#11745709 2006-02-16 jmiller Needs to be fixed w.r.t binlog
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_autodiscover3 : bug#21806
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index 518a3c90422..113fe6fdd44 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -1,3 +1,3 @@
-partition_basic_ndb : Bug#19899 Crashing the server
+partition_basic_ndb : Bug#11745782 Crashing the server
# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
-partition_syntax_ndb : Bug#36735 Not supported
+partition_syntax_ndb : Bug#11748568 Not supported
diff --git a/mysql-test/suite/rpl/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result
index ff217af6431..fb21540aa31 100644
--- a/mysql-test/suite/rpl/r/rpl_relayspace.result
+++ b/mysql-test/suite/rpl/r/rpl_relayspace.result
@@ -1,7 +1,6 @@
include/master-slave.inc
[connection master]
-stop slave;
-include/wait_for_slave_to_stop.inc
+include/stop_slave.inc
create table t1 (a int);
drop table t1;
create table t1 (a int);
@@ -9,11 +8,8 @@ drop table t1;
reset slave;
start slave io_thread;
include/wait_for_slave_param.inc [Slave_IO_State]
-stop slave io_thread;
-include/wait_for_slave_io_to_stop.inc
+include/stop_slave_io.inc
reset slave;
-start slave;
-select master_pos_wait('MASTER_LOG_FILE',200,30)=-1;
-master_pos_wait('MASTER_LOG_FILE',200,30)=-1
-0
+include/start_slave.inc
+include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL]
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_corruption.result b/mysql-test/suite/rpl/r/rpl_row_corruption.result
new file mode 100644
index 00000000000..7fd47a20f03
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_corruption.result
@@ -0,0 +1,49 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004 (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004 VALUES (2);
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
+include/wait_for_slave_sql_error.inc [errno=1593 ]
+include/stop_slave.inc
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+DROP TABLE t1_11753004, t2_11753004;
+include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004_ign (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004_ign VALUES (2);
+UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+ERROR HY000: Fatal error: Found table map event mapping table id 0 which was already mapped but with different settings.
+DROP TABLE t1,t2;
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+DROP TABLE t1_11753004;
+DROP TABLE t2_11753004_ign;
+SET GLOBAL debug= @save_debug;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index dacb69bc7cb..4f299a1b23b 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -19,7 +19,7 @@ change master to master_port=MASTER_PORT;
start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
-*** checking until postion execution: must be only t1 in the list ***
+*** checking until position execution: must be only t1 in the list ***
show tables;
Tables_in_test
t1
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 33f65ff3ecc..0a8f3cb2a50 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,7 +10,7 @@
#
##############################################################################
-rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576
-rpl_get_master_version_and_clock : Bug#59178 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
+rpl_row_create_table : Bug#11759274 Feb 27 2010 andrei failed different way than earlier with bug#45576
+rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
index 9df62e3a095..fc33d6bc0ba 100644
--- a/mysql-test/suite/rpl/t/rpl_relayspace.test
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test
@@ -2,10 +2,9 @@
# to force the deadlock after one event.
source include/master-slave.inc;
-let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1);
+--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1)
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
connection master;
# This will generate a master's binlog > 10 bytes
create table t1 (a int);
@@ -21,23 +20,33 @@ let $slave_param_value= Waiting for the slave SQL thread to free enough relay lo
source include/wait_for_slave_param.inc;
# A bug caused the I/O thread to refuse stopping.
-stop slave io_thread;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
reset slave;
-start slave;
-# The I/O thread stops filling the relay log when
-# it's >10b. And the SQL thread cannot purge this relay log
-# as purge is done only when the SQL thread switches to another
-# relay log, which does not exist here.
-# So we should have a deadlock.
-# if it is not resolved automatically we'll detect
-# it with master_pos_wait that waits for farther than 1Ob;
-# it will timeout;
-# also the slave will probably not cooperate to shutdown
-# (as 2 threads are locked)
---replace_result $master_log_file MASTER_LOG_FILE
-eval select master_pos_wait('$master_log_file',200,30)=-1;
+--source include/start_slave.inc
+# The I/O thread stops filling the relay log when it's >10b. And the
+# SQL thread cannot purge this relay log as purge is done only when
+# the SQL thread switches to another relay log, which does not exist
+# here. So we should have a deadlock. If it is not resolved
+# automatically we'll detect it with master_pos_wait that waits for
+# farther than 1Ob; it will timeout after 300 seconds (which is inline
+# with the default used for sync_slave_with_master and will protect us
+# against slow test envs); also the slave will probably not cooperate
+# to shutdown (as 2 threads are locked)
+--let $outcome= `SELECT MASTER_POS_WAIT('$master_log_file',200,300) AS mpw;`
+
+# master_pos_wait returns:
+#
+# * >= 0, the number of events the slave had to wait to advance to the
+# position
+#
+# * -1, if there was a timeout
+#
+# * NULL, if an error occurred, or the SQL thread was not started,
+# slave master info is not initialized, the arguments are incorrect
+--let $assert_text= Assert that master_pos_wait does not timeout nor it returns NULL
+--let $assert_cond= $outcome IS NOT NULL AND $outcome <> -1
+--source include/assert.inc
# End of 4.1 tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
new file mode 100644
index 00000000000..da199510eb3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
@@ -0,0 +1 @@
+--replicate-ignore-table=test.t2_11753004_ign
diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption.test b/mysql-test/suite/rpl/t/rpl_row_corruption.test
new file mode 100644
index 00000000000..a7650c615a3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption.test
@@ -0,0 +1,115 @@
+#
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+# BUG#11753004: 44360: REPLICATION FAILED
+
+## assert that we get an error when checking the
+## identifiers at the slave (instead of a crash or
+## different table being updated)
+
+--let $t1= t1_11753004
+--let $t2= t2_11753004
+--let $t2_ign= t2_11753004_ign
+
+## test #1: assert that we get an error raised when multiple
+## tables in the same RBR statement are mapped with the
+## same identifier
+
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2 (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2 VALUES (2)
+
+--sync_slave_with_master
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+
+# stop the slave and inject corruption
+--source include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+# both tables get mapped to 0 (in a way, simulating scenario
+# originated by BUG#56226)
+--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
+--connection slave
+
+# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
+--let $slave_sql_errno=1593
+--source include/wait_for_slave_sql_error.inc
+--source include/stop_slave.inc
+
+# clean up
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+--source include/rpl_reset.inc
+--eval DROP TABLE $t1, $t2
+--sync_slave_with_master
+
+## test #2: assert that ignored tables that may have been mapped
+## with the same identifier are skipped, thus no error
+## is raised.
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--source include/rpl_reset.inc
+--connection master
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2_ign (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2_ign VALUES (2)
+--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
+
+# must not raise error as second table is filtered
+--sync_slave_with_master
+
+
+## test #3: check that BINLOG statements will also raise an
+## error if containing table map events mapping different
+## tables to same table identifier.
+
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# FD event
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+
+#110708 12:21:44 server id 1 end_log_pos 774 Table_map: `test`.`t1` mapped to number 66
+# at 774
+#110708 12:21:44 server id 1 end_log_pos 815 Table_map: `test`.`t2` mapped to number 67
+# at 815
+#110708 12:21:44 server id 1 end_log_pos 855 Update_rows: table id 66
+# at 855
+#110708 12:21:44 server id 1 end_log_pos 895 Update_rows: table id 67 flags: STMT_END_F
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--error ER_SLAVE_FATAL_ERROR
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+
+
+# clean up
+DROP TABLE t1,t2;
+--connection slave
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--connection master
+--eval DROP TABLE $t1
+--eval DROP TABLE $t2_ign
+--sync_slave_with_master
+SET GLOBAL debug= @save_debug;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index afd964ca81a..bf38bd487ea 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -9,29 +9,29 @@ connection master;
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4);
DROP TABLE t1;
-# Save master log postion for query DROP TABLE t1
+# Save master log position for query DROP TABLE t1
save_master_pos;
let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7);
let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7);
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
-# Save master log postion for query CREATE TABLE t2
+# Save master log position for query CREATE TABLE t2
save_master_pos;
let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8);
INSERT INTO t2 VALUES (1),(2);
save_master_pos;
-# Save master log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save master log position for query INSERT INTO t2 VALUES (1),(2);
let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12);
sync_slave_with_master;
-# Save relay log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save relay log position for query INSERT INTO t2 VALUES (1),(2);
let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1);
connection master;
INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
-# Save master log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save master log position for query INSERT INTO t2 VALUES (1),(2);
let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 17);
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
index 32d5e1ec8f2..aeb7292ed17 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id2.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
@@ -47,7 +47,7 @@ eval start slave until master_log_file='master-bin.000001', master_log_pos=$unti
--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
---echo *** checking until postion execution: must be only t1 in the list ***
+--echo *** checking until position execution: must be only t1 in the list ***
show tables;
# cleanup
diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def
index 2f15112515e..8fa6e9c099e 100644
--- a/mysql-test/suite/rpl_ndb/t/disabled.def
+++ b/mysql-test/suite/rpl_ndb/t/disabled.def
@@ -11,4 +11,4 @@
##############################################################################
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
-rpl_ndb_2ndb : Bug#45974: rpl_ndb_2ndb fails sporadically
+rpl_ndb_2ndb : Bug#11754374 : rpl_ndb_2ndb fails sporadically
diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def
index 915ea7a6f5c..866172fb51a 100644
--- a/mysql-test/suite/sys_vars/t/disabled.def
+++ b/mysql-test/suite/sys_vars/t/disabled.def
@@ -9,5 +9,5 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-sys_vars.max_binlog_cache_size_basic_64 : bug#56408 2010-08-31 Horst
-sys_vars.max_binlog_cache_size_basic_32 : bug#56408 2010-08-31 Horst
+sys_vars.max_binlog_cache_size_basic_64 : bug#11763668 2010-08-31 Horst
+sys_vars.max_binlog_cache_size_basic_32 : bug#11763668 2010-08-31 Horst
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 57e2b7e1a5b..d0114a94dfd 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1100,4 +1100,31 @@ ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
+--echo #
+--echo # Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION
+--echo # FIRST CAN CAUSE DATA TO BE CORRUPTED".
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--echo # Use MyISAM engine as the fact that InnoDB doesn't support
+--echo # in-place ALTER TABLE in cases when columns are being renamed
+--echo # hides some bugs.
+create table t1 (i int, j int) engine=myisam;
+insert into t1 value (1, 2);
+--echo # First, test for original problem described in the bug report.
+select * from t1;
+--echo # Change of column order by the below ALTER TABLE statement should
+--echo # affect both column names and column contents.
+alter table t1 modify column j int first;
+select * from t1;
+--echo # Now test for similar problem with the same root.
+--echo # The below ALTER TABLE should change not only the name but
+--echo # also the value for the last column of the table.
+alter table t1 drop column i, add column k int default 0;
+select * from t1;
+--echo # Clean-up.
+drop table t1;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 5b819620e29..9ecbee1ac9f 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1687,7 +1687,6 @@ SELECT * FROM t1;
REPAIR TABLE t1 EXTENDED;
SELECT * FROM t1;
DROP TABLE t1;
-
#
# Bug #47012 archive tables are not upgradeable, and server crashes on
# any access
@@ -1700,3 +1699,17 @@ select * from t1;
repair table t1;
select sum(length(a)),sum(b) from t1;
drop table t1;
+--echo #
+--echo # BUG#57162 - valgrind errors, random data when returning
+--echo # ordered data from archive tables
+--echo #
+SET sort_buffer_size=32804;
+CREATE TABLE t1(a INT, b CHAR(255), c CHAR(255), d CHAR(255),
+ e CHAR(255), f INT) ENGINE=ARCHIVE DEFAULT CHARSET utf8;
+INSERT INTO t1 VALUES(-1,'b','c','d','e',1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6;
+SELECT * FROM t1 ORDER BY f LIMIT 1;
+DROP TABLE t1;
+SET sort_buffer_size=DEFAULT;
diff --git a/mysql-test/t/archive_debug.test b/mysql-test/t/archive_debug.test
new file mode 100644
index 00000000000..9cece254140
--- /dev/null
+++ b/mysql-test/t/archive_debug.test
@@ -0,0 +1,13 @@
+--source include/have_archive.inc
+--source include/have_debug.inc
+
+--echo #
+--echo # BUG#12402794 - 60976: CRASH, VALGRIND WARNING AND MEMORY LEAK
+--echo # WITH PARTITIONED ARCHIVE TABLES
+--echo #
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+INSERT INTO t1 VALUES(1);
+SET SESSION debug='d,simulate_archive_open_failure';
+CHECK TABLE t1;
+SET SESSION debug=DEFAULT;
+DROP TABLE t1;
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 8e60d548c2f..426d7c7fdf2 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -282,5 +282,19 @@ SELECT 1 FROM
) AS s LIMIT 1;
DROP TABLE t1;
+--echo #
+--echo # Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING
+--echo # DOESN'T ADHERE TO MAX_ALLOWED_PACKET
+
+SET @@GLOBAL.max_allowed_packet=2048;
+# reconnect to make the new max packet size take effect
+--connect (newconn, localhost, root,,)
+
+SELECT CONVERT('a', BINARY(2049));
+SELECT CONVERT('a', CHAR(2049));
+
+connection default;
+disconnect newconn;
+SET @@GLOBAL.max_allowed_packet=default;
--echo End of 5.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index c244d08e308..84c981c08c1 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -9,7 +9,7 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
-query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
-log_tables-big : Bug#48646 2010-11-15 mattiasj report already exists
-read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists
+kill : Bug#11748945 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
+read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
+main.log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
+
diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test
index ccdeb70d291..7f31e3fc881 100644
--- a/mysql-test/t/events_1.test
+++ b/mysql-test/t/events_1.test
@@ -4,6 +4,8 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
+
--disable_warnings
drop database if exists events_test;
drop database if exists db_x;
@@ -270,23 +272,28 @@ SHOW EVENTS;
--echo Try to alter mysql.event: the server should fail to load
--echo event information after mysql.event was tampered with.
--echo
---echo First, let's add a column to the end and make sure everything
---echo works as before
+--echo First, let's add a column to the end and check the error is emitted.
--echo
ALTER TABLE mysql.event ADD dummy INT;
---replace_column 8 # 9 #
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW EVENTS;
+--error ER_EVENT_OPEN_TABLE_FAILED
SELECT event_name FROM INFORMATION_SCHEMA.events;
---replace_regex /STARTS '[^']+'/STARTS '#'/
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW CREATE EVENT intact_check;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT no_such_event;
+--error ER_EVENT_OPEN_TABLE_FAILED
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_1;
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_2;
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check;
DROP DATABASE IF EXISTS mysqltest_no_such_database;
CREATE DATABASE mysqltest_db2;
@@ -296,6 +303,7 @@ SHOW VARIABLES LIKE 'event_scheduler';
SET GLOBAL event_scheduler=OFF;
# Clean up
ALTER TABLE mysql.event DROP dummy;
+DROP EVENT intact_check;
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
--echo
--echo Now let's add a column to the first position: the server
@@ -303,24 +311,26 @@ CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
--echo
ALTER TABLE mysql.event ADD dummy INT FIRST;
--error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW EVENTS;
--error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SELECT event_name FROM INFORMATION_SCHEMA.events;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW CREATE EVENT intact_check;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT no_such_event;
---error ER_EVENT_STORE_FAILED
+--error ER_EVENT_OPEN_TABLE_FAILED
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_1;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check;
# Should work OK
DROP DATABASE IF EXISTS mysqltest_no_such_database;
@@ -341,25 +351,25 @@ INSERT INTO event_like SELECT * FROM mysql.event;
--echo
--echo
ALTER TABLE mysql.event DROP comment, DROP starts;
---error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW EVENTS;
---error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
---error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW CREATE EVENT intact_check;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT no_such_event;
---error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
+--error ER_EVENT_OPEN_TABLE_FAILED
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_1;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_2;
-# Should succeed
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check;
DROP DATABASE IF EXISTS mysqltest_no_such_database;
CREATE DATABASE mysqltest_db2;
@@ -407,9 +417,54 @@ CREATE TABLE mysql.event like event_like;
DROP TABLE event_like;
--replace_column 8 # 9 #
SHOW EVENTS;
-#
-# End of tests
-#
+
+--echo
+--echo #
+--echo # Bug#12394306: the sever may crash if mysql.event is corrupted
+--echo #
+
+--echo
+CREATE EVENT ev1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ALTER EVENT ev1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+
+--echo
+CREATE TABLE event_original LIKE mysql.event;
+INSERT INTO event_original SELECT * FROM mysql.event;
+
+--echo
+ALTER TABLE mysql.event MODIFY modified CHAR(1);
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+SHOW EVENTS;
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+SELECT event_name, created, last_altered FROM information_schema.events;
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+CREATE EVENT ev2 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+ALTER EVENT ev1 ON SCHEDULE EVERY 9 HOUR DO SELECT 9;
+
+--echo
+DROP TABLE mysql.event;
+RENAME TABLE event_original TO mysql.event;
+
+--echo
+DROP EVENT ev1;
+
+--echo
+SHOW EVENTS;
+
+
+--echo
+--echo #
+--echo # End of tests
+--echo #
let $wait_condition=
select count(*) = 0 from information_schema.processlist
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 420e7183621..a57235d744b 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -857,6 +857,7 @@ DROP EVENT e2;
DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
+SET TIMESTAMP=DEFAULT;
#
# START - BUG#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
@@ -1235,7 +1236,73 @@ SHOW EVENTS;
DROP DATABASE event_test1;
DROP DATABASE event_test12;
+--echo #
+--echo # Bug#12546938 (formerly known as bug#61005):
+--echo # CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
+--echo #
+USE events_test;
+SET GLOBAL event_scheduler = ON;
+
+--disable_warnings
+DROP TABLE IF EXISTS table_bug12546938;
+DROP EVENT IF EXISTS event_Bug12546938;
+--enable_warnings
+CREATE TABLE table_bug12546938 (i INT);
+
+delimiter |;
+
+--echo # Create an event which will be executed with a small delay
+--echo # and won't be automatically dropped after that.
+CREATE EVENT event_Bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+ INSERT INTO table_bug12546938 VALUES(1);
+END
+|
+
+--echo # Now try to create the same event using CREATE EVENT IF NOT EXISTS.
+--echo # A warning should be emitted. A new event should not be created nor
+--echo # the old event should be re-executed.
+CREATE EVENT IF NOT EXISTS event_bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+ INSERT INTO table_bug12546938 VALUES (1);
+END
+|
+
+delimiter ;|
+--echo # Wait until at least one instance of event is executed.
+let $wait_condition= SELECT COUNT(*) FROM table_bug12546938;
+--source include/wait_condition.inc
+
+--echo # Check that only one instance of our event was executed.
+SELECT COUNT(*) FROM table_bug12546938;
+
+--echo # Clean-up.
+DROP EVENT IF EXISTS event_Bug12546938;
+DROP TABLE table_bug12546938;
+SET GLOBAL EVENT_SCHEDULER = OFF;
+
+#
+# Bug#11764334 - 57156: ALTER EVENT CHANGES THE EVENT STATUS
+#
+--disable_warnings
+DROP DATABASE IF EXISTS event_test11764334;
+--enable_warnings
+CREATE DATABASE event_test11764334;
+USE event_test11764334;
+CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
+--replace_column 9 # 10 #
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+ALTER EVENT ev1 ON SCHEDULE EVERY 4 SECOND;
+--replace_column 9 # 10 #
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+DROP EVENT ev1;
+DROP DATABASE event_test11764334;
+USE test;
###########################################################################
#
# End of tests
diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test
index e155fe2ea16..facf2912087 100644
--- a/mysql-test/t/events_restart.test
+++ b/mysql-test/t/events_restart.test
@@ -1,6 +1,8 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
+
#
# Test that when the server is restarted, it checks mysql.event table,
# and disables the scheduler if it's not up to date.
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index c6c30b58341..e764ee80578 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -1,5 +1,5 @@
#
-# Test of different EXPLAIN's
+# Test of different EXPLAINs
--disable_warnings
drop table if exists t1;
@@ -157,11 +157,12 @@ CREATE TABLE t1 (f1 INT);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
-# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
---error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+# EXPLAIN EXTENDED (with subselect). used to crash.
+# This is actually a valid query for this sql_mode,
+# but it was transformed in such a way that it failed, see
+# Bug#12329653 - EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
EXPLAIN EXTENDED SELECT 1 FROM t1
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-SHOW WARNINGS;
SET SESSION sql_mode=@old_sql_mode;
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 9d51a5c94f9..1906d2d347a 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -349,4 +349,10 @@ DROP TABLE t1;
SELECT ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'));
+--echo #
+--echo # Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
+--echo #
+
+SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 98ecb649c94..2d4f50c8271 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -921,4 +921,17 @@ SELECT DATE_FORMAT('0000-00-11', '%W');
SELECT DATE_FORMAT('0000-00-11', '%a');
SELECT DATE_FORMAT('0000-00-11', '%w');
+--echo #
+--echo # Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
+--echo #
+
+SELECT MAKEDATE(11111111,1);
+SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
+
+--echo #
+--echo # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
+--echo #
+
+DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 9e6002a1faf..b99d35ecd48 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -940,3 +940,31 @@ DROP TABLE t1;
--echo End of 5.0 tests.
+
+
+--echo #
+--echo # Bug #57323/11764487: myisam corruption with insert ignore
+--echo # and invalid spatial data
+--echo #
+
+CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL,
+ SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=NULL;
+SELECT ASTEXT(a), ASTEXT(b) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
+ KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=1, b=NULL;
+SELECT a, ASTEXT(b) FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 94cec60944a..f8cec14d9ae 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -760,10 +760,56 @@ drop table t1;
--echo # on char > 31 bytes".
--echo #
create table t1(a char(32) not null) engine=myisam;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_ARGUMENTS
create spatial index i on t1 (a);
drop table t1;
+#
+# Bug#11767480 - SPATIAL INDEXES ON NON-SPATIAL COLUMNS CAUSE CRASHES.
+#
+CREATE TABLE t0 (a BINARY(32) NOT NULL);
+--error ER_WRONG_ARGUMENTS
+CREATE SPATIAL INDEX i on t0 (a);
+INSERT INTO t0 VALUES (1);
+
+--error ER_WRONG_ARGUMENTS
+CREATE TABLE t1(
+ col0 BINARY NOT NULL,
+ col2 TIMESTAMP,
+ SPATIAL INDEX i1 (col0)
+) ENGINE=MyISAM;
+
+# Test other ways to add indices
+CREATE TABLE t1 (
+ col0 BINARY NOT NULL,
+ col2 TIMESTAMP
+) ENGINE=MyISAM;
+
+--error ER_WRONG_ARGUMENTS
+CREATE SPATIAL INDEX idx0 ON t1(col0);
+
+--error ER_WRONG_ARGUMENTS
+ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0);
+
+CREATE TABLE t2 (
+ col0 INTEGER NOT NULL,
+ col1 POINT,
+ col2 POINT
+);
+
+--error ER_WRONG_ARGUMENTS
+CREATE SPATIAL INDEX idx0 ON t2 (col1, col2);
+
+--error ER_WRONG_ARGUMENTS
+CREATE TABLE t3 (
+ col0 INTEGER NOT NULL,
+ col1 POINT,
+ col2 LINESTRING,
+ SPATIAL INDEX i1 (col1, col2)
+);
+
+# cleanup
+DROP TABLE t0, t1, t2;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 44af2ca27a2..8f38f0e9fd9 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1300,5 +1300,19 @@ FROM t1 GROUP BY a;
DROP TABLE t1;
+--echo #
+--echo # Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
+--echo # by functions
+--echo #
+
+SET SQL_BIG_TABLES=1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0),(0);
+SELECT 1 FROM t1 GROUP BY IF(`a`,'','');
+SELECT 1 FROM t1 GROUP BY TRIM(LEADING RAND() FROM '');
+SELECT 1 FROM t1 GROUP BY SUBSTRING('',SLEEP(0),'');
+SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<');
+DROP TABLE t1;
+SET SQL_BIG_TABLES=0;
--echo # End of 5.1 tests
diff --git a/mysql-test/t/implicit_char_to_num_conversion.test b/mysql-test/t/implicit_char_to_num_conversion.test
new file mode 100644
index 00000000000..b4948fbc69f
--- /dev/null
+++ b/mysql-test/t/implicit_char_to_num_conversion.test
@@ -0,0 +1,174 @@
+########### implicit_char_to_num_conversion.test #######################
+# #
+# This test aims at using string/char literal in comparison operators #
+# without explicit type-cast. This is a bug test for Bug#11766521 #
+# - Incorrect result is returned if string/char literal is used with #
+# comparision operator and bit data type column. Test is extended to #
+# include numeric data type comparison with string/char literal #
+# #
+# #
+# Creation: #
+# 2011-05-10 vfisrekar Implement this test as part of Bug#11766521 #
+# #
+########################################################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t5;
+--enable_warnings
+
+let $default_engine = `select @@SESSION.storage_engine`;
+
+# Bug#11766521 - BIT Datatype comparison in where clause return incorrect
+# result for '=' , '<=>' operators
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 BIT(2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (0), (1), (2);
+SELECT HEX(c1) FROM t5 ORDER BY c1;
+# Enable Following two select after Bug#11766521 fix
+# SELECT HEX(c1) FROM t5 WHERE c1 = '1' ORDER BY c1;
+# SELECT HEX(c1) FROM t5 WHERE c1 <=> '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 = b'1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 <=> b'1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 != b'1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 >= '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 <= '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 < '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 > '0' ORDER BY c1;
+DROP TABLE t5;
+
+# FLOAT Data-type
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 FLOAT(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (-10.10), (1), (0);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+# Following two queries does not return result may be due to Bug#11766521.
+# Enable them after Bug#11766521 fix.
+# SELECT c1 FROM t5 WHERE c1 = '10.10' ORDER BY c1;
+# SELECT c1 FROM t5 WHERE c2 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '10.10' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '1' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '1' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '0' ORDER BY c1;
+DROP TABLE t5;
+
+# TINYINT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 TINYINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95), (10),(11),(-8);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '10' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '10' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-8' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '10' ORDER BY c1;
+DROP TABLE t5;
+
+# SMALLINT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 SMALLINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (395), (-200), (100), (111);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '100' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '100' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '395' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '-200' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '100' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '111' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '111' ORDER BY c1;
+DROP TABLE t5;
+
+# MEDIUMINT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 MEDIUMINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (-8388607), (311),(215),(88608);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '311' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '311' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '215' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '88608' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-8388607' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '215' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '215' ORDER BY c1;
+DROP TABLE t5;
+
+# INT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 INT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (-2147483647), (1011),(15),(9388607);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '9388607' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '9388607' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '15' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '1011' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-2147483647' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '15' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '15' ORDER BY c1;
+DROP TABLE t5;
+
+# BIGINT Data-type
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 BIGINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (-9223372036854775807), (12011),(500),(3372036854775808);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '-9223372036854775807' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '-9223372036854775807' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '12011' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '500' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '3372036854775808' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '12011' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '12011' ORDER BY c1;
+DROP TABLE t5;
+
+# DOUBLE Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 DOUBLE(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+DROP TABLE t5;
+
+# NUMERIC Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 NUMERIC(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+DROP TABLE t5;
+
+# DECIMAL Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 DECIMAL(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+DROP TABLE t5;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 0b34f9fdbac..90386a97fc6 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1814,6 +1814,51 @@ REPAIR TABLE m1;
#
DROP TABLE m1, t1;
+
+--echo #
+--echo # BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD
+--echo # CRASHES SERVER
+--echo #
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE TABLE t3(a INT, b INT);
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+
+--echo # Test reopen merge parent failure
+LOCK TABLES m1 READ;
+--echo # Remove 'm1' table using file operations.
+remove_file $MYSQLD_DATADIR/test/m1.MRG;
+remove_file $MYSQLD_DATADIR/test/m1.frm;
+--error ER_NO_SUCH_TABLE
+FLUSH TABLES;
+UNLOCK TABLES;
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+
+--echo # Test reopen merge child failure
+LOCK TABLES m1 READ;
+--echo # Remove 't1' table using file operations.
+remove_file $MYSQLD_DATADIR/test/t1.frm;
+remove_file $MYSQLD_DATADIR/test/t1.MYI;
+remove_file $MYSQLD_DATADIR/test/t1.MYD;
+--error ER_NO_SUCH_TABLE
+FLUSH TABLES;
+UNLOCK TABLES;
+CREATE TABLE t1(a INT);
+
+--echo # Test reattach merge failure
+LOCK TABLES m1 READ;
+--echo # Replace 't1' with 't3' table using file operations.
+remove_file $MYSQLD_DATADIR/test/t1.frm;
+remove_file $MYSQLD_DATADIR/test/t1.MYI;
+remove_file $MYSQLD_DATADIR/test/t1.MYD;
+copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI;
+copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD;
+--error ER_CANT_REOPEN_TABLE
+FLUSH TABLES;
+UNLOCK TABLES;
+DROP TABLE t1, t2, t3, m1;
+
--echo End of 5.1 tests
--disable_result_log
diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/t/mysqlbinlog_base64.test
index fb21e28fdcb..3d3444cea1c 100644
--- a/mysql-test/t/mysqlbinlog_base64.test
+++ b/mysql-test/t/mysqlbinlog_base64.test
@@ -71,3 +71,32 @@ select count(*) from t2;
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
drop table t1;
drop table t2;
+
+#
+# BUG#12354268
+#
+# This test verifies that using --start-position with DECODE-ROWS
+# does not make mysqlbinlog to output an error stating that it
+# does not contain any FD event.
+#
+
+RESET MASTER;
+USE test;
+SET @old_binlog_format= @@binlog_format;
+SET SESSION binlog_format=ROW;
+CREATE TABLE t1(c1 INT);
+--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let $MYSQLD_DATADIR= `SELECT @@datadir`
+
+INSERT INTO t1 VALUES (1);
+
+FLUSH LOGS;
+
+--disable_result_log
+--exec $MYSQL_BINLOG --base64-output=DECODE-ROWS --start-position=$master_pos -v $MYSQLD_DATADIR/$master_binlog
+--enable_result_log
+
+DROP TABLE t1;
+SET SESSION binlog_format= @old_binlog_format;
+RESET MASTER;
diff --git a/mysql-test/t/parser_stack.test b/mysql-test/t/parser_stack.test
index 3330ef41833..e58459044f0 100644
--- a/mysql-test/t/parser_stack.test
+++ b/mysql-test/t/parser_stack.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 Sun Microsystems, Inc
+# Copyright (c) 2008 MySQL 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
@@ -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 St, Fifth Floor, Boston, MA 02110-1301 USA
#
# These tests are designed to cause an internal parser stack overflow,
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index c4c17a6d2f1..61aab8233ff 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -15,6 +15,37 @@ drop table if exists t1, t2;
--enable_warnings
--echo #
+--echo # Bug#11765667: bug#58655: ASSERTION FAILED,
+--echo # SERVER CRASHES WITH MYSQLD GOT SIGNAL 6
+--echo #
+CREATE TABLE t1 (
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt DATE, st VARCHAR(255), uid INT,
+ id2nd LONGBLOB, filler VARCHAR(255), PRIMARY KEY(id, dt)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+ ('1991-03-14', 'Initial Insert', 200, 1234567, 'No Data'),
+ ('1991-02-26', 'Initial Insert', 201, 1234567, 'No Data'),
+ ('1992-03-16', 'Initial Insert', 234, 1234567, 'No Data'),
+ ('1992-07-02', 'Initial Insert', 287, 1234567, 'No Data'),
+ ('1991-05-26', 'Initial Insert', 256, 1234567, 'No Data'),
+ ('1991-04-25', 'Initial Insert', 222, 1234567, 'No Data'),
+ ('1993-03-12', 'Initial Insert', 267, 1234567, 'No Data'),
+ ('1993-03-14', 'Initial Insert', 291, 1234567, 'No Data'),
+ ('1991-12-20', 'Initial Insert', 298, 1234567, 'No Data'),
+ ('1994-10-31', 'Initial Insert', 220, 1234567, 'No Data');
+ALTER TABLE t1 PARTITION BY LIST (YEAR(dt)) (
+ PARTITION d1 VALUES IN (1991, 1994),
+ PARTITION d2 VALUES IN (1993),
+ PARTITION d3 VALUES IN (1992, 1995, 1996)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+ ('1991-07-14', 'After Partitioning Insert', 299, 1234567, 'Insert row');
+UPDATE t1 SET filler='Updating the row' WHERE uid=298;
+
+DROP TABLE t1;
+
+--echo #
--echo # Bug#59297: Can't find record in 'tablename' on update inner join
--echo #
diff --git a/mysql-test/t/partition_not_embedded.test b/mysql-test/t/partition_myisam.test
index 5c512085a9e..51f46aa71be 100644
--- a/mysql-test/t/partition_not_embedded.test
+++ b/mysql-test/t/partition_myisam.test
@@ -1,5 +1,4 @@
-- source include/have_partition.inc
--- source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
@@ -51,3 +50,13 @@ DROP TABLE t1;
--list_files $MYSQLD_DATADIR/test t1*
--list_files $MYSQLD_DATADIR/test t2*
--echo # End of bug#30102 test.
+
+--echo # Test of post-push fix for bug#11766249/59316
+CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100,
+ PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100,
+ PARTITION pMax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1, "Partition p1, first row");
+DROP TABLE t1;
diff --git a/mysql-test/t/secure_file_priv_win-master.opt b/mysql-test/t/secure_file_priv_win-master.opt
new file mode 100644
index 00000000000..e9a43a5584d
--- /dev/null
+++ b/mysql-test/t/secure_file_priv_win-master.opt
@@ -0,0 +1 @@
+--secure_file_priv=$MYSQL_TMP_DIR
diff --git a/mysql-test/t/secure_file_priv_win.test b/mysql-test/t/secure_file_priv_win.test
new file mode 100644
index 00000000000..a12510974ce
--- /dev/null
+++ b/mysql-test/t/secure_file_priv_win.test
@@ -0,0 +1,79 @@
+#
+# Bug58747 breaks secure_file_priv+not secure yet+still accesses other folders
+#
+
+# we do the windows specific relative directory testing
+
+--source include/windows.inc
+
+CREATE TABLE t1 (c1 longtext);
+INSERT INTO t1 values ('a');
+
+LET $MYSQL_TMP_DIR_UCASE= `SELECT upper('$MYSQL_TMP_DIR')`;
+LET $MYSQL_TMP_DIR_LCASE= `SELECT lower('$MYSQL_TMP_DIR')`;
+
+#create the file
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR/B11764517.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show global variables like 'secure_file_priv';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR\\\\B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval SELECT load_file('$MYSQL_TMP_DIR_UCASE/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval SELECT load_file('$MYSQL_TMP_DIR_LCASE/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR\\\\B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR_UCASE/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error ER_OPTION_PREVENTS_STATEMENT
+eval LOAD DATA INFILE "$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp" into table t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error ER_OPTION_PREVENTS_STATEMENT
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517-2.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR\\\\B11764517-2.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR/B11764517-3.tmp';
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR_UCASE/B11764517-4.tmp';
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp';
+
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-2.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-3.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-4.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-5.tmp;
+DROP TABLE t1;
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 96f82c92248..b7a99ad4103 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -926,6 +926,43 @@ DROP DATABASE B48872;
--echo End of 5.0 tests.
+--echo #
+--echo # Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
+--echo # DEFINITION OF ANY ROUTINE.
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SELECT 1;
+CREATE USER user2@localhost IDENTIFIED BY '';
+GRANT SELECT(db) ON mysql.proc TO user2@localhost;
+
+--echo # Connection con2 as user2
+connect (con2, localhost, user2);
+--echo # The statement below before disclosed info from body_utf8 column.
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE db1.p1;
+
+--echo # Check that SHOW works with SELECT grant on whole table
+--echo # Connection default
+connection default;
+GRANT SELECT ON mysql.proc TO user2@localhost;
+
+--echo # Connection con2
+connection con2;
+--echo # This should work
+SHOW CREATE PROCEDURE db1.p1;
+
+--echo # Connection default
+connection default;
+disconnect con2;
+DROP USER user2@localhost;
+DROP DATABASE db1;
+
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 5cf050146dd..9207ea22290 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8350,6 +8350,33 @@ SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
+--echo #
+--echo # Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, KEY(b));
+CREATE TABLE t2 (c INT, d INT, KEY(c));
+INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
+INSERT INTO t2 VALUES (1,1),(1,2);
+
+DELIMITER $;
+
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+ DECLARE a int;
+ -- SQL statement inside
+ SELECT 1 INTO a;
+ RETURN a;
+END $
+
+DELIMITER ;$
+
+SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1();
+
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
+
+
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
diff --git a/mysql-test/t/sp_sync.test b/mysql-test/t/sp_sync.test
index f9dae17b039..d8458f69eef 100644
--- a/mysql-test/t/sp_sync.test
+++ b/mysql-test/t/sp_sync.test
@@ -1,7 +1,10 @@
# This test should work in embedded server after mysqltest is fixed
-- source include/not_embedded.inc
---echo Tests of syncronization of stored procedure execution.
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo Tests of synchronization of stored procedure execution.
--source include/have_debug_sync.inc
@@ -54,5 +57,31 @@ connection default;
DROP TABLE t1, t2;
DROP PROCEDURE p1;
+--echo #
+--echo # test for bug#11756013
+--echo #
+--disable_warnings
+DROP SCHEMA IF EXISTS s1;
+--enable_warnings
+CREATE SCHEMA s1;
+CREATE PROCEDURE s1.p1() BEGIN END;
+
+connect (con3, localhost, root);
+SET DEBUG_SYNC='before_db_dir_check SIGNAL check_db WAIT_FOR dropped_schema';
+--send CALL s1.p1
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR check_db';
+DROP SCHEMA s1;
+SET DEBUG_SYNC='now SIGNAL dropped_schema';
+
+connection con3;
+--error ER_BAD_DB_ERROR
+--reap
+connection default;
+disconnect con3;
+
SET DEBUG_SYNC = 'RESET';
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index 0b04b9d7668..2d59fb20bbd 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -594,6 +594,39 @@ drop table t3|
#
+# BUG#11758414: Default storage_engine not honored when set
+# from within a stored procedure
+#
+SELECT @@GLOBAL.storage_engine INTO @old_engine|
+SET @@GLOBAL.storage_engine=InnoDB|
+SET @@SESSION.storage_engine=InnoDB|
+# show defaults at define-time
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+CREATE PROCEDURE bug11758414()
+BEGIN
+ SET @@GLOBAL.storage_engine="MyISAM";
+ SET @@SESSION.storage_engine="MyISAM";
+ # show defaults at execution time / that setting them worked
+ SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+ SHOW SESSION VARIABLES LIKE 'storage_engine';
+ CREATE TABLE t1 (id int);
+ CREATE TABLE t2 (id int) ENGINE=InnoDB;
+ # show we're heeding the default (at run-time, not parse-time!)
+ SHOW CREATE TABLE t1;
+ # show that we didn't break explicit override with ENGINE=...
+ SHOW CREATE TABLE t2;
+END;
+|
+CALL bug11758414|
+# show that changing defaults within SP stuck
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+DROP PROCEDURE bug11758414|
+DROP TABLE t1, t2|
+SET @@GLOBAL.storage_engine=@old_engine|
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 1c5767d2acf..7ccc1390d41 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3399,6 +3399,39 @@ ORDER BY outr.pk;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug#12329653
+--echo # EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
+--echo #
+
+CREATE TABLE t1(a1 int);
+INSERT INTO t1 VALUES (1),(2);
+
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+
+## First a simpler query, illustrating the transformation
+## '1 < some (...)' => '1 < max(...)'
+SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1);
+
+## The query which made the server crash.
+PREPARE stmt FROM
+'SELECT 1 UNION ALL
+SELECT 1 FROM t1
+ORDER BY
+(SELECT 1 FROM t1 AS t1_0
+ WHERE 1 < SOME (SELECT a1 FROM t1)
+)' ;
+
+--error ER_SUBQUERY_NO_1_ROW
+EXECUTE stmt ;
+--error ER_SUBQUERY_NO_1_ROW
+EXECUTE stmt ;
+
+SET SESSION sql_mode=@old_sql_mode;
+
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
--echo End of 5.0 tests.
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index 2cc86692d0d..216e64f8543 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -106,4 +106,178 @@ DROP TABLE t2;
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
DROP DATABASE mysqltest_db1;
+USE test;
+
+--echo #
+--echo # Bug#45235: 5.1 does not support 5.0-only syntax triggers in any way
+--echo #
+let $MYSQLD_DATADIR=`SELECT @@datadir`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t3 VALUES (1), (2), (3);
+
+--echo # We simulate importing a trigger from 5.0 by writing a .TRN file for
+--echo # each trigger plus a .TRG file the way MySQL 5.0 would have done it,
+--echo # with syntax allowed in 5.0 only.
+--echo #
+--echo # Note that in 5.0 the following lines are missing from t1.TRG:
+--echo #
+--echo # client_cs_names='latin1'
+--echo # connection_cl_names='latin1_swedish_ci'
+--echo # db_cl_names='latin1_swedish_ci'
+
+--write_file $MYSQLD_DATADIR/test/tr11.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr12.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr13.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr14.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr15.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr12 AFTER INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr13 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr14 AFTER DELETE ON t1 FOR EACH ROW DELETE FROM non_existing_table' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr15 BEFORE UPDATE ON t1 FOR EACH ROW DELETE FROM non_existing_table a USING non_existing_table a'
+sql_modes=0 0 0 0 0
+definers='root@localhost' 'root@localhost' 'root@localhost' 'root@localhost' 'root@localhost'
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t2.TRG
+TYPE=TRIGGERS
+triggers='Not allowed syntax here, and trigger name cant be extracted either.'
+sql_modes=0
+definers='root@localhost'
+EOF
+
+--echo # We will get parse errors for most DDL and DML statements when the table
+--echo # has broken triggers. The parse error refers to the first broken
+--echo # trigger.
+--error ER_PARSE_ERROR
+CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
+--error ER_PARSE_ERROR
+CREATE TRIGGER tr22 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM non_existing_table;
+SHOW TRIGGERS;
+--error ER_PARSE_ERROR
+INSERT INTO t1 VALUES (1);
+--error ER_PARSE_ERROR
+INSERT INTO t2 VALUES (1);
+--error ER_PARSE_ERROR
+DELETE FROM t1;
+--error ER_PARSE_ERROR
+UPDATE t1 SET a = 1 WHERE a = 1;
+SELECT * FROM t1;
+--error ER_PARSE_ERROR
+RENAME TABLE t1 TO t1_2;
+SHOW TRIGGERS;
+
+DROP TRIGGER tr11;
+DROP TRIGGER tr12;
+DROP TRIGGER tr13;
+DROP TRIGGER tr14;
+DROP TRIGGER tr15;
+
+SHOW TRIGGERS;
+
+--echo # Make sure there is no trigger file left.
+--list_files $MYSQLD_DATADIR/test/ tr*
+
+--echo # We write the same trigger files one more time to test DROP TABLE.
+--write_file $MYSQLD_DATADIR/test/tr11.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr12.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr13.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr14.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr15.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr12 AFTER INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr13 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr14 AFTER DELETE ON t1 FOR EACH ROW DELETE FROM non_existing_table' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr15 BEFORE UPDATE ON t1 FOR EACH ROW DELETE FROM non_existing_table a USING non_existing_table a'
+sql_modes=0 0 0 0 0
+definers='root@localhost' 'root@localhost' 'root@localhost' 'root@localhost' 'root@localhost'
+EOF
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+--echo # Make sure there is no trigger file left.
+
+--list_files $MYSQLD_DATADIR/test/ tr*
+
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+
+--echo # We write three trigger files. First trigger is syntaxically incorrect, next trigger is correct
+--echo # and last trigger is broken.
+--echo # Next we try to execute SHOW CREATE TRGGIR command for broken trigger and then try to drop one.
+--write_file $MYSQLD_DATADIR/test/tr11.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr12.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE the wrongest trigger_in_the_world' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr12 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t2'
+sql_modes=0 0 0
+definers='root@localhost' 'root@localhost' 'root@localhost'
+EOF
+
+FLUSH TABLE t1;
+
+SHOW CREATE TRIGGER tr12;
+SHOW CREATE TRIGGER tr11;
+DROP TRIGGER tr12;
+DROP TRIGGER tr11;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 2cf7ab8fbdf..567d6c0b6a1 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1510,5 +1510,33 @@ group by PAY.id + 1;
DROP TABLE currencies, payments, sub_tasks;
+--echo #
+--echo # Bug#55436: buffer overflow in debug binary of dbug_buff in
+--echo # Field_new_decimal::store_value
+--echo #
+
+# this threw memory warnings on Windows. Also make sure future changes
+# don't change these results, as per usual.
+SET SQL_MODE='';
+CREATE TABLE t1(f1 DECIMAL(44,24)) ENGINE=MYISAM;
+INSERT INTO t1 SET f1 = -64878E-85;
+SELECT f1 FROM t1;
+DROP TABLE IF EXISTS t1;
+
+
--echo End of 5.1 tests
+
+--echo #
+--echo # BUG#12911710 - VALGRIND FAILURE IN
+--echo # ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
+--echo #
+
+CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
+ d2 DECIMAL(60,0) NOT NULL);
+
+INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
+SELECT d1 * d2 FROM t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index cbb5d54c1a0..f48fe1b9967 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1,5 +1,5 @@
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates.
-# Copyright (c) 2009-2011, Monty Program Ab
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+# Copyright (c) 2008-2011, Monty Program Ab
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public