changeset 880:fa5be649968f

Omit update of user_m when no records in user_s modified
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 14 Dec 2020 20:01:07 +0900
parents 188ad98d443f
children a240c8988c65
files s4-world.sh
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/s4-world.sh	Wed Dec 09 11:51:41 2020 +0900
+++ b/s4-world.sh	Mon Dec 14 20:01:07 2020 +0900
@@ -89,8 +89,14 @@
     case "$prevsync" in
       [2-9][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]\ [012][0-9]:??:??)
       SYNCCOND="WHERE name in (SELECT name FROM m.user_s WHERE key='wtime' AND val > '$prevsync')"
-      err synccond limited to \
-	  `query "SELECT DISTINCT name FROM m.user_s $SYNCCOND;"`
+      err "prevsync=$prevsync"
+      limited=`query "SELECT DISTINCT name FROM m.user_s $SYNCCOND;"`
+      if [ -n "$limited" ]; then
+	err synccond limited to "$limited"
+      else
+	err synccond canceled for user_m
+	SYNCCOND="WHERE NULL"
+      fi
       err "Touch $syncall (owner=`id -un`) to update all user_m."
       ;;
       *)

yatex.org