mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Bug#47525: MySQL crashed (Federated)
On Mac OS X or Windows, sending a SIGHUP to the server or a asynchronous flush (triggered by flush_time), would cause the server to crash. The problem was that a hook used to detach client API handles wasn't prepared to handle cases where the thread does not have a associated session. The solution is to verify whether the thread has a associated session before trying to detach a handle.
This commit is contained in:
37
mysql-test/r/federated_debug.result
Normal file
37
mysql-test/r/federated_debug.result
Normal file
@@ -0,0 +1,37 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
stop slave;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
#
|
||||
# Bug#47525: MySQL crashed (Federated)
|
||||
#
|
||||
# Switch to slave
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
# Switch to master
|
||||
CREATE TABLE t1(a INT) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
# Start a asynchronous reload
|
||||
# Wait for tables to be closed
|
||||
# Ensure that the server didn't crash
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
# Drop tables on master and slave
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1;
|
||||
# Federated cleanup
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
1
mysql-test/t/federated_debug-master.opt
Normal file
1
mysql-test/t/federated_debug-master.opt
Normal file
@@ -0,0 +1 @@
|
||||
--loose-debug=d,simulate_detached_thread_refresh
|
39
mysql-test/t/federated_debug.test
Normal file
39
mysql-test/t/federated_debug.test
Normal file
@@ -0,0 +1,39 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/federated.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#47525: MySQL crashed (Federated)
|
||||
--echo #
|
||||
|
||||
connection slave;
|
||||
--echo # Switch to slave
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
connection master;
|
||||
--echo # Switch to master
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE t1(a INT) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo # Start a asynchronous reload
|
||||
--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= refresh 2>&1
|
||||
|
||||
--echo # Wait for tables to be closed
|
||||
let $show_statement= SHOW STATUS LIKE 'Open_tables';
|
||||
let $field= Value;
|
||||
let $condition= = '0';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--echo # Ensure that the server didn't crash
|
||||
SELECT * FROM t1;
|
||||
--echo # Drop tables on master and slave
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
connection default;
|
||||
--echo # Federated cleanup
|
||||
source include/federated_cleanup.inc;
|
Reference in New Issue
Block a user