Fix ag_db_select()

Using parameter @err for error collection was a bad idea. Creating
local_err instead.
This commit is contained in:
Gergely Polonkai 2014-07-31 00:34:51 +02:00
parent ea9e4a73a5
commit bee9ae363f

View File

@ -196,8 +196,9 @@ ag_db_select(AgDb *db, GError **err, const gchar *sql, ...)
GdaSet *params; GdaSet *params;
GdaStatement *sth; GdaStatement *sth;
GdaDataModel *ret; GdaDataModel *ret;
gchar *error = NULL; gchar *error = NULL;
AgDbPrivate *priv = ag_db_get_instance_private(db); GError *local_err = NULL;
AgDbPrivate *priv = ag_db_get_instance_private(db);
parser = g_object_get_data(G_OBJECT(priv->conn), "parser"); parser = g_object_get_data(G_OBJECT(priv->conn), "parser");
@ -205,21 +206,21 @@ ag_db_select(AgDb *db, GError **err, const gchar *sql, ...)
parser, parser,
sql, sql,
&remain, &remain,
err &local_err
)) == NULL) { )) == NULL) {
g_error( g_error(
"SQL error: %s", "SQL error: %s",
(*err && (*err)->message) (local_err && local_err->message)
? (*err)->message ? local_err->message
: "no reason" : "no reason"
); );
} }
if (!gda_statement_get_parameters(sth, &params, err)) { if (!gda_statement_get_parameters(sth, &params, &local_err)) {
g_error( g_error(
"SQL error: %s", "SQL error: %s",
(*err && (*err)->message) (local_err && local_err->message)
? (*err)->message ? local_err->message
: "no reason" : "no reason"
); );
} }