From c9f55c95cb382e22c41a310c1005e3de43379ae9 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 17 Jan 2019 15:24:40 +0100 Subject: style: WHERE,ON,FROM,SELECT,JOIN should be on beginning of source lines --- bin/build-master-status | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'bin/build-master-status') diff --git a/bin/build-master-status b/bin/build-master-status index 3605a02..cb18280 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -62,7 +62,8 @@ if [ -s "${tmp_dir}/todos" ]; then done printf 'UPDATE `todos`' - printf ' JOIN `td` ON `todos`.`id`=`td`.`id`' + printf ' JOIN `td`' + printf ' ON `todos`.`id`=`td`.`id`' printf ',`todos`.`%s`=`td`.`%s`' \ 'file' 'file' \ 'line' 'line' \ @@ -75,20 +76,25 @@ if [ -s "${tmp_dir}/todos" ]; then printf ' FROM `td`' printf ' WHERE `td`.`id` IS NULL;\n' - printf 'DELETE FROM `todos` WHERE NOT EXISTS (' - printf 'SELECT 1 FROM `td`' - printf ' AND `td`.`%s`=`todos`.`%s`' \ - 'file' 'file' \ - 'line' 'line' \ - 'description' 'description' | \ - sed 's/^ AND / WHERE /' + printf 'DELETE FROM `todos`' + printf ' WHERE NOT EXISTS (' + printf 'SELECT 1' + printf ' FROM `td`' + printf ' AND `td`.`%s`=`todos`.`%s`' \ + 'file' 'file' \ + 'line' 'line' \ + 'description' 'description' | \ + sed 's/^ AND / WHERE /' printf ');\n' printf 'DROP TEMPORARY TABLE `td`;\n' - printf 'DELETE FROM `todo_links` WHERE NOT EXISTS (' - printf 'SELECT 1 FROM `todos` ' + printf 'DELETE FROM `todo_links`' + printf ' WHERE NOT EXISTS (' + printf 'SELECT 1' + printf ' FROM `todos` ' printf 'WHERE `todos`.`id`=`todo_links`.`depending_on`' printf ') OR NOT EXISTS (' - printf 'SELECT 1 FROM `todos` ' + printf 'SELECT 1' + printf ' FROM `todos` ' printf 'WHERE `todos`.`id`=`todo_links`.`dependent`' printf ');\n' } | \ -- cgit v1.2.3-70-g09d2