Commit 3ca77071 authored by unknown's avatar unknown

Merge mysql.com:/data0/mysqldev/my/mysql-5.0-build

into mysql.com:/data0/mysqldev/serg/m50b

parents 21c31125 968410b0
......@@ -376,3 +376,10 @@ explain select * from t1 where v like 'S%' order by v;
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;
......@@ -97,3 +97,12 @@ explain select * from t1 where v like 'This is a test' order by v;
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;
......@@ -5725,12 +5725,12 @@ void Field_varstring::get_key_image(char *buff, uint length, imagetype type)
{
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)
{
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment