List:Internals« Previous MessageNext Message »
From:konstantin Date:July 14 2005 5:05pm
Subject:bk commit into 5.0 tree (konstantin:1.1932)
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.1932 05/07/14 19:05:25 konstantin@stripped +2 -0
  Merge mysql.com:/opt/local/work/mysql-4.1-root
  into  mysql.com:/opt/local/work/mysql-5.0-root

  tests/mysql_client_test.c
    1.137 05/07/14 19:05:17 konstantin@stripped +46 -45
    Manual merge

  libmysql/libmysql.c
    1.224 05/07/14 19:05:17 konstantin@stripped +1 -2
    Manual merge

# 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-root/RESYNC

--- 1.223/libmysql/libmysql.c	2005-07-14 15:27:14 +04:00
+++ 1.224/libmysql/libmysql.c	2005-07-14 19:05:17 +04:00
@@ -1869,6 +1869,16 @@
   }
 }
 
+static void stmt_clear_error(MYSQL_STMT *stmt)
+{
+  if (stmt->last_errno)
+  {
+    stmt->last_errno= 0;
+    stmt->last_error[0]= '\0';
+    strmov(stmt->sqlstate, not_error_sqlstate);
+  }
+}
+
 /*
   Set statement error code, sqlstate, and error message
   from given errcode and sqlstate.
@@ -4959,6 +4969,7 @@
           stmt->state= MYSQL_STMT_INIT_DONE;
           return 1;
         }
+        stmt_clear_error(stmt);
       }
     }
     stmt->state= MYSQL_STMT_PREPARE_DONE;

--- 1.136/tests/mysql_client_test.c	2005-07-14 17:32:59 +04:00
+++ 1.137/tests/mysql_client_test.c	2005-07-14 19:05:17 +04:00
@@ -13660,6 +13660,51 @@
   myquery(rc);
 }
 
+
+/* Bug#11183 "mysql_stmt_reset() doesn't reset information about error" */
+
+static void test_bug11183()
+{
+  int rc;
+  MYSQL_STMT *stmt;
+  char bug_statement[]= "insert into t1 values (1)";
+
+  myheader("test_bug11183");
+
+  mysql_query(mysql, "drop table t1 if exists");
+  mysql_query(mysql, "create table t1 (a int)");
+
+  stmt= mysql_stmt_init(mysql);
+  DIE_UNLESS(stmt != 0);
+
+  rc= mysql_stmt_prepare(stmt, bug_statement, strlen(bug_statement));
+  check_execute(stmt, rc);
+
+  rc= mysql_query(mysql, "drop table t1");
+  myquery(rc);
+
+  /* Trying to execute statement that should fail on execute stage */
+  rc= mysql_stmt_execute(stmt);
+  DIE_UNLESS(rc);
+
+  mysql_stmt_reset(stmt);
+  DIE_UNLESS(mysql_stmt_errno(stmt) == 0);
+
+  mysql_query(mysql, "create table t1 (a int)");
+
+  /* Trying to execute statement that should pass ok */
+  if (mysql_stmt_execute(stmt))
+  {
+    mysql_stmt_reset(stmt);
+    DIE_UNLESS(mysql_stmt_errno(stmt) == 0);
+  }
+
+  mysql_stmt_close(stmt);
+
+  rc= mysql_query(mysql, "drop table t1");
+  myquery(rc);
+}
+
 /*
   Read and parse arguments and MySQL options from my.cnf
 */
@@ -13902,6 +13947,7 @@
   { "test_bug11656", test_bug11656 },
   { "test_bug10214", test_bug10214 },
   { "test_bug9735", test_bug9735 },
+  { "test_bug11183", test_bug11183 },
   { 0, 0 }
 };
 
Thread
bk commit into 5.0 tree (konstantin:1.1932)konstantin14 Jul