mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
merge from 5.1 main
This commit is contained in:
43
mysql-test/include/restart_slave_sql.inc
Normal file
43
mysql-test/include/restart_slave_sql.inc
Normal file
@@ -0,0 +1,43 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Provide a earier way to restart SQL thread when you want to stop sql thread
|
||||
# and then start it immediately.
|
||||
#
|
||||
# Sources stop_slave_sql.inc to stop SQL thread on the current connection.
|
||||
# Then issues START SLAVE SQL_THREAD and then waits until
|
||||
# the SQL threads have started, or until a timeout is reached.
|
||||
#
|
||||
# Please use this instead of 'STOP|START SLAVE SQL_THREAD', to reduce the risk of
|
||||
# test case bugs.
|
||||
#
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# [--let $slave_timeout= NUMBER]
|
||||
# [--let $rpl_debug= 1]
|
||||
# --source include/restart_slave_sql.inc
|
||||
#
|
||||
# Parameters:
|
||||
# $slave_timeout
|
||||
# See include/wait_for_slave_param.inc
|
||||
#
|
||||
# $rpl_debug
|
||||
# See include/rpl_init.inc
|
||||
|
||||
|
||||
--let $include_filename= restart_slave.inc
|
||||
--source include/begin_include_file.inc
|
||||
|
||||
|
||||
if (!$rpl_debug)
|
||||
{
|
||||
--disable_query_log
|
||||
}
|
||||
|
||||
source include/stop_slave_sql.inc;
|
||||
START SLAVE SQL_THREAD;
|
||||
source include/wait_for_slave_sql_to_start.inc;
|
||||
|
||||
|
||||
--let $include_filename= restart_slave.inc
|
||||
--source include/end_include_file.inc
|
2
mysql-test/include/rpl_connection_master.inc
Normal file
2
mysql-test/include/rpl_connection_master.inc
Normal file
@@ -0,0 +1,2 @@
|
||||
let $rpl_connection_name= master;
|
||||
source include/rpl_connection.inc;
|
2
mysql-test/include/rpl_connection_slave.inc
Normal file
2
mysql-test/include/rpl_connection_slave.inc
Normal file
@@ -0,0 +1,2 @@
|
||||
let $rpl_connection_name= slave;
|
||||
source include/rpl_connection.inc;
|
2
mysql-test/include/rpl_connection_slave1.inc
Normal file
2
mysql-test/include/rpl_connection_slave1.inc
Normal file
@@ -0,0 +1,2 @@
|
||||
let $rpl_connection_name= slave1;
|
||||
source include/rpl_connection.inc;
|
@@ -1683,3 +1683,18 @@ ARMENIAN CAPIT DA 2
|
||||
ARMENIAN CAPIT ECH 2
|
||||
ARMENIAN CAPIT ZA 2
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Start of 5.1 tests
|
||||
#
|
||||
#
|
||||
# Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
|
||||
#
|
||||
SET NAMES latin1;
|
||||
DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
|
||||
AS BINARY(0)) USING utf8);
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'Zpq'
|
||||
Warning 1292 Truncated incorrect BINARY(0) value: '1.'
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
||||
|
@@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3);
|
||||
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
|
||||
1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#59149 valgrind warnings with "like .. escape .." function
|
||||
#
|
||||
SELECT '' LIKE '1' ESCAPE COUNT(1);
|
||||
ERROR HY000: Incorrect arguments to ESCAPE
|
||||
End of 5.1 tests
|
||||
|
@@ -1113,4 +1113,15 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
|
||||
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
|
||||
SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
|
||||
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
|
||||
#
|
||||
# Bug #44332 my_xml_scan reads behind the end of buffer
|
||||
#
|
||||
SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
|
||||
UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1')
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT unexpected (ident or '/' wanted)'
|
||||
SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
|
||||
UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1')
|
||||
NULL
|
||||
End of 5.1 tests
|
||||
|
@@ -128,5 +128,47 @@ START SLAVE SQL_THREAD;
|
||||
include/wait_for_slave_sql_to_start.inc
|
||||
# Test end
|
||||
SET GLOBAL debug= '$debug_save';
|
||||
include/restart_slave.inc
|
||||
[connection master]
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
# Bug#58546 test rpl_packet timeout failure sporadically on PB
|
||||
# ----------------------------------------------------------------------
|
||||
# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
|
||||
# possible that IO thread stopped after replicating part of a transaction
|
||||
# which SQL thread was executing. SQL thread would be hung if the
|
||||
# transaction could not be rolled back safely.
|
||||
# It caused some sporadic failures on PB2.
|
||||
#
|
||||
# This test verifies that when 'STOP SLAVE' is issued by a user, IO
|
||||
# thread will continue to fetch the rest events of the transaction which
|
||||
# is being executed by SQL thread and is not able to be rolled back safely.
|
||||
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES(1, 1);
|
||||
SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
|
||||
[connection slave]
|
||||
include/restart_slave.inc
|
||||
BEGIN;
|
||||
UPDATE t1 SET c2 = 2 WHERE c1 = 1;
|
||||
[connection master]
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(2, 2);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
|
||||
COMMIT;
|
||||
[connection slave1]
|
||||
STOP SLAVE;
|
||||
[connection slave]
|
||||
ROLLBACK;
|
||||
[connection master]
|
||||
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
[connection slave]
|
||||
include/wait_for_slave_to_stop.inc
|
||||
[connection slave1]
|
||||
include/start_slave.inc
|
||||
[connection master]
|
||||
DROP TABLE t1, t2;
|
||||
SET GLOBAL debug= $debug_save;
|
||||
include/rpl_end.inc
|
||||
|
@@ -26,8 +26,8 @@ let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
|
||||
SET @@global.max_allowed_packet=1024;
|
||||
SET @@global.net_buffer_length=1024;
|
||||
|
||||
sync_slave_with_master;
|
||||
# Restart slave for setting to take effect
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
source include/start_slave.inc;
|
||||
|
||||
|
@@ -54,7 +54,69 @@ source extra/rpl_tests/rpl_stop_slave.test;
|
||||
|
||||
--echo # Test end
|
||||
SET GLOBAL debug= '$debug_save';
|
||||
source include/restart_slave_sql.inc;
|
||||
|
||||
connection master;
|
||||
--source include/rpl_connection_master.inc
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo
|
||||
--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
|
||||
--echo # ----------------------------------------------------------------------
|
||||
--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
|
||||
--echo # possible that IO thread stopped after replicating part of a transaction
|
||||
--echo # which SQL thread was executing. SQL thread would be hung if the
|
||||
--echo # transaction could not be rolled back safely.
|
||||
--echo # It caused some sporadic failures on PB2.
|
||||
--echo #
|
||||
--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
|
||||
--echo # thread will continue to fetch the rest events of the transaction which
|
||||
--echo # is being executed by SQL thread and is not able to be rolled back safely.
|
||||
|
||||
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES(1, 1);
|
||||
|
||||
let $debug_save= `SELECT @@GLOBAL.debug`;
|
||||
SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
--source include/rpl_connection_slave.inc
|
||||
source include/restart_slave_sql.inc;
|
||||
|
||||
BEGIN;
|
||||
UPDATE t1 SET c2 = 2 WHERE c1 = 1;
|
||||
|
||||
--source include/rpl_connection_master.inc
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(2, 2);
|
||||
INSERT INTO t2 VALUES(1);
|
||||
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
|
||||
COMMIT;
|
||||
|
||||
--source include/rpl_connection_slave1.inc
|
||||
let $show_statement= SHOW PROCESSLIST;
|
||||
let $field= Info;
|
||||
let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
|
||||
source include/wait_show_condition.inc;
|
||||
|
||||
send STOP SLAVE;
|
||||
|
||||
--source include/rpl_connection_slave.inc
|
||||
ROLLBACK;
|
||||
|
||||
--source include/rpl_connection_master.inc
|
||||
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
--source include/rpl_connection_slave.inc
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
|
||||
--source include/rpl_connection_slave1.inc
|
||||
reap;
|
||||
source include/start_slave.inc;
|
||||
|
||||
--source include/rpl_connection_master.inc
|
||||
DROP TABLE t1, t2;
|
||||
SET GLOBAL debug= $debug_save;
|
||||
--source include/rpl_end.inc
|
||||
|
@@ -64,12 +64,12 @@ SET last = pct;
|
||||
END IF;
|
||||
END WHILE;
|
||||
END//
|
||||
CREATE PROCEDURE check_pct(IN num DECIMAL)
|
||||
CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN)
|
||||
BEGIN
|
||||
IF (dirty_pct() < num) THEN
|
||||
IF (success_on_wait > 0) THEN
|
||||
SELECT 'BELOW_MAX' AS PCT_VALUE;
|
||||
ELSE
|
||||
SELECT 'ABOVE_MAX' AS PCT_VALUE;
|
||||
SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE;
|
||||
END IF;
|
||||
END//
|
||||
CREATE TABLE t1(
|
||||
@@ -83,7 +83,7 @@ CALL add_until(10);
|
||||
FLUSH TABLES;
|
||||
CALL add_records(500);
|
||||
'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
|
||||
CALL check_pct(10);
|
||||
CALL check_pct(1);
|
||||
PCT_VALUE
|
||||
BELOW_MAX
|
||||
DROP PROCEDURE add_records;
|
||||
|
@@ -117,12 +117,12 @@ BEGIN
|
||||
END WHILE;
|
||||
END//
|
||||
|
||||
CREATE PROCEDURE check_pct(IN num DECIMAL)
|
||||
CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN)
|
||||
BEGIN
|
||||
IF (dirty_pct() < num) THEN
|
||||
IF (success_on_wait > 0) THEN
|
||||
SELECT 'BELOW_MAX' AS PCT_VALUE;
|
||||
ELSE
|
||||
SELECT 'ABOVE_MAX' AS PCT_VALUE;
|
||||
SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE;
|
||||
END IF;
|
||||
END//
|
||||
|
||||
@@ -155,7 +155,8 @@ let $wait_condition= SELECT (dirty_pct() <= @@global.innodb_max_dirty_pages_pct)
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--echo 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
|
||||
CALL check_pct(10);
|
||||
# Value For $sucess will be set from include/wait_condition.inc file. It can have values 1 or 0. It will be 1 if dirty_pct() <= @@global.innodb_max_dirty_pages_pct else it will be 0.
|
||||
eval CALL check_pct($success);
|
||||
DROP PROCEDURE add_records;
|
||||
DROP PROCEDURE add_until;
|
||||
DROP PROCEDURE check_pct;
|
||||
|
@@ -211,3 +211,19 @@ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Start of 5.1 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
|
||||
--echo #
|
||||
|
||||
SET NAMES latin1;
|
||||
DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
|
||||
AS BINARY(0)) USING utf8);
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
||||
|
@@ -126,5 +126,10 @@ INSERT INTO t2 VALUES (1), (2), (3);
|
||||
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#59149 valgrind warnings with "like .. escape .." function
|
||||
--echo #
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
SELECT '' LIKE '1' ESCAPE COUNT(1);
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@@ -640,5 +640,10 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
|
||||
--error ER_ILLEGAL_VALUE_FOR_TYPE
|
||||
SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
|
||||
|
||||
--echo #
|
||||
--echo # Bug #44332 my_xml_scan reads behind the end of buffer
|
||||
--echo #
|
||||
SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
|
||||
SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user