From 1a170dc092f3f65b58ea4f22e3f663a470e2ab0b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Aug 2005 17:22:19 +0400 Subject: [PATCH 1/4] Fixes bug #12517. Clear user variables and replication events before closing temp tables in thread cleanup. mysql-test/r/connect.result: added results for test of bug #12517 mysql-test/t/connect.test: added test of bug #12517 sql/sql_class.cc: Clear user variables and replication events before closing temp tables in thread cleanup. --- mysql-test/r/connect.result | 16 ++++++++++++++++ mysql-test/t/connect.test | 18 ++++++++++++++++++ sql/sql_class.cc | 4 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index edf30e7f6e4..293ad37c31a 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -65,3 +65,19 @@ show tables; Tables_in_test delete from mysql.user where user=_binary"test"; flush privileges; +use test; +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +create table t1 (id integer not null auto_increment primary key); +drop table if exists t2; +Warnings: +Note 1051 Unknown table 't2' +create temporary table t2(id integer not null auto_increment primary key); +set @id := 1; +delete from t1 where id like @id; +use test; +drop table if exists t2; +Warnings: +Note 1051 Unknown table 't2' +drop table if exists t1; diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 1a6dca5b69e..9acc18a0cee 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -77,4 +77,22 @@ show tables; delete from mysql.user where user=_binary"test"; flush privileges; +# Test for bug #12517. +connect (con2,localhost,root,,test); +connection con2; +use test; +drop table if exists t1; +create table t1 (id integer not null auto_increment primary key); +drop table if exists t2; +create temporary table t2(id integer not null auto_increment primary key); +set @id := 1; +delete from t1 where id like @id; +disconnect con2; +sleep 5; +connect (con1,localhost,root,,test); +connection con1; +use test; +drop table if exists t2; +drop table if exists t1; + # End of 4.1 tests diff --git a/sql/sql_class.cc b/sql/sql_class.cc index e845769d7ad..11b45b848c8 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -353,12 +353,12 @@ void THD::cleanup(void) mysql_ha_flush(this, (TABLE_LIST*) 0, MYSQL_HA_CLOSE_FINAL | MYSQL_HA_FLUSH_ALL); hash_free(&handler_tables_hash); + delete_dynamic(&user_var_events); + hash_free(&user_vars); close_temporary_tables(this); my_free((char*) variables.time_format, MYF(MY_ALLOW_ZERO_PTR)); my_free((char*) variables.date_format, MYF(MY_ALLOW_ZERO_PTR)); my_free((char*) variables.datetime_format, MYF(MY_ALLOW_ZERO_PTR)); - delete_dynamic(&user_var_events); - hash_free(&user_vars); if (global_read_lock) unlock_global_read_lock(this); if (ull) From 34422f78c17ced6ae43a030a4d772273b7406405 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Sep 2005 12:09:30 +0400 Subject: [PATCH 2/4] Modified test case for bug #12517 --- mysql-test/r/connect.result | 14 ++------------ mysql-test/t/connect.test | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 293ad37c31a..68c86b80e60 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -1,3 +1,4 @@ +drop table if exists t1,t2; show tables; Tables_in_mysql columns_priv @@ -65,19 +66,8 @@ show tables; Tables_in_test delete from mysql.user where user=_binary"test"; flush privileges; -use test; -drop table if exists t1; -Warnings: -Note 1051 Unknown table 't1' create table t1 (id integer not null auto_increment primary key); -drop table if exists t2; -Warnings: -Note 1051 Unknown table 't2' create temporary table t2(id integer not null auto_increment primary key); set @id := 1; delete from t1 where id like @id; -use test; -drop table if exists t2; -Warnings: -Note 1051 Unknown table 't2' -drop table if exists t1; +drop table t1; diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 9acc18a0cee..ff15d74e5ac 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -6,6 +6,10 @@ # This test makes no sense with the embedded server --source include/not_embedded.inc +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + #connect (con1,localhost,root,,""); #show tables; connect (con1,localhost,root,,mysql); @@ -77,22 +81,18 @@ show tables; delete from mysql.user where user=_binary"test"; flush privileges; -# Test for bug #12517. +# +# Bug#12517: Clear user variables and replication events before +# closing temp tables in thread cleanup. connect (con2,localhost,root,,test); connection con2; -use test; -drop table if exists t1; create table t1 (id integer not null auto_increment primary key); -drop table if exists t2; create temporary table t2(id integer not null auto_increment primary key); set @id := 1; delete from t1 where id like @id; disconnect con2; -sleep 5; -connect (con1,localhost,root,,test); -connection con1; -use test; -drop table if exists t2; -drop table if exists t1; +--sleep 5 +connection default; +drop table t1; # End of 4.1 tests From 110230beeca54c76d142b184a35b08029fa3a91b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Sep 2005 16:47:27 +0200 Subject: [PATCH 3/4] corrected typo --- ndb/src/mgmsrv/MgmtSrvr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index e9d3ce19076..011643237f8 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2506,6 +2506,7 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) #endif if (rep->failNo == nodeId || waitCompleted == 1) + return 1326; // wait for next signal // master node will report aborted backup break; From 91d05c5234a3c507bcb6aac4cad6968afec34114 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Sep 2005 19:27:37 +0200 Subject: [PATCH 4/4] SignalSender.cpp: fixed compile error ndb/src/ndbapi/SignalSender.cpp: fixed compile error --- ndb/src/ndbapi/SignalSender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/SignalSender.cpp b/ndb/src/ndbapi/SignalSender.cpp index 0a23529dc73..a1c80f22041 100644 --- a/ndb/src/ndbapi/SignalSender.cpp +++ b/ndb/src/ndbapi/SignalSender.cpp @@ -266,5 +266,5 @@ SignalSender::execNodeStatus(void* signalSender, template SimpleSignal* SignalSender::waitFor(unsigned, WaitForNode&); template SimpleSignal* SignalSender::waitFor(unsigned, WaitForAny&); -template Vector; +template class Vector;