Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -r16621 -r16655 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16621) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 16655) @@ -1,6 +1,6 @@ Conn->Query('SHOW TABLES LIKE "'.$search_table.'"'); + if (!$this->Application->GetVar('do_not_drop_search_table')) { - $this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); // erase old search table if clean k4 event + if ( $search_table_exists ) { + $this->Conn->Query('TRUNCATE TABLE '.$search_table); + } + $this->Application->SetVar('do_not_drop_search_table', true); } - $search_table_exists = $this->Conn->Query('SHOW TABLES LIKE "'.$search_table.'"'); if ($search_table_exists) { $select_intro = 'INSERT INTO '.$search_table.' (Relevance, ItemId, ResourceId, ItemType, EdPick) '; } else { - $select_intro = 'CREATE TABLE '.$search_table.' AS '; + $select_intro = 'CREATE TABLE '.$search_table.' ENGINE = MEMORY AS '; } $edpick_clause = $this->Application->getUnitOption($event->Prefix.'.EditorsPick', 'Fields') ? $items_table.'.EditorsPick' : '0';