List:Commits« Previous MessageNext Message »
From:bar Date:June 22 2006 3:52pm
Subject:bk commit into 5.1 tree (bar:1.2205)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of bar. When bar 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.2205 06/06/22 18:51:50 bar@stripped +3 -0
  Merge abarkov@stripped:/home/bk/mysql-5.1-kt
  into  mysql.com:/usr/home/bar/mysql-5.1.b20086

  sql/field.h
    1.188 06/06/22 18:51:35 bar@stripped +0 -0
    Auto merged

  sql/field.cc
    1.320 06/06/22 18:51:35 bar@stripped +0 -0
    Auto merged

  mysql-test/t/partition_innodb.test
    1.4 06/06/22 18:51:34 bar@stripped +0 -0
    Auto merged

# 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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-5.1.b20086/RESYNC

--- 1.319/sql/field.cc	2006-06-19 04:57:05 +05:00
+++ 1.320/sql/field.cc	2006-06-22 18:51:35 +05:00
@@ -1243,6 +1243,21 @@ uint Field::offset()
 }
 
 
+void Field::hash(ulong *nr, ulong *nr2)
+{
+  if (is_null())
+  {
+    *nr^= (*nr << 1) | 1;
+  }
+  else
+  {
+    uint len= pack_length();
+    CHARSET_INFO *cs= charset();
+    cs->coll->hash_sort(cs, (uchar*) ptr, len, nr, nr2);
+  }
+}
+
+
 void Field::copy_from_tmp(int row_offset)
 {
   memcpy(ptr,ptr+row_offset,pack_length());
@@ -6922,6 +6937,21 @@ uint Field_varstring::is_equal(create_fi
       return IS_EQUAL_PACK_LENGTH; // VARCHAR, longer variable length
   }
   return IS_EQUAL_NO;
+}
+
+
+void Field_varstring::hash(ulong *nr, ulong *nr2)
+{
+  if (is_null())
+  {
+    *nr^= (*nr << 1) | 1;
+  }
+  else
+  {
+    uint len=  length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+    CHARSET_INFO *cs= charset();
+    cs->coll->hash_sort(cs, (uchar*) ptr + length_bytes, len, nr, nr2);
+  }
 }
 
 

--- 1.187/sql/field.h	2006-06-18 15:56:31 +05:00
+++ 1.188/sql/field.h	2006-06-22 18:51:35 +05:00
@@ -351,6 +351,8 @@ public:
     return field_length / charset()->mbmaxlen;
   }
 
+  /* Hash value */
+  virtual void hash(ulong *nr, ulong *nr2);
   friend bool reopen_table(THD *,struct st_table *,bool);
   friend int cre_myisam(my_string name, register TABLE *form, uint options,
 			ulonglong auto_increment_value);
@@ -1120,6 +1122,7 @@ public:
                        char *new_ptr, uchar *new_null_ptr,
                        uint new_null_bit);
   uint is_equal(create_field *new_field);
+  void hash(ulong *nr, ulong *nr2);
 };
 
 

--- 1.3/mysql-test/t/partition_innodb.test	2006-06-20 19:16:03 +05:00
+++ 1.4/mysql-test/t/partition_innodb.test	2006-06-22 18:51:34 +05:00
@@ -66,3 +66,15 @@ DROP TABLE IF EXISTS t0_definition;
 DROP TABLE IF EXISTS t0_template;
 --enable_warnings
 
+#
+# Bug#20086: Can't get data from key partitioned tables with VARCHAR key
+#
+create table t1 (id varchar(64) primary key) engine=innodb
+partition by key(id) partitions 5;
+insert into t1 values ('a');
+insert into t1 values ('aa');
+insert into t1 values ('aaa');
+select * from t1 where id = 'a';
+select * from t1 where id = 'aa';
+select * from t1 where id = 'aaa';
+drop table t1;
Thread
bk commit into 5.1 tree (bar:1.2205)bar22 Jun