[Git][debian-gis-team/spatialite][experimental] 4 commits: New upstream version 5.0.1~rc1

Bas Couwenberg gitlab at salsa.debian.org
Fri Feb 5 06:04:38 GMT 2021



Bas Couwenberg pushed to branch experimental at Debian GIS Project / spatialite


Commits:
c28784fa by Bas Couwenberg at 2021-02-05T06:42:38+01:00
New upstream version 5.0.1~rc1
- - - - -
0f29eecc by Bas Couwenberg at 2021-02-05T06:43:20+01:00
Update upstream source from tag 'upstream/5.0.1_rc1'

Update to upstream version '5.0.1~rc1'
with Debian dir c4ab33fb10436ee70d87d24bac8a9332b43080ca
- - - - -
b98af1c0 by Bas Couwenberg at 2021-02-05T06:45:30+01:00
New upstream release candidate.

- - - - -
2656dcc4 by Bas Couwenberg at 2021-02-05T06:46:39+01:00
Set distribution to experimental.

- - - - -


14 changed files:

- config.h
- configure
- configure.ac
- debian/changelog
- fakeconfig.h
- src/Makefile.am
- src/Makefile.in
- src/headers/spatialite/gaiaconfig-msvc.h
- src/headers/spatialite/gaiaconfig.h
- src/shapefiles/shapefiles.c
- src/spatialite/virtualXL.c
- src/spatialite/virtualdbf.c
- src/spatialite/virtualgeojson.c
- src/spatialite/virtualshape.c


Changes:

=====================================
config.h
=====================================
@@ -153,7 +153,7 @@
 #define PACKAGE_NAME "libspatialite"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libspatialite 5.0.1-rc0"
+#define PACKAGE_STRING "libspatialite 5.0.1-rc1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libspatialite"
@@ -162,7 +162,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "5.0.1-rc0"
+#define PACKAGE_VERSION "5.0.1-rc1"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1


=====================================
configure
=====================================
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libspatialite 5.0.1-rc0.
+# Generated by GNU Autoconf 2.69 for libspatialite 5.0.1-rc1.
 #
 # Report bugs to <a.furieri at lqt.it>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libspatialite'
 PACKAGE_TARNAME='libspatialite'
-PACKAGE_VERSION='5.0.1-rc0'
-PACKAGE_STRING='libspatialite 5.0.1-rc0'
+PACKAGE_VERSION='5.0.1-rc1'
+PACKAGE_STRING='libspatialite 5.0.1-rc1'
 PACKAGE_BUGREPORT='a.furieri at lqt.it'
 PACKAGE_URL=''
 
@@ -1371,7 +1371,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libspatialite 5.0.1-rc0 to adapt to many kinds of systems.
+\`configure' configures libspatialite 5.0.1-rc1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1441,7 +1441,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libspatialite 5.0.1-rc0:";;
+     short | recursive ) echo "Configuration of libspatialite 5.0.1-rc1:";;
    esac
   cat <<\_ACEOF
 
@@ -1471,12 +1471,13 @@ Optional Features:
   --enable-freexl         enables FreeXL inclusion [default=yes]
   --enable-epsg           enables full EPSG dataset support [default=yes]
   --enable-geos           enables GEOS inclusion [default=yes]
-  --enable-gcp            enables Control Points (from Grass GIS) [default=no]
+  --enable-gcp            enables Control Points (from Grass GIS)
+                          [default=yes]
   --enable-geosadvanced   enables GEOS advanced features [default=yes]
   --enable-geosreentrant  enables GEOS reentrant (fully thread safe)
                           [default=yes]
   --enable-geos370        enables GEOS 3.7.0 features [default=yes]
-  --enable-rttopo         enables RTTOPO support [default=no]
+  --enable-rttopo         enables RTTOPO support [default=yes]
   --enable-libxml2        enables libxml2 inclusion [default=yes]
   --enable-minizip        enables MiniZIP inclusion [default=yes]
   --enable-geopackage     enables GeoPackage support [default=yes]
@@ -1585,7 +1586,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libspatialite configure 5.0.1-rc0
+libspatialite configure 5.0.1-rc1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2175,7 +2176,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libspatialite $as_me 5.0.1-rc0, which was
+It was created by libspatialite $as_me 5.0.1-rc1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3046,7 +3047,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libspatialite'
- VERSION='5.0.1-rc0'
+ VERSION='5.0.1-rc1'
 
 
 # Some tools Automake needs.
@@ -18279,7 +18280,7 @@ fi
 if test "${enable_gcp+set}" = set; then :
   enableval=$enable_gcp;
 else
-  enable_gcp=no
+  enable_gcp=yes
 fi
 
   if test x"$enable_gcp" != "xno"; then
@@ -18529,7 +18530,7 @@ fi
 if test "${enable_rttopo+set}" = set; then :
   enableval=$enable_rttopo;
 else
-  enable_rttopo=no
+  enable_rttopo=yes
 fi
 
   if test x"$enable_rttopo" != "xno"; then
@@ -19590,7 +19591,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libspatialite $as_me 5.0.1-rc0, which was
+This file was extended by libspatialite $as_me 5.0.1-rc1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19656,7 +19657,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libspatialite config.status 5.0.1-rc0
+libspatialite config.status 5.0.1-rc1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 


=====================================
configure.ac
=====================================
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT(libspatialite, 5.0.1-rc0, a.furieri at lqt.it)
+AC_INIT(libspatialite, 5.0.1-rc1, a.furieri at lqt.it)
 AC_LANG(C)
 AC_CONFIG_MACRO_DIR([m4])
 
@@ -357,8 +357,8 @@ if test x"$enable_geos" != "xno"; then
   #   --enable-controlpoints
   #
   AC_ARG_ENABLE(gcp, [AS_HELP_STRING(
-	  [--enable-gcp], [enables Control Points (from Grass GIS) [default=no]])],
-	  [], [enable_gcp=no])
+	  [--enable-gcp], [enables Control Points (from Grass GIS) [default=yes]])],
+	  [], [enable_gcp=yes])
   if test x"$enable_gcp" != "xno"; then
 	  AC_DEFINE(ENABLE_GCP)
   fi
@@ -410,8 +410,8 @@ if test x"$enable_geos" != "xno"; then
   #   --enable-rttopo
   #
   AC_ARG_ENABLE(rttopo, [AS_HELP_STRING(
-	  [--enable-rttopo], [enables RTTOPO support [default=no]])],
-	  [], [enable_rttopo=no])
+	  [--enable-rttopo], [enables RTTOPO support [default=yes]])],
+	  [], [enable_rttopo=yes])
   if test x"$enable_rttopo" != "xno"; then
 	  AC_CHECK_HEADERS(librttopo.h,, [AC_MSG_ERROR([cannot find librttopo.h, bailing out])])
 	  AC_SEARCH_LIBS(rtt_AddLineNoFace,rttopo,,AC_MSG_ERROR(['librttopo' (>= v.1.1.0) is required but it doesn't seem to be installed on this system. You may need to try re-running configure with a --disable-rttopo parameter.]))


=====================================
debian/changelog
=====================================
@@ -1,8 +1,9 @@
-spatialite (5.0.1~rc0-1~exp2) UNRELEASED; urgency=medium
+spatialite (5.0.1~rc1-1~exp1) experimental; urgency=medium
 
+  * New upstream release candidate.
   * Update upstream metadata.
 
- -- Bas Couwenberg <sebastic at debian.org>  Tue, 26 Jan 2021 18:11:44 +0100
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 05 Feb 2021 06:46:23 +0100
 
 spatialite (5.0.1~rc0-1~exp1) experimental; urgency=medium
 


=====================================
fakeconfig.h
=====================================
@@ -204,7 +204,7 @@
 #define PACKAGE_NAME "libspatialite"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libspatialite 5.0.1-rc0"
+#define PACKAGE_STRING "libspatialite 5.0.1-rc1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libspatialite"
@@ -213,7 +213,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "5.0.1-rc0"
+#define PACKAGE_VERSION "5.0.1-rc1"
 
 /* Should be defined in order to enable PROJ.6 support. */
 #define PROJ_NEW 1
@@ -222,7 +222,7 @@
 #define SPATIALITE_TARGET_CPU "x86_64-redhat-linux"
 
 /* the Version of this package. */
-#define SPATIALITE_VERSION "5.0.1-rc0"
+#define SPATIALITE_VERSION "5.0.1-rc1"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1


=====================================
src/Makefile.am
=====================================
@@ -52,10 +52,10 @@ libspatialite_la_LDFLAGS = -version-info 4:4:0 -no-undefined
 libspatialite_la_LIBADD += -lm
 else 
 if ANDROID
-libspatialite_la_LDFLAGS = -version-info 8:1:1
+libspatialite_la_LDFLAGS = -version-info 8:2:1
 libspatialite_la_LIBADD += -ldl -lm
 else
-libspatialite_la_LDFLAGS = -version-info 8:1:1
+libspatialite_la_LDFLAGS = -version-info 8:2:1
 libspatialite_la_LIBADD += -lpthread -ldl -lm
 endif
 endif


=====================================
src/Makefile.in
=====================================
@@ -455,8 +455,8 @@ libspatialite_la_LIBADD = ./gaiaaux/libgaiaaux.la \
 	./connection_cache/libconnection_cache.la \
 	./virtualtext/libvirtualtext.la ./wfs/libwfs.la @LIBXML2_LIBS@ \
 	$(am__append_1) $(am__append_2) $(am__append_3)
- at ANDROID_FALSE@@MINGW_FALSE at libspatialite_la_LDFLAGS = -version-info 8:1:1
- at ANDROID_TRUE@@MINGW_FALSE at libspatialite_la_LDFLAGS = -version-info 8:1:1
+ at ANDROID_FALSE@@MINGW_FALSE at libspatialite_la_LDFLAGS = -version-info 8:2:1
+ at ANDROID_TRUE@@MINGW_FALSE at libspatialite_la_LDFLAGS = -version-info 8:2:1
 @MINGW_TRUE at libspatialite_la_LDFLAGS = -version-info 4:4:0 -no-undefined
 mod_spatialite_la_SOURCES = versioninfo/version.c
 mod_spatialite_la_LIBADD = ./gaiaaux/gaiaaux.la ./gaiaexif/gaiaexif.la \


=====================================
src/headers/spatialite/gaiaconfig-msvc.h
=====================================
@@ -53,4 +53,4 @@
 #define PROJ_NEW 1
 
 /* the Version of this package */
-#define SPATIALITE_VERSION "5.0.1-rc0"
+#define SPATIALITE_VERSION "5.0.1-rc1"


=====================================
src/headers/spatialite/gaiaconfig.h
=====================================
@@ -59,4 +59,4 @@
 #define SPATIALITE_TARGET_CPU "x86_64-redhat-linux"
 
 /* the Version of this package */
-#define SPATIALITE_VERSION "5.0.1-rc0"
+#define SPATIALITE_VERSION "5.0.1-rc1"


=====================================
src/shapefiles/shapefiles.c
=====================================
@@ -554,8 +554,8 @@ do_check_shp_unique_pk_values (sqlite3 * sqlite, gaiaShapefilePtr shp, int srid,
 			    ok_insert = 1;
 			    sqlite3_bind_text (stmt, 1,
 					       dbf_field->Value->TxtValue,
-					       strlen (dbf_field->Value->
-						       TxtValue),
+					       strlen (dbf_field->
+						       Value->TxtValue),
 					       SQLITE_STATIC);
 			}
 		      else if (pk_type == SQLITE_FLOAT)
@@ -1510,8 +1510,9 @@ load_shapefile_common (struct zip_mem_shapefile *mem_shape, sqlite3 * sqlite,
 		      if (pk_type == SQLITE_TEXT)
 			  sqlite3_bind_text (stmt, 1,
 					     dbf_field->Value->TxtValue,
-					     strlen (dbf_field->Value->
-						     TxtValue), SQLITE_STATIC);
+					     strlen (dbf_field->
+						     Value->TxtValue),
+					     SQLITE_STATIC);
 		      else if (pk_type == SQLITE_FLOAT)
 			  sqlite3_bind_double (stmt, 1,
 					       dbf_field->Value->DblValue);
@@ -1552,8 +1553,8 @@ load_shapefile_common (struct zip_mem_shapefile *mem_shape, sqlite3 * sqlite,
 			case GAIA_TEXT_VALUE:
 			    sqlite3_bind_text (stmt, cnt + 2,
 					       dbf_field->Value->TxtValue,
-					       strlen (dbf_field->Value->
-						       TxtValue),
+					       strlen (dbf_field->
+						       Value->TxtValue),
 					       SQLITE_STATIC);
 			    break;
 			default:
@@ -1715,8 +1716,8 @@ do_check_dbf_unique_pk_values (sqlite3 * sqlite, gaiaDbfPtr dbf, int text_dates,
 			    ok_insert = 1;
 			    sqlite3_bind_text (stmt, 1,
 					       dbf_field->Value->TxtValue,
-					       strlen (dbf_field->Value->
-						       TxtValue),
+					       strlen (dbf_field->
+						       Value->TxtValue),
 					       SQLITE_STATIC);
 			}
 		      else if (pk_type == SQLITE_FLOAT)
@@ -2231,8 +2232,9 @@ load_dbf_common (struct zip_mem_shapefile *mem_shape, sqlite3 * sqlite,
 		      if (pk_type == SQLITE_TEXT)
 			  sqlite3_bind_text (stmt, 1,
 					     dbf_field->Value->TxtValue,
-					     strlen (dbf_field->Value->
-						     TxtValue), SQLITE_STATIC);
+					     strlen (dbf_field->
+						     Value->TxtValue),
+					     SQLITE_STATIC);
 		      else if (pk_type == SQLITE_FLOAT)
 			  sqlite3_bind_double (stmt, 1,
 					       dbf_field->Value->DblValue);
@@ -2273,8 +2275,8 @@ load_dbf_common (struct zip_mem_shapefile *mem_shape, sqlite3 * sqlite,
 			case GAIA_TEXT_VALUE:
 			    sqlite3_bind_text (stmt, cnt + 2,
 					       dbf_field->Value->TxtValue,
-					       strlen (dbf_field->Value->
-						       TxtValue),
+					       strlen (dbf_field->
+						       Value->TxtValue),
 					       SQLITE_STATIC);
 			    break;
 			default:
@@ -2822,24 +2824,25 @@ do_read_zipfile_file (unzFile uf, struct zip_mem_shapefile *mem_shape, int wich)
     is_open = 1;
     rd_cnt = 0;
     while (rd_cnt < size_buf)
-    {
-		/* reading big chunks so to avoid large file issues */
-		uint32_t max = 1000000000;	/* max chunk size */
-		uint32_t len;
-		unrd_cnt = size_buf - rd_cnt;
-		if (unrd_cnt < max)
-			len = unrd_cnt;
-		else
-			len = max;
-		err = unzReadCurrentFile (uf, buf+rd_cnt, len);
-		if (err < 0)
-		  {
-		  spatialite_e ("Error %d with zipfile in unzReadCurrentFile\n", err);
-		  retval = 0;
-		  goto skip;
-		  }
-		  rd_cnt += len;
-	}
+      {
+	  /* reading big chunks so to avoid large file issues */
+	  uint32_t max = 1000000000;	/* max chunk size */
+	  uint32_t len;
+	  unrd_cnt = size_buf - rd_cnt;
+	  if (unrd_cnt < max)
+	      len = unrd_cnt;
+	  else
+	      len = max;
+	  err = unzReadCurrentFile (uf, buf + rd_cnt, len);
+	  if (err < 0)
+	    {
+		spatialite_e ("Error %d with zipfile in unzReadCurrentFile\n",
+			      err);
+		retval = 0;
+		goto skip;
+	    }
+	  rd_cnt += len;
+      }
     mem_file->buf = buf;
     mem_file->size = size_buf;
 
@@ -5837,6 +5840,55 @@ do_check_geometry (sqlite3 * sqlite, const char *table, const char *geom_col,
 			       table, geom_col);
     ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg);
     sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  spatialite_e ("dump GeoJSON2 MetaData error: <%s>\n", errMsg);
+	  sqlite3_free (errMsg);
+	  return 0;
+      }
+    if (rows == 1)
+	goto ok;
+
+/* it could be a possible Spatial View */
+    if (geom_col == NULL)
+	sql =
+	    sqlite3_mprintf
+	    ("SELECT g.f_geometry_column, g.srid, g.geometry_type "
+	     "FROM views_geometry_columns AS v "
+	     "JOIN geometry_columns AS g ON (v.f_table_name = g.f_table_name) "
+	     "WHERE Lower(v.view_name) = Lower(%Q)", table);
+    else
+	sql =
+	    sqlite3_mprintf
+	    ("SELECT g.f_geometry_column, g.srid, g.geometry_type "
+	     "FROM views_geometry_columns AS v "
+	     "JOIN geometry_columns AS g ON (v.f_table_name = g.f_table_name) "
+	     "WHERE Lower(v.view_name) = Lower(%Q) AND "
+	     "Lower(v.view_geometry) = Lower(%Q)", table, geom_col);
+    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg);
+    sqlite3_free (sql);
+    if (ret != SQLITE_OK)
+      {
+	  spatialite_e ("dump GeoJSON2 MetaData error: <%s>\n", errMsg);
+	  sqlite3_free (errMsg);
+	  return 0;
+      }
+    if (rows == 1)
+	goto ok;
+
+/* it could be a possible Spatial Virtual Table */
+    if (geom_col == NULL)
+	sql = sqlite3_mprintf ("SELECT virt_geometry, srid, geometry_type "
+			       "FROM virts_geometry_columns "
+			       "WHERE Lower(virt_name) = Lower(%Q)", table);
+    else
+	sql = sqlite3_mprintf ("SELECT virt_geometry, srid, geometry_type "
+			       "FROM virts_geometry_columns "
+			       "WHERE Lower(virt_name) = Lower(%Q) AND "
+			       "Lower(virt_geometry) = Lower(%Q)",
+			       table, geom_col);
+    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg);
+    sqlite3_free (sql);
     if (ret != SQLITE_OK)
       {
 	  spatialite_e ("dump GeoJSON2 MetaData error: <%s>\n", errMsg);
@@ -5845,6 +5897,8 @@ do_check_geometry (sqlite3 * sqlite, const char *table, const char *geom_col,
       }
     if (rows != 1)
 	goto error;
+
+  ok:
     for (i = 1; i <= rows; i++)
       {
 	  int gtype;
@@ -5984,7 +6038,7 @@ do_prepare_sql (sqlite3 * sqlite, const char *table, const char *geom_col,
 		      /* exporting eventual M-Values */
 		      sql =
 			  sqlite3_mprintf
-			  ("SELECT AsGeoJSON(ST_Transform(ST_ForcePolygonCCW(\"%s\", 4326)), %d)",
+			  ("SELECT AsGeoJSON(ST_Transform(ST_ForcePolygonCCW(\"%s\"), 4326), %d)",
 			   x_col, precision);
 		  }
 		else
@@ -6010,7 +6064,7 @@ do_prepare_sql (sqlite3 * sqlite, const char *table, const char *geom_col,
 			    /* unchanged dimensions */
 			    sql =
 				sqlite3_mprintf
-				("SELECT AsGeoJSON(ST_Transform(ST_ForcePolygonCCW(\"%s\", 4326)), %d)",
+				("SELECT AsGeoJSON(ST_Transform(ST_ForcePolygonCCW(\"%s\"), 4326), %d)",
 				 x_col, precision);
 			}
 		  }
@@ -8517,8 +8571,8 @@ load_XL (sqlite3 * sqlite, const char *path, const char *table,
 						     cell.value.int_value);
 			    else if (cell.type == FREEXL_CELL_DOUBLE)
 				dummy = sqlite3_mprintf ("%1.2f ",
-							 cell.value.
-							 double_value);
+							 cell.
+							 value.double_value);
 			    else if (cell.type == FREEXL_CELL_TEXT
 				     || cell.type == FREEXL_CELL_SST_TEXT
 				     || cell.type == FREEXL_CELL_DATE
@@ -8529,8 +8583,8 @@ load_XL (sqlite3 * sqlite, const char *path, const char *table,
 				  if (len < 256)
 				      dummy =
 					  sqlite3_mprintf ("%s",
-							   cell.value.
-							   text_value);
+							   cell.
+							   value.text_value);
 				  else
 				      dummy = sqlite3_mprintf ("col_%d", col);
 			      }


=====================================
src/spatialite/virtualXL.c
=====================================
@@ -556,6 +556,18 @@ vXL_eval_constraints (VirtualXLCursorPtr cursor)
 				     (unsigned short) pC->iColumn - 1, &cell);
 	  else
 	      cell.type = FREEXL_CELL_NULL;
+	  if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNULL)
+	    {
+		if (cell.type == FREEXL_CELL_NULL)
+		    ok = 1;
+		goto done;
+	    }
+	  if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNOTNULL)
+	    {
+		if (cell.type != FREEXL_CELL_NULL)
+		    ok = 1;
+		goto done;
+	    }
 	  if (cell.type == FREEXL_CELL_INT)
 	    {
 		if (pC->valueType == 'I')


=====================================
src/spatialite/virtualdbf.c
=====================================
@@ -552,6 +552,16 @@ vdbf_eval_constraints (VirtualDbfCursorPtr cursor)
 	  if (pC->iColumn == 0)
 	    {
 		/* the PRIMARY KEY column */
+		if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNULL)
+		  {
+		      ok = 0;
+		      goto done;
+		  }
+		if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNOTNULL)
+		  {
+		      ok = 1;
+		      goto done;
+		  }
 		if (pC->valueType == 'I')
 		  {
 		      switch (pC->op)
@@ -592,6 +602,19 @@ vdbf_eval_constraints (VirtualDbfCursorPtr cursor)
 		  {
 		      if ((pFld->Value))
 			{
+			    switch (pC->op)
+			      {
+			      case SQLITE_INDEX_CONSTRAINT_ISNULL:
+				  if (pFld->Value->Type == GAIA_NULL_VALUE)
+				      ok = 1;
+				  break;
+			      case SQLITE_INDEX_CONSTRAINT_ISNOTNULL:
+				  if (pFld->Value->Type != GAIA_NULL_VALUE)
+				      ok = 1;
+				  break;
+			      };
+			    if (ok)
+				break;
 			    switch (pFld->Value->Type)
 			      {
 			      case GAIA_INT_VALUE:


=====================================
src/spatialite/virtualgeojson.c
=====================================
@@ -2922,6 +2922,16 @@ vgeojson_eval_constraints (VirtualGeoJsonCursorPtr cursor)
 	  if (pC->iColumn == 0)
 	    {
 		/* the PRIMARY KEY column */
+		if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNULL)
+		  {
+		      ok = 0;
+		      goto done;
+		  }
+		if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNOTNULL)
+		  {
+		      ok = 1;
+		      goto done;
+		  }
 		if (pC->valueType == 'I')
 		  {
 		      switch (pC->op)
@@ -2954,6 +2964,32 @@ vgeojson_eval_constraints (VirtualGeoJsonCursorPtr cursor)
 		  }
 		goto done;
 	    }
+	  if (pC->iColumn == 1)
+	    {
+		/* the Geometry column */
+		if (cursor->Feature != NULL)
+		  {
+		      switch (pC->op)
+			{
+			case SQLITE_INDEX_CONSTRAINT_ISNULL:
+			    if (cursor->Feature->geometry == NULL)
+				ok = 1;
+			    break;
+			case SQLITE_INDEX_CONSTRAINT_ISNOTNULL:
+			    if (cursor->Feature->geometry != NULL)
+				ok = 1;
+			    break;
+			};
+
+		  }
+		else
+		  {
+		      if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNULL)
+			  ok = 1;
+		  }
+		goto done;
+	    }
+	  /* any other ordinary column */
 	  nCol = 2;
 	  col = cursor->pVtab->Parser->first_col;
 	  while (col)
@@ -2976,6 +3012,19 @@ vgeojson_eval_constraints (VirtualGeoJsonCursorPtr cursor)
 		      col = col->next;
 		      continue;
 		  }
+		switch (pC->op)
+		  {
+		  case SQLITE_INDEX_CONSTRAINT_ISNULL:
+		      if (prop->type == GEOJSON_NULL)
+			  ok = 1;
+		      break;
+		  case SQLITE_INDEX_CONSTRAINT_ISNOTNULL:
+		      if (prop->type != GEOJSON_NULL)
+			  ok = 1;
+		      break;
+		  };
+		if (ok)
+		    break;
 		switch (prop->type)
 		  {
 		  case GEOJSON_INTEGER:


=====================================
src/spatialite/virtualshape.c
=====================================
@@ -904,6 +904,16 @@ vshp_eval_constraints (VirtualShapeCursorPtr cursor)
 	  if (pC->iColumn == 0)
 	    {
 		/* the PRIMARY KEY column */
+		if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNULL)
+		  {
+		      ok = 0;
+		      goto done;
+		  }
+		if (pC->op == SQLITE_INDEX_CONSTRAINT_ISNOTNULL)
+		  {
+		      ok = 1;
+		      goto done;
+		  }
 		if (pC->valueType == 'I')
 		  {
 		      switch (pC->op)
@@ -936,6 +946,32 @@ vshp_eval_constraints (VirtualShapeCursorPtr cursor)
 		  }
 		goto done;
 	    }
+	  /* the Geometry column */
+	  nCol = 1;
+	  pFld = cursor->pVtab->Shp->Dbf->First;
+	  while (pFld)
+	    {
+		if (nCol == pC->iColumn)
+		  {
+		      if ((pFld->Value))
+			{
+			    switch (pC->op)
+			      {
+			      case SQLITE_INDEX_CONSTRAINT_ISNULL:
+				  if (pFld->Value->Type == GAIA_NULL_VALUE)
+				      ok = 1;
+				  break;
+			      case SQLITE_INDEX_CONSTRAINT_ISNOTNULL:
+				  if (pFld->Value->Type != GAIA_NULL_VALUE)
+				      ok = 1;
+				  break;
+			      };
+			}
+		      goto done;
+		  }
+		pFld = pFld->Next;
+	    }
+	  /* any other ordinary column */
 	  nCol = 2;
 	  pFld = cursor->pVtab->Shp->Dbf->First;
 	  while (pFld)
@@ -944,6 +980,19 @@ vshp_eval_constraints (VirtualShapeCursorPtr cursor)
 		  {
 		      if ((pFld->Value))
 			{
+			    switch (pC->op)
+			      {
+			      case SQLITE_INDEX_CONSTRAINT_ISNULL:
+				  if (pFld->Value->Type == GAIA_NULL_VALUE)
+				      ok = 1;
+				  break;
+			      case SQLITE_INDEX_CONSTRAINT_ISNOTNULL:
+				  if (pFld->Value->Type != GAIA_NULL_VALUE)
+				      ok = 1;
+				  break;
+			      };
+			    if (ok)
+				break;
 			    switch (pFld->Value->Type)
 			      {
 			      case GAIA_INT_VALUE:
@@ -1095,9 +1144,8 @@ vshp_eval_constraints (VirtualShapeCursorPtr cursor)
 					  case SQLITE_INDEX_CONSTRAINT_LIKE:
 					      ret =
 						  sqlite3_strlike (pC->txtValue,
-								   pFld->
-								   Value->TxtValue,
-								   0);
+								   pFld->Value->
+								   TxtValue, 0);
 					      if (ret == 0)
 						  ok = 1;
 					      break;
@@ -1169,6 +1217,11 @@ vshp_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr,
 		    strcpy (pC->txtValue,
 			    (char *) sqlite3_value_text (argv[i]));
 	    }
+	  if (sqlite3_value_type (argv[i]) == SQLITE_BLOB)
+	    {
+		pC->valueType = 'B';
+		fprintf (stderr, "cmp BLOB\n");
+	    }
 	  if (cursor->firstConstraint == NULL)
 	      cursor->firstConstraint = pC;
 	  if (cursor->lastConstraint != NULL)



View it on GitLab: https://salsa.debian.org/debian-gis-team/spatialite/-/compare/f99d3ea4fbbd6ee827a622f35beb0ea908241b00...2656dcc4ea831ae3ea7687538efbdc08cfc9c260

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/spatialite/-/compare/f99d3ea4fbbd6ee827a622f35beb0ea908241b00...2656dcc4ea831ae3ea7687538efbdc08cfc9c260
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210205/6bff9eb8/attachment-0001.html>


More information about the Pkg-grass-devel mailing list