List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:September 30 2009 11:24pm
Subject:bzr commit into mysql-pe branch (davi:3614)
View as plain text  
# At a local mysql-pe repository of davi

 3614 Davi Arnaut	2009-09-30 [merge]
      Manual merge.

    added:
      mysql-test/suite/federated/federated_debug-master.opt
      mysql-test/suite/federated/federated_debug.result
      mysql-test/suite/federated/federated_debug.test
    modified:
      mysql-test/suite/federated/my.cnf
      scripts/make_win_bin_dist
      sql/slave.cc
      sql/sql_parse.cc
=== added file 'mysql-test/suite/federated/federated_debug-master.opt'
--- a/mysql-test/suite/federated/federated_debug-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/federated/federated_debug-master.opt	2009-09-30 22:25:06 +0000
@@ -0,0 +1 @@
+--loose-debug=d,simulate_detached_thread_refresh

=== added file 'mysql-test/suite/federated/federated_debug.result'
--- a/mysql-test/suite/federated/federated_debug.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/federated/federated_debug.result	2009-09-30 22:25:06 +0000
@@ -0,0 +1,28 @@
+CREATE DATABASE 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@stripped: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 federated;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE federated;

=== added file 'mysql-test/suite/federated/federated_debug.test'
--- a/mysql-test/suite/federated/federated_debug.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/federated/federated_debug.test	2009-09-30 23:22:49 +0000
@@ -0,0 +1,39 @@
+--source include/have_debug.inc
+--source 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@stripped:$SLAVE_MYPORT/test/t1';
+
+SELECT * FROM t1;
+
+--echo # Start a asynchronous reload
+--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -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 federated_cleanup.inc;

=== modified file 'mysql-test/suite/federated/my.cnf'
--- a/mysql-test/suite/federated/my.cnf	2009-07-08 07:30:40 +0000
+++ b/mysql-test/suite/federated/my.cnf	2009-09-30 23:22:49 +0000
@@ -10,4 +10,7 @@ log-bin=                 master-bin
 
 [ENV]
 MASTER_MYPORT=           @mysqld.1.port
+MASTER_MYSOCK=           @mysqld.1.socket
+
 SLAVE_MYPORT=            @mysqld.2.port
+SLAVE_MYSOCK=            @mysqld.2.socket

=== modified file 'scripts/make_win_bin_dist'
--- a/scripts/make_win_bin_dist	2009-09-29 15:03:12 +0000
+++ b/scripts/make_win_bin_dist	2009-09-30 23:22:49 +0000
@@ -335,6 +335,7 @@ fi
 
 mkdir $DESTDIR/mysql-test
 cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/
+cp mysql-test/mysql-stress-test.pl $DESTDIR/mysql-test/
 cp mysql-test/README $DESTDIR/mysql-test/
 cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/
 

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-09-29 15:03:12 +0000
+++ b/sql/slave.cc	2009-09-30 23:22:49 +0000
@@ -4070,7 +4070,7 @@ extern "C" void slave_io_thread_detach_v
 {
 #ifdef SIGNAL_WITH_VIO_CLOSE
   THD *thd= current_thd;
-  if (thd->slave_thread)
+  if (thd && thd->slave_thread)
     thd->clear_active_vio();
 #endif
 }

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2009-09-25 14:15:30 +0000
+++ b/sql/sql_parse.cc	2009-09-30 23:22:49 +0000
@@ -1243,6 +1243,27 @@ bool dispatch_command(enum enum_server_c
     if (check_global_access(thd,RELOAD_ACL))
       break;
     general_log_print(thd, command, NullS);
+#ifndef DBUG_OFF
+    bool debug_simulate= FALSE;
+    DBUG_EXECUTE_IF("simulate_detached_thread_refresh", debug_simulate= TRUE;);
+    if (debug_simulate)
+    {
+      /*
+        Simulate a reload without a attached thread session.
+        Provides a environment similar to that of when the
+        server receives a SIGHUP signal and reloads caches
+        and flushes tables.
+      */
+      bool res;
+      my_pthread_setspecific_ptr(THR_THD, NULL);
+      res= reload_acl_and_cache(NULL, options | REFRESH_FAST,
+                                NULL, &not_used);
+      my_pthread_setspecific_ptr(THR_THD, thd);
+      if (res)
+        break;
+    }
+    else
+#endif
     if (reload_acl_and_cache(thd, options, (TABLE_LIST*) 0, &not_used))
       break;
     if (trans_commit_implicit(thd))


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20090930232249-eyd72qv33abu3agd.bundle
Thread
bzr commit into mysql-pe branch (davi:3614)Davi Arnaut1 Oct