mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Revert Bar's fix as this causes changes in the key tree that could cause incompatibilites
Fix instead wrong call to ha_key_cmp This is related to bug #10741 Inserting double value into utf8 column crashes server
This commit is contained in:
parent
a411763dae
commit
1c725ff797
4 changed files with 9 additions and 5 deletions
|
@ -84,8 +84,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
|
||||||
pos= (byte*) record+keyseg->start;
|
pos= (byte*) record+keyseg->start;
|
||||||
if (keyseg->flag & HA_SPACE_PACK)
|
if (keyseg->flag & HA_SPACE_PACK)
|
||||||
{
|
{
|
||||||
FIX_LENGTH(cs, pos, length, char_length);
|
end= pos + length;
|
||||||
end= pos + char_length;
|
|
||||||
if (type != HA_KEYTYPE_NUM)
|
if (type != HA_KEYTYPE_NUM)
|
||||||
{
|
{
|
||||||
while (end > pos && end[-1] == ' ')
|
while (end > pos && end[-1] == ' ')
|
||||||
|
@ -96,7 +95,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
|
||||||
while (pos < end && pos[0] == ' ')
|
while (pos < end && pos[0] == ' ')
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
char_length= (uint) (end - pos);
|
length=(uint) (end-pos);
|
||||||
|
FIX_LENGTH(cs, pos, length, char_length);
|
||||||
store_key_length_inc(key,char_length);
|
store_key_length_inc(key,char_length);
|
||||||
memcpy((byte*) key,(byte*) pos,(size_t) char_length);
|
memcpy((byte*) key,(byte*) pos,(size_t) char_length);
|
||||||
key+=char_length;
|
key+=char_length;
|
||||||
|
|
|
@ -68,8 +68,8 @@ int mi_rnext_same(MI_INFO *info, byte *buf)
|
||||||
info->lastkey_length,SEARCH_BIGGER,
|
info->lastkey_length,SEARCH_BIGGER,
|
||||||
info->s->state.key_root[inx])))
|
info->s->state.key_root[inx])))
|
||||||
break;
|
break;
|
||||||
if (ha_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey,
|
if (ha_key_cmp(keyinfo->seg, info->lastkey, info->lastkey2,
|
||||||
info->last_rkey_length, SEARCH_FIND, ¬_used))
|
info->last_rkey_length, SEARCH_FIND, ¬_used))
|
||||||
{
|
{
|
||||||
error=1;
|
error=1;
|
||||||
my_errno=HA_ERR_END_OF_FILE;
|
my_errno=HA_ERR_END_OF_FILE;
|
||||||
|
|
|
@ -901,4 +901,7 @@ insert into t1 values (2,'Durban');
|
||||||
select * from t1 where city = 'Durban';
|
select * from t1 where city = 'Durban';
|
||||||
id city
|
id city
|
||||||
2 Durban
|
2 Durban
|
||||||
|
select * from t1 where city = 'Durban ';
|
||||||
|
id city
|
||||||
|
2 Durban
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
|
@ -744,4 +744,5 @@ create table t1 (
|
||||||
insert into t1 values (1,'Durban North');
|
insert into t1 values (1,'Durban North');
|
||||||
insert into t1 values (2,'Durban');
|
insert into t1 values (2,'Durban');
|
||||||
select * from t1 where city = 'Durban';
|
select * from t1 where city = 'Durban';
|
||||||
|
select * from t1 where city = 'Durban ';
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue