1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/opt/local/work/mysql-5.0-7306-final
This commit is contained in:
konstantin@mysql.com
2005-06-07 16:28:08 +04:00
25 changed files with 202 additions and 131 deletions

View File

@ -2374,7 +2374,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;
@ -3164,13 +3165,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)
@ -3276,9 +3279,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:
@ -3865,9 +3870,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:
@ -5149,7 +5155,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)
@ -5164,6 +5169,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()))
@ -5213,7 +5219,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;
}
}
@ -5261,8 +5267,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;
@ -6776,8 +6782,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)
{