-
Bug
-
Resolution: Fixed
-
Major
-
3.2.1
-
None
When deleting data of the attached extension, I'm getting this error:
ContextErrorException in driver.php line 999
User Error: SQL ERROR [ mysqli ]<br /><br />Table 'phpbb32.phpbb_test_table' doesn't exist [1146]<br /><br />SQL<br /><br />SHOW COLUMNS FROM phpbb_test_table
in driver.php line 999
- at ErrorHandler->handleError('256', 'SQL ERROR [ mysqli ]<br /><br />Table 'phpbb32.phpbb_test_table' doesn't exist [1146]<br /><br />SQL<br /><br />SHOW COLUMNS FROM phpbb_test_table', '/vagrant/www/32/phpbb/db/driver/driver.php', '999', array('sql' => 'SHOW COLUMNS FROM phpbb_test_table', 'auth' => object(auth), 'user' => object(user), 'config' => object(db), 'message' => 'SQL ERROR [ mysqli ]<br /><br />Table 'phpbb32.phpbb_test_table' doesn't exist [1146]<br /><br />SQL<br /><br />SHOW COLUMNS FROM phpbb_test_table'), null) in error_handler.php line 29
- at error_handler->handleError('256', 'SQL ERROR [ mysqli ]<br /><br />Table 'phpbb32.phpbb_test_table' doesn't exist [1146]<br /><br />SQL<br /><br />SHOW COLUMNS FROM phpbb_test_table', '/vagrant/www/32/phpbb/db/driver/driver.php', '999', array('sql' => 'SHOW COLUMNS FROM phpbb_test_table', 'auth' => object(auth), 'user' => object(user), 'config' => object(db), 'message' => 'SQL ERROR [ mysqli ]<br /><br />Table 'phpbb32.phpbb_test_table' doesn't exist [1146]<br /><br />SQL<br /><br />SHOW COLUMNS FROM phpbb_test_table'))
- at trigger_error('SQL ERROR [ mysqli ]<br /><br />Table 'phpbb32.phpbb_test_table' doesn't exist [1146]<br /><br />SQL<br /><br />SHOW COLUMNS FROM phpbb_test_table', '256') in driver.php line 999
- at driver->sql_error('SHOW COLUMNS FROM phpbb_test_table') in mysqli.php line 193
- at mysqli->sql_query('SHOW COLUMNS FROM phpbb_test_table') in tools.php line 885
- at tools->sql_list_columns('phpbb_test_table') in tools.php line 902
- at tools->sql_column_exists('phpbb_test_table', 'some_number') in tools.php line 602
- at tools->perform_schema_changes(array('drop_columns' => array('phpbb_test_table' => array('some_number'))))
- at call_user_func_array(array(object(tools), 'perform_schema_changes'), array(array('drop_columns' => array('phpbb_test_table' => array('some_number'))))) in migrator.php line 711
- at migrator->run_step(array('dbtools.perform_schema_changes', array(array('drop_columns' => array('phpbb_test_table' => array('some_number'))))), null, false) in migrator.php line 658
- at migrator->process_data_step(array(array('dbtools.perform_schema_changes', array(array('add_columns' => array('phpbb_test_table' => array('some_numbr' => array('UINT', '0')))))), array('dbtools.perform_schema_changes', array(array('drop_columns' => array('phpbb_test_table' => array('some_number')))))), array('result' => null, 'step' => '1', '_total_time' => '0.0045359134674072')) in migrator.php line 586
- at migrator->try_revert('\kasimi\migrationtest\migrations\m2_schema_fix') in migrator.php line 514
- at migrator->revert_do('\kasimi\migrationtest\migrations\m2_schema_fix') in migrator.php line 488
- at migrator->revert('\kasimi\migrationtest\migrations\m2_schema_fix') in base.php line 108
- at base->purge_step(true) in manager.php line 359
- at manager->purge_step('kasimi/migrationtest') in acp_extensions.php line 304
- at acp_extensions->main('extensions', 'main') in functions_module.php line 676
- at p_master->load_active() in index.php line 82
What happens in my deleting data tests is that from m2, the 'add_columns' is executed, but 'drop_columns' isn't. Then, m1's revert_schema is executed, deleting the table. Finally it goes back to m2 and tries to do the 'drop_column' on the table that doesn't exist any more.
The code of the two migrations in the attached extension is also here:
https://gist.github.com/kasimi/00291a408fb175359b6854f312541cf4
Can anyone reproduce this?