List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:March 17 2008 7:39pm
Subject:bk commit into 5.1 tree (davi:1.2569)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of davi.  When davi does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-03-17 16:39:09-03:00, davi@buzz.(none) +4 -0
  Post-merge fixes for Bug 35103

  libmysql/libmysql.c@stripped, 2008-03-17 16:39:08-03:00, davi@buzz.(none) +1 -1
    Manual merge

  sql/sql_class.cc@stripped, 2008-03-17 16:39:08-03:00, davi@buzz.(none) +18 -4
    Don't send anything back to the client if disabled.

  sql/sql_prepare.cc@stripped, 2008-03-17 16:39:08-03:00, davi@buzz.(none) +2 -2
    Don't send any packet back for statement close.

  tests/mysql_client_test.c@stripped, 2008-03-17 16:39:08-03:00, davi@buzz.(none) +19 -9
    Manual merge

diff -Nrup a/libmysql/libmysql.c b/libmysql/libmysql.c
--- a/libmysql/libmysql.c	2008-03-17 16:13:58 -03:00
+++ b/libmysql/libmysql.c	2008-03-17 16:39:08 -03:00
@@ -4751,7 +4751,7 @@ int STDCALL mysql_stmt_store_result(MYSQ
   if (!mysql)
   {
     /* mysql can be reset in mysql_close called from mysql_reconnect */
-    set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
+    set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL);
     DBUG_RETURN(1);
   }
 
diff -Nrup a/sql/sql_class.cc b/sql/sql_class.cc
--- a/sql/sql_class.cc	2008-02-26 13:26:41 -03:00
+++ b/sql/sql_class.cc	2008-03-17 16:39:08 -03:00
@@ -395,8 +395,11 @@ Diagnostics_area::set_ok_status(THD *thd
 {
   DBUG_ASSERT(! is_set());
 #ifdef DBUG_OFF
-  /* In production, refuse to overwrite an error with an OK packet. */
-  if (is_error())
+  /*
+    In production, refuse to overwrite an error or a custom response
+    with an OK packet.
+  */
+  if (is_error() || is_disabled())
     return;
 #endif
   /** Only allowed to report success if has not yet reported an error */
@@ -424,8 +427,11 @@ Diagnostics_area::set_eof_status(THD *th
 
   DBUG_ASSERT(! is_set());
 #ifdef DBUG_OFF
-  /* In production, refuse to overwrite an error with an EOF packet. */
-  if (is_error())
+  /*
+    In production, refuse to overwrite an error or a custom response
+    with an EOF packet.
+  */
+  if (is_error() || is_disabled())
     return;
 #endif
 
@@ -454,6 +460,14 @@ Diagnostics_area::set_error_status(THD *
     an error can happen during the flush.
   */
   DBUG_ASSERT(! is_set() || can_overwrite_status);
+#ifdef DBUG_OFF
+  /*
+    In production, refuse to overwrite a custom response with an
+    ERROR packet.
+  */
+  if (is_disabled())
+    return;
+#endif
 
   m_sql_errno= sql_errno_arg;
   strmake(m_message, message_arg, sizeof(m_message) - 1);
diff -Nrup a/sql/sql_prepare.cc b/sql/sql_prepare.cc
--- a/sql/sql_prepare.cc	2008-03-17 16:13:26 -03:00
+++ b/sql/sql_prepare.cc	2008-03-17 16:39:08 -03:00
@@ -2555,6 +2555,8 @@ void mysql_stmt_close(THD *thd, char *pa
   Prepared_statement *stmt;
   DBUG_ENTER("mysql_stmt_close");
 
+  thd->main_da.disable_status();
+
   if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close")))
     DBUG_VOID_RETURN;
 
@@ -2565,8 +2567,6 @@ void mysql_stmt_close(THD *thd, char *pa
   DBUG_ASSERT(! (stmt->flags & (uint) Prepared_statement::IS_IN_USE));
   (void) stmt->deallocate();
   general_log_print(thd, thd->command, NullS);
-
-  thd->main_da.disable_status();
 
   DBUG_VOID_RETURN;
 }
diff -Nrup a/tests/mysql_client_test.c b/tests/mysql_client_test.c
--- a/tests/mysql_client_test.c	2008-03-17 16:13:40 -03:00
+++ b/tests/mysql_client_test.c	2008-03-17 16:39:08 -03:00
@@ -12016,6 +12016,7 @@ static void test_bug5194()
 
     rc= mysql_stmt_execute(stmt);
     check_execute(stmt, rc);
+    mysql_stmt_reset(stmt);
   }
 
   mysql_stmt_close(stmt);
@@ -16600,7 +16601,10 @@ static void test_bug27592()
   DBUG_VOID_RETURN;
 }
 
-#if 0
+
+/**
+  Bug#29948 autoreconnect + prepared statements + kill seems unstable
+*/
 
 static void test_bug29948()
 {
@@ -16614,7 +16618,10 @@ static void test_bug29948()
   const char *query;
   int buf;
   unsigned long length, cursor_type;
-  
+
+  DBUG_ENTER("test_bug29948");
+  myheader("test_bug29948");
+
   dbc = mysql_init(NULL);
   DIE_UNLESS(dbc);
 
@@ -16650,7 +16657,7 @@ static void test_bug29948()
   res= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&cursor_type);
   myquery(res);
 
-  query= "SELECT * from t1 where a=?";
+  query= "SELECT * FROM t1 WHERE a=?";
   res= mysql_stmt_prepare(stmt, query, strlen(query));
   myquery(res);
 
@@ -16662,20 +16669,23 @@ static void test_bug29948()
 
   res= mysql_stmt_bind_result(stmt,&bind);
   check_execute(stmt, res);
-    
-  sprintf(kill_buf, "kill %ld", dbc->thread_id);
-  mysql_query(dbc, kill_buf);
+
+  my_snprintf(kill_buf, sizeof(kill_buf), "KILL %ld", dbc->thread_id);
+  res= mysql_query(dbc, kill_buf);
+  myquery(res);
 
   res= mysql_stmt_store_result(stmt);
   DIE_UNLESS(res);
 
   mysql_stmt_free_result(stmt);
   mysql_stmt_close(stmt);
-  mysql_query(dbc, "DROP TABLE t1");
+
+  res= mysql_query(dbc, "DROP TABLE t1");
+  myquery(res);
+
   mysql_close(dbc);
 }
 
-#endif
 
 /*
   Bug#29687 mysql_stmt_store_result memory leak in libmysqld
@@ -17715,7 +17725,7 @@ static struct my_tests_st my_tests[]= {
   { "test_bug28505", test_bug28505 },
   { "test_bug28934", test_bug28934 },
   { "test_bug27592", test_bug27592 },
-  /* { "test_bug29948", test_bug29948 }, */
+  { "test_bug29948", test_bug29948 },
   { "test_bug29687", test_bug29687 },
   { "test_bug29692", test_bug29692 },
   { "test_bug29306", test_bug29306 },
Thread
bk commit into 5.1 tree (davi:1.2569)Davi Arnaut17 Mar