summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2006-11-16 09:03:47 -0700
committerunknown <malff/marcsql@weblab.(none)>2006-11-16 09:03:47 -0700
commit2975d65cd86dea288d968c55fd0ffd177a92f390 (patch)
tree97166381743b2b830ba8d62a7acf0f37382a39ac /sql/item_func.h
parent12ed25e7e38c40c231b4752b918bcb5937d900bd (diff)
downloadmariadb-git-2975d65cd86dea288d968c55fd0ffd177a92f390.tar.gz
Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
Before this change, the functions BENCHMARK, ENCODE, DECODE and FORMAT could only accept a constant for some parameters. After this change, this restriction has been removed. An implication is that these functions can also be used in prepared statements. The change consist of changing the following classes: - Item_func_benchmark - Item_func_encode - Item_func_decode - Item_func_format to: - only accept Item* in the constructor, - and evaluate arguments during calls to val_xxx() which fits the general design of all the other functions. The 'TODO' items identified in item_create.cc during the work done for Bug 21114 are addressed by this fix, as a natural consequence of aligning the design. In the 'func_str' test, a single very long test line involving an explain extended select with many functions has been rewritten into multiple separate tests, to improve maintainability. The result of explain extended select decode(encode(...)) has changed, since the encode and decode functions now print all their parameters. mysql-test/r/func_str.result: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) mysql-test/r/parser.result: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) mysql-test/r/ps.result: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) mysql-test/t/func_str.test: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) mysql-test/t/parser.test: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) mysql-test/t/ps.test: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) sql/item_create.cc: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) sql/item_func.cc: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) sql/item_func.h: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) sql/item_strfunc.cc: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions) sql/item_strfunc.h: Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index f820a89b5b6..65a1686bf44 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -924,10 +924,9 @@ public:
class Item_func_benchmark :public Item_int_func
{
- ulong loop_count;
public:
- Item_func_benchmark(ulong loop_count_arg,Item *expr)
- :Item_int_func(expr), loop_count(loop_count_arg)
+ Item_func_benchmark(Item *count_expr, Item *expr)
+ :Item_int_func(count_expr, expr)
{}
longlong val_int();
const char *func_name() const { return "benchmark"; }