List:Commits« Previous MessageNext Message »
From:jonas Date:January 24 2007 6:26pm
Subject:bk commit into 5.1 tree (jonas:1.2095) BUG#25587
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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-01-24 18:26:42+01:00, jonas@stripped +3 -0
  ndb - bug#25587
    Fix unaligned or non-32-bit values in "smart scan"
    (mysql-5.1-wl2325-5.0)

  mysql-test/r/ndb_partition_key.result@stripped, 2007-01-24 18:26:41+01:00,
jonas@stripped +48 -0
    testcase

  mysql-test/t/ndb_partition_key.test@stripped, 2007-01-24 18:26:41+01:00,
jonas@stripped +28 -0
    testcase

  storage/ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2007-01-24 18:26:41+01:00,
jonas@stripped +9 -3
    Fix unaligned or non-32-bit values in "smart scan"

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/drop5

--- 1.76/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-01-24 18:26:46 +01:00
+++ 1.77/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-01-24 18:26:46 +01:00
@@ -1138,25 +1138,31 @@
     const bool nobytes = (len & 0x3) == 0;
     const Uint32 totalLen = 2 + sizeInWords;
     Uint32 tupKeyLen = theTupKeyLen;
+    union {
+      Uint32 tempData[2000];
+      Uint64 __align;
+    };
+    Uint64 *valPtr;
     if(remaining > totalLen && aligned && nobytes){
       Uint32 * dst = theKEYINFOptr + currLen;
       * dst ++ = type;
       * dst ++ = ahValue;
       memcpy(dst, aValue, 4 * sizeInWords);
       theTotalNrOfKeyWordInSignal = currLen + totalLen;
+      valPtr = (Uint64*)aValue;
     } else {
       if(!aligned || !nobytes){
-        Uint32 tempData[2000];
 	tempData[0] = type;
 	tempData[1] = ahValue;
 	tempData[2 + (len >> 2)] = 0;
         memcpy(tempData+2, aValue, len);
-	
 	insertBOUNDS(tempData, 2+sizeInWords);
+	valPtr = (Uint64*)(tempData+2);
       } else {
 	Uint32 buf[2] = { type, ahValue };
 	insertBOUNDS(buf, 2);
 	insertBOUNDS((Uint32*)aValue, sizeInWords);
+	valPtr = (Uint64*)aValue;
       }
     }
     theTupKeyLen = tupKeyLen + totalLen;
@@ -1173,7 +1179,7 @@
     if(type == BoundEQ && tDistrKey)
     {
       theNoOfTupKeyLeft--;
-      return handle_distribution_key((Uint64*)aValue, sizeInWords);
+      return handle_distribution_key(valPtr, sizeInWords);
     }
     return 0;
   } else {

--- 1.6/mysql-test/r/ndb_partition_key.result	2007-01-24 18:26:46 +01:00
+++ 1.7/mysql-test/r/ndb_partition_key.result	2007-01-24 18:26:46 +01:00
@@ -79,3 +79,51 @@
   PRIMARY KEY  USING HASH (`a`,`b`,`c`)
 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (b) 
 DROP TABLE t1;
+CREATE TABLE t1 (
+a tinyint unsigned NOT NULL,
+b bigint(20) unsigned NOT NULL,
+c char(12),
+PRIMARY KEY (a,b)
+) ENGINE ndb DEFAULT CHARSET=latin1 PARTITION BY KEY (a);
+insert into t1 values(1,1,'1'), (2,2,'2'), (3,3,'3'), (4,4,'4'), (5,5,'5');
+select * from t1 where a = 1;
+a	b	c
+1	1	1
+select * from t1 where a = 2;
+a	b	c
+2	2	2
+select * from t1 where a = 3;
+a	b	c
+3	3	3
+select * from t1 where a = 4;
+a	b	c
+4	4	4
+select * from t1 where a = 5;
+a	b	c
+5	5	5
+delete from t1 where a = 1;
+select * from t1 order by 1;
+a	b	c
+2	2	2
+3	3	3
+4	4	4
+5	5	5
+delete from t1 where a = 2;
+select * from t1 order by 1;
+a	b	c
+3	3	3
+4	4	4
+5	5	5
+delete from t1 where a = 3;
+select * from t1 order by 1;
+a	b	c
+4	4	4
+5	5	5
+delete from t1 where a = 4;
+select * from t1 order by 1;
+a	b	c
+5	5	5
+delete from t1 where a = 5;
+select * from t1 order by 1;
+a	b	c
+drop table t1;

--- 1.5/mysql-test/t/ndb_partition_key.test	2007-01-24 18:26:46 +01:00
+++ 1.6/mysql-test/t/ndb_partition_key.test	2007-01-24 18:26:46 +01:00
@@ -63,3 +63,31 @@
 show create table t1;
 
 DROP TABLE t1;
+
+# bug#25587
+
+CREATE TABLE t1 (
+a tinyint unsigned NOT NULL,
+b bigint(20) unsigned NOT NULL,
+c char(12),
+PRIMARY KEY (a,b)
+) ENGINE ndb DEFAULT CHARSET=latin1 PARTITION BY KEY (a);
+
+insert into t1 values(1,1,'1'), (2,2,'2'), (3,3,'3'), (4,4,'4'), (5,5,'5');
+select * from t1 where a = 1;
+select * from t1 where a = 2;
+select * from t1 where a = 3;
+select * from t1 where a = 4;
+select * from t1 where a = 5;
+delete from t1 where a = 1;
+select * from t1 order by 1;
+delete from t1 where a = 2;
+select * from t1 order by 1;
+delete from t1 where a = 3;
+select * from t1 order by 1;
+delete from t1 where a = 4;
+select * from t1 order by 1;
+delete from t1 where a = 5;
+select * from t1 order by 1;
+
+drop table t1;
Thread
bk commit into 5.1 tree (jonas:1.2095) BUG#25587jonas24 Jan