mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Manual merge.
This commit is contained in:
@ -2351,7 +2351,8 @@ mysql_execute_command(THD *thd)
|
||||
{
|
||||
SELECT_LEX *param= lex->unit.global_parameters;
|
||||
if (!param->explicit_limit)
|
||||
param->select_limit= thd->variables.select_limit;
|
||||
param->select_limit=
|
||||
new Item_int((ulonglong)thd->variables.select_limit);
|
||||
}
|
||||
|
||||
select_result *result=lex->result;
|
||||
@ -3141,13 +3142,15 @@ end_with_restore_list:
|
||||
DBUG_ASSERT(first_table == all_tables && first_table != 0);
|
||||
if (update_precheck(thd, all_tables))
|
||||
break;
|
||||
DBUG_ASSERT(select_lex->offset_limit == 0);
|
||||
unit->set_limit(select_lex);
|
||||
res= (result= mysql_update(thd, all_tables,
|
||||
select_lex->item_list,
|
||||
lex->value_list,
|
||||
select_lex->where,
|
||||
select_lex->order_list.elements,
|
||||
(ORDER *) select_lex->order_list.first,
|
||||
select_lex->select_limit,
|
||||
unit->select_limit_cnt,
|
||||
lex->duplicates, lex->ignore));
|
||||
/* mysql_update return 2 if we need to switch to multi-update */
|
||||
if (result != 2)
|
||||
@ -3253,9 +3256,11 @@ end_with_restore_list:
|
||||
DBUG_ASSERT(first_table == all_tables && first_table != 0);
|
||||
if ((res= delete_precheck(thd, all_tables)))
|
||||
break;
|
||||
DBUG_ASSERT(select_lex->offset_limit == 0);
|
||||
unit->set_limit(select_lex);
|
||||
res = mysql_delete(thd, all_tables, select_lex->where,
|
||||
&select_lex->order_list,
|
||||
select_lex->select_limit, select_lex->options);
|
||||
unit->select_limit_cnt, select_lex->options);
|
||||
break;
|
||||
}
|
||||
case SQLCOM_DELETE_MULTI:
|
||||
@ -3842,9 +3847,10 @@ end_with_restore_list:
|
||||
*/
|
||||
if (check_db_used(thd, all_tables))
|
||||
goto error;
|
||||
unit->set_limit(select_lex);
|
||||
res= mysql_ha_read(thd, first_table, lex->ha_read_mode, lex->ident.str,
|
||||
lex->insert_list, lex->ha_rkey_mode, select_lex->where,
|
||||
select_lex->select_limit, select_lex->offset_limit);
|
||||
unit->select_limit_cnt, unit->offset_limit_cnt);
|
||||
break;
|
||||
|
||||
case SQLCOM_BEGIN:
|
||||
@ -5126,7 +5132,6 @@ mysql_init_select(LEX *lex)
|
||||
{
|
||||
SELECT_LEX *select_lex= lex->current_select;
|
||||
select_lex->init_select();
|
||||
select_lex->select_limit= HA_POS_ERROR;
|
||||
lex->orig_sql_command= SQLCOM_END;
|
||||
lex->wild= 0;
|
||||
if (select_lex == &lex->select_lex)
|
||||
@ -5141,6 +5146,7 @@ bool
|
||||
mysql_new_select(LEX *lex, bool move_down)
|
||||
{
|
||||
SELECT_LEX *select_lex;
|
||||
THD *thd;
|
||||
DBUG_ENTER("mysql_new_select");
|
||||
|
||||
if (!(select_lex= new(lex->thd->mem_root) SELECT_LEX()))
|
||||
@ -5190,7 +5196,7 @@ mysql_new_select(LEX *lex, bool move_down)
|
||||
fake->select_number= INT_MAX;
|
||||
fake->make_empty_select();
|
||||
fake->linkage= GLOBAL_OPTIONS_TYPE;
|
||||
fake->select_limit= HA_POS_ERROR;
|
||||
fake->select_limit= 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5238,8 +5244,8 @@ void mysql_init_multi_delete(LEX *lex)
|
||||
{
|
||||
lex->sql_command= SQLCOM_DELETE_MULTI;
|
||||
mysql_init_select(lex);
|
||||
lex->select_lex.select_limit= lex->unit.select_limit_cnt=
|
||||
HA_POS_ERROR;
|
||||
lex->select_lex.select_limit= 0;
|
||||
lex->unit.select_limit_cnt= HA_POS_ERROR;
|
||||
lex->select_lex.table_list.save_and_clear(&lex->auxilliary_table_list);
|
||||
lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
|
||||
lex->query_tables= 0;
|
||||
@ -6753,8 +6759,7 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables)
|
||||
|
||||
if (select_lex->order_list.elements)
|
||||
msg= "ORDER BY";
|
||||
else if (select_lex->select_limit && select_lex->select_limit !=
|
||||
HA_POS_ERROR)
|
||||
else if (select_lex->select_limit)
|
||||
msg= "LIMIT";
|
||||
if (msg)
|
||||
{
|
||||
|
Reference in New Issue
Block a user