Comment 21 for bug 1193308

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The cause is handler->table == NULL, making handler::clone() fail. That's because the temp table for ALTER is created without opening it in the engine (open_table_from_share() arg db_stats = 0, because open_table_uncached() arg open_in_engine = false from mysql_alter_table()). And engine opening is what sets the handler->table pointer.

The fix is to detect this->table == NULL in clone() and return NULL, and then fixing bug 1206486.

This is 5.6-specific code. In 5.5 and 5.1 table opens without engine open can happen in some other code paths, which warrant the same fix there, but perhaps without the testcases.