[GRASS-SVN] r58846 - grass/branches/releasebranch_6_4/vector/v.patch

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 3 03:23:54 PST 2014


Author: neteler
Date: 2014-02-03 03:23:54 -0800 (Mon, 03 Feb 2014)
New Revision: 58846

Modified:
   grass/branches/releasebranch_6_4/vector/v.patch/main.c
Log:
v.patch: create index for table (backport from trunk, r58803)

Modified: grass/branches/releasebranch_6_4/vector/v.patch/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.patch/main.c	2014-02-03 08:26:12 UTC (rev 58845)
+++ grass/branches/releasebranch_6_4/vector/v.patch/main.c	2014-02-03 11:23:54 UTC (rev 58846)
@@ -285,6 +285,17 @@
 		G_fatal_error(_("Unable to create table <%s>"),
 			      fi_out->table);
 	    }
+
+	    /* do not allow duplicate keys */
+	    if (db_create_index2(driver_out, fi_out->table, fi_out->key) != DB_OK)
+		G_warning(_("Unable to create index"));
+
+	    if (db_grant_on_table
+		(driver_out, fi_out->table, DB_PRIV_SELECT,
+		 DB_GROUP | DB_PUBLIC) != DB_OK)
+		G_fatal_error(_("Unable to grant privileges on table <%s>"),
+			      fi_out->table);
+
 	    Vect_map_add_dblink(&OutMap, 1, NULL, fi_out->table,
 				fi_in->key, fi_out->database, fi_out->driver);
 	}



More information about the grass-commit mailing list