MCPcopy Create free account
hub / github.com/MariaDB/server / normalize_cond

Function normalize_cond

sql/sql_parse.cc:8976–9006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8974*/
8975
8976Item *normalize_cond(THD *thd, Item *cond)
8977{
8978 if (cond)
8979 {
8980 Item::Type type= cond->type();
8981 if (type == Item::FIELD_ITEM || type == Item::REF_ITEM)
8982 {
8983 item_base_t is_cond_flag= cond->base_flags &
8984 (item_base_t::IS_COND | item_base_t::AT_TOP_LEVEL);
8985 cond->base_flags&= ~item_base_t::IS_COND;
8986 cond= new (thd->mem_root) Item_func_istrue(thd, cond);
8987 if (cond)
8988 cond->base_flags|= is_cond_flag;
8989 }
8990 else
8991 {
8992 if (type == Item::FUNC_ITEM)
8993 {
8994 Item_func *func_item= (Item_func *)cond;
8995 if (func_item->functype() == Item_func::NOT_FUNC)
8996 {
8997 Item *arg= func_item->arguments()[0];
8998 if (arg->type() == Item::FIELD_ITEM ||
8999 arg->type() == Item::REF_ITEM)
9000 cond= new (thd->mem_root) Item_func_isfalse(thd, arg);
9001 }
9002 }
9003 }
9004 }
9005 return cond;
9006}
9007
9008
9009/**

Callers 1

add_join_onFunction · 0.85

Calls 3

argumentsMethod · 0.80
typeMethod · 0.45
functypeMethod · 0.45

Tested by

no test coverage detected