summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_str.test
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-10-21 21:45:31 +0400
committerunknown <kaa@polly.(none)>2007-10-21 21:45:31 +0400
commit04311fabaa11105743ce124de283cd504c978cc4 (patch)
treed9a0e8a70b282f3cc95eb07c97026d17a8afa4db /mysql-test/t/func_str.test
parent62a7e160bc0e960ec1374a546dde4a7f26120ceb (diff)
downloadmariadb-git-04311fabaa11105743ce124de283cd504c978cc4.tar.gz
Bug #28550 "Potential bugs related to the return type of the CHAR function".
Since, as of MySQL 5.0.15, CHAR() arguments larger than 255 are converted into multiple result bytes, a single CHAR() argument can now take up to 4 bytes. This patch fixes Item_func_char::fix_length_and_dec() to take this into account. This patch also fixes a regression introduced by the patch for bug21513. As now we do not always have the 'name' member of Item set for Item_hex_string and Item_bin_string, an own print() method has been added to Item_hex_string so that it could correctly be printed by Item_func::print_args(). mysql-test/r/func_str.result: Import patch bug288550.patch mysql-test/t/func_str.test: Import patch bug288550.patch sql/item.cc: Import patch bug288550.patch sql/item.h: Import patch bug288550.patch sql/item_strfunc.h: Import patch bug288550.patch
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r--mysql-test/t/func_str.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 1a32580aa0f..e04276fa305 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1124,4 +1124,16 @@ SELECT SUBSTR(a,1,len) FROM t1;
DROP TABLE t1;
+#
+# Bug #28850: Potential bugs related to the return type of the CHAR function
+#
+
+CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from t1;
+DROP TABLE t1;
+
+CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
+SELECT HEX(c1) from v1;
+DROP VIEW v1;
+
--echo End of 5.0 tests