[libgda/LIBGDA_4.2] SQL rendering correction



commit a2f4ebcce7974d45d4b9df11e138a21e84d65372
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Dec 29 18:43:19 2011 +0100

    SQL rendering correction
    
    correctly enclose between parenthesis SELECT statements in expressions

 libgda/gda-statement.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libgda/gda-statement.c b/libgda/gda-statement.c
index 1b6cb26..4f3c20e 100644
--- a/libgda/gda-statement.c
+++ b/libgda/gda-statement.c
@@ -1729,7 +1729,11 @@ default_render_function (GdaSqlFunction *func, GdaSqlRenderingContext *context,
 			g_string_append (string, ", ");
 		str = context->render_expr (list->data, context, NULL, NULL, error);
 		if (!str) goto err;
+		if (((GdaSqlExpr*) list->data)->select)
+			g_string_append_c (string, '(');
 		g_string_append (string, str);
+		if (((GdaSqlExpr*) list->data)->select)
+			g_string_append_c (string, ')');
 		g_free (str);
 	}
 	g_string_append_c (string, ')');



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