• Satya B's avatar
    Fix for BUG#46384 - mysqld segfault when trying to create table with same · 6e27ef43
    Satya B authored
                        name as existing view
    
    When trying to create a table with the same name as existing view with
    join, mysql server crashes.
    
    The problem is when create table is issued with the same name as view, while
    verifying with the existing tables, we assume that base table object is 
    created always.
    
    In this case, since it is a view over multiple tables, we don't have the 
    mysql derived table object.
    
    Fixed the logic which checks if there is an existing table to not to assume
    that table object is created when the base table is view over multiple 
    tables.
    
    mysql-test/r/create.result:
      BUG#46384 - mysqld segfault when trying to create table with same 
                  name as existing view
      
      Testcase for the bug
    mysql-test/t/create.test:
      BUG#46384 - mysqld segfault when trying to create table with same 
                  name as existing view
      
      Testcase for the bug
    sql/sql_insert.cc:
      BUG#46384 - mysqld segfault when trying to create table with same 
                      name as existing view
          
      Fixed create_table_from_items() method to properly check, if the base table 
      is a view over multiple tables.
    6e27ef43
sql_insert.cc 110 KB