[libgda] Fixed a crash case in the GdaThreadProvider
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Fixed a crash case in the GdaThreadProvider
- Date: Mon, 12 Jul 2010 20:21:10 +0000 (UTC)
commit c4b350317686ec2d09852796a5e7c0ba6bb55b7f
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Jul 12 19:33:39 2010 +0200
Fixed a crash case in the GdaThreadProvider
libgda/thread-wrapper/gda-thread-provider.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/libgda/thread-wrapper/gda-thread-provider.c b/libgda/thread-wrapper/gda-thread-provider.c
index 4d406e4..bc5d675 100644
--- a/libgda/thread-wrapper/gda-thread-provider.c
+++ b/libgda/thread-wrapper/gda-thread-provider.c
@@ -1429,13 +1429,18 @@ typedef struct {
GSList **params_used;
} StmtToSqlData;
-static const gchar *
+static gchar *
sub_thread_statement_to_sql (StmtToSqlData *data, GError **error)
{
/* WARNING: function executed in sub thread! */
- const gchar *retval;
- retval = PROV_CLASS (data->prov)->statement_to_sql (data->prov, data->cnc, data->stmt,
- data->params, data->flags, data->params_used, error);
+ gchar *retval;
+ if (PROV_CLASS (data->prov)->statement_to_sql)
+ retval = PROV_CLASS (data->prov)->statement_to_sql (data->prov, data->cnc, data->stmt,
+ data->params, data->flags, data->params_used, error);
+ else
+ retval = gda_statement_to_sql_extended (data->stmt, data->cnc, data->params, data->flags, data->params_used,
+ error);
+
#ifdef GDA_DEBUG_NO
g_print ("/%s() => %s\n", __FUNCTION__, retval);
#endif
@@ -1460,7 +1465,7 @@ gda_thread_provider_statement_to_sql (GdaServerProvider *provider, GdaConnection
cdata = (ThreadConnectionData*) gda_connection_internal_get_provider_data (cnc);
if (!cdata)
return NULL;
-
+
wdata.prov = cdata->cnc_provider;
wdata.cnc = cdata->sub_connection;
wdata.stmt = stmt;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]