From 807e0c961d18a18874633dd5347feea8df6dc24a Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Fri, 8 Mar 2013 12:58:27 +0100 Subject: [PATCH] list files: replace WHEREs with INNER JOIN ON --- atom | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/atom b/atom index 13a3c74..6570161 100755 --- a/atom +++ b/atom @@ -983,18 +983,18 @@ removeObsoleteFiles # get files echo ' SELECT COUNT(DISTINCT source_files.filename) - FROM source_files, - destinations, - destination_files, - mime_type_actions, - tags - WHERE destination_files.last_change < source_files.last_change - AND destinations.id = destination_files.destination_id - AND mime_type_actions.destination_id = destinations.id - AND mime_type_actions.id = source_files.mime_type - AND source_files.id = destination_files.source_file_id - AND source_files.id = tags.source_file - AND tags.last_change < source_files.last_change + FROM source_files + INNER JOIN destination_files + ON destination_files.source_file_id=source_files.id + INNER JOIN destinations + ON destination_files.destination_id=destinations.id + INNER JOIN mime_type_actions + ON destinations.id=mime_type_actions.destination_id + INNER JOIN tags + ON source_files.id=tags.source_file + WHERE mime_type_actions.id = source_files.mime_type + AND NOT destination_files.last_change = source_files.last_change + AND NOT tags.last_change = source_files.last_change AND mime_type_actions.action = 1;' >&3 read -u4 filecount echo ' @@ -1003,18 +1003,18 @@ echo ' source_files.last_change, mime_type_actions.mime_text, source_files.filename - FROM source_files, - destinations, - destination_files, - mime_type_actions, - tags - WHERE destination_files.last_change < source_files.last_change - AND destinations.id = destination_files.destination_id - AND mime_type_actions.destination_id = destinations.id - AND mime_type_actions.id = source_files.mime_type - AND source_files.id = destination_files.source_file_id - AND source_files.id = tags.source_file - AND tags.last_change < source_files.last_change + FROM source_files + INNER JOIN destination_files + ON destination_files.source_file_id=source_files.id + INNER JOIN destinations + ON destination_files.destination_id=destinations.id + INNER JOIN mime_type_actions + ON destinations.id=mime_type_actions.destination_id + INNER JOIN tags + ON source_files.id=tags.source_file + WHERE mime_type_actions.id = source_files.mime_type + AND NOT destination_files.last_change = source_files.last_change + AND NOT tags.last_change = source_files.last_change AND mime_type_actions.action = 1; SELECT "AtOM:NoMoreFiles";' >&3