[libgda/LIBGDA_5.2] Added support for GLOB operator in virtual provider



commit 3b6047fee7a76aecba4ab06be6e26c0b25d860f1
Author: Daniel Espinosa <esodan gmail com>
Date:   Sun Sep 23 02:14:43 2018 -0500

    Added support for GLOB operator in virtual provider

 libgda/Gda-5.0.gir                               | 2 ++
 libgda/gda-statement.c                           | 3 +++
 libgda/sql-parser/gda-statement-struct-parts.h   | 3 ++-
 libgda/sqlite/virtual/gda-vprovider-data-model.c | 3 +++
 4 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/libgda/Gda-5.0.gir b/libgda/Gda-5.0.gir
index fdb74719a..e7361f41b 100644
--- a/libgda/Gda-5.0.gir
+++ b/libgda/Gda-5.0.gir
@@ -23511,6 +23511,8 @@ This structure represents the name of a table's field.</doc>
               value="32"
               c:identifier="GDA_SQL_OPERATOR_TYPE_NOTILIKE">
       </member>
+      <member name="glob" value="33" c:identifier="GDA_SQL_OPERATOR_TYPE_GLOB">
+      </member>
     </enumeration>
     <class name="SqlParser"
            c:symbol-prefix="sql_parser"
diff --git a/libgda/gda-statement.c b/libgda/gda-statement.c
index 08bea9b85..1b1220065 100644
--- a/libgda/gda-statement.c
+++ b/libgda/gda-statement.c
@@ -1951,6 +1951,9 @@ default_render_operation (GdaSqlOperation *op, GdaSqlRenderingContext *context,
        case GDA_SQL_OPERATOR_TYPE_OR:
                multi_op = "OR";
                break;
+       case GDA_SQL_OPERATOR_TYPE_GLOB:
+               str = g_strdup_printf ("%s GLOB %s", SQL_OPERAND (sql_list->data)->sql, SQL_OPERAND 
(sql_list->next->data)->sql);
+               break;
        default:
                g_assert_not_reached ();
                break;
diff --git a/libgda/sql-parser/gda-statement-struct-parts.h b/libgda/sql-parser/gda-statement-struct-parts.h
index 956feec34..768011e65 100644
--- a/libgda/sql-parser/gda-statement-struct-parts.h
+++ b/libgda/sql-parser/gda-statement-struct-parts.h
@@ -315,7 +315,8 @@ typedef enum {
        GDA_SQL_OPERATOR_TYPE_ILIKE,
 
        GDA_SQL_OPERATOR_TYPE_NOTLIKE,
-       GDA_SQL_OPERATOR_TYPE_NOTILIKE
+       GDA_SQL_OPERATOR_TYPE_NOTILIKE,
+       GDA_SQL_OPERATOR_TYPE_GLOB
 } GdaSqlOperatorType;
 
 /**
diff --git a/libgda/sqlite/virtual/gda-vprovider-data-model.c 
b/libgda/sqlite/virtual/gda-vprovider-data-model.c
index 8c1f2a8d3..ff1c94bd6 100644
--- a/libgda/sqlite/virtual/gda-vprovider-data-model.c
+++ b/libgda/sqlite/virtual/gda-vprovider-data-model.c
@@ -1315,6 +1315,9 @@ map_sqlite3_info_to_gda_filter (sqlite3_index_info *info, GdaVconnectionDataMode
                        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;
                        default:
                                g_assert_not_reached ();
                        }


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