-
unknown authored
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)
2975d65c