mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed that NULL and 0 returns 0 instead of NULL
This is coded to not cause a speed impact on top level AND expressions where we don't care if an AND expression returns 0 or NULL mysql-test/r/bdb.result: Fix results after serges last patch mysql-test/r/innodb.result: Fix results after serges last patch mysql-test/r/null.result: Update for new AND handling of NULL scripts/mysqld_safe.sh: Fix 'isroot' test to work even if user is not root sql/item.h: Fixed that NULL and 0 returns 0 instead of NULL sql/item_cmpfunc.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/item_cmpfunc.h: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_base.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_parse.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_select.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_yacc.yy: Fixed that NULL and 0 returns 0 instead of NULL
This commit is contained in:
@ -560,10 +560,12 @@ class Item_cond :public Item_bool_func
|
||||
{
|
||||
protected:
|
||||
List<Item> list;
|
||||
bool abort_on_null;
|
||||
public:
|
||||
Item_cond() : Item_bool_func() { const_item_cache=0; }
|
||||
Item_cond(Item *i1,Item *i2) :Item_bool_func()
|
||||
{ list.push_back(i1); list.push_back(i2); }
|
||||
/* Item_cond() is only used to create top level items */
|
||||
Item_cond() : Item_bool_func(), abort_on_null(1) { const_item_cache=0; }
|
||||
Item_cond(Item *i1,Item *i2) :Item_bool_func(), abort_on_null(0)
|
||||
{ list.push_back(i1); list.push_back(i2); }
|
||||
~Item_cond() { list.delete_elements(); }
|
||||
bool add(Item *item) { return list.push_back(item); }
|
||||
bool fix_fields(THD *,struct st_table_list *);
|
||||
@ -576,6 +578,7 @@ public:
|
||||
void split_sum_func(List<Item> &fields);
|
||||
friend int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds);
|
||||
unsigned int size_of() { return sizeof(*this);}
|
||||
void top_level_item() { abort_on_null=1; }
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user