summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-12-13 15:08:16 +0400
committerAlexander Barkov <bar@mariadb.org>2017-12-13 15:08:16 +0400
commit701e22d5cd6642e803cfca2443c522a2998e3047 (patch)
tree3ccc3cef3c0fd19d263646168c5a8b77a5dbae1d
parenta53e087ea9d865bbe1f3a53a90b1683196feb5ba (diff)
downloadmariadb-git-701e22d5cd6642e803cfca2443c522a2998e3047.tar.gz
Removing a dead code in sql_load.cc
The loop in read_xml_field(), unlike the same loop in read_sep_field(), cannot end with item<>NULL, as it does not have any "break" statements. The entire block "if (item) {...}" was a dead code.
-rw-r--r--sql/sql_load.cc35
1 files changed, 2 insertions, 33 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index dfb7ede04f4..2a389d68ef9 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1330,39 +1330,8 @@ read_xml_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
skip_lines--;
continue;
}
-
- if (item)
- {
- /* Have not read any field, thus input file is simply ended */
- if (item == fields_vars.head())
- break;
-
- for ( ; item; item= it++)
- {
- Item_field *real_item= item->field_for_view_update();
- if (item->type() == Item::STRING_ITEM)
- ((Item_user_var_as_out_param *)item)->set_null_value(cs);
- else if (!real_item)
- {
- my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), item->name.str);
- DBUG_RETURN(1);
- }
- else
- {
- /*
- QQ: We probably should not throw warning for each field.
- But how about intention to always have the same number
- of warnings in THD::cuted_fields (and get rid of cuted_fields
- in the end ?)
- */
- thd->cuted_fields++;
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_WARN_TOO_FEW_RECORDS,
- ER_THD(thd, ER_WARN_TOO_FEW_RECORDS),
- thd->get_stmt_da()->current_row_for_warning());
- }
- }
- }
+
+ DBUG_ASSERT(!item);
if (thd->killed ||
fill_record_n_invoke_before_triggers(thd, table, set_fields, set_values,