1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

caching of queries with isammerge tables forbiden using general way

SQL_SELECT_LIMIT as default will be applied only for SELECT statement if there was not explicit LIMIT clause
correct table list passed to class constructor of select_update
This commit is contained in:
bell@sanja.is.com.ua
2004-05-05 21:21:41 +03:00
parent e9492cca05
commit c5c35c667e
11 changed files with 72 additions and 48 deletions

View File

@ -1874,7 +1874,7 @@ mysql_execute_command(THD *thd)
if (&lex->select_lex != lex->all_selects_list &&
lex->unit.create_total_list(thd, lex, &tables))
DBUG_VOID_RETURN;
/*
When option readonly is set deny operations which change tables.
Except for the replication thread and the 'super' users.
@ -1891,6 +1891,13 @@ mysql_execute_command(THD *thd)
switch (lex->sql_command) {
case SQLCOM_SELECT:
{
/* assign global limit variable if limit is not given */
{
SELECT_LEX *param= lex->unit.global_parameters;
if (!param->explicit_limit)
param->select_limit= thd->variables.select_limit;
}
select_result *result=lex->result;
if (tables)
{
@ -3742,9 +3749,7 @@ mysql_init_select(LEX *lex)
{
SELECT_LEX *select_lex= lex->current_select;
select_lex->init_select();
select_lex->select_limit= (&lex->select_lex == select_lex) ?
lex->thd->variables.select_limit : /* Primry UNION */
HA_POS_ERROR; /* subquery */
select_lex->select_limit= HA_POS_ERROR;
if (select_lex == &lex->select_lex)
{
lex->exchange= 0;
@ -3796,9 +3801,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= (&lex->unit == unit) ?
lex->thd->variables.select_limit : /* Primry UNION */
HA_POS_ERROR; /* subquery */
fake->select_limit= HA_POS_ERROR;
}
}