summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-06-07 16:28:08 +0400
committerunknown <konstantin@mysql.com>2005-06-07 16:28:08 +0400
commite77314572de519623bcc4ecd184ab20565b9e860 (patch)
tree890c08f61b3f89d5bb5fb7d7164cda4299998f52 /sql/sql_yacc.yy
parent06a948c36bedd42eb9a702bd657718332b813b12 (diff)
parent83af1d42e53aa15fe86c19da75ac4011a55c780b (diff)
downloadmariadb-git-e77314572de519623bcc4ecd184ab20565b9e860.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-7306-final sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy29
1 files changed, 17 insertions, 12 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 8094f1dc10e..f84fc6ba33a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -721,7 +721,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
signed_literal now_or_signed_literal opt_escape
sp_opt_default
simple_ident_nospvar simple_ident_q
- field_or_var
+ field_or_var limit_option
%type <item_num>
NUM_literal
@@ -5564,8 +5564,8 @@ opt_limit_clause_init:
{
LEX *lex= Lex;
SELECT_LEX *sel= lex->current_select;
- sel->offset_limit= 0L;
- sel->select_limit= HA_POS_ERROR;
+ sel->offset_limit= 0;
+ sel->select_limit= 0;
}
| limit_clause {}
;
@@ -5580,21 +5580,21 @@ limit_clause:
;
limit_options:
- ulong_num
+ limit_option
{
SELECT_LEX *sel= Select;
sel->select_limit= $1;
- sel->offset_limit= 0L;
+ sel->offset_limit= 0;
sel->explicit_limit= 1;
}
- | ulong_num ',' ulong_num
+ | limit_option ',' limit_option
{
SELECT_LEX *sel= Select;
sel->select_limit= $3;
sel->offset_limit= $1;
sel->explicit_limit= 1;
}
- | ulong_num OFFSET_SYM ulong_num
+ | limit_option OFFSET_SYM limit_option
{
SELECT_LEX *sel= Select;
sel->select_limit= $1;
@@ -5602,18 +5602,23 @@ limit_options:
sel->explicit_limit= 1;
}
;
+limit_option:
+ param_marker
+ | ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); }
+ | LONG_NUM { $$= new Item_uint($1.str, $1.length); }
+ | NUM { $$= new Item_uint($1.str, $1.length); }
delete_limit_clause:
/* empty */
{
LEX *lex=Lex;
- lex->current_select->select_limit= HA_POS_ERROR;
+ lex->current_select->select_limit= 0;
}
- | LIMIT ulonglong_num
+ | LIMIT limit_option
{
SELECT_LEX *sel= Select;
- sel->select_limit= (ha_rows) $2;
+ sel->select_limit= $2;
sel->explicit_limit= 1;
};
@@ -7980,8 +7985,8 @@ handler:
LEX *lex=Lex;
lex->sql_command = SQLCOM_HA_READ;
lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */
- lex->current_select->select_limit= 1;
- lex->current_select->offset_limit= 0L;
+ lex->current_select->select_limit= new Item_int(1);
+ lex->current_select->offset_limit= 0;
if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
YYABORT;
}