List:Commits« Previous MessageNext Message »
From:tomas Date:June 14 2007 10:51am
Subject:bk commit into 5.1 tree (tomas:1.2547) BUG#29103
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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-06-14 12:51:13+02:00, tomas@stripped +3 -0
  Bug #29103 ndb_restore segfaults on NULL var[char|binary]
  

  mysql-test/r/ndb_restore.result@stripped, 2007-06-14 12:51:10+02:00, tomas@stripped +10 -10
    Bug #29103 ndb_restore segfaults on NULL var[char|binary]
    - add extra row with NULL value to test

  mysql-test/t/ndb_restore.test@stripped, 2007-06-14 12:51:10+02:00, tomas@stripped +1 -1
    Bug #29103 ndb_restore segfaults on NULL var[char|binary]
    - add extra row with NULL value to test

  storage/ndb/tools/restore/consumer_restore.cpp@stripped, 2007-06-14 12:51:10+02:00, tomas@stripped +16 -13
    Bug #29103 ndb_restore segfaults on NULL var[char|binary]
    - check that the attribute is not null

# 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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new-ndb

--- 1.47/storage/ndb/tools/restore/consumer_restore.cpp	2007-05-08 03:52:22 +02:00
+++ 1.48/storage/ndb/tools/restore/consumer_restore.cpp	2007-06-14 12:51:10 +02:00
@@ -1158,19 +1158,22 @@
 	char * dataPtr = attr_data->string_value;
 	Uint32 length = 0;
        
-        const unsigned char * src = (const unsigned char *)dataPtr;
-        switch(attr_desc->m_column->getType()){
-        case NdbDictionary::Column::Varchar:
-        case NdbDictionary::Column::Varbinary:
-          length = src[0] + 1;
-          break;
-        case NdbDictionary::Column::Longvarchar:
-        case NdbDictionary::Column::Longvarbinary:
-          length = src[0] + (src[1] << 8) + 2;
-          break;
-        default:
-          length = attr_data->size;
-          break;
+        if (!attr_data->null)
+        {
+          const unsigned char * src = (const unsigned char *)dataPtr;
+          switch(attr_desc->m_column->getType()){
+          case NdbDictionary::Column::Varchar:
+          case NdbDictionary::Column::Varbinary:
+            length = src[0] + 1;
+            break;
+          case NdbDictionary::Column::Longvarchar:
+          case NdbDictionary::Column::Longvarbinary:
+            length = src[0] + (src[1] << 8) + 2;
+            break;
+          default:
+            length = attr_data->size;
+            break;
+          }
         }
 	if (j == 0 && tup.getTable()->have_auto_inc(i))
 	  tup.getTable()->update_max_auto_val(dataPtr,size*arraySize);

--- 1.23/mysql-test/r/ndb_restore.result	2007-04-30 11:43:48 +02:00
+++ 1.24/mysql-test/r/ndb_restore.result	2007-06-14 12:51:10 +02:00
@@ -18,7 +18,7 @@
 PRIMARY KEY  (`capgotod`),
 KEY `i quadaddsvr` (`gotod`)
 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
+INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'),(5,0,'',NULL,NULL,'');
 CREATE TABLE `t3_c` (
 `CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
 `capgotod` smallint(5) unsigned NOT NULL default '0',
@@ -154,15 +154,15 @@
 5
 select count(*) from t2;
 count(*)
-6
+7
 select count(*) from t2_c;
 count(*)
-6
+7
 select count(*)
 from (select * from t2 union 
 select * from t2_c) a;
 count(*)
-6
+7
 select count(*) from t3;
 count(*)
 4
@@ -286,15 +286,15 @@
 5
 select count(*) from t2;
 count(*)
-6
+7
 select count(*) from t2_c;
 count(*)
-6
+7
 select count(*)
 from (select * from t2 union 
 select * from t2_c) a;
 count(*)
-6
+7
 select count(*) from t3;
 count(*)
 4
@@ -386,15 +386,15 @@
 5
 select count(*) from t2;
 count(*)
-6
+7
 select count(*) from t2_c;
 count(*)
-6
+7
 select count(*)
 from (select * from t2 union 
 select * from t2_c) a;
 count(*)
-6
+7
 select count(*) from t3;
 count(*)
 4

--- 1.26/mysql-test/t/ndb_restore.test	2007-04-30 11:43:48 +02:00
+++ 1.27/mysql-test/t/ndb_restore.test	2007-06-14 12:51:10 +02:00
@@ -33,7 +33,7 @@
   PRIMARY KEY  (`capgotod`),
   KEY `i quadaddsvr` (`gotod`)
 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
+INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'),(5,0,'',NULL,NULL,'');
 
 # Added ROW_FORMAT=FIXED to use below to see that setting is preserved
 # by restore
Thread
bk commit into 5.1 tree (tomas:1.2547) BUG#29103tomas14 Jun