List:Internals« Previous MessageNext Message »
From:tomas Date:January 18 2006 9:55am
Subject:bk commit into 5.1 tree (tomas:1.1966)
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
  1.1966 06/01/18 10:55:11 tomas@stripped[tomas] +3 -0
  bug15682.patch

  sql/ha_ndbcluster.cc
    1.238 06/01/18 10:54:16 tomas@stripped[tomas] +20 -2
    Import patch bug15682.patch

  mysql-test/t/ndb_basic.test
    1.31 06/01/18 10:54:16 tomas@stripped[tomas] +11 -0
    Import patch bug15682.patch

  mysql-test/r/ndb_basic.result
    1.30 06/01/18 10:54:16 tomas@stripped[tomas] +16 -0
    Import patch bug15682.patch

# 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:	poseidon.ndb.mysql.com
# Root:	/home/tomas/wl2325-alcatel

--- 1.29/mysql-test/r/ndb_basic.result	2005-09-15 02:31:38 +02:00
+++ 1.30/mysql-test/r/ndb_basic.result	2006-01-18 10:54:16 +01:00
@@ -673,3 +673,19 @@
 a
 2
 drop table atablewithareallylongandirritatingname;
+create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB;
+insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
+insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
+select * from t1 order by f1;
+f1	f2	f3
+111111	aaaaaa	1
+222222	bbbbbb	2
+select * from t1 order by f2;
+f1	f2	f3
+111111	aaaaaa	1
+222222	bbbbbb	2
+select * from t1 order by f3;
+f1	f2	f3
+111111	aaaaaa	1
+222222	bbbbbb	2
+drop table t1;

--- 1.30/mysql-test/t/ndb_basic.test	2005-07-28 16:09:48 +02:00
+++ 1.31/mysql-test/t/ndb_basic.test	2006-01-18 10:54:16 +01:00
@@ -615,3 +615,14 @@
 insert into atablewithareallylongandirritatingname values (2);
 select * from atablewithareallylongandirritatingname;
 drop table atablewithareallylongandirritatingname;
+
+#
+# Bug#15682
+#
+create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB;
+insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
+insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
+select * from t1 order by f1;
+select * from t1 order by f2;
+select * from t1 order by f3;
+drop table t1;

--- 1.237/sql/ha_ndbcluster.cc	2006-01-18 10:49:56 +01:00
+++ 1.238/sql/ha_ndbcluster.cc	2006-01-18 10:54:16 +01:00
@@ -3057,8 +3057,26 @@
         }      
         *buff++= 0;
       }
-      memcpy(buff, record + key_part->offset, key_part->length);
-      buff += key_part->length;
+
+      size_t len = key_part->length;
+      const byte * ptr = record + key_part->offset;
+      Field *field = key_part->field;
+      if ((field->type() ==  MYSQL_TYPE_VARCHAR) &&
+	  ((Field_varstring*)field)->length_bytes == 1)
+      {
+	/** 
+	 * Keys always use 2 bytes length
+	 */
+	buff[0] = ptr[0];
+	buff[1] = 0;
+	memcpy(buff+2, ptr + 1, len);	
+	len += 2;
+      }
+      else
+      {
+	memcpy(buff, ptr, len);
+      }
+      buff += len;
     }
   } 
   else 
Thread
bk commit into 5.1 tree (tomas:1.1966)tomas18 Jan