summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2010-05-05 14:34:20 +0400
committerAlexander Barkov <bar@mysql.com>2010-05-05 14:34:20 +0400
commit25d31b8f7cfc2de56a2e5bf77b6b498687b8aa7f (patch)
tree1abfd7db1feb7aa4fd379967e8d9010ec18e2b48 /sql/item_func.h
parent6bf10a8623e39efd90c62711cbf72ff5ff1e152c (diff)
downloadmariadb-git-25d31b8f7cfc2de56a2e5bf77b6b498687b8aa7f.tar.gz
Bug#51571 load xml infile causes server crash
Problem: item->name was NULL for Item_user_var_as_out_param which made strcmp(something, item->name) crash in the LOAD XML code. Fix: - item_func.h: Adding set_name() in constuctor for Item_user_var_as_out_param - sql_load.cc: Changing the condition in write_execute_load_query_log_event() which distiguished between Item_user_var_as_out_param and Item_field from if (item->name == NULL) to if (item->type() == Item::FIELD_ITEM) - loadxml.result, loadxml.test: adding tests
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index c3f8b254f28..834ecd60e21 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1498,7 +1498,8 @@ class Item_user_var_as_out_param :public Item
LEX_STRING name;
user_var_entry *entry;
public:
- Item_user_var_as_out_param(LEX_STRING a) : name(a) {}
+ Item_user_var_as_out_param(LEX_STRING a) : name(a)
+ { set_name(a.str, 0, system_charset_info); }
/* We should return something different from FIELD_ITEM here */
enum Type type() const { return STRING_ITEM;}
double val_real();