• Kristofer Pettersson's avatar
    Bug#46615 Assertion in Query_cache::invalidate in INSERT in a VIEW of a MERGE table · 1dba7249
    Kristofer Pettersson authored
    If the listed columns in the view definition of 
    the table used in a 'INSERT .. SELECT ..'
    statement mismatched, a debug assertion would
    trigger in the cache invalidation code
    following the failing statement.
    
    Although the find_field_in_view() function
    correctly generated ER_BAD_FIELD_ERROR during
    setup_fields(), the error failed to propagate
    further than handle_select(). This patch fixes
    the issue by adding a check for the return
    value.
    
    
    mysql-test/r/query_cache_with_views.result:
      * added test for bug 46615
    mysql-test/t/query_cache_with_views.test:
      * added test for bug 46615
    sql/sql_parse.cc:
      * added check for handle_select() return code before attempting to invalidate the cache.
    1dba7249
sql_parse.cc 233 KB