summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-01-28 13:58:39 +0400
committerAlexander Barkov <bar@mariadb.org>2016-01-28 13:58:39 +0400
commitce40ccaf24af2fe395f541cb1079256de8727ccd (patch)
tree505c7982ba062d448d2f265d5967e244f3204e3e /sql/item_cmpfunc.h
parent5092ab28ba91646922e16ee6afc8c40ac5235a31 (diff)
downloadmariadb-git-ce40ccaf24af2fe395f541cb1079256de8727ccd.tar.gz
MDEV-9181 (NULLIF(count(table.col)), 0) gives wrong result on 10.1.x
Wrapping args[0] and args[2] into an Item_cache for aggregate functions.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index b7c51cd5178..16f8a247999 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -995,10 +995,13 @@ class Item_func_nullif :public Item_func_hybrid_field_type
- Item_field::propagate_equal_fields(ANY_SUBST) for the left "a"
- Item_field::propagate_equal_fields(IDENTITY_SUBST) for the right "a"
*/
+ Item_cache *m_cache;
+ int compare();
public:
// Put "a" to args[0] for comparison and to args[2] for the returned value.
Item_func_nullif(THD *thd, Item *a, Item *b):
- Item_func_hybrid_field_type(thd, a, b, a)
+ Item_func_hybrid_field_type(thd, a, b, a),
+ m_cache(NULL)
{}
bool date_op(MYSQL_TIME *ltime, uint fuzzydate);
double real_op();
@@ -1009,6 +1012,9 @@ public:
uint decimal_precision() const { return args[2]->decimal_precision(); }
const char *func_name() const { return "nullif"; }
void print(String *str, enum_query_type query_type);
+ void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields,
+ uint flags);
+ void update_used_tables();
table_map not_null_tables() const { return 0; }
bool is_null();
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)