MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:serg Date:March 22 2005 7:13pm
Subject:bk commit into 5.0 tree (serg:1.1847) BUG#9339
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of mysqldev. When mysqldev 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.1847 05/03/22 20:13:49 serg@stripped +3 -0
  BUG#9339 - Updating a column does not work if the table has a UTF-8 VARCHAR primary key
  fixed my_charpos() call in Field_varstring::get_key_image

  mysql-test/r/type_varchar.result
    1.4 05/03/22 20:13:20 serg@stripped +7 -0
    BUG#9339 - Updating a column does not work if the table has a UTF-8 VARCHAR primary key

  mysql-test/t/type_varchar.test
    1.4 05/03/22 20:12:59 serg@stripped +9 -0
    BUG#9339 - Updating a column does not work if the table has a UTF-8 VARCHAR primary key

  sql/field.cc
    1.244 05/03/22 20:10:34 serg@stripped +3 -3
    BUG#9339 - Updating a column does not work if the table has a UTF-8 VARCHAR primary key
    fixed my_charpos() call in Field_varstring::get_key_image

# 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:	serg
# Host:	production.mysql.com
# Root:	/data0/mysqldev/serg/m50b

--- 1.243/sql/field.cc	2005-03-19 01:12:20 +01:00
+++ 1.244/sql/field.cc	2005-03-22 20:10:34 +01:00
@@ -5725,12 +5725,12 @@
 {
   uint f_length=  length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
   uint char_length= length / field_charset->mbmaxlen;
-  char_length= my_charpos(field_charset, ptr, ptr + length_bytes,
-                          char_length);
+  char *pos= ptr+length_bytes;
+  char_length= my_charpos(field_charset, pos, pos + f_length, char_length);
   set_if_smaller(f_length, char_length);
   /* Key is always stored with 2 bytes */
   int2store(buff,f_length);
-  memcpy(buff+HA_KEY_BLOB_LENGTH, ptr+length_bytes, f_length);
+  memcpy(buff+HA_KEY_BLOB_LENGTH, pos, f_length);
   if (f_length < length)
   {
     /*

--- 1.3/mysql-test/r/type_varchar.result	2004-12-19 19:25:14 +01:00
+++ 1.4/mysql-test/r/type_varchar.result	2005-03-22 20:13:20 +01:00
@@ -376,3 +376,10 @@
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	range	v	v	13	NULL	2	Using where; Using filesort
 drop table t1;
+create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol));
+insert into t1 values ('test', 'something');
+update t1 set othercol='somethingelse' where pkcol='test';
+select * from t1;
+pkcol	othercol
+test	somethingelse
+drop table t1;

--- 1.3/mysql-test/t/type_varchar.test	2004-12-19 19:25:14 +01:00
+++ 1.4/mysql-test/t/type_varchar.test	2005-03-22 20:12:59 +01:00
@@ -97,3 +97,12 @@
 explain select * from t1 where v='This is a test' order by v;
 explain select * from t1 where v like 'S%' order by v;
 drop table t1;
+
+#
+# bug#9339 - meaningless Field_varstring::get_key_image
+#
+create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol));
+insert into t1 values ('test', 'something');
+update t1 set othercol='somethingelse' where pkcol='test';
+select * from t1;
+drop table t1;
Thread
bk commit into 5.0 tree (serg:1.1847) BUG#9339serg22 Mar