[libgda] Correction for bug #729057



commit 69ef86b62bae8e13059386fba2bde36c44f38d71
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun May 18 22:57:59 2014 +0200

    Correction for bug #729057

 providers/firebird/gda-firebird-provider.c         |    7 +++----
 providers/jdbc/gda-jdbc-provider.c                 |    5 ++---
 providers/postgres/gda-postgres-provider.c         |    5 ++---
 .../skel-implementation/capi/gda-capi-provider.c   |    5 +++--
 providers/web/gda-web-provider.c                   |    7 +++----
 5 files changed, 13 insertions(+), 16 deletions(-)
---
diff --git a/providers/firebird/gda-firebird-provider.c b/providers/firebird/gda-firebird-provider.c
index 05430f9..22f57ec 100644
--- a/providers/firebird/gda-firebird-provider.c
+++ b/providers/firebird/gda-firebird-provider.c
@@ -1086,22 +1086,21 @@ gda_firebird_provider_create_parser (GdaServerProvider *provider, GdaConnection
  * The implementation show here simply calls gda_statement_to_sql_extended() but the rendering
  * can be specialized to the database's SQL dialect, see the implementation of 
gda_statement_to_sql_extended()
  * and SQLite's specialized rendering for more details
+ *
+ * NOTE: This implementation can call gda_statement_to_sql_extended() _ONLY_ if it passes a %NULL @cnc 
argument
  */
 static gchar *
 gda_firebird_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
                                        GdaStatement *stmt, GdaSet *params, GdaStatementSqlFlag flags,
                                        GSList **params_used, GError **error)
 {
-       //gchar *str;
-       //GdaSqlRenderingContext context;
-       
        g_return_val_if_fail (GDA_IS_STATEMENT (stmt), NULL);
        if (cnc) {
                g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
                g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, NULL);
        }
 
-       return gda_statement_to_sql_extended (stmt, cnc, params, flags, params_used, error);
+       return gda_statement_to_sql_extended (stmt, NULL, params, flags, params_used, error);
 }
 
 
diff --git a/providers/jdbc/gda-jdbc-provider.c b/providers/jdbc/gda-jdbc-provider.c
index cf4f71e..4c7d680 100644
--- a/providers/jdbc/gda-jdbc-provider.c
+++ b/providers/jdbc/gda-jdbc-provider.c
@@ -1156,8 +1156,7 @@ gda_jdbc_provider_get_default_dbms_type (GdaServerProvider *provider, GdaConnect
  * can be specialized to the database's SQL dialect, see the implementation of 
gda_statement_to_sql_extended()
  * and SQLite's specialized rendering for more details
  *
- * NOTE: This implementation MUST NOT call gda_statement_to_sql_extended() if it is
- *       the GdaServerProvider::statement_to_sql() virtual method's implementation
+ * NOTE: This implementation can call gda_statement_to_sql_extended() _ONLY_ if it passes a %NULL @cnc 
argument
  */
 static gchar *
 gda_jdbc_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
@@ -1170,7 +1169,7 @@ gda_jdbc_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *
                g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, NULL);
        }
 
-       return gda_statement_to_sql_extended (stmt, cnc, params, flags, params_used, error);
+       return gda_statement_to_sql_extended (stmt, NULL, params, flags, params_used, error);
 }
 
 /*
diff --git a/providers/postgres/gda-postgres-provider.c b/providers/postgres/gda-postgres-provider.c
index 968e395..89de364 100644
--- a/providers/postgres/gda-postgres-provider.c
+++ b/providers/postgres/gda-postgres-provider.c
@@ -1572,8 +1572,7 @@ gda_postgres_provider_create_parser (G_GNUC_UNUSED GdaServerProvider *provider,
  * can be specialized to the database's SQL dialect, see the implementation of 
gda_statement_to_sql_extended()
  * and SQLite's specialized rendering for more details
  *
- * NOTE: This implementation MUST NOT call gda_statement_to_sql_extended() if it is
- *       the GdaServerProvider::statement_to_sql() virtual method's implementation
+ * NOTE: This implementation can call gda_statement_to_sql_extended() _ONLY_ if it passes a %NULL @cnc 
argument
  */
 static gchar *
 gda_postgres_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
@@ -1586,7 +1585,7 @@ gda_postgres_provider_statement_to_sql (GdaServerProvider *provider, GdaConnecti
                g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, NULL);
        }
 
-       return gda_statement_to_sql_extended (stmt, cnc, params, flags, params_used, error);
+       return gda_statement_to_sql_extended (stmt, NULL, params, flags, params_used, error);
 }
 
 static gboolean
diff --git a/providers/skel-implementation/capi/gda-capi-provider.c 
b/providers/skel-implementation/capi/gda-capi-provider.c
index 7065680..a14048a 100644
--- a/providers/skel-implementation/capi/gda-capi-provider.c
+++ b/providers/skel-implementation/capi/gda-capi-provider.c
@@ -989,7 +989,7 @@ gda_capi_provider_create_parser (G_GNUC_UNUSED GdaServerProvider *provider, G_GN
  * can be specialized to the database's SQL dialect, see the implementation of 
gda_statement_to_sql_extended()
  * and SQLite's specialized rendering for more details
  *
- * NOTE: The implementation MUST NOT call gda_statement_to_sql_extended() because this will end up in a loop.
+ * NOTE: This implementation can call gda_statement_to_sql_extended() _ONLY_ if it passes a %NULL @cnc 
argument
  */
 static gchar *
 gda_capi_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
@@ -1003,7 +1003,8 @@ gda_capi_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *
        }
 
        TO_IMPLEMENT;
-       return NULL;
+
+       return gda_statement_to_sql_extended (stmt, NULL, params, flags, params_used, error);
 }
 
 /*
diff --git a/providers/web/gda-web-provider.c b/providers/web/gda-web-provider.c
index 71fc321..a604570 100644
--- a/providers/web/gda-web-provider.c
+++ b/providers/web/gda-web-provider.c
@@ -1118,8 +1118,7 @@ gda_web_provider_create_parser (G_GNUC_UNUSED GdaServerProvider *provider, GdaCo
  * can be specialized to the database's SQL dialect, see the implementation of 
gda_statement_to_sql_extended()
  * and SQLite's specialized rendering for more details
  *
- * NOTE: This implementation MUST NOT call gda_statement_to_sql_extended() if it is
- *       the GdaServerProvider::statement_to_sql() virtual method's implementation
+ * NOTE: This implementation can call gda_statement_to_sql_extended() _ONLY_ if it passes a %NULL @cnc 
argument
  */
 static gchar *
 gda_web_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
@@ -1136,10 +1135,10 @@ gda_web_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *c
                cdata = (WebConnectionData*) gda_connection_internal_get_provider_data_error (cnc, error);
        }
        if (!cdata)
-               return gda_statement_to_sql_extended (stmt, cnc, params, flags, params_used, error);
+               return gda_statement_to_sql_extended (stmt, NULL, params, flags, params_used, error);
 
        /*TO_IMPLEMENT;*/
-       return gda_statement_to_sql_extended (stmt, cnc, params, flags, params_used, error);
+       return gda_statement_to_sql_extended (stmt, NULL, params, flags, params_used, error);
 }
 
 static const gchar*


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