• unknown's avatar
    Fix for bug#19634 "Re-execution of multi-delete which involve trigger/stored · e9452db1
    unknown authored
    function crashes server".
    
    Attempts to execute prepared multi-delete statement which involved trigger or
    stored function caused server crashes (the same happened for such statements
    included in stored procedures in cases when one tried to execute them more
    than once).
    
    The problem was caused by yet another incorrect usage of check_table_access()
    routine (the latter assumes that table list which it gets as argument
    corresponds to value LEX::query_tables_own_last). We solve this problem by
    juggling with LEX::query_tables_own_last value when we call
    check_table_access() for LEX::auxilliary_table_list (better solution is too
    intrusive and should be done in 5.1).
    
    
    mysql-test/r/sp-prelocking.result:
      Added test for bug#19634 "Re-execution of multi-delete which involve trigger/
      stored function crashes server".
    mysql-test/t/sp-prelocking.test:
      Added test for bug#19634 "Re-execution of multi-delete which involve trigger/
      stored function crashes server".
    sql/sql_parse.cc:
      To call safely check_table_access() for LEX::auxilliary_table_list we have
      to juggle with LEX::query_tables_own_last value.
    e9452db1
sp-prelocking.result 4.55 KB