1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MWL#205 DELETE with result set (mdev-3814)

Includes all post-review fixes as well.
This commit is contained in:
Igor Babaev
2013-08-06 13:31:38 -07:00
parent 807fef40ff
commit 86d62605e8
9 changed files with 487 additions and 16 deletions

View File

@ -3169,6 +3169,7 @@ end_with_restore_list:
}
case SQLCOM_DELETE:
{
select_result *sel_result=lex->result;
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if ((res= delete_precheck(thd, all_tables)))
break;
@ -3176,9 +3177,13 @@ end_with_restore_list:
unit->set_limit(select_lex);
MYSQL_DELETE_START(thd->query());
res = mysql_delete(thd, all_tables, select_lex->where,
&select_lex->order_list,
unit->select_limit_cnt, select_lex->options);
if (!(sel_result= lex->result) && !(sel_result= new select_send()))
return 1;
res = mysql_delete(thd, all_tables,
select_lex->where, &select_lex->order_list,
unit->select_limit_cnt, select_lex->options,
sel_result);
delete sel_result;
MYSQL_DELETE_DONE(res, (ulong) thd->get_row_count_func());
break;
}