[GRASS-SVN] r64397 - in grass/branches/releasebranch_7_0/db/drivers: dbf mysql ogr postgres sqlite

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 2 05:44:36 PST 2015


Author: mmetz
Date: 2015-02-02 05:44:36 -0800 (Mon, 02 Feb 2015)
New Revision: 64397

Modified:
   grass/branches/releasebranch_7_0/db/drivers/dbf/db.c
   grass/branches/releasebranch_7_0/db/drivers/dbf/describe.c
   grass/branches/releasebranch_7_0/db/drivers/dbf/table.c
   grass/branches/releasebranch_7_0/db/drivers/mysql/parse.c
   grass/branches/releasebranch_7_0/db/drivers/mysql/replace.c
   grass/branches/releasebranch_7_0/db/drivers/ogr/execute.c
   grass/branches/releasebranch_7_0/db/drivers/postgres/parse.c
   grass/branches/releasebranch_7_0/db/drivers/sqlite/db.c
Log:
db drivers: chop tokens

Modified: grass/branches/releasebranch_7_0/db/drivers/dbf/db.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/dbf/db.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/dbf/db.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -65,6 +65,7 @@
 	db.name[0] = '\0';	/* re-init */
 
 	for (n = 0; n < no_tokens; n++) {
+	    G_chop(tokens[n]);
 	    G_debug(3, "tokens[%d] = %s", n, tokens[n]);
 	    if (tokens[n][0] == '$') {
 		G_strchg(tokens[n], '$', ' ');

Modified: grass/branches/releasebranch_7_0/db/drivers/dbf/describe.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/dbf/describe.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/dbf/describe.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -65,6 +65,9 @@
 	else
 	    col = i;
 
+	precision = 0;
+	scale = 0;
+
 	dcol = &(db.tables[tab].cols[col]);
 	column = db_get_table_column(*table, i);
 

Modified: grass/branches/releasebranch_7_0/db/drivers/dbf/table.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/dbf/table.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/dbf/table.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -259,6 +259,9 @@
 	case DBF_DOUBLE:
 	    dbftype = FTDouble;
 	    break;
+	default:
+	    G_warning("invalid/unsupported DBFFieldType");
+	    break;
 	}
 
 	width = db.tables[t].cols[i].width;

Modified: grass/branches/releasebranch_7_0/db/drivers/mysql/parse.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/mysql/parse.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/mysql/parse.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -49,6 +49,7 @@
 	tokens = G_tokenize(str, delm);
 	i = 0;
 	while (tokens[i]) {
+	    G_chop(tokens[i]);
 	    G_debug(3, "token %d : %s", i, tokens[i]);
 	    if (strncmp(tokens[i], "host", 4) == 0) {
 		conn->host = G_store(tokens[i] + 5);

Modified: grass/branches/releasebranch_7_0/db/drivers/mysql/replace.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/mysql/replace.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/mysql/replace.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -42,6 +42,7 @@
 
 	tmp[0] = '\0';
 	for (n = 0; n < no_tokens - 1; n++) {
+	    G_chop(tokens[n]);
 	    if (n > 0)
 		strcat(tmp, "/");
 

Modified: grass/branches/releasebranch_7_0/db/drivers/ogr/execute.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/ogr/execute.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/ogr/execute.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -181,6 +181,7 @@
     *cols = (column_info *)G_malloc(sizeof(column_info) * (*ncols));
     
     for (n = 0; n < (*ncols); n++) {
+	G_chop(token[n]);
 	itoken = G_tokenize(token[n], "=");
 	if (G_number_of_tokens(itoken) != 2)
 	    return FALSE;

Modified: grass/branches/releasebranch_7_0/db/drivers/postgres/parse.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/postgres/parse.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/postgres/parse.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -44,6 +44,7 @@
 	tokens = G_tokenize(str, delm);
 	i = 0;
 	while (tokens[i]) {
+	    G_chop(tokens[i]);
 	    G_debug(3, "token %d : %s", i, tokens[i]);
 	    if (strncmp(tokens[i], "host", 4) == 0)
 		pgconn->host = G_store(tokens[i] + 5);

Modified: grass/branches/releasebranch_7_0/db/drivers/sqlite/db.c
===================================================================
--- grass/branches/releasebranch_7_0/db/drivers/sqlite/db.c	2015-02-02 13:34:52 UTC (rev 64396)
+++ grass/branches/releasebranch_7_0/db/drivers/sqlite/db.c	2015-02-02 13:44:36 UTC (rev 64397)
@@ -60,6 +60,7 @@
 
 	name2[0] = '\0';
 	for (n = 0; n < no_tokens; n++) {
+	    G_chop(tokens[n]);
 	    if (n > 0)
 		strcat(name2, "/");
 



More information about the grass-commit mailing list