• Jon Olav Hauglid's avatar
    Bug #51099 Assertion in mysql_multi_delete_prepare() · c4a18b6a
    Jon Olav Hauglid authored
    This assert was triggered if DELETE was done on a view that
    referenced another view which in turn (directly or indirectly)
    referenced more than one table.
    
    Delete from a view referencing more than one table (a join view)
    is not supported and is supposed to give ER_VIEW_DELETE_MERGE_VIEW
    error. Before this error was reported from the multi table 
    delete code, an assert verified that the view from the DELETE statement
    had more than one underlying table. However, this assert did not take
    into account that the view could refer to another view which in turn
    referenced the actual tables.
    
    This patch fixes the problem by adjusting the assert to take this
    possibility into account. This problem was only noticeable on debug
    builds of the server. On release builds, ER_VIEW_DELETE_MERGE_VIEW
    was correctly reported.
    
    Test case added to delete.test.
    c4a18b6a
sql_delete.cc 29.4 KB