[mapserver-commits] r12485 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:30:53 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:30:53 -0700 (Fri, 26 Aug 2011)
New Revision: 12485

Modified:
   trunk/mapserver/mapcache/src/cache_sqlite.c
Log:


Modified: trunk/mapserver/mapcache/src/cache_sqlite.c
===================================================================
--- trunk/mapserver/mapcache/src/cache_sqlite.c	2011-08-26 11:30:49 UTC (rev 12484)
+++ trunk/mapserver/mapcache/src/cache_sqlite.c	2011-08-26 11:30:53 UTC (rev 12485)
@@ -318,7 +318,12 @@
             geocache_grid_link *gridlink = APR_ARRAY_IDX(tileset->grid_links,i,geocache_grid_link*);
             geocache_grid *grid = gridlink->grid;
             char *dbname = _get_dbname(ctx,tileset,grid);
-            sqlite3_open(dbname, &db);
+            ret = sqlite3_open(dbname, &db);
+            if(ret != SQLITE_OK) {
+               ctx->set_error(ctx,500,"sqlite backend failed to open db %s: %s",dbname,sqlite3_errmsg(db));
+               sqlite3_close(db);
+               return;
+            }
             ret = sqlite3_exec(db, dcache->create_stmt.sql, 0, 0, &errmsg);
             if(ret != SQLITE_OK) {
                ctx->set_error(ctx,500,"sqlite backend failed to create tiles table: %s",sqlite3_errmsg(db));



More information about the mapserver-commits mailing list