summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 93669554a5a..17e2aca79e4 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -322,13 +322,13 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
killed_state killed_status;
bool is_concurrent;
#endif
- const char *db = table_list->db; // This is never null
+ const char *db= table_list->db.str; // This is never null
/*
If path for file is not defined, we will use the current database.
If this is not set, we will use the directory where the table to be
loaded is located
*/
- const char *tdb= thd->db ? thd->db : db; // Result is never null
+ const char *tdb= thd->db.str ? thd->db.str : db; // Result is never null
ulong skip_lines= ex->skip_lines;
bool transactional_table __attribute__((unused));
DBUG_ENTER("mysql_load");
@@ -379,7 +379,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
!table_list->single_table_updatable() || // and derived tables
check_key_in_view(thd, table_list))
{
- my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "LOAD");
+ my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias.str, "LOAD");
DBUG_RETURN(TRUE);
}
if (table_list->prepare_where(thd, 0, TRUE) ||
@@ -398,7 +398,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
*/
if (unique_table(thd, table_list, table_list->next_global, 0))
{
- my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name,
+ my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name.str,
"LOAD DATA");
DBUG_RETURN(TRUE);
}
@@ -710,8 +710,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
writing binary log will be ignored */
if (thd->transaction.stmt.modified_non_trans_table)
(void) write_execute_load_query_log_event(thd, ex,
- table_list->db,
- table_list->table_name,
+ table_list->db.str,
+ table_list->table_name.str,
is_concurrent,
handle_duplicates, ignore,
transactional_table,
@@ -761,7 +761,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
{
int errcode= query_error_code(thd, killed_status == NOT_KILLED);
error= write_execute_load_query_log_event(thd, ex,
- table_list->db, table_list->table_name,
+ table_list->db.str,
+ table_list->table_name.str,
is_concurrent,
handle_duplicates, ignore,
transactional_table,
@@ -810,7 +811,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
List<Item> fv;
Item *item, *val;
int n;
- const char *tdb= (thd->db != NULL ? thd->db : db_arg);
+ const char *tdb= (thd->db.str != NULL ? thd->db.str : db_arg);
const char *qualify_db= NULL;
char command_buffer[1024];
String query_str(command_buffer, sizeof(command_buffer),
@@ -826,7 +827,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
lle.set_fname_outside_temp_buf(ex->file_name, strlen(ex->file_name));
query_str.length(0);
- if (!thd->db || strcmp(db_arg, thd->db))
+ if (!thd->db.str || strcmp(db_arg, thd->db.str))
{
/*
If used database differs from table's database,
@@ -853,7 +854,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
if (n++)
query_str.append(", ");
if (item->real_type() == Item::FIELD_ITEM)
- append_identifier(thd, &query_str, item->name.str, item->name.length);
+ append_identifier(thd, &query_str, &item->name);
else
{
/* Actually Item_user_var_as_out_param despite claiming STRING_ITEM. */
@@ -877,7 +878,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
val= lv++;
if (n++)
query_str.append(STRING_WITH_LEN(", "));
- append_identifier(thd, &query_str, item->name.str, item->name.length);
+ append_identifier(thd, &query_str, &item->name);
query_str.append(&val->name);
}
}
@@ -966,7 +967,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
*/
while ((sql_field= (Item_field*) it++))
{
- Field *field= sql_field->field;
+ Field *field= sql_field->field;
table->auto_increment_field_not_null= auto_increment_field_not_null;
/*
No fields specified in fields_vars list can be null in this format.