[GRASS-SVN] r35519 - grass/branches/releasebranch_6_4/vector/v.to.db
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 20 15:39:00 EST 2009
Author: martinl
Date: 2009-01-20 15:39:00 -0500 (Tue, 20 Jan 2009)
New Revision: 35519
Modified:
grass/branches/releasebranch_6_4/vector/v.to.db/update.c
Log:
v.to.db: report missing qlayer connection only when querying
(merge from devbr6, r35515)
Modified: grass/branches/releasebranch_6_4/vector/v.to.db/update.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.to.db/update.c 2009-01-20 20:37:26 UTC (rev 35518)
+++ grass/branches/releasebranch_6_4/vector/v.to.db/update.c 2009-01-20 20:39:00 UTC (rev 35519)
@@ -23,15 +23,22 @@
db_init_string(&stmt);
/* layer to find table to read from */
- if ((qFi = Vect_get_field(Map, options.qfield)) == NULL)
+ qFi = Vect_get_field(Map, options.qfield);
+ if (options.option == O_QUERY && qFi == NULL)
G_fatal_error(_("Database connection not defined for layer %d. Use v.db.connect first."),
options.qfield);
/* layer to find table to write to */
if ((Fi = Vect_get_field(Map, options.field)) == NULL)
G_fatal_error(_("Database connection not defined for layer %d. Use v.db.connect first."),
options.field);
- G_debug(3, "Reading from map <%s>, query layer %d (table <%s>): updating table <%s>, column <%s>",
- options.name, options.qfield, qFi->table, Fi->table, Fi->key);
+ if (qFi) {
+ G_debug(3, "Reading from map <%s>, query layer %d (table <%s>): updating table <%s>, column <%s>",
+ options.name, options.qfield, qFi->table, Fi->table, Fi->key);
+ }
+ else {
+ G_debug(3, "Reading from map <%s>, updating table <%s>, column <%s>",
+ options.name, Fi->table, Fi->key);
+ }
/* Open driver */
driver = db_start_driver_open_database(Fi->driver, Fi->database);
More information about the grass-commit
mailing list