Loading mysql-test/r/func_set.result +1 −2 Original line number Diff line number Diff line Loading @@ -41,8 +41,7 @@ interval(null, 1, 10, 100) -1 drop table if exists t1,t2; create table t1 (id int(10) not null unique); create table t2 (id int(10) not null primary key, val int(10) not null); create table t2 (id int(10) not null primary key, val int(10) not null); insert into t1 values (1),(2),(4); insert into t2 values (1,1),(2,1),(3,1),(4,2); select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id; Loading sql/field.cc +4 −6 Original line number Diff line number Diff line Loading @@ -4403,16 +4403,14 @@ char *Field_string::pack(char *to, const char *from, uint max_length) char *Field_string::pack_key(char *to, const char *from, uint max_length) { const char *end=from+min(field_length,max_length); int length; while (end > from && end[-1] == ' ') end--; length= end-from; int length=min(field_length,max_length); uint char_length= (field_charset->mbmaxlen > 1) ? max_length/field_charset->mbmaxlen : max_length; if (length > char_length) char_length= my_charpos(field_charset, from, end, char_length); char_length= my_charpos(field_charset, from, from+length, char_length); set_if_smaller(length, char_length); while (length && from[length-1] == ' ') length--; *to= (uchar)length; memcpy(to+1, from, length); return to+1+length; Loading Loading
mysql-test/r/func_set.result +1 −2 Original line number Diff line number Diff line Loading @@ -41,8 +41,7 @@ interval(null, 1, 10, 100) -1 drop table if exists t1,t2; create table t1 (id int(10) not null unique); create table t2 (id int(10) not null primary key, val int(10) not null); create table t2 (id int(10) not null primary key, val int(10) not null); insert into t1 values (1),(2),(4); insert into t2 values (1,1),(2,1),(3,1),(4,2); select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id; Loading
sql/field.cc +4 −6 Original line number Diff line number Diff line Loading @@ -4403,16 +4403,14 @@ char *Field_string::pack(char *to, const char *from, uint max_length) char *Field_string::pack_key(char *to, const char *from, uint max_length) { const char *end=from+min(field_length,max_length); int length; while (end > from && end[-1] == ' ') end--; length= end-from; int length=min(field_length,max_length); uint char_length= (field_charset->mbmaxlen > 1) ? max_length/field_charset->mbmaxlen : max_length; if (length > char_length) char_length= my_charpos(field_charset, from, end, char_length); char_length= my_charpos(field_charset, from, from+length, char_length); set_if_smaller(length, char_length); while (length && from[length-1] == ' ') length--; *to= (uchar)length; memcpy(to+1, from, length); return to+1+length; Loading