Loading mysql-test/r/func_system.result +15 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,21 @@ drop table t1; select TRUE,FALSE,NULL; TRUE FALSE NULL 1 0 NULL create table t1 (c1 char(5)) character set=latin1; insert into t1 values('row 1'); insert into t1 values('row 2'); insert into t1 values('row 3'); select concat(user(), '--', c1) from t1; concat(user(), '--', c1) root@localhost--row 1 root@localhost--row 2 root@localhost--row 3 select concat(database(), '--', c1) from t1; concat(database(), '--', c1) test--row 1 test--row 2 test--row 3 drop table t1; create table t1 (a char(10)) character set latin1; select * from t1 where a=version(); a Loading mysql-test/t/func_system.test +12 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,18 @@ drop table t1; select TRUE,FALSE,NULL; # # Bug#12351: CONCAT with USER()/DATEBASE() and # a constant and a column gets strange results # create table t1 (c1 char(5)) character set=latin1; insert into t1 values('row 1'); insert into t1 values('row 2'); insert into t1 values('row 3'); select concat(user(), '--', c1) from t1; select concat(database(), '--', c1) from t1; drop table t1; # # Bug#8291 Illegal collation mix with USER() function # Loading sql/item_strfunc.cc +1 −0 Original line number Diff line number Diff line Loading @@ -1562,6 +1562,7 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs) return NULL; } conv->str_value.copy(); conv->str_value.shrink_to_length(); return conv; } Loading Loading
mysql-test/r/func_system.result +15 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,21 @@ drop table t1; select TRUE,FALSE,NULL; TRUE FALSE NULL 1 0 NULL create table t1 (c1 char(5)) character set=latin1; insert into t1 values('row 1'); insert into t1 values('row 2'); insert into t1 values('row 3'); select concat(user(), '--', c1) from t1; concat(user(), '--', c1) root@localhost--row 1 root@localhost--row 2 root@localhost--row 3 select concat(database(), '--', c1) from t1; concat(database(), '--', c1) test--row 1 test--row 2 test--row 3 drop table t1; create table t1 (a char(10)) character set latin1; select * from t1 where a=version(); a Loading
mysql-test/t/func_system.test +12 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,18 @@ drop table t1; select TRUE,FALSE,NULL; # # Bug#12351: CONCAT with USER()/DATEBASE() and # a constant and a column gets strange results # create table t1 (c1 char(5)) character set=latin1; insert into t1 values('row 1'); insert into t1 values('row 2'); insert into t1 values('row 3'); select concat(user(), '--', c1) from t1; select concat(database(), '--', c1) from t1; drop table t1; # # Bug#8291 Illegal collation mix with USER() function # Loading
sql/item_strfunc.cc +1 −0 Original line number Diff line number Diff line Loading @@ -1562,6 +1562,7 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs) return NULL; } conv->str_value.copy(); conv->str_value.shrink_to_length(); return conv; } Loading