From af22eb35e577ef17226faf662f2cffc4705bde26 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Nov 2006 14:06:51 +0300 Subject: Add 5.0 part of fix for bug 17047. mysql-test/r/func_str.result: Add result for bug#17047: CHAR() and IN() can return NULL without signaling NULL result. mysql-test/t/func_str.test: Add test case for bug#17047: CHAR() and IN() can return NULL without signaling NULL result. sql/item_strfunc.cc: Add Item_str_func::fix_fields() implementation, and set maybe_null to TRUE if we are in the SQL mode that requires some functions to return null even if they normally do not. sql/item_strfunc.h: Add declaration of Item_str_func::fix_fields(). Do not reset maybe_null in Item_func_char::fix_length_and_dec(). --- mysql-test/t/func_str.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t/func_str.test') diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 45415882ac7..9255669f6e3 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -780,4 +780,18 @@ SELECT * FROM t1 INNER JOIN t2 ON code=id DROP TABLE t1,t2; + +# +# BUG#17047: CHAR() and IN() can return NULL without signaling NULL +# result +# +SET @orig_sql_mode = @@SQL_MODE; +SET SQL_MODE=traditional; + +SELECT CHAR(0xff,0x8f USING utf8); +SELECT CHAR(0xff,0x8f USING utf8) IS NULL; + +SET SQL_MODE=@orig_sql_mode; + + --echo End of 5.0 tests -- cgit v1.2.1