Loading myisam/mi_search.c +2 −3 Original line number Diff line number Diff line Loading @@ -451,9 +451,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, /* We have to compare k and vseg as if they where space extended */ for (end=vseg + (len-cmplen) ; vseg < end && *vseg == (uchar) ' '; vseg++) ; if (vseg == end) goto cmp_rest; /* should never happen */ vseg++, matched++) ; DBUG_ASSERT(vseg < end); if (*vseg > (uchar) ' ') { Loading mysql-test/r/myisam.result +16 −0 Original line number Diff line number Diff line Loading @@ -428,6 +428,22 @@ select * from t1 where a='807780' and b='477' and c='165'; a b c 807780 477 165 drop table t1; DROP TABLE IF EXISTS t1; Warnings: Note 1051 Unknown table 't1' CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)); INSERT t1 VALUES ("can \tcan"); INSERT t1 VALUES ("can can"); INSERT t1 VALUES ("can"); SELECT * FROM t1; a can can can can can CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; create table t1 (a blob); insert into t1 values('a '),('a'); select concat(a,'.') from t1 where a='a'; Loading mysql-test/t/myisam.test +12 −0 Original line number Diff line number Diff line Loading @@ -422,6 +422,18 @@ insert into t1 values('807780', '472', '162'); select * from t1 where a='807780' and b='477' and c='165'; drop table t1; # # space-stripping in _mi_prefix_search: BUG#5284 # DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)); INSERT t1 VALUES ("can \tcan"); INSERT t1 VALUES ("can can"); INSERT t1 VALUES ("can"); SELECT * FROM t1; CHECK TABLE t1; DROP TABLE t1; # # Verify blob handling # Loading Loading
myisam/mi_search.c +2 −3 Original line number Diff line number Diff line Loading @@ -451,9 +451,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, /* We have to compare k and vseg as if they where space extended */ for (end=vseg + (len-cmplen) ; vseg < end && *vseg == (uchar) ' '; vseg++) ; if (vseg == end) goto cmp_rest; /* should never happen */ vseg++, matched++) ; DBUG_ASSERT(vseg < end); if (*vseg > (uchar) ' ') { Loading
mysql-test/r/myisam.result +16 −0 Original line number Diff line number Diff line Loading @@ -428,6 +428,22 @@ select * from t1 where a='807780' and b='477' and c='165'; a b c 807780 477 165 drop table t1; DROP TABLE IF EXISTS t1; Warnings: Note 1051 Unknown table 't1' CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)); INSERT t1 VALUES ("can \tcan"); INSERT t1 VALUES ("can can"); INSERT t1 VALUES ("can"); SELECT * FROM t1; a can can can can can CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; create table t1 (a blob); insert into t1 values('a '),('a'); select concat(a,'.') from t1 where a='a'; Loading
mysql-test/t/myisam.test +12 −0 Original line number Diff line number Diff line Loading @@ -422,6 +422,18 @@ insert into t1 values('807780', '472', '162'); select * from t1 where a='807780' and b='477' and c='165'; drop table t1; # # space-stripping in _mi_prefix_search: BUG#5284 # DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a)); INSERT t1 VALUES ("can \tcan"); INSERT t1 VALUES ("can can"); INSERT t1 VALUES ("can"); SELECT * FROM t1; CHECK TABLE t1; DROP TABLE t1; # # Verify blob handling # Loading