• unknown's avatar
    BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage engine · 9d85b0a6
    unknown authored
    An update that used a join of a table to itself and modified the
    table on one side of the join reported the table as crashed or
    updated wrong rows.
    
    Fixed by creating temporary table for self-joined multi update statement.
    
    
    mysql-test/r/myisam.result:
      A test case for BUG#21310.
    mysql-test/t/myisam.test:
      A test case for BUG#21310.
    sql/lock.cc:
      Exclude 'table' param from check.
    sql/sql_update.cc:
      Disabling record cache for self-joined multi update statement is wrong.
      The join must only see the table as it was at the beginning of the statement.
      safe_update_on_fly check if it is safe to update first table on the fly, that is
      not creating temporary table. It is possible in case a row from this table is
      never read more than once. safe_update_on_fly now detect self-joined table and
      refuse to update this table on the fly.
    9d85b0a6
sql_update.cc 36.9 KB