[GRASS-SVN] r48359 - grass/trunk/db/drivers/sqlite

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 19 04:14:58 EDT 2011


Author: mmetz
Date: 2011-09-19 01:14:58 -0700 (Mon, 19 Sep 2011)
New Revision: 48359

Modified:
   grass/trunk/db/drivers/sqlite/describe.c
Log:
SQLite driver: understand datetime (#730)

Modified: grass/trunk/db/drivers/sqlite/describe.c
===================================================================
--- grass/trunk/db/drivers/sqlite/describe.c	2011-09-19 03:01:59 UTC (rev 48358)
+++ grass/trunk/db/drivers/sqlite/describe.c	2011-09-19 08:14:58 UTC (rev 48359)
@@ -404,7 +404,8 @@
     if (streq(buf, "time") || streq(buf, "timetz"))
 	return DB_SQL_TYPE_TIME;
 
-    if (streq(buf, "timestamp") || streq(buf, "timestamptz"))
+    if (streq(buf, "timestamp") || streq(buf, "timestamptz") || 
+	streq(buf, "datetime"))
 	return DB_SQL_TYPE_TIMESTAMP;
 
     if (streq(buf, "interval"))
@@ -433,7 +434,7 @@
 	streq(word[2], "time") && streq(word[3], "zone")) {
 	if (streq(word[0], "time"))
 	    return DB_SQL_TYPE_TIME;
-	if (streq(word[0], "timestamp"))
+	if (streq(word[0], "timestamp") || streq(word[0], "datetime"))
 	    return DB_SQL_TYPE_TIMESTAMP;
     }
 
@@ -457,7 +458,8 @@
 	return DB_SQL_TYPE_TIME;
 
     if (sscanf(buf, "timestamp ( %d )", length) == 1 ||
-	sscanf(buf, "timestamptz ( %d )", length) == 1)
+	sscanf(buf, "timestamptz ( %d )", length) == 1 ||
+	sscanf(buf, "datetime ( %d )", length) == 1 )
 	return DB_SQL_TYPE_TIMESTAMP;
 
     if (sscanf
@@ -467,7 +469,7 @@
 	streq(word[2], "time") && streq(word[3], "zone")) {
 	if (streq(word[0], "time"))
 	    return DB_SQL_TYPE_TIME;
-	if (streq(word[0], "timestamp"))
+	if (streq(word[0], "timestamp") || streq(word[0], "datetime"))
 	    return DB_SQL_TYPE_TIMESTAMP;
     }
 



More information about the grass-commit mailing list