A very nasty bug in multi-table deletes & updates

parent aa9d81e6
......@@ -1792,6 +1792,7 @@ mysql_execute_command(void)
tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
if ((res=open_and_lock_tables(thd,tables)))
break;
thd->select_limit=HA_POS_ERROR;
if (!setup_fields(thd,tables,select_lex->item_list,1,0,0) &&
!setup_fields(thd,tables,lex->value_list,0,0,0) && ! thd->fatal_error &&
(result=new multi_update(thd,tables,select_lex->item_list,lex->duplicates,
......@@ -2741,7 +2742,7 @@ void mysql_init_multi_delete(LEX *lex)
{
lex->sql_command = SQLCOM_DELETE_MULTI;
mysql_init_select(lex);
lex->select->select_limit=HA_POS_ERROR;
lex->select->select_limit=lex->thd->select_limit=HA_POS_ERROR;
lex->auxilliary_table_list=lex->select_lex.table_list;
lex->select->table_list.elements=0;
lex->select->table_list.first=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment