• Jon Olav Hauglid's avatar
    Bug #51099 Assertion in mysql_multi_delete_prepare() · 7a64d43a
    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.
    7a64d43a
delete.test 14.6 KB