1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.5' into 10.6

This commit is contained in:
Yuchen Pei
2024-06-26 09:16:54 +08:00
20 changed files with 403 additions and 224 deletions

View File

@@ -9158,6 +9158,7 @@ push_new_name_resolution_context(THD *thd,
/**
Fix condition which contains only field (f turns to f <> 0 )
or only contains the function NOT field (not f turns to f == 0)
@param cond The condition to fix
@@ -9173,6 +9174,21 @@ Item *normalize_cond(THD *thd, Item *cond)
{
cond= new (thd->mem_root) Item_func_ne(thd, cond, new (thd->mem_root) Item_int(thd, 0));
}
else
{
if (type == Item::FUNC_ITEM)
{
Item_func *func_item= (Item_func *)cond;
if (func_item->functype() == Item_func::NOT_FUNC)
{
Item *arg= func_item->arguments()[0];
if (arg->type() == Item::FIELD_ITEM ||
arg->type() == Item::REF_ITEM)
cond= new (thd->mem_root) Item_func_eq(thd, arg,
new (thd->mem_root) Item_int(thd, 0));
}
}
}
}
return cond;
}