summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2003-04-09 18:22:17 +0300
committerSinisa@sinisa.nasamreza.org <>2003-04-09 18:22:17 +0300
commita81dc6d9f3d23e50459a91c5473ab0f2aeb21033 (patch)
tree2eaf9a3a77a2551b9a316acddd3d4f5378a62f28 /sql/sql_delete.cc
parent5ca7b274fe61896c3866a5fff2b69b5dd8183c3a (diff)
downloadmariadb-git-a81dc6d9f3d23e50459a91c5473ab0f2aeb21033.tar.gz
A fix for DELETE with ORDER BY and LIMIT.
How come we do not have a test case for this ??
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 05f84616a4c..3b8af37c1aa 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -126,12 +126,15 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
table->io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
- if (setup_order(thd, 0, &tables, fields, all_fields, order) ||
- !(sortorder=make_unireg_sortorder(order, &length)) ||
- (table->found_records = filesort(thd, table, sortorder, length,
- (SQL_SELECT *) 0, HA_POS_ERROR,
- &examined_rows))
- == HA_POS_ERROR)
+ if (setup_ref_array(thd, &thd->lex.select_lex.ref_pointer_array,
+ all_fields.elements)||
+ setup_order(thd, thd->lex.select_lex.ref_pointer_array, &tables,
+ fields, all_fields, order) ||
+ !(sortorder=make_unireg_sortorder(order, &length)) ||
+ (table->found_records = filesort(thd, table, sortorder, length,
+ (SQL_SELECT *) 0, HA_POS_ERROR,
+ &examined_rows))
+ == HA_POS_ERROR)
{
delete select;
free_underlaid_joins(thd, &thd->lex.select_lex);