[GRASS-SVN] r63789 - grass/branches/releasebranch_6_4/scripts/v.rast.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 27 15:49:41 PST 2014


Author: neteler
Date: 2014-12-27 15:49:41 -0800 (Sat, 27 Dec 2014)
New Revision: 63789

Modified:
   grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats
Log:
v.rast.stats: don't use TRANSACTION with DBF driver (trac #2457)

Modified: grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats	2014-12-27 23:21:19 UTC (rev 63788)
+++ grass/branches/releasebranch_6_4/scripts/v.rast.stats/v.rast.stats	2014-12-27 23:49:41 UTC (rev 63789)
@@ -360,7 +360,11 @@
 
 # create SQL file for extended and normal statistics
 g.message -v "Creating SQL file ..."
-echo "BEGIN TRANSACTION;" > "$SQLTMP"
+if [ "$DBFDRIVER" -eq 1 ] ; then
+    echo "" > "$SQLTMP"
+else
+    echo "BEGIN TRANSACTION;" > "$SQLTMP"
+fi
 if [ $GIS_FLAG_E -eq 1 ] ; then
     sed -e '1d' "$STATSTMP" | awk -F "|" \
       '{printf "\nUPDATE '${TABLE}' SET '${col1}' = %i , '${col2}' = %.15g , \
@@ -375,8 +379,11 @@
       '${col7}' = %.15g , '${col8}' = %.15g , '${col9}' = %.15g \
       WHERE '${KEYCOL}' = %i;", $2,$3,$4,$5,$6,$7,$8,$9,$10,$1}' >> "$SQLTMP"
 fi
-echo "COMMIT;" >> "$SQLTMP"
-
+if [ "$DBFDRIVER" -eq 1 ] ; then
+    echo "" >> "$SQLTMP"
+else
+    echo "COMMIT;" >> "$SQLTMP"
+fi
 g.message message="Updating the database ..."
 db.execute input="$SQLTMP" database="$DB_DATABASE" driver="$DB_SQLDRIVER"
 EXITCODE=$?



More information about the grass-commit mailing list