diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2010-06-24 15:29:53 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2010-06-24 15:29:53 +0400 |
commit | a23729ad385b940f52d35e6074a5e2a2e7250996 (patch) | |
tree | d8fb0bddfcc57680aab7f6b55f99bc800b5521c0 /sql | |
parent | 1970da07168afc7fb5e1500614dae0391bc67bd8 (diff) | |
parent | f4420a3b90e57c68cc72606b4ecb240266260861 (diff) | |
download | mariadb-git-a23729ad385b940f52d35e6074a5e2a2e7250996.tar.gz |
Automerge.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_cmpfunc.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index cea5b3c90fd..d31799d7e60 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4581,13 +4581,14 @@ Item_func::optimize_type Item_func_like::select_optimize() const if (args[1]->const_item()) { String* res2= args[1]->val_str((String *)&cmp.value2); + const char *ptr2; - if (!res2) + if (!res2 || !(ptr2= res2->ptr())) return OPTIMIZE_NONE; - if (*res2->ptr() != wild_many) + if (*ptr2 != wild_many) { - if (args[0]->result_type() != STRING_RESULT || *res2->ptr() != wild_one) + if (args[0]->result_type() != STRING_RESULT || *ptr2 != wild_one) return OPTIMIZE_OP; } } |