Fix ag_db_select()
Using parameter @err for error collection was a bad idea. Creating local_err instead.
This commit is contained in:
parent
ea9e4a73a5
commit
bee9ae363f
17
src/ag-db.c
17
src/ag-db.c
@ -196,8 +196,9 @@ ag_db_select(AgDb *db, GError **err, const gchar *sql, ...)
|
||||
GdaSet *params;
|
||||
GdaStatement *sth;
|
||||
GdaDataModel *ret;
|
||||
gchar *error = NULL;
|
||||
AgDbPrivate *priv = ag_db_get_instance_private(db);
|
||||
gchar *error = NULL;
|
||||
GError *local_err = NULL;
|
||||
AgDbPrivate *priv = ag_db_get_instance_private(db);
|
||||
|
||||
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,
|
||||
sql,
|
||||
&remain,
|
||||
err
|
||||
&local_err
|
||||
)) == NULL) {
|
||||
g_error(
|
||||
"SQL error: %s",
|
||||
(*err && (*err)->message)
|
||||
? (*err)->message
|
||||
(local_err && local_err->message)
|
||||
? local_err->message
|
||||
: "no reason"
|
||||
);
|
||||
}
|
||||
|
||||
if (!gda_statement_get_parameters(sth, ¶ms, err)) {
|
||||
if (!gda_statement_get_parameters(sth, ¶ms, &local_err)) {
|
||||
g_error(
|
||||
"SQL error: %s",
|
||||
(*err && (*err)->message)
|
||||
? (*err)->message
|
||||
(local_err && local_err->message)
|
||||
? local_err->message
|
||||
: "no reason"
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user