[libgda/LIBGDA_4.0] Corrections to GdaSqlStatement's SQL rendering



commit dc8b267c14cdf5a46cbfadd1cbc22600629fc0e4
Author: Vivien Malerba <malerba gnome-db org>
Date:   Fri Jan 15 20:52:22 2010 +0100

    Corrections to GdaSqlStatement's SQL rendering

 providers/jdbc/gda-jdbc-provider.c                 |    6 +++++-
 providers/postgres/gda-postgres-provider.c         |    6 +++++-
 .../skel-implementation/capi/gda-capi-provider.c   |    8 +++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/providers/jdbc/gda-jdbc-provider.c b/providers/jdbc/gda-jdbc-provider.c
index 24d9d23..a51c99b 100644
--- a/providers/jdbc/gda-jdbc-provider.c
+++ b/providers/jdbc/gda-jdbc-provider.c
@@ -187,7 +187,8 @@ gda_jdbc_provider_class_init (GdaJdbcProviderClass *klass)
         provider_class->delete_savepoint = gda_jdbc_provider_delete_savepoint;
 
 	provider_class->create_parser = NULL;
-	provider_class->statement_to_sql = gda_jdbc_provider_statement_to_sql;
+	provider_class->statement_to_sql = NULL; /* don't use gda_jdbc_provider_statement_to_sql()
+						  * because it only calls gda_statement_to_sql_extended() */
 	provider_class->statement_prepare = gda_jdbc_provider_statement_prepare;
 	provider_class->statement_execute = gda_jdbc_provider_statement_execute;
 
@@ -1006,6 +1007,9 @@ gda_jdbc_provider_get_default_dbms_type (GdaServerProvider *provider, GdaConnect
  * 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 MUST NOT call gda_statement_to_sql_extended() if it is
+ *       the GdaServerProvider::statement_to_sql() virtual method's implementation
  */
 static gchar *
 gda_jdbc_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
diff --git a/providers/postgres/gda-postgres-provider.c b/providers/postgres/gda-postgres-provider.c
index 9502088..2555a01 100644
--- a/providers/postgres/gda-postgres-provider.c
+++ b/providers/postgres/gda-postgres-provider.c
@@ -212,7 +212,8 @@ gda_postgres_provider_class_init (GdaPostgresProviderClass *klass)
         provider_class->delete_savepoint = gda_postgres_provider_delete_savepoint;
 
 	provider_class->create_parser = gda_postgres_provider_create_parser;
-	provider_class->statement_to_sql = gda_postgres_provider_statement_to_sql;
+	provider_class->statement_to_sql = NULL; /* don't use gda_postgres_provider_statement_to_sql()
+						  * because it only calls gda_statement_to_sql_extended() */
 	provider_class->statement_prepare = gda_postgres_provider_statement_prepare;
 	provider_class->statement_execute = gda_postgres_provider_statement_execute;
 
@@ -1602,6 +1603,9 @@ gda_postgres_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 MUST NOT call gda_statement_to_sql_extended() if it is
+ *       the GdaServerProvider::statement_to_sql() virtual method's implementation
  */
 static gchar *
 gda_postgres_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,
diff --git a/providers/skel-implementation/capi/gda-capi-provider.c b/providers/skel-implementation/capi/gda-capi-provider.c
index 8a59f5f..ed609ac 100644
--- a/providers/skel-implementation/capi/gda-capi-provider.c
+++ b/providers/skel-implementation/capi/gda-capi-provider.c
@@ -185,7 +185,10 @@ gda_capi_provider_class_init (GdaCapiProviderClass *klass)
         provider_class->delete_savepoint = gda_capi_provider_delete_savepoint;
 
 	provider_class->create_parser = gda_capi_provider_create_parser;
-	provider_class->statement_to_sql = gda_capi_provider_statement_to_sql;
+	provider_class->statement_to_sql = NULL; /* don't use gda_capi_provider_statement_to_sql()
+						  * because it only calls gda_statement_to_sql_extended().
+						  * Set it to gda_capi_provider_statement_to_sql() if it does
+						  * not call calls gda_statement_to_sql_extended() */
 	provider_class->statement_prepare = gda_capi_provider_statement_prepare;
 	provider_class->statement_execute = gda_capi_provider_statement_execute;
 
@@ -883,6 +886,9 @@ gda_capi_provider_create_parser (GdaServerProvider *provider, GdaConnection *cnc
  * 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 MUST NOT call gda_statement_to_sql_extended() if it is
+ *       the GdaServerProvider::statement_to_sql() virtual method's implementation
  */
 static gchar *
 gda_capi_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection *cnc,



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