diff options
author | Igor Babaev <igor@askmonty.org> | 2011-05-19 20:01:43 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-05-19 20:01:43 -0700 |
commit | 8e33aa9aa7a9d774b3f33a66cb3bd1416de9a0ae (patch) | |
tree | 23b56d29b235aebde574eb3d3c0a62942a548a10 /sql/item_func.cc | |
parent | 54a3d1869c609407488782fd74c345b408dc9cdc (diff) | |
parent | 016a09cb7d40236c3530ae4c5c4815072aa8dacb (diff) | |
download | mariadb-git-8e33aa9aa7a9d774b3f33a66cb3bd1416de9a0ae.tar.gz |
Merged the fix for bug 777745 into 5.3.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 03c74ab66da..c0c18167796 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -352,6 +352,8 @@ Item *Item_func::transform(Item_transformer transformer, uchar *argument) the old item is substituted for a new one. After this the transformer is applied to the root node of the Item_func object. + The compile function is not called if the analyzer returns NULL + in the parameter arg_p. @param analyzer the analyzer callback function to be applied to the nodes of the tree of the object @@ -369,7 +371,7 @@ Item *Item_func::compile(Item_analyzer analyzer, uchar **arg_p, { if (!(this->*analyzer)(arg_p)) return 0; - if (arg_count) + if (*arg_p && arg_count) { Item **arg,**arg_end; for (arg= args, arg_end= args+arg_count; arg != arg_end; arg++) @@ -377,7 +379,7 @@ Item *Item_func::compile(Item_analyzer analyzer, uchar **arg_p, /* The same parameter value of arg_p must be passed to analyze any argument of the condition formula. - */ + */ uchar *arg_v= *arg_p; Item *new_item= (*arg)->compile(analyzer, &arg_v, transformer, arg_t); if (new_item && *arg != new_item) |