summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <gluh@eagle.intranet.mysql.r18.ru>2006-03-20 17:41:45 +0400
committerunknown <gluh@eagle.intranet.mysql.r18.ru>2006-03-20 17:41:45 +0400
commitde26416468c3915ec1363d6e95e6a4302846641c (patch)
tree81e5dd291e1c126dbb53c2f6707de616496f2ec9 /sql/item.cc
parentf9dd31ca8ec96c2c315a9f8011d4f1ed5b73b0a4 (diff)
downloadmariadb-git-de26416468c3915ec1363d6e95e6a4302846641c.tar.gz
Bug#14367 Partitions: crash if utf8 column
use part_info->item_free_list instead of thd->free_list during partition function parsing mysql-test/r/partition.result: Bug#14367 Partitions: crash if utf8 column test case mysql-test/t/partition.test: Bug#14367 Partitions: crash if utf8 column test case sql/item.cc: Bug#14367 Partitions: crash if utf8 column create copy of string in current mem_root to avoid memory leak
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index cf59c0bad9e..a734984a496 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -647,6 +647,7 @@ Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs)
{
Item_string *conv;
uint conv_errors;
+ char *ptr;
String tmp, cstr, *ostr= val_str(&tmp);
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
if (conv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(),
@@ -661,7 +662,9 @@ Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs)
*/
return NULL;
}
- conv->str_value.copy();
+ if (!(ptr= current_thd->memdup(cstr.ptr(), cstr.length() + 1 )))
+ return NULL;
+ conv->str_value.set(ptr, cstr.length(), cstr.charset());
/* Ensure that no one is going to change the result string */
conv->str_value.mark_as_const();
return conv;