Commit c0927eff2c2388a0c93cce4b1e6e2b76b5ba3173

Authored by kevin_fourie
1 parent 57f069e3

Merged in from DEV trunk...

KTS-3229
"SQL for search cleanup function is not compatible in newer versions of mysql"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8338 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/indexerCore.inc.php
... ... @@ -539,17 +539,10 @@ abstract class Indexer
539 539 global $default;
540 540  
541 541 $sql = 'DELETE FROM
542   - iff USING index_files AS iff, documents
  542 + index_files
543 543 WHERE
544   - NOT EXISTS(
545   - SELECT
546   - d.id
547   - FROM
548   - documents AS d
549   - INNER JOIN document_metadata_version dmv ON d.metadata_version_id=dmv.id
550   - WHERE
551   - iff.document_id = d.id OR dmv.status_id=3
552   - );';
  544 + document_id in (SELECT d.id FROM documents AS d WHERE d.status_id=3) OR
  545 + NOT EXISTS(SELECT index_files.document_id FROM documents WHERE index_files.document_id=documents.id)';
553 546 DBUtil::runQuery($sql);
554 547  
555 548 $default->log->debug("Indexer::clearoutDeleted: removed documents from indexing queue that have been deleted");
... ...