summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2008-02-28 14:23:22 +0100
committerunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2008-02-28 14:23:22 +0100
commita0eec8abbb233d9e3f278d343eaed2e70b55161e (patch)
treed7fe47965f56b028624438c1549357c09d710ab1 /sql/item.h
parenta4b0a2cf67356c0f8f80b5291b3c1f4f8327cb97 (diff)
downloadmariadb-git-a0eec8abbb233d9e3f278d343eaed2e70b55161e.tar.gz
Bug#34749: Server crash when using NAME_CONST() with an aggregate function
NAME_CONST('whatever', -1) * MAX(whatever) bombed since -1 was not seen as constant, but as FUNCTION_UNARY_MINUS(constant) while we are at the same time pretending it was a basic const item. This confused the aggregate handlers in exciting ways. We now make NAME_CONST() behave more consistently. mysql-test/r/func_misc.result: show that a combination of NAME_CONST('x', -y) and an aggregate no longer crashes the server. mysql-test/t/func_misc.test: show that a combination of NAME_CONST('x', -y) and an aggregate no longer crashes the server. sql/ha_ndbcluster_cond.cc: tell cluster about "new" function type NEG_FUNC. (this was previous identified as UNKNOWN_FUNC, so we just handle it the same way, that's all.) sql/ha_ndbcluster_cond.h: tell cluster about "new" function type NEG_FUNC. (this was previous identified as UNKNOWN_FUNC, so we just handle it the same way, that's all.) sql/item.cc: make NAME_CONST() transparent in that type() of -constant is that of constant, not that of unary minus (id est, FUNC_ITEM). sql/item.h: Move constructor to item.cc sql/item_func.h: Revert Bug#30832; we can apply the magic more narrowly (just for NAME_CONST() rather than all Item_func_neg). Introduce new function type "NEG_FUNC."
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/sql/item.h b/sql/item.h
index 5f511557f47..9af98e0efdb 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1113,14 +1113,7 @@ class Item_name_const : public Item
Item *name_item;
bool valid_args;
public:
- Item_name_const(Item *name_arg, Item *val):
- value_item(val), name_item(name_arg)
- {
- if (!(valid_args= name_item->basic_const_item() &
- value_item->basic_const_item()))
- my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST");
- Item::maybe_null= TRUE;
- }
+ Item_name_const(Item *name_arg, Item *val);
bool fix_fields(THD *, Item **);