[libgda] Misc corrections
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Misc corrections
- Date: Thu, 10 Apr 2014 19:11:02 +0000 (UTC)
commit 2797302d40fceaf5b1416af54e48c9de906166d7
Author: Vivien Malerba <malerba gnome-db org>
Date: Thu Apr 10 21:07:32 2014 +0200
Misc corrections
doc/C/libgda-sections.txt | 1 +
libgda/gda-connection.c | 5 ++++-
providers/mysql/gda-mysql-provider.c | 4 +++-
3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/doc/C/libgda-sections.txt b/doc/C/libgda-sections.txt
index 05dd28f..4af77a4 100644
--- a/doc/C/libgda-sections.txt
+++ b/doc/C/libgda-sections.txt
@@ -155,6 +155,7 @@ gda_connection_get_authentication
gda_connection_get_date_format
<SUBSECTION>
gda_connection_get_events
+gda_connection_point_available_event
<SUBSECTION>
gda_connection_create_operation
gda_connection_perform_operation
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index cec8ab1..9260b2e 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -2507,6 +2507,7 @@ gda_connection_add_event (GdaConnection *cnc, GdaConnectionEvent *event)
g_return_if_fail (GDA_IS_CONNECTION (cnc));
g_return_if_fail (GDA_IS_CONNECTION_EVENT (event));
+ g_object_ref (cnc);
gda_connection_lock ((GdaLockable*) cnc);
/* clear external list of events */
@@ -2562,7 +2563,9 @@ gda_connection_add_event (GdaConnection *cnc, GdaConnectionEvent *event)
#ifdef GDA_DEBUG_NO
dump_events_array (cnc);
#endif
+
gda_connection_unlock ((GdaLockable*) cnc);
+ g_object_unref (cnc);
}
/**
@@ -5505,7 +5508,7 @@ gda_connection_internal_savepoint_removed (GdaConnection *cnc, const gchar *svp_
* @cnc: a #GdaConnection
* @stmt: a #GdaStatement which has been executed
* @params: (allow-none): execution's parameters
- * @error: a #GdaConnectionEvent if the execution failed, or %NULL
+ * @error: (transfer none): a #GdaConnectionEvent if the execution failed, or %NULL
*
* Internal functions to be called by database providers when a statement has been executed
* to keep track of the transaction status of the connection
diff --git a/providers/mysql/gda-mysql-provider.c b/providers/mysql/gda-mysql-provider.c
index 6bf9c1d..3240431 100644
--- a/providers/mysql/gda-mysql-provider.c
+++ b/providers/mysql/gda-mysql-provider.c
@@ -2206,6 +2206,7 @@ gda_mysql_provider_statement_execute (GdaServerProvider *provider,
g_free (str);
gda_connection_internal_statement_executed (cnc, stmt,
params, event); /* required: help @cnc keep some stats */
+ g_object_unref (event);
return (GObject *) gda_set_new_inline
(1, "IMPACTED_ROWS", G_TYPE_INT, (int) affected_rows);
}
@@ -2724,6 +2725,7 @@ gda_mysql_provider_statement_execute (GdaServerProvider *provider,
GObject *return_value = NULL;
if (mysql_stmt_execute (ps->mysql_stmt)) {
event = _gda_mysql_make_error (cnc, NULL, ps->mysql_stmt, error);
+ gda_connection_add_event (cnc, event);
}
else {
/* execute prepared statement using C API depending on its kind */
@@ -2765,6 +2767,7 @@ gda_mysql_provider_statement_execute (GdaServerProvider *provider,
(1, "IMPACTED_ROWS", G_TYPE_INT, (int) affected_rows);
gda_connection_internal_statement_executed (cnc, stmt, params, event); /* required:
help @cnc keep some stats */
+ g_object_unref (event);
if (last_inserted_row) {
my_ulonglong last_row;
@@ -2772,7 +2775,6 @@ gda_mysql_provider_statement_execute (GdaServerProvider *provider,
if (last_row)
*last_inserted_row = make_last_inserted_set (cnc, stmt, last_row);
}
-
}
}
g_object_unref (ps);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]