diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2010-06-24 15:26:14 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2010-06-24 15:26:14 +0400 |
commit | f4420a3b90e57c68cc72606b4ecb240266260861 (patch) | |
tree | 7509d121d5203589571ed293ff7edec9fe6926d2 /sql | |
parent | 4b2e7aa19fa905237ac70d342603860e3d0e388a (diff) | |
parent | 1614c3c1288ad9d71879d44ef4e8c1edee84d96a (diff) | |
download | mariadb-git-f4420a3b90e57c68cc72606b4ecb240266260861.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 9ff72d56050..e91aba63023 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4578,13 +4578,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; } } |