diff options
author | unknown <bell@sanja.is.com.ua> | 2004-05-05 21:21:41 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-05-05 21:21:41 +0300 |
commit | f6428e8bb9ac0cad24465513c5969a50cd13f6f2 (patch) | |
tree | dc6fc7f740dabf7da6ce3e21af3673dc04bbd8fd /sql/sql_yacc.yy | |
parent | ea646dce60994b8a5d36d575ed371144cd01eeb3 (diff) | |
download | mariadb-git-f6428e8bb9ac0cad24465513c5969a50cd13f6f2.tar.gz |
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
mysql-test/r/subselect.result:
do not show limit if it is not explicit
mysql-test/r/union.result:
test of LIMIT + ORDER
mysql-test/t/union.test:
test of LIMIT + ORDER
sql/ha_isammrg.h:
caching of queries with isammerge tables forbiden
sql/sql_cache.cc:
removed check on isammerge
sql/sql_lex.cc:
tag of explicit limit in statement
sql/sql_lex.h:
tag of explicit limit in statement
sql/sql_parse.cc:
blanks in empty line removed
no limit by default (SQL_SELECT_LIMIT as default will be applied only for SELECT statement if there was not explicit LIMIT clause)
sql/sql_union.cc:
reverted incorrect patch
sql/sql_update.cc:
reverted incorrect patch
correct table list passed to class constructor
sql/sql_yacc.yy:
explicit LIMIT marked
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 568a526fd58..2155aa7e80f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3566,9 +3566,7 @@ opt_limit_clause_init: LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; sel->offset_limit= 0L; - sel->select_limit= (&lex->select_lex == sel) ? - Lex->thd->variables.select_limit : /* primary SELECT */ - HA_POS_ERROR; /* subquery */ + sel->select_limit= HA_POS_ERROR; } | limit_clause {} ; @@ -3588,18 +3586,21 @@ limit_options: SELECT_LEX *sel= Select; sel->select_limit= $1; sel->offset_limit= 0L; + sel->explicit_limit= 1; } | ULONG_NUM ',' ULONG_NUM { SELECT_LEX *sel= Select; sel->select_limit= $3; sel->offset_limit= $1; + sel->explicit_limit= 1; } | ULONG_NUM OFFSET_SYM ULONG_NUM { SELECT_LEX *sel= Select; sel->select_limit= $1; sel->offset_limit= $3; + sel->explicit_limit= 1; } ; @@ -3611,7 +3612,11 @@ delete_limit_clause: lex->current_select->select_limit= HA_POS_ERROR; } | LIMIT ulonglong_num - { Select->select_limit= (ha_rows) $2; }; + { + SELECT_LEX *sel= Select; + sel->select_limit= (ha_rows) $2; + sel->explicit_limit= 1; + }; ULONG_NUM: NUM { $$= strtoul($1.str,NULL,10); } |