Skip to content
  • Praveenkumar Hulakund's avatar
    b18eae3d
    Bug#28509306 - DIAGNOSTIC AREA NOT POPULATED ON PREPARE STATEMENT ERROR 1615. · b18eae3d
    Praveenkumar Hulakund authored
    Issue here is, SQL condition in diagnostics area is not pushed
    when re-prepare fails for the prepared statements.
    
    When table is opened for the prepared statement, the tables version
    is verified to check if they change since statement prepare.
    If any table is changed then parse tree may no longer be valid
    and it should be reprepared. In such situation, ER_NEED_REPREPARE
    error is set in the diagnostics area by the table version change
    observer of the prepared statement. The intention of this to
    inform executor method to re-prepare the statement and execute
    again. Since it is internal to the server, observer just sets the
    diagnostics area but exception handlers are not invoked and
    SQL condition is not set.
    
    The prepared statement executor attempts only three times to
    re-prepare the statement and reports ER_NEED_REPREPARE to user
    if tables version mismatches again. Since the error is set in the
    diagnostics area, proper error is reported to the user but
    GET DIAGNOSTIC statement to access SQL condition fails as it
    is not pushed in this situation.
    
    This issue can be observed with stored routine instructions too
    as similar logic is used for it.
    
    To fix this issue for the prepared statement and stored routine
    instructions, now SQL condition is pushed if the execution fails
    with ER_NEED_REPREPARE for more than three times.
    b18eae3d
    Bug#28509306 - DIAGNOSTIC AREA NOT POPULATED ON PREPARE STATEMENT ERROR 1615.
    Praveenkumar Hulakund authored
    Issue here is, SQL condition in diagnostics area is not pushed
    when re-prepare fails for the prepared statements.
    
    When table is opened for the prepared statement, the tables version
    is verified to check if they change since statement prepare.
    If any table is changed then parse tree may no longer be valid
    and it should be reprepared. In such situation, ER_NEED_REPREPARE
    error is set in the diagnostics area by the table version change
    observer of the prepared statement. The intention of this to
    inform executor method to re-prepare the statement and execute
    again. Since it is internal to the server, observer just sets the
    diagnostics area but exception handlers are not invoked and
    SQL condition is not set.
    
    The prepared statement executor attempts only three times to
    re-prepare the statement and reports ER_NEED_REPREPARE to user
    if tables version mismatches again. Since the error is set in the
    diagnostics area, proper error is reported to the user but
    GET DIAGNOSTIC statement to access SQL condition fails as it
    is not pushed in this situation.
    
    This issue can be observed with stored routine instructions too
    as similar logic is used for it.
    
    To fix this issue for the prepared statement and stored routine
    instructions, now SQL condition is pushed if the execution fails
    with ER_NEED_REPREPARE for more than three times.
Loading