MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:konstantin Date:November 17 2005 4:41pm
Subject:bk commit into 5.0 tree (konstantin:1.1971) BUG#13524
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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
  1.1971 05/11/17 19:40:48 konstantin@stripped +1 -0
  Post-review fixes (Bug#13524).

  sql/sql_prepare.cc
    1.165 05/11/17 19:40:21 konstantin@stripped +12 -5
    Post-review fixes (Bug#13524): make sure 
    mysql_reset_thd_for_next_command is called first for
    all PS commands.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	konstantin
# Host:	dragonfly.local
# Root:	/opt/local/work/mysql-5.0-13524

--- 1.164/sql/sql_prepare.cc	2005-11-17 16:20:00 +03:00
+++ 1.165/sql/sql_prepare.cc	2005-11-17 19:40:21 +03:00
@@ -1827,13 +1827,16 @@
 
 void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
 {
-  Prepared_statement *stmt= new Prepared_statement(thd, &thd->protocol_prep);
+  Prepared_statement *stmt;
   bool error;
   DBUG_ENTER("mysql_stmt_prepare");
 
   DBUG_PRINT("prep_query", ("%s", packet));
 
-  if (stmt == 0)
+  /* First of all clear possible warnings from the previous command */
+  mysql_reset_thd_for_next_command(thd);
+
+  if (! (stmt= new Prepared_statement(thd, &thd->protocol_prep)))
     DBUG_VOID_RETURN; /* out of memory: error is set in Sql_alloc */
 
   if (thd->stmt_map.insert(stmt))
@@ -1842,7 +1845,6 @@
     DBUG_VOID_RETURN;                           /* out of memory */
   }
 
-  mysql_reset_thd_for_next_command(thd);
   /* Reset warnings from previous command */
   mysql_reset_errors(thd, 0);
   sp_cache_flush_obsolete(&thd->sp_proc_cache);
@@ -2186,13 +2188,15 @@
 
   packet+= 9;                               /* stmt_id + 5 bytes of flags */
 
+  /* First of all clear possible warnings from the previous command */
+  mysql_reset_thd_for_next_command(thd);
+
   if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute")))
     DBUG_VOID_RETURN;
 
   DBUG_PRINT("exec_query", ("%s", stmt->query));
   DBUG_PRINT("info",("stmt: %p", stmt));
 
-  mysql_reset_thd_for_next_command(thd);
   sp_cache_flush_obsolete(&thd->sp_proc_cache);
   sp_cache_flush_obsolete(&thd->sp_func_cache);
 
@@ -2312,6 +2316,7 @@
   Server_side_cursor *cursor;
   DBUG_ENTER("mysql_stmt_fetch");
 
+  /* First of all clear possible warnings from the previous command */
   mysql_reset_thd_for_next_command(thd);
   statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
   if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
@@ -2374,6 +2379,9 @@
   Prepared_statement *stmt;
   DBUG_ENTER("mysql_stmt_reset");
 
+  /* First of all clear possible warnings from the previous command */
+  mysql_reset_thd_for_next_command(thd);
+
   statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
   if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
     DBUG_VOID_RETURN;
@@ -2388,7 +2396,6 @@
 
   stmt->state= Query_arena::PREPARED;
 
-  mysql_reset_thd_for_next_command(thd);
   send_ok(thd);
 
   DBUG_VOID_RETURN;
Thread
bk commit into 5.0 tree (konstantin:1.1971) BUG#13524konstantin17 Nov