Loading mysql-test/r/func_str.result +9 −0 Original line number Diff line number Diff line Loading @@ -273,3 +273,12 @@ i ELT(j, '345', '34') 1 345 2 34 DROP TABLE t1; create table t1(a char(4)); insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') one 'one' 0 0 'one' NULL NULL 1 1 n two 'two' 0 0 'two' four 'four' 0 0 'four' drop table t1; mysql-test/t/func_str.test +9 −0 Original line number Diff line number Diff line Loading @@ -163,3 +163,12 @@ CREATE TABLE t1 (i int, j int); INSERT INTO t1 VALUES (1,1),(2,2); SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; DROP TABLE t1; # # bug #3756: quote and NULL # create table t1(a char(4)); insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; drop table t1; No newline at end of file sql/item_strfunc.cc +1 −0 Original line number Diff line number Diff line Loading @@ -2215,6 +2215,7 @@ String *Item_func_quote::val_str(String *str) } *to= '\''; str->length(new_length); null_value= 0; return str; null: Loading Loading
mysql-test/r/func_str.result +9 −0 Original line number Diff line number Diff line Loading @@ -273,3 +273,12 @@ i ELT(j, '345', '34') 1 345 2 34 DROP TABLE t1; create table t1(a char(4)); insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') one 'one' 0 0 'one' NULL NULL 1 1 n two 'two' 0 0 'two' four 'four' 0 0 'four' drop table t1;
mysql-test/t/func_str.test +9 −0 Original line number Diff line number Diff line Loading @@ -163,3 +163,12 @@ CREATE TABLE t1 (i int, j int); INSERT INTO t1 VALUES (1,1),(2,2); SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; DROP TABLE t1; # # bug #3756: quote and NULL # create table t1(a char(4)); insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; drop table t1; No newline at end of file
sql/item_strfunc.cc +1 −0 Original line number Diff line number Diff line Loading @@ -2215,6 +2215,7 @@ String *Item_func_quote::val_str(String *str) } *to= '\''; str->length(new_length); null_value= 0; return str; null: Loading