From 25d31b8f7cfc2de56a2e5bf77b6b498687b8aa7f Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 5 May 2010 14:34:20 +0400 Subject: 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 --- sql/sql_load.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_load.cc') diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 87a347b9f98..9bab87e2720 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -696,7 +696,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, { if (n++) pfields.append(", "); - if (item->name) + if (item->type() == Item::FIELD_ITEM) { pfields.append("`"); pfields.append(item->name); -- cgit v1.2.1