diff options
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b5df0e03823..f0ca5ad6c7b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -380,9 +380,10 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *ut, List<Item> &fs, } int -multi_update::prepare(List<Item> &values) +multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u) { DBUG_ENTER("multi_update::prepare"); + unit= u; do_update = true; thd->count_cuted_fields=1; thd->cuted_fields=0L; @@ -480,9 +481,12 @@ multi_update::prepare(List<Item> &values) } if (counter) { - Field_string offset(table_ref->table->file->ref_length,false,"offset",table_ref->table,true); + Field_string offset(table_ref->table->file->ref_length, false, + "offset", table_ref->table, true, + default_charset_info); temp_fields->push_front(new Item_field(((Field *)&offset))); - // Here I make tmp tables + + // Make a temporary table int cnt=counter-1; TMP_TABLE_PARAM tmp_table_param; bzero((char*) &tmp_table_param,sizeof(tmp_table_param)); @@ -490,7 +494,8 @@ multi_update::prepare(List<Item> &values) if (!(tmp_tables[cnt]=create_tmp_table(thd, &tmp_table_param, *temp_fields, (ORDER*) 0, 1, 0, 0, - TMP_TABLE_ALL_COLUMNS))) + TMP_TABLE_ALL_COLUMNS, + unit))) { error = 1; // A proper error message is due here DBUG_RETURN(1); @@ -638,7 +643,8 @@ bool multi_update::send_data(List<Item> &values) { // Here we insert into each temporary table values_by_table.push_front(new Item_string((char*) table->file->ref, - table->file->ref_length)); + table->file->ref_length, + system_charset_info)); fill_record(tmp_tables[secure_counter]->field,values_by_table); error= write_record(tmp_tables[secure_counter], &(infos[secure_counter])); |