summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2012-01-12 16:42:23 +0200
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2012-01-12 16:42:23 +0200
commitaa03fc5333115cc637ff7a21c9b24422406748a6 (patch)
treedd212eddb4b0b87157caa2755f88fa1b8e27c223 /mysql-test
parent6c1bbb50cb9ee124e762f66004a3daad297e6d6f (diff)
parentfaaa1b3b41b68594b1c99a8fca9cf111276346e9 (diff)
downloadmariadb-git-aa03fc5333115cc637ff7a21c9b24422406748a6.tar.gz
weave merge mysql-5.1->mysql-5.1-security
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/init_connect.result2
-rw-r--r--mysql-test/r/mysqldump.result439
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result6
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test23
-rw-r--r--mysql-test/suite/federated/federated_server.result4
-rw-r--r--mysql-test/suite/federated/federated_server.test8
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug12400341.result25
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug12400341-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug12400341.test103
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result25
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt1
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test103
-rw-r--r--mysql-test/t/init_connect.test8
-rw-r--r--mysql-test/t/mysqldump.test112
14 files changed, 848 insertions, 12 deletions
diff --git a/mysql-test/r/init_connect.result b/mysql-test/r/init_connect.result
index f5ec0bdc932..0ff6c206422 100644
--- a/mysql-test/r/init_connect.result
+++ b/mysql-test/r/init_connect.result
@@ -20,6 +20,8 @@ hex(a)
616263
set GLOBAL init_connect="adsfsdfsdfs";
select @a;
+ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed)
+select @a;
Got one of the listed errors
drop table t1;
End of 4.1 tests
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index a337c0384f6..1d4a5783c3f 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -4628,5 +4628,444 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
DROP DATABASE `test-database`;
USE `test`;
#
+# BUG#11760384 : 52792: mysqldump in XML mode does not dump routines.
+#
+CREATE DATABASE BUG52792;
+USE BUG52792;
+CREATE TABLE t1 (c1 INT, c2 VARCHAR(20));
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc');
+INSERT INTO t2 VALUES (1),(2),(3);
+# Stored Procedures.
+CREATE PROCEDURE simpleproc1 (OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t1;
+END//
+CREATE PROCEDURE simpleproc2 (OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t2;
+END//
+# Events.
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+# Functions.
+CREATE FUNCTION `hello1` (s CHAR(20))
+RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT('Hello, ' ,s ,'!');
+CREATE FUNCTION `hello2` (s CHAR(20))
+RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT(']]>, ' , s ,'!');
+# Triggers.
+CREATE TRIGGER trig1 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END;
+|
+CREATE TRIGGER trig2 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1, ']]>');
+INSERT INTO t2 VALUES(2, '<![CDATA]]>');
+INSERT INTO t2 VALUES(3, '<![CDATA[');
+INSERT INTO t2 VALUES(4, '< > & \ " _');
+END;
+|
+# Views
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v2 AS SELECT * FROM t2;
+
+# Dumping BUG52792 database in xml format.
+
+# Running 'replace_regex on timestamp'
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="BUG52792">
+ <table_structure name="t1">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+ <table_data name="t1">
+ <row>
+ <field name="c1">1</field>
+ <field name="c2">aaa</field>
+ </row>
+ <row>
+ <field name="c1">2</field>
+ <field name="c2">bbb</field>
+ </row>
+ <row>
+ <field name="c1">3</field>
+ <field name="c2">ccc</field>
+ </row>
+ </table_data>
+ <table_structure name="t2">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="t2" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="21" Max_data_length="1970324836974591" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+ <table_data name="t2">
+ <row>
+ <field name="c1">1</field>
+ </row>
+ <row>
+ <field name="c1">2</field>
+ </row>
+ <row>
+ <field name="c1">3</field>
+ </row>
+ </table_data>
+ <triggers name="t2">
+ <trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END
+]]>
+ </trigger>
+ <trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` TRIGGER trig2 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1, ']]]]><![CDATA[>');
+INSERT INTO t2 VALUES(2, '<![CDATA]]]]><![CDATA[>');
+INSERT INTO t2 VALUES(3, '<![CDATA[');
+INSERT INTO t2 VALUES(4, '< > & \ " _');
+END
+]]>
+ </trigger>
+ </triggers>
+ <table_structure name="v1">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="v1" Comment="VIEW" />
+ </table_structure>
+ <table_structure name="v2">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="v2" Comment="VIEW" />
+ </table_structure>
+ <events>
+ <event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792
+]]>
+ </event>
+ <event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792
+]]>
+ </event>
+ </events>
+ <routines>
+ <routine Function="hello1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` FUNCTION `hello1`(s CHAR(20)) RETURNS char(50) CHARSET latin1
+ DETERMINISTIC
+RETURN CONCAT('Hello, ' ,s ,'!')
+]]>
+ </routine>
+ <routine Function="hello2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` FUNCTION `hello2`(s CHAR(20)) RETURNS char(50) CHARSET latin1
+ DETERMINISTIC
+RETURN CONCAT(']]]]><![CDATA[>, ' , s ,'!')
+]]>
+ </routine>
+ <routine Procedure="simpleproc1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc1`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t1;
+END
+]]>
+ </routine>
+ <routine Procedure="simpleproc2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc2`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t2;
+END
+]]>
+ </routine>
+ </routines>
+</database>
+</mysqldump>
+
+# Dumping BUG52792 database in xml format with comments.
+
+# Running 'replace_regex on timestamp'
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="BUG52792">
+<!--
+-
+- Table structure for table `t1`
+-
+
+ -->
+ <table_structure name="t1">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+<!--
+-
+- Dumping data for table `t1`
+-
+ -->
+ <table_data name="t1">
+ <row>
+ <field name="c1">1</field>
+ <field name="c2">aaa</field>
+ </row>
+ <row>
+ <field name="c1">2</field>
+ <field name="c2">bbb</field>
+ </row>
+ <row>
+ <field name="c1">3</field>
+ <field name="c2">ccc</field>
+ </row>
+ </table_data>
+<!--
+-
+- Table structure for table `t2`
+-
+
+ -->
+ <table_structure name="t2">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="t2" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="21" Max_data_length="1970324836974591" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+<!--
+-
+- Dumping data for table `t2`
+-
+ -->
+ <table_data name="t2">
+ <row>
+ <field name="c1">1</field>
+ </row>
+ <row>
+ <field name="c1">2</field>
+ </row>
+ <row>
+ <field name="c1">3</field>
+ </row>
+ </table_data>
+ <triggers name="t2">
+ <trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END
+]]>
+ </trigger>
+ <trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` TRIGGER trig2 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1, ']]]]><![CDATA[>');
+INSERT INTO t2 VALUES(2, '<![CDATA]]]]><![CDATA[>');
+INSERT INTO t2 VALUES(3, '<![CDATA[');
+INSERT INTO t2 VALUES(4, '< > & \ " _');
+END
+]]>
+ </trigger>
+ </triggers>
+<!--
+-
+- Table structure for table `v1`
+-
+
+ -->
+ <table_structure name="v1">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="v1" Comment="VIEW" />
+ </table_structure>
+<!--
+-
+- Table structure for table `v2`
+-
+
+ -->
+ <table_structure name="v2">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="v2" Comment="VIEW" />
+ </table_structure>
+<!--
+-
+- Dumping events for database 'BUG52792'
+-
+ -->
+ <events>
+ <event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792
+]]>
+ </event>
+ <event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792
+]]>
+ </event>
+ </events>
+<!--
+-
+- Dumping routines for database 'BUG52792'
+-
+ -->
+ <routines>
+ <routine Function="hello1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` FUNCTION `hello1`(s CHAR(20)) RETURNS char(50) CHARSET latin1
+ DETERMINISTIC
+RETURN CONCAT('Hello, ' ,s ,'!')
+]]>
+ </routine>
+ <routine Function="hello2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` FUNCTION `hello2`(s CHAR(20)) RETURNS char(50) CHARSET latin1
+ DETERMINISTIC
+RETURN CONCAT(']]]]><![CDATA[>, ' , s ,'!')
+]]>
+ </routine>
+ <routine Procedure="simpleproc1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc1`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t1;
+END
+]]>
+ </routine>
+ <routine Procedure="simpleproc2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc2`(OUT param1 INT)
+BEGIN
+SELECT COUNT(*) INTO param1 FROM t2;
+END
+]]>
+ </routine>
+ </routines>
+</database>
+</mysqldump>
+
+# Test to check 'Insufficient privileges' error.
+
+GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+# Running 'replace_regex on timestamp'
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="BUG52792">
+ <table_structure name="t1">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+ <table_data name="t1">
+ <row>
+ <field name="c1">1</field>
+ <field name="c2">aaa</field>
+ </row>
+ <row>
+ <field name="c1">2</field>
+ <field name="c2">bbb</field>
+ </row>
+ <row>
+ <field name="c1">3</field>
+ <field name="c2">ccc</field>
+ </row>
+ </table_data>
+ <table_structure name="t2">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="t2" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="21" Max_data_length="1970324836974591" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+ </table_structure>
+ <table_data name="t2">
+ <row>
+ <field name="c1">1</field>
+ </row>
+ <row>
+ <field name="c1">2</field>
+ </row>
+ <row>
+ <field name="c1">3</field>
+ </row>
+ </table_data>
+ <triggers name="t2">
+ <trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1);
+END
+]]>
+ </trigger>
+ <trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` TRIGGER trig2 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+INSERT INTO t2 VALUES(1, ']]]]><![CDATA[>');
+INSERT INTO t2 VALUES(2, '<![CDATA]]]]><![CDATA[>');
+INSERT INTO t2 VALUES(3, '<![CDATA[');
+INSERT INTO t2 VALUES(4, '< > & \ " _');
+END
+]]>
+ </trigger>
+ </triggers>
+ <table_structure name="v1">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="v1" Comment="VIEW" />
+ </table_structure>
+ <table_structure name="v2">
+ <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <options Name="v2" Comment="VIEW" />
+ </table_structure>
+ <events>
+ <event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792
+]]>
+ </event>
+ <event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792
+]]>
+ </event>
+ </events>
+ <routines>
+<!--
+- insufficient privileges to SHOW CREATE FUNCTION `hello1`
+ -->
+<!-- - does user1 have permissions on mysql.proc?
+
+ -->
+DROP USER user1;
+DROP DATABASE BUG52792;
+# UTF-8
+CREATE DATABASE BUG52792;
+USE BUG52792;
+SET NAMES utf8;
+CREATE FUNCTION `straße` ( c1 CHAR(20))
+RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT(']]>, ', s, '!');
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="BUG52792">
+ <routines>
+ <routine Function="straße" sql_mode="" character_set_client="utf8" collation_connection="utf8_general_ci" Database_Collation="latin1_swedish_ci">
+<![CDATA[
+CREATE DEFINER=`root`@`localhost` FUNCTION `straße`( c1 CHAR(20)) RETURNS char(50) CHARSET latin1
+ DETERMINISTIC
+RETURN CONCAT(']]]]><![CDATA[>, ', s, '!')
+]]>
+ </routine>
+ </routines>
+</database>
+</mysqldump>
+DROP DATABASE BUG52792;
+USE test;
+#
# End of 5.1 tests
#
diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
index edbd878982b..08f193c9f5f 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
@@ -34,13 +34,13 @@ USE test;
#
SET @old_log_warnings = @@log_warnings;
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10));
+CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15));
SET GLOBAL LOG_WARNINGS = 0;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+INSERT INTO t1 VALUES(UUID(), 'timestamp');
Warnings:
Note 1592 Statement may not be safe to log in statement format.
SET GLOBAL LOG_WARNINGS = 1;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+INSERT INTO t1 VALUES(UUID(), 'timestamp');
Warnings:
Note 1592 Statement may not be safe to log in statement format.
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
index 21c11d5a3df..e5424a911bb 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
@@ -80,22 +80,33 @@ eval USE $old_db;
--echo # Bug#46265: Can not disable warning about unsafe statements for binary logging
--echo #
+# Here introducing a sleep of one Second, just to make sure
+# that when this test executes with "--repeat" option,
+# the timestamp value is different and hence the Occcurrence count is one.
+--sleep 1
+
SET @old_log_warnings = @@log_warnings;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10));
+let BINLOG_COUNTER1= `select CONVERT(NOW(),UNSIGNED) as timestmap from dual`;
+
+CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15));
SET GLOBAL LOG_WARNINGS = 0;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+# Replacing the result file content here.
+# Instead of writing $BINLOG_COUNTER1 value to result file, writing a fixed string timestamp to it.
+--replace_result $BINLOG_COUNTER1 timestamp
+eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1');
SET GLOBAL LOG_WARNINGS = 1;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+--replace_result $BINLOG_COUNTER1 timestamp
+eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1');
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!`select LENGTH('$log_error_')`)
+if(!$log_error_)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
@@ -111,7 +122,9 @@ perl;
use strict;
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
- my $count = () = grep(/Bug#46265/g,<FILE>);
+ my $binlog_counter= $ENV{'BINLOG_COUNTER1'} or die "BINLOG_COUNTER1 not set";
+ my $count = () = grep(/$binlog_counter/g,<FILE>);
+ # Grep the timestamp value from the error file.
print "Occurrences: $count\n";
close(FILE);
EOF
diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result
index 2c20d1c1d57..6b37277b5a9 100644
--- a/mysql-test/suite/federated/federated_server.result
+++ b/mysql-test/suite/federated/federated_server.result
@@ -54,7 +54,7 @@ PASSWORD '',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
-select * from mysql.servers;
+select * from mysql.servers order by Server_name;
Server_name Host Db Username Password Port Socket Wrapper Owner
server_one 127.0.0.1 first_db root SLAVE_PORT mysql root
server_two 127.0.0.1 second_db root SLAVE_PORT mysql root
@@ -154,7 +154,7 @@ id name
drop table federated.t1;
drop server 'server_one';
drop server 'server_two';
-select * from mysql.servers;
+select * from mysql.servers order by Server_name;
Server_name Host Db Username Password Port Socket Wrapper Owner
drop table first_db.t1;
drop table second_db.t1;
diff --git a/mysql-test/suite/federated/federated_server.test b/mysql-test/suite/federated/federated_server.test
index ec952d071f2..64ee74edb16 100644
--- a/mysql-test/suite/federated/federated_server.test
+++ b/mysql-test/suite/federated/federated_server.test
@@ -62,7 +62,9 @@ eval create server 'server_two' foreign data wrapper 'mysql' options
OWNER 'root');
--replace_result $SLAVE_MYPORT SLAVE_PORT
-eval select * from mysql.servers;
+# Adding 'order by' clause here, in order to maintain consistent result out of the select query.
+#eval select * from mysql.servers;
+eval select * from mysql.servers order by Server_name;
DROP TABLE IF EXISTS federated.old;
--replace_result $SLAVE_MYPORT SLAVE_PORT
@@ -147,7 +149,9 @@ drop table federated.t1;
drop server 'server_one';
drop server 'server_two';
-select * from mysql.servers;
+# Adding 'order by' clause here, in order to maintain consistent result out of the select query.
+#select * from mysql.servers;
+eval select * from mysql.servers order by Server_name;
connection slave;
drop table first_db.t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result
new file mode 100644
index 00000000000..551e94f5e77
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result
@@ -0,0 +1,25 @@
+call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
+show variables like "max_connections";
+Variable_name Value
+max_connections 64
+show variables like "innodb_thread_concurrency";
+Variable_name Value
+innodb_thread_concurrency 0
+show variables like "innodb_file_per_table";
+Variable_name Value
+innodb_file_per_table ON
+drop database if exists mysqltest;
+create database mysqltest;
+CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB;
+select count(*) from information_schema.processlist;
+count(*)
+33
+CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
+ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177)
+select count(*) from information_schema.processlist;
+count(*)
+33
+select count(*) from information_schema.processlist;
+count(*)
+33
+drop database mysqltest;
diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt b/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt
new file mode 100644
index 00000000000..2e85b082c68
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt
@@ -0,0 +1 @@
+--max_connections=64 --innodb_thread_concurrency=0 --innodb_file_per_table
diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test
new file mode 100644
index 00000000000..2ab1be81f6d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test
@@ -0,0 +1,103 @@
+# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND
+
+-- source include/have_innodb.inc
+
+if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`)
+{
+ --skip Test requires InnoDB built with UNIV_DEBUG definition.
+}
+
+call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
+
+--disable_query_log
+set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug;
+set global innodb_trx_rseg_n_slots_debug = 32;
+--enable_query_log
+
+show variables like "max_connections";
+show variables like "innodb_thread_concurrency";
+show variables like "innodb_file_per_table";
+
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+
+create database mysqltest;
+CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB;
+
+--disable_query_log
+#
+# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached,
+# because the cached insert_undo can be reused at "CREATE TABLE" statement later.
+#
+START TRANSACTION;
+let $c = 1024;
+while ($c)
+{
+ eval INSERT INTO mysqltest.transtable (id) VALUES ($c);
+ dec $c;
+}
+COMMIT;
+
+let $c = 32;
+while ($c)
+{
+ # if failed at here, it might be shortage of file descriptors limit.
+ connect (con$c,localhost,root,,);
+ dec $c;
+}
+--enable_query_log
+
+select count(*) from information_schema.processlist;
+
+#
+# fill the all undo slots
+#
+--disable_query_log
+let $c = 32;
+while ($c)
+{
+ connection con$c;
+ START TRANSACTION;
+ eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c;
+ dec $c;
+}
+--enable_query_log
+
+connection default;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
+
+select count(*) from information_schema.processlist;
+
+--disable_query_log
+let $c = 32;
+while ($c)
+{
+ connection con$c;
+ ROLLBACK;
+ dec $c;
+}
+--enable_query_log
+
+connection default;
+select count(*) from information_schema.processlist;
+
+--disable_query_log
+let $c = 32;
+while ($c)
+{
+ disconnect con$c;
+ dec $c;
+}
+--enable_query_log
+
+#
+# If the isolated .ibd file remained, the drop database should fail.
+#
+drop database mysqltest;
+
+--disable_query_log
+set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug;
+--enable_query_log
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result b/mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result
new file mode 100644
index 00000000000..551e94f5e77
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result
@@ -0,0 +1,25 @@
+call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
+show variables like "max_connections";
+Variable_name Value
+max_connections 64
+show variables like "innodb_thread_concurrency";
+Variable_name Value
+innodb_thread_concurrency 0
+show variables like "innodb_file_per_table";
+Variable_name Value
+innodb_file_per_table ON
+drop database if exists mysqltest;
+create database mysqltest;
+CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB;
+select count(*) from information_schema.processlist;
+count(*)
+33
+CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
+ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177)
+select count(*) from information_schema.processlist;
+count(*)
+33
+select count(*) from information_schema.processlist;
+count(*)
+33
+drop database mysqltest;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt
new file mode 100644
index 00000000000..2e85b082c68
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt
@@ -0,0 +1 @@
+--max_connections=64 --innodb_thread_concurrency=0 --innodb_file_per_table
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test
new file mode 100644
index 00000000000..b9e40e0dff3
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test
@@ -0,0 +1,103 @@
+# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND
+
+-- source include/have_innodb_plugin.inc
+
+if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`)
+{
+ --skip Test requires InnoDB built with UNIV_DEBUG definition.
+}
+
+call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
+
+--disable_query_log
+set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug;
+set global innodb_trx_rseg_n_slots_debug = 32;
+--enable_query_log
+
+show variables like "max_connections";
+show variables like "innodb_thread_concurrency";
+show variables like "innodb_file_per_table";
+
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+
+create database mysqltest;
+CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB;
+
+--disable_query_log
+#
+# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached,
+# because the cached insert_undo can be reused at "CREATE TABLE" statement later.
+#
+START TRANSACTION;
+let $c = 1024;
+while ($c)
+{
+ eval INSERT INTO mysqltest.transtable (id) VALUES ($c);
+ dec $c;
+}
+COMMIT;
+
+let $c = 32;
+while ($c)
+{
+ # if failed at here, it might be shortage of file descriptors limit.
+ connect (con$c,localhost,root,,);
+ dec $c;
+}
+--enable_query_log
+
+select count(*) from information_schema.processlist;
+
+#
+# fill the all undo slots
+#
+--disable_query_log
+let $c = 32;
+while ($c)
+{
+ connection con$c;
+ START TRANSACTION;
+ eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c;
+ dec $c;
+}
+--enable_query_log
+
+connection default;
+
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
+
+select count(*) from information_schema.processlist;
+
+--disable_query_log
+let $c = 32;
+while ($c)
+{
+ connection con$c;
+ ROLLBACK;
+ dec $c;
+}
+--enable_query_log
+
+connection default;
+select count(*) from information_schema.processlist;
+
+--disable_query_log
+let $c = 32;
+while ($c)
+{
+ disconnect con$c;
+ dec $c;
+}
+--enable_query_log
+
+#
+# If the isolated .ibd file remained, the drop database should fail.
+#
+drop database mysqltest;
+
+--disable_query_log
+set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug;
+--enable_query_log
diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test
index b6bac5f65fa..e96d02fe0d1 100644
--- a/mysql-test/t/init_connect.test
+++ b/mysql-test/t/init_connect.test
@@ -36,6 +36,14 @@ connection con0;
set GLOBAL init_connect="adsfsdfsdfs";
connect (con5,localhost,user_1,,);
connection con5;
+# BUG#11755281/47032: ERROR 2006 / ERROR 2013 INSTEAD OF PROPER ERROR MESSAGE
+# We now throw a proper error message here:
+--replace_regex /connection .* to/connection to/
+--error ER_NEW_ABORTING_CONNECTION
+select @a;
+# We got disconnected after receiving the above error message; any further
+# requests should fail with a notice that no one's listening to us.
+# --error CR_SERVER_GONE_ERROR,CR_SERVER_LOST
--error 2013,2006
select @a;
connection con0;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 8ecf8187ff9..20c788e3b9a 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2197,6 +2197,118 @@ DROP DATABASE `test-database`;
USE `test`;
--echo #
+--echo # BUG#11760384 : 52792: mysqldump in XML mode does not dump routines.
+--echo #
+CREATE DATABASE BUG52792;
+USE BUG52792;
+CREATE TABLE t1 (c1 INT, c2 VARCHAR(20));
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc');
+INSERT INTO t2 VALUES (1),(2),(3);
+
+--echo # Stored Procedures.
+
+DELIMITER //;
+CREATE PROCEDURE simpleproc1 (OUT param1 INT)
+BEGIN
+ SELECT COUNT(*) INTO param1 FROM t1;
+END//
+DELIMITER ;//
+
+DELIMITER //;
+CREATE PROCEDURE simpleproc2 (OUT param1 INT)
+BEGIN
+ SELECT COUNT(*) INTO param1 FROM t2;
+END//
+DELIMITER ;//
+
+--echo # Events.
+
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
+
+--echo # Functions.
+
+CREATE FUNCTION `hello1` (s CHAR(20))
+ RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT('Hello, ' ,s ,'!');
+
+CREATE FUNCTION `hello2` (s CHAR(20))
+ RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT(']]>, ' , s ,'!');
+
+--echo # Triggers.
+
+DELIMITER |;
+CREATE TRIGGER trig1 BEFORE INSERT ON t2
+ FOR EACH ROW BEGIN
+ INSERT INTO t2 VALUES(1);
+END;
+|
+DELIMITER ;|
+
+DELIMITER |;
+CREATE TRIGGER trig2 AFTER INSERT ON t2
+ FOR EACH ROW BEGIN
+ INSERT INTO t2 VALUES(1, ']]>');
+ INSERT INTO t2 VALUES(2, '<![CDATA]]>');
+ INSERT INTO t2 VALUES(3, '<![CDATA[');
+ INSERT INTO t2 VALUES(4, '< > & \ " _');
+END;
+|
+DELIMITER ;|
+
+--echo # Views
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v2 AS SELECT * FROM t2;
+--echo
+--echo # Dumping BUG52792 database in xml format.
+--echo
+--echo # Running 'replace_regex on timestamp'
+--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/
+--exec $MYSQL_DUMP --user=root --compact -R -E --triggers -X BUG52792
+--echo
+--echo # Dumping BUG52792 database in xml format with comments.
+--echo
+--echo # Running 'replace_regex on timestamp'
+--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/
+--exec $MYSQL_DUMP --comments --user=root -R -E --triggers -X BUG52792
+
+--echo
+--echo # Test to check 'Insufficient privileges' error.
+--echo
+
+GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+
+connect (conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK);
+connection conn_1;
+
+--echo # Running 'replace_regex on timestamp'
+--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/
+--error 2
+--exec $MYSQL_DUMP --user=user1 -R -E --triggers -X BUG52792
+
+connection default;
+disconnect conn_1;
+
+DROP USER user1;
+DROP DATABASE BUG52792;
+--echo # UTF-8
+CREATE DATABASE BUG52792;
+USE BUG52792;
+SET NAMES utf8;
+CREATE FUNCTION `straße` ( c1 CHAR(20))
+ RETURNS CHAR(50) DETERMINISTIC
+RETURN CONCAT(']]>, ', s, '!');
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 -R -X BUG52792
+
+DROP DATABASE BUG52792;
+
+USE test;
+
+--echo #
--echo # End of 5.1 tests
--echo #