Bug #56811 Allow user variables in LIMIT clause.

Submitted: 16 Sep 2010 6:02 Modified: 16 Sep 2010 7:13
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Parser Severity:S4 (Feature request)
Version:Any OS:Any
Assigned to: CPU Architecture:Any

[16 Sep 2010 6:02] Konstantin Osipov
Description:
MySQL still doesn't allow user variables in LIMIT clause.
The fix for Bug#11918 only allows stored procedure variables.
See how-to repeat.

How to repeat:
drop table if exists t1;
create table t1 (a int);
set @var=1;
select * from t1 limit @var;

Suggested fix:
Allow user variables in LIMIT clause. If the variable is STRING or DOUBLE or NULL, or negative integer, produce an error.
[14 May 2012 18:04] Trey Raymond
Like the last bug, this one is just sitting with no updates...Will we see this fix in an upcoming 5.5 build?  For SP-based applications, or even just apps that use variables statement to statement in a transaction, it's a pretty big limitation.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.