diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2009-01-09 23:06:07 +0100 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2009-01-09 23:06:07 +0100 |
commit | 386ec13b590a29608bf8ddea39e1acc875c702a7 (patch) | |
tree | 58ec547f64c9d7db30e481af51b884b0881f869e | |
parent | 017577c1f4a3d44a57a7207e252a40b2e3f49b6c (diff) | |
parent | 529fff05bf172dd806c2a6ccbdcf3222a0b35ab7 (diff) | |
download | mariadb-git-386ec13b590a29608bf8ddea39e1acc875c702a7.tar.gz |
auto-merge
-rw-r--r-- | client/mysqltest.c | 2 | ||||
-rw-r--r-- | mysql-test/r/mysql.result | 2 | ||||
-rw-r--r-- | mysql-test/t/mysql.test | 5 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 6 |
4 files changed, 14 insertions, 1 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index d73cf78d9d4..62ec5a88599 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1344,7 +1344,7 @@ int diff_check() { char buf[512]= {0}; FILE *res_file; - char *cmd = "diff -v"; + const char *cmd = "diff -v"; int have_diff = 0; if (!(res_file= popen(cmd, "r"))) diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 95bdcab6ba1..9bad3b9f791 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -186,4 +186,6 @@ delimiter 2 2 2 +@z:='1' @z=database() +1 NULL End of 5.0 tests diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 76941af893a..68a01a309d4 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -309,4 +309,9 @@ EOF --exec $MYSQL -c < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/bug38158.sql; +# +# Bug #41437: Value stored in 'case' lacks charset, causees segfault +# +--exec $MYSQL -e "select @z:='1',@z=database()" + --echo End of 5.0 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d1e3f45bba1..34f974042a5 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1696,6 +1696,12 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs) Item_string *conv; uint conv_errors; String tmp, cstr, *ostr= val_str(&tmp); + if (null_value) + { + Item *null_item= new Item_null((char *) fully_qualified_func_name()); + null_item->collation.set (tocs); + return null_item; + } cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors); if (conv_errors || !(conv= new Item_static_string_func(fully_qualified_func_name(), |