[libgda/LIBGDA_4.2] GdaBrowser: improved debug message



commit 66e04979db80ca4f42ce7e12b8046e33a7354ee0
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sat Sep 24 21:41:10 2011 +0200

    GdaBrowser: improved debug message

 tools/browser/common/ui-formgrid.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/tools/browser/common/ui-formgrid.c b/tools/browser/common/ui-formgrid.c
index 3c7d624..50503f8 100644
--- a/tools/browser/common/ui-formgrid.c
+++ b/tools/browser/common/ui-formgrid.c
@@ -1100,9 +1100,14 @@ compute_modification_statements (UiFormGrid *formgrid, GdaDataModel *model)
 	for (mod = MOD_INSERT; mod < MOD_LAST; mod++) {
 		if (formgrid->priv->mod_stmt[mod]) {
 			gchar *sql;
+			GError *lerror = NULL;
 			sql = gda_statement_to_sql_extended (formgrid->priv->mod_stmt[mod], NULL, NULL,
-							     GDA_STATEMENT_SQL_PARAMS_LONG, NULL, NULL);
-			g_print ("STMT[%d] = [%s]\n", mod, sql);
+							     GDA_STATEMENT_SQL_PARAMS_LONG, NULL, &lerror);
+			g_print ("STMT[%d] = [%s]", mod, sql ? sql : "ERR");
+			if (!sql)
+				g_print (" --- %s", lerror && lerror->message ? lerror->message : "No detail");
+			g_clear_error (&lerror);
+			g_print ("\n");
 			g_free (sql);
 		}
 		else



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