List:Commits« Previous MessageNext Message »
From:Dmitry Shulga Date:July 27 2010 8:52am
Subject:bzr commit into mysql-5.1-bugteam branch (Dmitry.Shulga:3456) Bug#47485
View as plain text  
#At file:///Users/shulga/projects/mysql/5.1-bugteam-bug47485/ based on revid:dmitry.shulga@stripped

 3456 Dmitry Shulga	2010-07-27
      Fixed bug #47485 - mysql_store_result returns a not NULL result set for a prepared statement.
     @ include/mysql.h
        enumerator MYSQL_STATUS_STATEMENT_GET_RESULT was added into mysql_status enum.
     @ include/mysql.h.pp
        enumerator MYSQL_STATUS_STATEMENT_GET_RESULT was added into mysql_status enum.
     @ libmysql/libmysql.c
        Introduce a separate mysql state to distinguish the situation
        when we have a binary result set pending on the server from the
        situation when the result set is in text protocol.
        execute() modified: set mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT
        before return. stmt_read_row_unbuffered() and mysql_stmt_store_result()
        were modified: added checking for mysql->status against
        MYSQL_STATUS_STATEMENT_GET_RESULT value instead of MYSQL_STATUS_GET_RESULT.

    modified:
      include/mysql.h
      include/mysql.h.pp
      libmysql/libmysql.c
=== modified file 'include/mysql.h'
--- a/include/mysql.h	2010-07-20 17:44:29 +0000
+++ b/include/mysql.h	2010-07-27 08:52:36 +0000
@@ -224,7 +224,7 @@ struct st_mysql_options {
 
 enum mysql_status 
 {
-  MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
+  MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, MYSQL_STATUS_STATEMENT_GET_RESULT
 };
 
 enum mysql_protocol_type 

=== modified file 'include/mysql.h.pp'
--- a/include/mysql.h.pp	2010-07-20 17:44:29 +0000
+++ b/include/mysql.h.pp	2010-07-27 08:52:36 +0000
@@ -293,7 +293,7 @@ struct st_mysql_options {
 };
 enum mysql_status
 {
-  MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
+  MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, MYSQL_STATUS_STATEMENT_GET_RESULT
 };
 enum mysql_protocol_type
 {

=== modified file 'libmysql/libmysql.c'
--- a/libmysql/libmysql.c	2010-07-06 22:31:54 +0000
+++ b/libmysql/libmysql.c	2010-07-27 08:52:36 +0000
@@ -2502,7 +2502,8 @@ static my_bool execute(MYSQL_STMT *stmt,
     if (stmt->mysql)
       set_stmt_errmsg(stmt, net);
     DBUG_RETURN(1);
-  }
+  } else
+    stmt->mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT;
   DBUG_RETURN(0);
 }
 
@@ -2641,7 +2642,7 @@ static int stmt_read_row_unbuffered(MYSQ
     set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL);
     return 1;
   }
-  if (mysql->status != MYSQL_STATUS_GET_RESULT)
+  if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT)
   {
     set_stmt_error(stmt, stmt->unbuffered_fetch_cancelled ?
                    CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC,
@@ -4847,7 +4848,7 @@ int STDCALL mysql_stmt_store_result(MYSQ
       DBUG_RETURN(1);
     }
   }
-  else if (mysql->status != MYSQL_STATUS_GET_RESULT)
+  else if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT)
   {
     set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL);
     DBUG_RETURN(1);


Attachment: [text/bzr-bundle] bzr/dmitry.shulga@sun.com-20100727085236-28zi6r6xo5l55p1j.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (Dmitry.Shulga:3456) Bug#47485Dmitry Shulga27 Jul
  • Re: bzr commit into mysql-5.1-bugteam branch (Dmitry.Shulga:3456)Bug#47485Konstantin Osipov27 Jul