changeset 569:81b5ec847687

Turn off debug sql logging
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 23 Apr 2019 09:22:17 +0900
parents 3cb5c360e1bf
children 9328392f7c55
files s4-funcs.sh
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Mon Apr 22 12:03:16 2019 +0900
+++ b/s4-funcs.sh	Tue Apr 23 09:22:17 2019 +0900
@@ -3170,12 +3170,13 @@
 
 	-- ${ddd:+.system gdate +%T.%3N >> tmp/d1}
 	DROP TABLE IF EXISTS _news;
+	DROP VIEW IF EXISTS _news;
 
 	-- CREATE TEMPORARY TABLE _news($_i, newcnt);
-	--  INSERT INTO _news
+	-- INSERT INTO _news
 	/* **COMPARE** the efficiency of TEMP-TABLE and VIEW !!! */
-	CREATE VIEW _news AS (
-    	  SELECT a.id, coalesce(newcnt, 0) newcnt
+	CREATE TEMPORARY VIEW _news AS
+    	  SELECT a.id $_i, coalesce(newcnt, 0) newcnt
     	  FROM   (SELECT DISTINCT id FROM _target)
 	      a LEFT JOIN
 	      	 (SELECT $_i, count(ctime) newcnt
@@ -3184,7 +3185,7 @@
                                           WHERE tblrowid=x.trowid),
                                	         '1970-01-01')
                   GROUP BY $_i) b
-          ON a.id=b.$_i);
+          ON a.id=b.$_i;
 	-- ${ddd:+.system gdate +%T.%3N >> tmp/d1}
 	EOF
     # REMOVE next line until 2019/5/1
@@ -3249,8 +3250,8 @@
 	`cat $sqlfile`
 	EOF
   if [ "$ddd" ]; then	# REMOVE this block until 2019/7/1
-    rm -f tmp/sql; cat $sqlfile >> tmp/sql
     err "----- `gdate +%FT%T.%3N` ------------555555aaaaa"
+    cat $sqlfile >> tmp/sql
     # query ".read $sqlfile" > $tmpd/foo
     sqlite3 -header -cmd 'pragma foreign_keys=ON' $db ".read $sqlfile" > $tmpd/foo
     cp $tmpd/foo tmp/

yatex.org