summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps.result
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 /mysql-test/r/ps.result
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 'mysql-test/r/ps.result')
-rw-r--r--mysql-test/r/ps.result46
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 617e289d30d..753fde8ccab 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -2391,3 +2391,49 @@ Level Code Message
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
deallocate prepare abc;
+set @my_password="password";
+set @my_data="clear text to encode";
+prepare stmt1 from 'select decode(encode(?, ?), ?)';
+execute stmt1 using @my_data, @my_password, @my_password;
+decode(encode(?, ?), ?)
+clear text to encode
+set @my_data="more text to encode";
+execute stmt1 using @my_data, @my_password, @my_password;
+decode(encode(?, ?), ?)
+more text to encode
+set @my_password="new password";
+execute stmt1 using @my_data, @my_password, @my_password;
+decode(encode(?, ?), ?)
+more text to encode
+deallocate prepare stmt1;
+set @to_format="123456789.123456789";
+set @dec=0;
+prepare stmt2 from 'select format(?, ?)';
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+123,456,789
+set @dec=4;
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+123,456,789.1235
+set @dec=6;
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+123,456,789.123457
+set @dec=2;
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+123,456,789.12
+set @to_format="100";
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+100.00
+set @to_format="1000000";
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+1,000,000.00
+set @to_format="10000";
+execute stmt2 using @to_format, @dec;
+format(?, ?)
+10,000.00
+deallocate prepare stmt2;