Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites
locking type of temp table The problem is that INSERT INTO .. SELECT FROM .. and CREATE TABLE .. SELECT FROM a temporary table could inadvertently overwrite the locking type of the temporary table. The lock type of temporary tables should be a write lock by default. The solution is to reset the lock type of temporary tables back to its default value after they are used in a statement. mysql-test/r/innodb_mysql.result: Add test case result for Bug#41348 mysql-test/r/temp_table.result: Add test case result for Bug#41348 mysql-test/t/innodb_mysql.test: Add test case for Bug#41348 mysql-test/t/temp_table.test: Add test case for Bug#41348 sql/sql_base.cc: Allow the lock type of temp tables to be overwritten now that the the value is being restored once the table is marked as free for re-use. This makes the behavior consistent with that of non-temporary tables and avoids confusion.
Showing
Please register or sign in to comment