Skip to content

Commit 2d76de3

Browse files
author
esseffe
committedApr 11, 2009
fixed spatialite RTree issue
git-svn-id: http://svn.osgeo.org/qgis/trunk@10534 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d3a38b0 commit 2d76de3

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed
 

‎src/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ IF (WITH_INTERNAL_SPATIALITE)
132132
spatialite/spatialite.c
133133
)
134134

135-
INCLUDE_DIRECTORIES(spatialite/headers)
135+
INCLUDE_DIRECTORIES(spatialite/headers/spatialite)
136136
ENDIF (WITH_INTERNAL_SPATIALITE)
137137

138138
ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)

‎src/core/spatialite/spatialite.c

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
** of 5% are more are commonly seen when SQLite is compiled as a single
88
** translation unit.
99
**
10-
** This amalgamation was generated on 2009-04-06 09:20:53 +0200.
10+
** This amalgamation was generated on 2009-04-11 15:32:35 +0200.
1111

1212
Author: Alessandro (Sandro) Furieri <a.furieri@lqt.it>
1313

@@ -60,15 +60,13 @@ the terms of any one of the MPL, the GPL or the LGPL.
6060
#include <locale.h>
6161
#include <errno.h>
6262

63-
#include "headers/spatialite/sqlite3ext.h"
63+
#include "sqlite3ext.h"
6464

6565
#if defined(__MINGW32__) || defined(_WIN32)
6666
#define LIBICONV_STATIC
6767
#include <iconv.h>
6868
#define LIBCHARSET_STATIC
69-
#ifndef _MSC_VER
7069
#include <localcharset.h>
71-
#endif
7270
#else /* not WINDOWS */
7371
#ifdef __APPLE__
7472
#include <iconv.h>
@@ -1482,7 +1480,6 @@ gaiaCleanSqlString (char *value)
14821480

14831481
/* #include <spatialite/gaiaaux.h> */
14841482

1485-
#ifndef _MSC_VER
14861483
GAIAAUX_DECLARE const char *
14871484
gaiaGetLocaleCharset ()
14881485
{
@@ -1497,7 +1494,6 @@ gaiaGetLocaleCharset ()
14971494
#endif
14981495
#endif
14991496
}
1500-
#endif
15011497

15021498
GAIAAUX_DECLARE int
15031499
gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs)
@@ -14953,7 +14949,7 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table,
1495314949
{
1495414950
/* building MbrCache SpatialIndex */
1495514951
sprintf (trigger,
14956-
"CREATE VIRTUAL TABLE \"cache_%s_%s\" USING MbrCache(\"%s\", \"%s\")\n",
14952+
"CREATE VIRTUAL TABLE \"cache_%s_%s\" USING MbrCache(%s, %s)\n",
1495714953
curr_idx->TableName, curr_idx->ColumnName,
1495814954
curr_idx->TableName, curr_idx->ColumnName);
1495914955
ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg);
@@ -26642,7 +26638,7 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc,
2664226638
int geom_done;
2664326639
int err_geom = 0;
2664426640
int geom_constraint_err = 0;
26645-
char prefix;
26641+
char prefix[16];
2664626642
const char *text;
2664726643
const unsigned char *blob;
2664826644
char *text_wkt;
@@ -26655,20 +26651,20 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc,
2665526651
for (ic = 0; ic < p_vt->nColumns; ic++)
2665626652
{
2665726653
if (ic == 0)
26658-
prefix = '(';
26654+
strcpy(prefix, "(");
2665926655
else
26660-
prefix = ',';
26661-
sprintf (buf, "%c%s", prefix, *(p_vt->Column + ic));
26656+
strcpy(prefix, ", ");
26657+
sprintf (buf, "%s\"%s\"", prefix, *(p_vt->Column + ic));
2666226658
strcat (sql, buf);
2666326659
}
2666426660
strcat (sql, ") VALUES ");
2666526661
for (ic = 0; ic < p_vt->nColumns; ic++)
2666626662
{
2666726663
if (ic == 0)
26668-
prefix = '(';
26664+
strcpy(prefix, "(");
2666926665
else
26670-
prefix = ',';
26671-
sprintf (buf, "%c?", prefix);
26666+
strcpy(prefix, ", ");
26667+
sprintf (buf, "%s?", prefix);
2667226668
strcat (sql, buf);
2667326669
}
2667426670
strcat (sql, ")");
@@ -26828,7 +26824,7 @@ vfdo_update_row (VirtualFDOPtr p_vt, sqlite3_int64 rowid, int argc,
2682826824
int geom_done;
2682926825
int err_geom = 0;
2683026826
int geom_constraint_err = 0;
26831-
char prefix;
26827+
char prefix[16];
2683226828
const char *text;
2683326829
const unsigned char *blob;
2683426830
char *text_wkt;
@@ -26841,10 +26837,10 @@ vfdo_update_row (VirtualFDOPtr p_vt, sqlite3_int64 rowid, int argc,
2684126837
for (ic = 0; ic < p_vt->nColumns; ic++)
2684226838
{
2684326839
if (ic == 0)
26844-
prefix = ' ';
26840+
strcpy(prefix, " ");
2684526841
else
26846-
prefix = ',';
26847-
sprintf (buf, "\"%c%s\" = ?", prefix, *(p_vt->Column + ic));
26842+
strcpy(prefix, ", ");
26843+
sprintf (buf, "%s\"%s\" = ?", prefix, *(p_vt->Column + ic));
2684826844
strcat (sql, buf);
2684926845
}
2685026846
#if defined(_WIN32) || defined(__MINGW32__)
@@ -27258,7 +27254,7 @@ vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv,
2725827254
char **results;
2725927255
char sql[4096];
2726027256
char buf[256];
27261-
char prefix;
27257+
char prefix[16];
2726227258
VirtualFDOPtr p_vt = NULL;
2726327259
/* checking for table_name */
2726427260
if (argc == 4)
@@ -27388,10 +27384,10 @@ vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv,
2738827384
for (i = 0; i < p_vt->nColumns; i++)
2738927385
{
2739027386
if (i == 0)
27391-
prefix = '(';
27387+
strcpy(prefix, "(");
2739227388
else
27393-
prefix = ',';
27394-
sprintf (buf, "\"%c%s\" %s", prefix, *(p_vt->Column + i),
27389+
strcpy(prefix, ", ");
27390+
sprintf (buf, "%s\"%s\" %s", prefix, *(p_vt->Column + i),
2739527391
*(p_vt->Type + i));
2739627392
if (*(p_vt->NotNull + i))
2739727393
strcat (buf, " NOT NULL");

0 commit comments

Comments
 (0)
Please sign in to comment.