Automerge.

This commit is contained in:
Ramil Kalimullin 2010-06-24 15:26:14 +04:00
commit f4420a3b90
3 changed files with 34 additions and 5 deletions

View file

@ -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;
}
}