summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8ea9db41ce4..08e47022b48 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -9301,8 +9301,6 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
int error= 1;
Copy_field *copy= NULL, *copy_end;
ha_rows found_count= 0, delete_count= 0;
- uint length= 0;
- SORT_FIELD *sortorder;
READ_RECORD info;
TABLE_LIST tables;
List<Item> fields;
@@ -9404,10 +9402,10 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
Filesort_tracker dummy_tracker(false);
if (thd->lex->select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
- &tables, fields, all_fields, order) ||
- !(sortorder= make_unireg_sortorder(thd, order, &length, NULL)) ||
- (from->sort.found_records= filesort(thd, from, sortorder, length,
- NULL, HA_POS_ERROR,
+ &tables, fields, all_fields, order))
+ goto err;
+ Filesort fsort(order, HA_POS_ERROR, NULL);
+ if ((from->sort.found_records= filesort(thd, from, &fsort,
true,
&examined_rows, &found_rows,
&dummy_tracker)) ==