[libgda] fixed bug #579513 and added the GDA_STATEMENT_SQL_PARAMS_AS_VALUES flag
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Subject: [libgda] fixed bug #579513 and added the GDA_STATEMENT_SQL_PARAMS_AS_VALUES flag
- Date: Thu, 23 Apr 2009 14:57:28 -0400 (EDT)
commit c2f8d41f8bc55b435d7478b148b4ba017bbc42c6
Author: Vivien Malerba <malerba gnome-db org>
Date: Wed Apr 22 09:25:49 2009 +0200
fixed bug #579513 and added the GDA_STATEMENT_SQL_PARAMS_AS_VALUES flag
---
ChangeLog | 6 ++++++
doc/C/tmpl/gda-statement.sgml | 1 +
libgda/gda-statement.c | 7 ++++++-
libgda/gda-statement.h | 1 +
4 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0d9599c..9e77d11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-22 Vivien Malerba <malerba gnome-db org>
+
+ * libgda/gda-statement.h: added the GDA_STATEMENT_SQL_PARAMS_AS_VALUES constant
+ name which defaults to 0
+ * libgda/gda-statement.c: fix for bug #579513
+
2009-04-21 Vivien Malerba <malerba gnome-db org>
* doc/C/libgda-4.0-docs.sgml:
diff --git a/doc/C/tmpl/gda-statement.sgml b/doc/C/tmpl/gda-statement.sgml
index 88a1205..5693f84 100644
--- a/doc/C/tmpl/gda-statement.sgml
+++ b/doc/C/tmpl/gda-statement.sgml
@@ -64,6 +64,7 @@ This property changes or queries the internal #GdaSqlStatement structure. A copy
Specifies how the general rendering is done
</para>
+ GDA_STATEMENT_SQL_PARAMS_AS_VALUES: rendering will replace parameters with their values
@GDA_STATEMENT_SQL_PRETTY: rendering will include newlines and indentation to make it easy to read
@GDA_STATEMENT_SQL_PARAMS_LONG: parameters will be rendered using the "/* name:<param_name> ... */" syntax
@GDA_STATEMENT_SQL_PARAMS_SHORT: parameters will be rendered using the "##<param_name>..." syntax
diff --git a/libgda/gda-statement.c b/libgda/gda-statement.c
index 64a180d..5a35480 100644
--- a/libgda/gda-statement.c
+++ b/libgda/gda-statement.c
@@ -1334,7 +1334,12 @@ default_render_expr (GdaSqlExpr *expr, GdaSqlRenderingContext *context, gboolean
}
else if (expr->select) {
gchar *str1;
- str1 = context->render_select (GDA_SQL_ANY_PART (expr->select), context, error);
+ if (GDA_SQL_ANY_PART (expr->select)->type == GDA_SQL_ANY_STMT_SELECT)
+ str1 = context->render_select (GDA_SQL_ANY_PART (expr->select), context, error);
+ else if (GDA_SQL_ANY_PART (expr->select)->type == GDA_SQL_ANY_STMT_COMPOUND)
+ str1 = context->render_compound (GDA_SQL_ANY_PART (expr->select), context, error);
+ else
+ g_assert_not_reached ();
if (!str1) goto err;
str = g_strdup_printf ("(%s)", str1);
g_free (str1);
diff --git a/libgda/gda-statement.h b/libgda/gda-statement.h
index 36c06f6..1612d75 100644
--- a/libgda/gda-statement.h
+++ b/libgda/gda-statement.h
@@ -56,6 +56,7 @@ typedef enum {
} GdaStatementModelUsage;
typedef enum {
+ GDA_STATEMENT_SQL_PARAMS_AS_VALUES = 0,
GDA_STATEMENT_SQL_PRETTY = 1 << 0,
GDA_STATEMENT_SQL_PARAMS_LONG = 1 << 1,
GDA_STATEMENT_SQL_PARAMS_SHORT = 1 << 2,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]