MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:holyfoot Date:July 20 2007 10:47am
Subject:bk commit into 4.1 tree (holyfoot:1.2676) BUG#29494
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of hf. When hf 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, 2007-07-20 15:47:50+05:00, holyfoot@stripped +1 -0
  Bug #29494 Field packet with NULL fields crashes libmysqlclient.
  
  unpack_fields() didn't expect NULL_LENGHT in the field's descriptions.
  In this case we get NULL in the resulting string so cannot use
  strdup_root to make a copy of it.
  strdup_root changed with strmake_root as it's NULL-safe

  sql-common/client.c@stripped, 2007-07-20 15:47:49+05:00, holyfoot@stripped +6 -6
    Bug #29494 Field packet with NULL fields crashes libmysqlclient
    
    strdup_root changed with strmake_root in unpack_fields()

diff -Nrup a/sql-common/client.c b/sql-common/client.c
--- a/sql-common/client.c	2007-01-29 17:31:47 +04:00
+++ b/sql-common/client.c	2007-07-20 15:47:49 +05:00
@@ -1176,12 +1176,12 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT 
       /* fields count may be wrong */
       DBUG_ASSERT ((field - result) < fields);
       cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7);
-      field->catalog  = strdup_root(alloc,(char*) row->data[0]);
-      field->db       = strdup_root(alloc,(char*) row->data[1]);
-      field->table    = strdup_root(alloc,(char*) row->data[2]);
-      field->org_table= strdup_root(alloc,(char*) row->data[3]);
-      field->name     = strdup_root(alloc,(char*) row->data[4]);
-      field->org_name = strdup_root(alloc,(char*) row->data[5]);
+      field->catalog=   strmake_root(alloc,(char*) row->data[0], lengths[0]);
+      field->db=        strmake_root(alloc,(char*) row->data[1], lengths[1]);
+      field->table=     strmake_root(alloc,(char*) row->data[2], lengths[2]);
+      field->org_table= strmake_root(alloc,(char*) row->data[3], lengths[3]);
+      field->name=      strmake_root(alloc,(char*) row->data[4], lengths[4]);
+      field->org_name=  strmake_root(alloc,(char*) row->data[5], lengths[5]);
 
       field->catalog_length=	lengths[0];
       field->db_length=		lengths[1];
Thread
bk commit into 4.1 tree (holyfoot:1.2676) BUG#29494holyfoot20 Jul