Index: install.php =================================================================== --- install.php (revision 13571) +++ install.php (working copy) @@ -271,6 +271,8 @@ } } + $this->toolkit->deleteEditTables(); + $this->currentStep = $this->GetNextStep(); break; Index: install/install_toolkit.php =================================================================== --- install/install_toolkit.php (revision 13571) +++ install/install_toolkit.php (working copy) @@ -819,6 +819,25 @@ } /** + * Deletes all temp tables (from active sessions too) + * + */ + function deleteEditTables() + { + $table_prefix = $this->getSystemConfig('Database', 'TablePrefix'); + + $tables = $this->Conn->GetCol('SHOW TABLES'); + $mask_edit_table = '/' . $table_prefix . 'ses_(.*)_edit_(.*)/'; + $mask_search_table = '/' . $table_prefix . 'ses_(.*?)_(.*)/'; + + foreach ($tables as $table) { + if ( preg_match($mask_edit_table, $table, $rets) || preg_match($mask_search_table, $table, $rets) ) { + $this->Conn->Query('DROP TABLE IF EXISTS ' . $table); + } + } + } + + /** * Perform redirect after separate module install * * @param string $module_folder