From 95825fa28a7e84a2f5dbdef5241078f7055c5b04 Mon Sep 17 00:00:00 2001 From: Knut Anders Hatlen Date: Thu, 7 Jan 2016 12:53:18 +0100 Subject: Bug#21682356: STOP INJECTING DATA ITEMS IN AN ERROR MESSAGE GENERATED BY THE EXP() FUNCTION When generating the error message for numeric overflow, pass a flag to Item::print() that prevents it from expanding constant expressions and parameters to the values they evaluate to. For consistency, also pass the flag to Item::print() when Item_func_spatial_collection::fix_length_and_dec() generates an error message. It doesn't make any difference at the moment, since constant expressions haven't been evaluated yet when this function is called. --- mysql-test/r/func_math.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index ec0ca748c49..8a505d8bb9d 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -632,9 +632,9 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED); INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809); SELECT -a FROM t1; -ERROR 22003: BIGINT value is out of range in '-('-9223372036854775808')' +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' SELECT -b FROM t1; -ERROR 22003: BIGINT value is out of range in '-('9223372036854775809')' +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' DROP TABLE t1; SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999; SELECT @a + @a; -- cgit v1.2.1 From 7d19d4b2dd692deb38d230e64d3c4c3b64570ad6 Mon Sep 17 00:00:00 2001 From: Deepthi Eranti_Sreenivas Date: Wed, 20 Jan 2016 18:23:16 +0530 Subject: Bug#22086528 : TEST CODE DISABLED THOUGH THE HISTORIC REASONS - BUGS - ARE FIXED Problem: mysql-test/suite/rpl/t/rpl_killed_ddl.test This test contains code which was disabled because of certain bugs. BUG#44041 declared to be a duplicate of Bug#45516 which was fixed 2010 BUG#43353 fixed 2012 BUG#44171 fixed 2010 Fix: Enabled the test code related to the above mentioned bugs. --- mysql-test/suite/rpl/r/rpl_killed_ddl.result | 14 +++++++++ mysql-test/suite/rpl/t/rpl_killed_ddl.test | 43 +++++++++------------------- 2 files changed, 28 insertions(+), 29 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result index a02c9b599bf..4d9f8b77735 100644 --- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result @@ -56,6 +56,10 @@ CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100; CREATE DATABASE d2; source include/kill_query.inc; include/rpl_diff.inc +ALTER DATABASE d1 +DEFAULT CHARACTER SET = 'utf8'; +source include/kill_query.inc; +include/rpl_diff.inc DROP DATABASE d1; source include/kill_query.inc; include/rpl_diff.inc @@ -67,6 +71,10 @@ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY DO INSERT INTO test.t1 VALUES (2); source include/kill_query.inc; include/rpl_diff.inc +ALTER EVENT e1 +ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; +source include/kill_query.inc; +include/rpl_diff.inc DROP EVENT e1; source include/kill_query.inc; include/rpl_diff.inc @@ -83,6 +91,9 @@ include/rpl_diff.inc DROP FUNCTION f1; source include/kill_query.inc; include/rpl_diff.inc +DROP FUNCTION IF EXISTS f2; +source include/kill_query.inc; +include/rpl_diff.inc CREATE PROCEDURE p2 (OUT rows INT) BEGIN SELECT COUNT(*) INTO rows FROM t2; @@ -96,6 +107,9 @@ include/rpl_diff.inc DROP PROCEDURE p1; source include/kill_query.inc; include/rpl_diff.inc +DROP PROCEDURE IF EXISTS p2; +source include/kill_query.inc; +include/rpl_diff.inc CREATE TABLE t2 (b int); source include/kill_query.inc; include/rpl_diff.inc diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test index a56a39a2784..76e9b3af091 100644 --- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test +++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test @@ -26,10 +26,7 @@ # # There are some part of the test are temporarily disabled because of # the following bugs, please enable then once they get fixed: -# - BUG#44041 -# - BUG#43353 -# - BUG#25705 -# - BUG#44171 +# - BUG#22473427 source include/have_debug.inc; source include/master-slave.inc; @@ -145,11 +142,9 @@ let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata send CREATE DATABASE d2; source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the -# collation of other database on slave -#send ALTER DATABASE d1 -# DEFAULT CHARACTER SET = 'utf8'; -#source include/kill_query_and_diff_master_slave.inc; +send ALTER DATABASE d1 + DEFAULT CHARACTER SET = 'utf8'; +source include/kill_query_and_diff_master_slave.inc; send DROP DATABASE d1; source include/kill_query_and_diff_master_slave.inc; @@ -168,11 +163,9 @@ send CREATE EVENT e2 DO INSERT INTO test.t1 VALUES (2); source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled because of BUG#44171, killing ALTER EVENT can -# crash the server -#send ALTER EVENT e1 -# ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; -#source include/kill_query_and_diff_master_slave.inc; +send ALTER EVENT e1 + ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; +source include/kill_query_and_diff_master_slave.inc; send DROP EVENT e1; source include/kill_query_and_diff_master_slave.inc; @@ -198,16 +191,8 @@ source include/kill_query_and_diff_master_slave.inc; # function f2 probably does not exist because the CREATE query was # killed -# -# Temporarily disabled. Because of BUG#43353, KILL the query may -# result in function not found, and for 5.1, DROP statements will be -# logged if the function is not found on master, so the following DROP -# FUNCTION statement may be interrupted and not drop the function on -# master, but still get logged and executed on slave and cause -# inconsistence. Also disable the following DROP PROCEDURE IF EXITS -# below. -#send DROP FUNCTION IF EXISTS f2; -#source include/kill_query_and_diff_master_slave.inc; +send DROP FUNCTION IF EXISTS f2; +source include/kill_query_and_diff_master_slave.inc; ######## PROCEDURE ######## @@ -228,9 +213,8 @@ source include/kill_query_and_diff_master_slave.inc; send DROP PROCEDURE p1; source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS -#send DROP PROCEDURE IF EXISTS p2; -#source include/kill_query_and_diff_master_slave.inc; +send DROP PROCEDURE IF EXISTS p2; +source include/kill_query_and_diff_master_slave.inc; ######## TABLE ######## @@ -258,9 +242,10 @@ source include/kill_query_and_diff_master_slave.inc; ######## SERVER ######## -# Tempoarily disabled, see bug#25705 +# Temporarily disabled, see Bug #22473427 - DROP SERVER FAILS +# AFTER ALTER SERVER+KILL QUERY -# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\' +# --let $rpl_diff_statement= SELECT * FROM mysql.servers WHERE Server_name like \'s%\' # send CREATE SERVER s2 # FOREIGN DATA WRAPPER mysql -- cgit v1.2.1 From 1624c26d429171c33ad33613e73bba23a5a3cbdd Mon Sep 17 00:00:00 2001 From: Deepthi Eranti_Sreenivas Date: Fri, 22 Jan 2016 16:51:21 +0530 Subject: Bug#22086528: TEST CODE DISABLED THOUGH THE HISTORIC REASONS - BUGS - ARE FIXED Post push fix for 5.5 and 5.6.Disabled the test code due to Bug#22587377 --- mysql-test/suite/rpl/r/rpl_killed_ddl.result | 4 ---- mysql-test/suite/rpl/t/rpl_killed_ddl.test | 9 ++++++--- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result index 4d9f8b77735..ed8745ca2c1 100644 --- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result @@ -71,10 +71,6 @@ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY DO INSERT INTO test.t1 VALUES (2); source include/kill_query.inc; include/rpl_diff.inc -ALTER EVENT e1 -ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; -source include/kill_query.inc; -include/rpl_diff.inc DROP EVENT e1; source include/kill_query.inc; include/rpl_diff.inc diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test index 76e9b3af091..e9f5a5c47c2 100644 --- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test +++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test @@ -27,6 +27,7 @@ # There are some part of the test are temporarily disabled because of # the following bugs, please enable then once they get fixed: # - BUG#22473427 +# - Bug#22587377 source include/have_debug.inc; source include/master-slave.inc; @@ -163,9 +164,11 @@ send CREATE EVENT e2 DO INSERT INTO test.t1 VALUES (2); source include/kill_query_and_diff_master_slave.inc; -send ALTER EVENT e1 - ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; -source include/kill_query_and_diff_master_slave.inc; +# Temporarily disabled,see Bug#22587377-RPL.RPL_KILLED_DDL +# FAILS SPORADICALLY ON PB2 IN 5.5 AND 5.6 +#send ALTER EVENT e1 +# ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; +#source include/kill_query_and_diff_master_slave.inc; send DROP EVENT e1; source include/kill_query_and_diff_master_slave.inc; -- cgit v1.2.1 From d9c541cb1be5b239787833d9d499067d44ea44d3 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Wed, 10 Feb 2016 19:57:17 +0530 Subject: BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN KEY CONSTRAINT. Analysis ======= INSERT and UPDATE operations using the IGNORE keyword which causes FOREIGN KEY constraint violations reports an error despite using the IGNORE keyword. Foreign key violation errors were not ignored and reported as errors instead of warnings even when IGNORE was set. Fix === Added code to ignore the foreign key violation errors and report them as warnings when the IGNORE keyword is used. --- mysql-test/r/insert.result | 38 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/insert.test | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 655303be7f4..1aa22349593 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -686,3 +686,41 @@ ERROR 42000: Column 'a' specified twice INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2; ERROR 42000: Column 'a' specified twice DROP TABLE t1; +# +# BUG#22037930: INSERT IGNORE FAILS TO IGNORE +# FOREIGN KEY CONSTRAINT +# Setup. +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB; +CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1)) +ENGINE=INNODB; +INSERT INTO t1 VALUES(0); +INSERT INTO t2 VALUES(0); +# Without fix, an error is reported. +INSERT IGNORE INTO t2 VALUES(1); +Warnings: +Warning 1452 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0; +Warnings: +Warning 1452 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0; +Warnings: +Warning 1451 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +# Test for multi update. +UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3; +Warnings: +Warning 1452 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3; +Warnings: +Warning 1451 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +# Reports an error since IGNORE is not used. +INSERT INTO t2 VALUES(1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t2 SET fld2=20 WHERE fld2=0; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1 SET fld1=20 WHERE fld1=0; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +DROP TABLE t2, t1; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 2bf543511ac..ea89872200c 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -550,3 +550,44 @@ INSERT IGNORE t1 (a, a) SELECT 1,1; INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2; DROP TABLE t1; + + +--echo # +--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE +--echo # FOREIGN KEY CONSTRAINT + +--echo # Setup. +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB; +CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1)) +ENGINE=INNODB; +INSERT INTO t1 VALUES(0); +INSERT INTO t2 VALUES(0); + +--echo # Without fix, an error is reported. +--enable_warnings +INSERT IGNORE INTO t2 VALUES(1); +UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0; +UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0; + +--echo # Test for multi update. +UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3; +UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3; +--disable_warnings + +--echo # Reports an error since IGNORE is not used. +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES(1); + +--error ER_NO_REFERENCED_ROW_2 +UPDATE t2 SET fld2=20 WHERE fld2=0; + +--error ER_ROW_IS_REFERENCED_2 +UPDATE t1 SET fld1=20 WHERE fld1=0; + +--error ER_NO_REFERENCED_ROW_2 +UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3; + +--error ER_ROW_IS_REFERENCED_2 +UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3; + +DROP TABLE t2, t1; -- cgit v1.2.1 From b3e9211e48a3fb586e88b0270a175d2348935424 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 19 Feb 2016 23:31:10 +0400 Subject: WL#9072: Backport WL#8785 to 5.5 --- mysql-test/r/ssl_mode.result | 44 ++++++++++++++++++++++++++++++ mysql-test/r/ssl_mode_no_ssl.result | 22 +++++++++++++++ mysql-test/t/ssl_mode.test | 47 +++++++++++++++++++++++++++++++++ mysql-test/t/ssl_mode_no_ssl-master.opt | 1 + mysql-test/t/ssl_mode_no_ssl.test | 41 ++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 mysql-test/r/ssl_mode.result create mode 100644 mysql-test/r/ssl_mode_no_ssl.result create mode 100644 mysql-test/t/ssl_mode.test create mode 100644 mysql-test/t/ssl_mode_no_ssl-master.opt create mode 100644 mysql-test/t/ssl_mode_no_ssl.test (limited to 'mysql-test') diff --git a/mysql-test/r/ssl_mode.result b/mysql-test/r/ssl_mode.result new file mode 100644 index 00000000000..38fc4e1dca2 --- /dev/null +++ b/mysql-test/r/ssl_mode.result @@ -0,0 +1,44 @@ +# positive client tests +# mysql +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); +# mysqldump +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES (0); +# mysqladmin +mysqld is alive +# mysqlcheck +test.t1 OK +# mysqlimport +CREATE TABLE words(a VARCHAR(255)); +test.words: Records: 70 Deleted: 0 Skipped: 0 Warnings: 0 +DROP TABLE words; +# mysqlshow +Database: test ++--------+ +| Tables | ++--------+ +| t1 | ++--------+ +# mysqlslap +# mysqltest +Output from mysqltest-x.inc +DROP TABLE t1; +# negative client tests +# mysql +Unknown value to --ssl-mode: ''. Use --ssl-mode=REQUIRED +Unknown value to --ssl-mode: 'DERIUQER'. Use --ssl-mode=REQUIRED +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections + +End of tests diff --git a/mysql-test/r/ssl_mode_no_ssl.result b/mysql-test/r/ssl_mode_no_ssl.result new file mode 100644 index 00000000000..409b7a0fa1b --- /dev/null +++ b/mysql-test/r/ssl_mode_no_ssl.result @@ -0,0 +1,22 @@ +# negative client tests +# mysql +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +# mysqldump +mysqldump: Got error: 2026: --ssl-mode=REQUIRED option forbids non SSL connections when trying to connect +# mysqladmin +mysqladmin: error: '--ssl-mode=REQUIRED option forbids non SSL connections' +# mysqlcheck +mysqlcheck: Got error: 2026: --ssl-mode=REQUIRED option forbids non SSL connections when trying to connect +# mysqlimport +mysqlimport: Error: 2026 --ssl-mode=REQUIRED option forbids non SSL connections +# mysqlshow +mysqlshow: --ssl-mode=REQUIRED option forbids non SSL connections +# mysqlslap +mysqlslap: Error when connecting to server: --ssl-mode=REQUIRED option forbids non SSL connections +# mysqltest +mysqltest: Could not open connection 'default': 2026 --ssl-mode=REQUIRED option forbids non SSL connections + +End of tests diff --git a/mysql-test/t/ssl_mode.test b/mysql-test/t/ssl_mode.test new file mode 100644 index 00000000000..ce1f2aa5e0a --- /dev/null +++ b/mysql-test/t/ssl_mode.test @@ -0,0 +1,47 @@ +-- source include/not_embedded.inc +-- source include/have_ssl_communication.inc + +--echo # positive client tests +--echo # mysql +--exec $MYSQL test --ssl-mode=ReQuIrEd --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1 +--exec $MYSQL test --ssl-mode=REQUIRED --ssl --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1 + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); + +--echo # mysqldump +--exec $MYSQL_DUMP --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA --compact --skip-comments test 2>&1 +--echo # mysqladmin +--exec $MYSQLADMIN --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 +--echo # mysqlcheck +--exec $MYSQL_CHECK --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA test 2>&1 +--echo # mysqlimport +CREATE TABLE words(a VARCHAR(255)); +--exec $MYSQL_IMPORT --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA test $MYSQLTEST_VARDIR/std_data/words.dat 2>&1 +DROP TABLE words; +--echo # mysqlshow +--exec $MYSQL_SHOW --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA test 2>&1 +--echo # mysqlslap +--exec $MYSQL_SLAP --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA --create-schema=test --query="select * from t1" --silent 2>&1 +--echo # mysqltest +--exec $MYSQL_TEST --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 + +DROP TABLE t1; + +--echo # negative client tests +--echo # mysql +--error 5 +--exec $MYSQL test --ssl-mode +--error 1 +--exec $MYSQL test --ssl-mode= 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=DERIUQER 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED --ssl 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA --skip-ssl 2>&1 + +--echo +--echo End of tests diff --git a/mysql-test/t/ssl_mode_no_ssl-master.opt b/mysql-test/t/ssl_mode_no_ssl-master.opt new file mode 100644 index 00000000000..0ca403efdfb --- /dev/null +++ b/mysql-test/t/ssl_mode_no_ssl-master.opt @@ -0,0 +1 @@ +--skip-ssl diff --git a/mysql-test/t/ssl_mode_no_ssl.test b/mysql-test/t/ssl_mode_no_ssl.test new file mode 100644 index 00000000000..65f7d1cd46b --- /dev/null +++ b/mysql-test/t/ssl_mode_no_ssl.test @@ -0,0 +1,41 @@ +-- source include/not_embedded.inc + +--echo # negative client tests +--echo # mysql +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED --ssl 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED --ssl-cipher=DHE-RSA-AES256-SHA 2>&1 +--error 1 +--exec $MYSQL test --ssl-mode=REQUIRED --ssl --ssl-cipher=DHE-RSA-AES256-SHA 2>&1 +--echo # mysqldump +--error 2 +--exec $MYSQL_DUMP --ssl-mode=REQUIRED test 2>&1 +--echo # mysqladmin +--replace_regex /.*mysqladmin.*/mysqladmin: / +--error 1 +--exec $MYSQLADMIN --ssl-mode=REQUIRED -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 +--echo # mysqlcheck +--replace_regex /.*mysqlcheck(\.exe)*/mysqlcheck/ +--error 2 +--exec $MYSQL_CHECK --ssl-mode=REQUIRED test 2>&1 +--echo # mysqlimport +--replace_regex /.*mysqlimport(\.exe)*/mysqlimport/ +--error 1 +--exec $MYSQL_IMPORT --ssl-mode=REQUIRED test $MYSQLTEST_VARDIR/tmp/t1.txt 2>&1 +--echo # mysqlshow +--replace_regex /.*mysqlshow(\.exe)*/mysqlshow/ +--error 1 +--exec $MYSQL_SHOW --ssl-mode=REQUIRED test 2>&1 +--echo # mysqlslap +--replace_regex /.*mysqlslap(\.exe)*/mysqlslap/ +--error 1 +--exec $MYSQL_SLAP --ssl-mode=REQUIRED 2>&1 +--echo # mysqltest +--error 1 +--exec $MYSQL_TEST --ssl-mode=REQUIRED -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 + +--echo +--echo End of tests -- cgit v1.2.1 From 29cc2c28832ae4733804ac6b29d650238ee0559c Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Fri, 26 Feb 2016 09:01:49 +0530 Subject: BUG#20574550 MAIN.MERGE TEST CASE FAILS IF BINLOG_FORMAT=ROW The main.merge test case was failing when tested using row based binlog format. While analyzing the issue it was found the following issues: a) The server is calling binlog related code even when a statement will not be binlogged; b) The child table list was not present into table structure by the time to generate the create table statement; c) The tables in the child table list will not be opened yet when generating table create info using row based replication; d) CREATE TABLE LIKE TEMP_TABLE does not preserve original table storage engine when using row based replication; This patch addressed all above issues. @ sql/sql_class.h Added a function to determine if the binary log is disabled to the current session. This is related with issue (a) above. @ sql/sql_table.cc Added code to skip binary logging related code if the statement will not be binlogged. This is related with issue (a) above. Added code to add the children to the query list of the table that will have its CREATE TABLE generated. This is related with issue (b) above. Added code to force the storage engine to be generated into the CREATE TABLE. This is related with issue (d) above. @ storage/myisammrg/ha_myisammrg.cc Added a test to skip a table getting info about a child table if the child table is not opened. This is related to issue (c) above. --- mysql-test/suite/binlog/r/binlog_row_binlog.result | 4 +- mysql-test/suite/rpl/r/rpl_row_merge_engine.result | 5 ++- .../suite/rpl/r/rpl_tmp_table_and_DDL.result | 10 +++++ mysql-test/suite/rpl/t/rpl_row_merge_engine.test | 6 ++- mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test | 51 ++++++++++++++++++++++ 5 files changed, 70 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 75105689246..1fcc915fa1f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1203,7 +1203,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -1238,7 +1238,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result index c61167e84e0..3b2e02bf97c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result +++ b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result @@ -4,8 +4,9 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM; CREATE TABLE t2 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t2 VALUES (4), (5), (6); -CREATE TABLE IF NOT EXISTS t1_merge LIKE t1; -ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1; +ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TABLE t1_merge LIKE tt1_merge; include/diff_tables.inc [master:test.t1, slave:test.t1] include/diff_tables.inc [master:test.t2, slave:test.t2] UPDATE t1_merge SET a=10 WHERE a=1; diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index 0264c9421fc..fb4e8f8ab8a 100644 --- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -192,4 +192,14 @@ DROP FUNCTION f2; DROP PROCEDURE p2; DROP EVENT e2; DROP TABLE t1, t2; +CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=MyISAM; +CREATE TABLE t1 LIKE temp_t1; +CREATE TABLE t2 LIKE temp_t2; +include/assert.inc ["t1 on master and temp_t1 have the same storage engine"] +include/assert.inc ["t2 on master and temp_t2 have the same storage engine"] +include/assert.inc ["t1 on slave and temp_t1 have the same storage engine"] +include/assert.inc ["t2 on slave and temp_t2 have the same storage engine"] +DROP TEMPORARY TABLE temp_t1, temp_t2; +DROP TABLE t1, t2; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test index 5add8dc1cda..dcbb8b891d8 100644 --- a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test +++ b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test @@ -20,8 +20,10 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM; CREATE TABLE t2 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t2 VALUES (4), (5), (6); -CREATE TABLE IF NOT EXISTS t1_merge LIKE t1; -ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); +# Changed a little to check also an issue reported on BUG#20574550 +CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1; +ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TABLE t1_merge LIKE tt1_merge; --sync_slave_with_master diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index d722a15f255..decbdcc1f99 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -166,4 +166,55 @@ DROP PROCEDURE p2; DROP EVENT e2; DROP TABLE t1, t2; +--sync_slave_with_master +# +# BUG#20574550 +# CREATE TABLE LIKE does not preserve original table storage +# engine when using row based replication +# +--connection master + +# Define temp_t1 and temp_t2 storage engines +--let $engine_temp_t1= InnoDB +--let $engine_temp_t2= MyISAM + +# Create the two temporary tables +--eval CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=$engine_temp_t1 +--eval CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=$engine_temp_t2 + +# Create t1 and t2 based on temporary tables +CREATE TABLE t1 LIKE temp_t1; +CREATE TABLE t2 LIKE temp_t2; +--sync_slave_with_master + +# On master +--connection master +# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2 +--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1) +--let $assert_cond= "$engine_t1" = "$engine_temp_t1" +--let $assert_text= "t1 on master and temp_t1 have the same storage engine" +--source include/assert.inc + +--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) +--let $assert_cond= "$engine_t2" = "$engine_temp_t2" +--let $assert_text= "t2 on master and temp_t2 have the same storage engine" +--source include/assert.inc + +# On slave +--connection slave +# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2 +--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1) +--let $assert_cond= "$engine_t1" = "$engine_temp_t1" +--let $assert_text= "t1 on slave and temp_t1 have the same storage engine" +--source include/assert.inc + +--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) +--let $assert_cond= "$engine_t2" = "$engine_temp_t2" +--let $assert_text= "t2 on slave and temp_t2 have the same storage engine" +--source include/assert.inc + +# Cleanup +--connection master +DROP TEMPORARY TABLE temp_t1, temp_t2; +DROP TABLE t1, t2; --source include/rpl_end.inc -- cgit v1.2.1