diff options
author | unknown <petr@mysql.com> | 2005-09-13 15:15:38 +0400 |
---|---|---|
committer | unknown <petr@mysql.com> | 2005-09-13 15:15:38 +0400 |
commit | dd51642361262ecb1cbe2088aee332244768ce29 (patch) | |
tree | 05b160d5640b0be52bb2e9918659835563a16c53 /sql/item.cc | |
parent | 276e9f82b380d0f7c0cb2661c2cf86bac981b276 (diff) | |
download | mariadb-git-dd51642361262ecb1cbe2088aee332244768ce29.tar.gz |
Fix for Bug #13124 Stored Procedure using SELECT INTO crashes server
mysql-test/r/sp.result:
added a test
mysql-test/t/sp.test:
corrected result file
sql/item.cc:
check for NULL value before copying string
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index e7da646ae73..d18d0143d2c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -818,6 +818,8 @@ String *Item_splocal::val_str(String *sp) DBUG_ASSERT(fixed); Item *it= this_item(); String *ret= it->val_str(sp); + + null_value= it->null_value; /* This way we mark returned value of val_str as const, so that various functions (e.g. CONCAT) won't try to @@ -833,9 +835,12 @@ String *Item_splocal::val_str(String *sp) This is intended behaviour of Item_func_concat. Comments to Item_param class contain some more details on the topic. */ + + if (!ret) + return NULL; + str_value_ptr.set(ret->ptr(), ret->length(), ret->charset()); - null_value= it->null_value; return &str_value_ptr; } |