diff options
-rw-r--r-- | myisam/mi_search.c | 2 | ||||
-rw-r--r-- | mysql-test/r/myisam.result | 4 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c index c6ee18a8477..b98ee351195 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -847,7 +847,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, full_b_length=b_length; next_key_length=key_length-b_length-pack_length; - if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE))) + if ((nextflag & (SEARCH_FIND | SEARCH_UPDATE)) == SEARCH_FIND) { while (a_length && a[a_length-1] == ' ') a_length--; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 11e8ef4fcd7..fbb84a677cf 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -390,4 +390,8 @@ insert into t1 values ('aaa '),('aaa'); repair table t1; Table Op Msg_type Msg_text test.t1 repair status OK +select concat(a,'.') from t1 where a='aaa'; +concat(a,'.') +aaa. +aaa . drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7ad038bcad0..25bb76ceaba 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -387,10 +387,11 @@ check table t1; drop table t1; # -# sort-repair bug +# two bugs in myisam-space-stripping feature # create table t1 ( a text not null, key a (a(20))); insert into t1 values ('aaa '),('aaa'); repair table t1; +select concat(a,'.') from t1 where a='aaa'; drop table t1; |