List:Commits« Previous MessageNext Message »
From:konstantin Date:January 17 2006 8:19pm
Subject:bk commit into 4.1 tree (konstantin:1.2477) BUG#16144
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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.2477 06/01/17 23:19:43 konstantin@stripped +2 -0
  A fix and a test case for Bug#16144 "mysql_stmt_attr_get type error":
  use the right type in mysql_stmt_attr_get

  tests/mysql_client_test.c
    1.162 06/01/17 23:19:39 konstantin@stripped +20 -0
    A test case for Bug#16144

  libmysql/libmysql.c
    1.299 06/01/17 23:19:38 konstantin@stripped +1 -1
    Fix Bug#16144 "mysql_stmt_attr_get type error"

# 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-4.1-root

--- 1.298/libmysql/libmysql.c	2005-08-04 14:22:34 +04:00
+++ 1.299/libmysql/libmysql.c	2006-01-17 23:19:38 +03:00
@@ -2733,7 +2733,7 @@
 {
   switch (attr_type) {
   case STMT_ATTR_UPDATE_MAX_LENGTH:
-    *(unsigned long *) value= stmt->update_max_length;
+    *(my_bool*) value= stmt->update_max_length;
     break;
   default:
     return TRUE;

--- 1.161/tests/mysql_client_test.c	2005-10-25 21:11:44 +04:00
+++ 1.162/tests/mysql_client_test.c	2006-01-17 23:19:39 +03:00
@@ -11753,6 +11753,25 @@
 }
 
 
+/* Bug #16144: mysql_stmt_attr_get type error */
+
+static void test_bug16144()
+{
+  const my_bool flag_orig= (my_bool) 0xde;
+  my_bool flag= flag_orig;
+  MYSQL_STMT *stmt;
+  myheader("test_bug16144");
+
+  /* Check that attr_get returns correct data on little and big endian CPUs */
+  stmt= mysql_stmt_init(mysql);
+  mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void*) &flag);
+  mysql_stmt_attr_get(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &flag);
+  DIE_UNLESS(flag == flag_orig);
+
+  mysql_stmt_close(stmt);
+}
+
+
 /*
   Read and parse arguments and MySQL options from my.cnf
 */
@@ -11974,6 +11993,7 @@
   { "test_bug12001", test_bug12001 },
   { "test_bug11718", test_bug11718 },
   { "test_bug12925", test_bug12925 },
+  { "test_bug16144", test_bug16144 },
   { 0, 0 }
 };
 
Thread
bk commit into 4.1 tree (konstantin:1.2477) BUG#16144konstantin17 Jan