Skip to content
  • Nisha Gopalakrishnan's avatar
    ee17163e
    BUG#19897405: CRASH WHILE ACCESSING VIEWS IN STORED ROUTINE · ee17163e
    Nisha Gopalakrishnan authored
                  AND TABLES ARE FLUSHED
    
    Analysis:
    ---------
    The server crashes while accessing view columns in the
    stored procedure after DDL/FLUSH TABLE operation
    is performed on the tables used by the SQL statements
    in the stored procedure.
    
    The DDL/FLUSH TABLE operation on the tables used by the
    SQL statement of the stored procedure triggers a
    re-parse of the query. The state of the statement arena
    was set to 'STMT_EXECUTED' and was not reset to
    'STMT_INITIALIZED_FOR_SP' during the re-parse. This state
    of the query arena caused the runtime arena to be used
    for the allocation of item representing the view column
    instead of persistent arena. The runtime arena and the
    mem_root associated with it is not persistent and is
    deallocated at the end of the query execution. Hence
    the subsequent execution of the stored procedure,
    accesses invalid(freed) memory causing the server to crash.
    
    Fix:
    ---
    The state of the statement arena for the query re-parsed
    is set to STMT_INITIALIZED_FOR_SP. Thus, when the item
    representing the view column is created, it will
    be allocated on the persistent memroot which
    will be accessible for the subsequent calls to
    the stored procedure
    ee17163e
    BUG#19897405: CRASH WHILE ACCESSING VIEWS IN STORED ROUTINE
    Nisha Gopalakrishnan authored
                  AND TABLES ARE FLUSHED
    
    Analysis:
    ---------
    The server crashes while accessing view columns in the
    stored procedure after DDL/FLUSH TABLE operation
    is performed on the tables used by the SQL statements
    in the stored procedure.
    
    The DDL/FLUSH TABLE operation on the tables used by the
    SQL statement of the stored procedure triggers a
    re-parse of the query. The state of the statement arena
    was set to 'STMT_EXECUTED' and was not reset to
    'STMT_INITIALIZED_FOR_SP' during the re-parse. This state
    of the query arena caused the runtime arena to be used
    for the allocation of item representing the view column
    instead of persistent arena. The runtime arena and the
    mem_root associated with it is not persistent and is
    deallocated at the end of the query execution. Hence
    the subsequent execution of the stored procedure,
    accesses invalid(freed) memory causing the server to crash.
    
    Fix:
    ---
    The state of the statement arena for the query re-parsed
    is set to STMT_INITIALIZED_FOR_SP. Thus, when the item
    representing the view column is created, it will
    be allocated on the persistent memroot which
    will be accessible for the subsequent calls to
    the stored procedure
Loading