[GRASS-SVN] r53306 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 3 06:08:51 PDT 2012


Author: glynn
Date: 2012-10-03 06:08:51 -0700 (Wed, 03 Oct 2012)
New Revision: 53306

Modified:
   grass/trunk/tools/sql.sh
Log:
Minor changes to nonansi* tables


Modified: grass/trunk/tools/sql.sh
===================================================================
--- grass/trunk/tools/sql.sh	2012-10-03 12:55:59 UTC (rev 53305)
+++ grass/trunk/tools/sql.sh	2012-10-03 13:08:51 UTC (rev 53306)
@@ -275,6 +275,11 @@
 ungetc
 vfprintf
 vsprintf
+fgetpos64
+fopen64
+freopen64
+fsetpos64
+tmpfile64
 EOF
 
 dropdb "$dbname"
@@ -496,24 +501,31 @@
 	FROM ansi ;
 
 CREATE TABLE nonansi_progs AS
-	SELECT a.symbol, COUNT(*)
+	SELECT a.program, a.symbol
 	FROM prog_imp a, nonansi b
-	WHERE a.symbol = b.symbol
-	AND a.program NOT LIKE 'bin/%'
-	GROUP BY a.symbol ;
+	WHERE a.symbol = b.symbol ;
 
 CREATE TABLE nonansi_libs AS
-	SELECT a.symbol, COUNT(*)
+	SELECT a.library, a.symbol
 	FROM imports a, nonansi b
-	WHERE a.symbol = b.symbol
-	GROUP BY a.symbol ;
+	WHERE a.symbol = b.symbol ;
 
+CREATE TABLE nonansi_prog_counts AS
+	SELECT symbol, COUNT(*)
+	FROM nonansi_progs
+	GROUP BY symbol ;
+
+CREATE TABLE nonansi_lib_counts AS
+	SELECT symbol, COUNT(*)
+	FROM nonansi_libs
+	GROUP BY symbol ;
+
 SELECT symbol
 INTO TABLE nonansi_counts
-	FROM nonansi_progs
+	FROM nonansi_prog_counts
 UNION
 SELECT symbol
-	FROM nonansi_libs ;
+	FROM nonansi_lib_counts ;
 
 ALTER TABLE nonansi_counts
 	ADD COLUMN progs INTEGER ;
@@ -526,16 +538,16 @@
 
 UPDATE nonansi_counts
 	SET progs = b.count
-	FROM nonansi_progs b
+	FROM nonansi_prog_counts b
 	WHERE nonansi_counts.symbol = b.symbol ;
 
 UPDATE nonansi_counts
 	SET libs = c.count
-	FROM nonansi_libs c
+	FROM nonansi_lib_counts c
 	WHERE nonansi_counts.symbol = c.symbol;
 
 -- SELECT a.symbol, a.program
--- 	FROM prog_imp a, nonansi_progs b
+-- 	FROM prog_imp a, nonansi_prog_counts b
 -- 	WHERE a.symbol = b.symbol
 -- 	AND a.program NOT LIKE 'bin/%'
 -- 	ORDER BY b.count DESC, b.symbol ;



More information about the grass-commit mailing list