[libgda/LIBGDA_5.2] Fix virtual connection test suite using embedded SQLite version



commit a8068bfeb92635e230a4ea3d38ddf6707b7bf7ab
Author: Daniel Espinosa <esodan gmail com>
Date:   Sun Sep 23 11:22:46 2018 -0500

    Fix virtual connection test suite using embedded SQLite version
    
    Current embedded version doesn't support LIKE operator, so
    disabling unit tests using it.
    
    For system installed version, now is 3.10.2 minimum version is
    required.

 configure.ac                                     | 2 +-
 libgda/Gda-5.0.gir                               | 6 ------
 libgda/sqlite/virtual/gda-vprovider-data-model.c | 4 +++-
 tests/data-models/check_vcnc.c                   | 3 ++-
 4 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c9e2c7122..0bc1597f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -708,7 +708,7 @@ else
                [use_syst_sqlite=$enableval], [use_syst_sqlite="no"])
 
        if test "x$use_syst_sqlite" = "xyes"; then
-               SQLITE_MODULES="sqlite3 >= 3.6.11"
+               SQLITE_MODULES="sqlite3 >= 3.10.2"
                PKG_CHECK_MODULES(SQLITE, $SQLITE_MODULES, have_sqlite=yes, have_sqlite=no)
                if test x"$have_sqlite" = "xyes"
                then
diff --git a/libgda/Gda-5.0.gir b/libgda/Gda-5.0.gir
index e7361f41b..fe7a5f2b3 100644
--- a/libgda/Gda-5.0.gir
+++ b/libgda/Gda-5.0.gir
@@ -23655,12 +23655,6 @@ To include variables in the @sql string, see the
       <property name="column-error" transfer-ownership="none">
         <type name="gint" c:type="gint"/>
       </property>
-      <property name="debug"
-                readable="0"
-                writable="1"
-                transfer-ownership="none">
-        <type name="gboolean" c:type="gboolean"/>
-      </property>
       <property name="line-error" transfer-ownership="none">
         <type name="gint" c:type="gint"/>
       </property>
diff --git a/libgda/sqlite/virtual/gda-vprovider-data-model.c 
b/libgda/sqlite/virtual/gda-vprovider-data-model.c
index ff1c94bd6..2598cc543 100644
--- a/libgda/sqlite/virtual/gda-vprovider-data-model.c
+++ b/libgda/sqlite/virtual/gda-vprovider-data-model.c
@@ -1292,7 +1292,6 @@ map_sqlite3_info_to_gda_filter (sqlite3_index_info *info, GdaVconnectionDataMode
                        if (! info->aConstraint[i].usable)
                                continue;
 
-                       filter->aConstraint[j].iColumn = info->aConstraint[i].iColumn;
                        switch (info->aConstraint[i].op) {
                        case SQLITE_INDEX_CONSTRAINT_EQ:
                                filter->aConstraint[j].op = GDA_SQL_OPERATOR_TYPE_EQ;
@@ -1312,15 +1311,18 @@ map_sqlite3_info_to_gda_filter (sqlite3_index_info *info, GdaVconnectionDataMode
                        case SQLITE_INDEX_CONSTRAINT_MATCH:
                                filter->aConstraint[j].op = GDA_SQL_OPERATOR_TYPE_REGEXP;
                                break;
+#if HAVE_SQLITE
                        case SQLITE_INDEX_CONSTRAINT_LIKE:
                                filter->aConstraint[j].op = GDA_SQL_OPERATOR_TYPE_LIKE;
                                break;
                        case SQLITE_INDEX_CONSTRAINT_GLOB:
                                filter->aConstraint[j].op = GDA_SQL_OPERATOR_TYPE_GLOB;
                                break;
+#endif
                        default:
                                g_assert_not_reached ();
                        }
+                       filter->aConstraint[j].iColumn = info->aConstraint[i].iColumn;
 
                        filter->aConstraintUsage[j].argvIndex = 0;
                        filter->aConstraintUsage[j].omit = FALSE;
diff --git a/tests/data-models/check_vcnc.c b/tests/data-models/check_vcnc.c
index 9b8908bcf..d7cd5c894 100644
--- a/tests/data-models/check_vcnc.c
+++ b/tests/data-models/check_vcnc.c
@@ -90,8 +90,9 @@ main (int argc, char *argv[])
 
        g_print ("*** Copying data into 'countries' virtual table...\n");
        assert_run_sql_non_select (virtual, "INSERT INTO out.countries SELECT * FROM country", NULL);
-
+#if HAVE_SQLITE
        check_simultanous_select_random (virtual);
+#endif
        check_simultanous_select_forward (virtual);
        check_threads_select_random (virtual);
        check_date (virtual);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]