• unknown's avatar
    Fix for bug #9841 "Unexpected read lock when trying to update a view in · 1e6193ca
    unknown authored
    a stored procedure" (version 2).
    
    To handle updates and inserts into view in SP properly we should set
    lock types for tables of the view's main select when we are opening
    view for prelocking purproses.
    
    
    mysql-test/r/sp.result:
      Added test case for bug #9841 "Unexpected read lock when trying to update
      a view in a stored procedure"
    mysql-test/t/sp.test:
      Added test case for bug #9841 "Unexpected read lock when trying to update
      a view in a stored procedure"
    sql/sql_view.cc:
      mysql_make_view():
        To handle updates and inserts into view in SP properly we should set
        lock types for tables of the view's main select when we are opening
        view for prelocking purproses.
        Also it is more correct to use LEX::select_lex::get_table_list() 
        instead of 'view_tables' variable for obtaining list of those
        tables.
    1e6193ca
sp.test 76.3 KB