Bug #1337 Prepared Statement doesn' like LIMIT ? parameter

Submitted: 18 Sep 2003 10:55 Modified: 3 Oct 2003 11:48
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[18 Sep 2003 10:55] [ name withheld ]
Description:
Looks like it isn't completely functional yet 
 Prepared statemens doesn't like the second ? It gives a SQL parse error. Why ? 
 I put the newline in just to make sure the error was the second ? not the 
first. 
 The error message tells you what line of the SQL statment the error is on. 
  
 "SELECT token FROM indexdata WHERE token >= ? \n ORDER BY token LIMIT ? " 

How to repeat:
CREATE TABLE indexdata ( token VARCHAR(255) NOT NULL , data BLOB, PRIMARY KEY ( 
token )); 
"SELECT token FROM indexdata WHERE token >= ? \n ORDER BY token LIMIT ? "
[3 Oct 2003 11:48] Indrek Siitan
This doesn't qualify as a bug. LIMIT requires an integer constant (or two)
as parameters, but prepared statement passes it as a data value, which
means quoted -- LIMIT '1' instead of LIMIT 1 what MySQL expects.
[7 Oct 2003 23:42] [ name withheld ]
Well then how do you specify a variable limit between queries ? 
Create a prepared statement for every integer ?  
Come on what is your solution. 
 
Postgres can do this
[8 Oct 2003 13:48] Brian Aker
See CPAN bug: 
http://rt.cpan.org/NoAuth/Bug.html?id=3016
[31 Aug 2009 9:02] d di
Related: bug 34629

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

Page generated in 0.040 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.