List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:October 17 2011 9:29am
Subject:bzr push into mysql-5.1-telco-7.1 branch (magnus.blaudd:4305 to 4306)
View as plain text  
 4306 magnus.blaudd@stripped	2011-10-17 [merge]
      Merge 7.0 -> 7.1

    modified:
      sql/sql_parse.cc
      tests/mysql_client_test.c
 4305 jonas oreland	2011-10-16 [merge]
      ndb - merge 70 to 71

    added:
      storage/ndb/test/run-test/conf-daily-perf.cnf
      storage/ndb/test/run-test/daily-perf-tests.txt
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2011-06-30 15:59:25 +0000
+++ b/sql/sql_parse.cc	2011-10-17 09:17:54 +0000
@@ -1476,6 +1476,14 @@ bool dispatch_command(enum enum_server_c
   case COM_REFRESH:
   {
     int not_used;
+#ifndef MCP_BUG13001491
+    /*
+      Initialize thd->lex since it's used in many base functions, such as
+      open_tables(). Otherwise, it remains unitialized and may cause crash
+      during execution of COM_REFRESH.
+    */
+    lex_start(thd);
+#endif
     status_var_increment(thd->status_var.com_stat[SQLCOM_FLUSH]);
     ulong options= (ulong) (uchar) packet[0];
     if (check_global_access(thd,RELOAD_ACL))
@@ -6978,7 +6986,18 @@ bool reload_acl_and_cache(THD *thd, ulon
     if (ha_flush_logs(NULL))
       result=1;
     if (flush_error_log())
+#ifndef MCP_BUG13001491
+    {
+      /*
+        When flush_error_log() failed, my_error() has not been called.
+        So, we have to do it here to keep the protocol.
+      */
+      my_error(ER_UNKNOWN_ERROR, MYF(0));
+      result= 1;
+    }
+#else
       result=1;
+#endif
   }
 #ifdef HAVE_QUERY_CACHE
   if (options & REFRESH_QUERY_CACHE_FREE)

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2011-06-30 15:55:35 +0000
+++ b/tests/mysql_client_test.c	2011-10-17 09:17:54 +0000
@@ -18399,6 +18399,87 @@ static void test_bug47485()
 }
 
 
+#ifndef MCP_BUG13001491
+/*
+  Bug#13001491: MYSQL_REFRESH CRASHES WHEN STORED ROUTINES ARE RUN CONCURRENTLY.
+*/
+static void test_bug13001491()
+{
+  int rc;
+  char query[MAX_TEST_QUERY_LENGTH];
+  MYSQL *c;
+
+  myheader("test_bug13001491");
+
+  snprintf(query, MAX_TEST_QUERY_LENGTH,
+           "GRANT ALL PRIVILEGES ON *.* TO mysqltest_u1@%s",
+           opt_host ? opt_host : "'localhost'");
+           
+  rc= mysql_query(mysql, query);
+  myquery(rc);
+
+  snprintf(query, MAX_TEST_QUERY_LENGTH,
+           "GRANT RELOAD ON *.* TO mysqltest_u1@%s",
+           opt_host ? opt_host : "'localhost'");
+           
+  rc= mysql_query(mysql, query);
+  myquery(rc);
+
+  c= mysql_client_init(NULL);
+
+  DIE_UNLESS(mysql_real_connect(c, opt_host, "mysqltest_u1", NULL,
+                                current_db, opt_port, opt_unix_socket,
+                                CLIENT_MULTI_STATEMENTS |
+                                CLIENT_MULTI_RESULTS));
+
+  rc= mysql_query(c, "DROP PROCEDURE IF EXISTS p1");
+  myquery(rc);
+
+  rc= mysql_query(c,
+    "CREATE PROCEDURE p1() "
+    "BEGIN "
+    " DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; "
+    " SELECT COUNT(*) "
+    " FROM INFORMATION_SCHEMA.PROCESSLIST "
+    " GROUP BY user "
+    " ORDER BY NULL "
+    " INTO @a; "
+    "END");
+  myquery(rc);
+
+  rc= mysql_query(c, "CALL p1()");
+  myquery(rc);
+
+  mysql_free_result(mysql_store_result(c));
+
+  /* Check that mysql_refresh() succeeds without REFRESH_LOG. */
+  rc= mysql_refresh(c, REFRESH_GRANT |
+                       REFRESH_TABLES | REFRESH_HOSTS |
+                       REFRESH_STATUS | REFRESH_THREADS);
+  myquery(rc);
+
+  /*
+    Check that mysql_refresh(REFRESH_LOG) does not crash the server even if it
+    fails. mysql_refresh(REFRESH_LOG) fails when error log points to unavailable
+    location.
+  */
+  mysql_refresh(c, REFRESH_LOG);
+
+  rc= mysql_query(c, "DROP PROCEDURE p1");
+  myquery(rc);
+
+  mysql_close(c);
+  c= NULL;
+
+  snprintf(query, MAX_TEST_QUERY_LENGTH,
+           "DROP USER mysqltest_u1@%s",
+           opt_host ? opt_host : "'localhost'");
+           
+  rc= mysql_query(mysql, query);
+  myquery(rc);
+}
+
+#endif
 /*
   Read and parse arguments and MySQL options from my.cnf
 */
@@ -18725,6 +18806,9 @@ static struct my_tests_st my_tests[]= {
   { "test_bug42373", test_bug42373 },
   { "test_bug54041", test_bug54041 },
   { "test_bug47485", test_bug47485 },
+#ifndef MCP_BUG13001491
+  { "test_bug13001491", test_bug13001491 },
+#endif
   { 0, 0 }
 };
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (magnus.blaudd:4305 to 4306) magnus.blaudd17 Oct