Bug #28464 a string argument to 'limit ?' PS - replication fails
Submitted: 16 May 2007 8:29 Modified: 7 Jun 2007 17:10
Reporter: Ramil Kalimullin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Ramil Kalimullin CPU Architecture:Any

[16 May 2007 8:29] Ramil Kalimullin
Description:
binlogging the following

prepare s from "select 1 limit ?"; 
set @a='qwe'; 
execute s using @a;

we'll get a syntactically wrong query in the binary log.

How to repeat:
just replicate

prepare s from "select 1 limit ?"; 
set @a='qwe'; 
execute s using @a;

Suggested fix:
Raise an error in such cases.
[16 May 2007 10:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/26805

ChangeSet@1.2457, 2007-05-16 15:47:52+05:00, ramil@mysql.com +3 -0
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
  
  Problem: we may get syntactically incorrect queries in the binary log 
  if we use a string value user variable executing a PS which 
  contains '... limit ?' clause, e.g.
  prepare s from "select 1 limit ?"; 
  set @a='qwe'; 
  execute s using @a;
  
  Fix: raise an error in such cases.
[18 May 2007 7:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/26941

ChangeSet@1.2484, 2007-05-18 12:08:07+05:00, ramil@mysql.com +5 -0
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
  
  Problem: we may get syntactically incorrect queries in the binary log 
  if we use a string value user variable executing a PS which 
  contains '... limit ?' clause, e.g.
  prepare s from "select 1 limit ?"; 
  set @a='qwe'; execute s using @a;
    
  Fix: raise an error in such cases.
[6 Jun 2007 16:54] Bugs System
Pushed into 5.1.20-beta
[6 Jun 2007 16:57] Bugs System
Pushed into 5.0.44
[7 Jun 2007 17:10] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.0.44 and 5.1.20 changelogs.