summaryrefslogtreecommitdiff
path: root/mysql-test/suite/federated
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-08 19:47:34 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-08 22:49:09 +0200
commitfa1f214cf82ae3be9b61dc3879b4e4d05058be8f (patch)
treedd290043a07b8f0a6d0137cfedb32fbb2709ee5f /mysql-test/suite/federated
parent5099d6de61fd03b8225dfba9e4becb13b5a74c67 (diff)
downloadmariadb-git-fa1f214cf82ae3be9b61dc3879b4e4d05058be8f.tar.gz
MDEV-12725 select on federated table crashes server
NET can only store current_thd if this NET (or its MYSQL) is not moved between threads. In FederatedX MYSQL is part of the TABLE, and a TABLE can migrate between threads. Fix: associate NET with THD in txn->acquire() , and dissociate in txn->release()
Diffstat (limited to 'mysql-test/suite/federated')
-rw-r--r--mysql-test/suite/federated/net_thd_crash-12725.result10
-rw-r--r--mysql-test/suite/federated/net_thd_crash-12725.test17
2 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/suite/federated/net_thd_crash-12725.result b/mysql-test/suite/federated/net_thd_crash-12725.result
new file mode 100644
index 00000000000..8c85b7a7594
--- /dev/null
+++ b/mysql-test/suite/federated/net_thd_crash-12725.result
@@ -0,0 +1,10 @@
+SET GLOBAL query_cache_size= 16*1024*1024;
+SET GLOBAL query_cache_type= 1;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
+ALTER TABLE t2 DISABLE KEYS;
+ERROR HY000: Storage engine FEDERATED of the table `test`.`t2` doesn't have this option
+CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
+SET GLOBAL query_cache_size= default;
+SET GLOBAL query_cache_type= default;
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/federated/net_thd_crash-12725.test b/mysql-test/suite/federated/net_thd_crash-12725.test
new file mode 100644
index 00000000000..e94001cde01
--- /dev/null
+++ b/mysql-test/suite/federated/net_thd_crash-12725.test
@@ -0,0 +1,17 @@
+#
+# MDEV-12725 select on federated table crashes server
+#
+#
+SET GLOBAL query_cache_size= 16*1024*1024;
+SET GLOBAL query_cache_type= 1;
+CREATE TABLE t1 (i INT);
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
+--error ER_ILLEGAL_HA
+ALTER TABLE t2 DISABLE KEYS;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
+source include/restart_mysqld.inc;
+SET GLOBAL query_cache_size= default;
+SET GLOBAL query_cache_type= default;
+drop table t1, t2, t3;