• unknown's avatar
    Fix for bug #28464: a string argument to 'limit ?' PS - replication fails · c630de3f
    unknown authored
    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.
    
    
    mysql-test/r/limit.result:
      Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
        - test result
    mysql-test/t/limit.test:
      Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
        - test case
    sql/item.cc:
      Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
        - if Item_param::strict_type is set, check given and required types,
          return an error if not equal.
    sql/item.h:
      Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
        - bool strict_type introduced, which indicates that a parameter value must be of 
          the required_result_type type.
        - set_strict_type() function introduced to set required type.
    sql/sql_yacc.yy:
      Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
        - as we accept only INTs in the 'limit' clause set parameter's required type.
    c630de3f
item.h 82.3 KB