[libgda] Misc. corrections
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Subject: [libgda] Misc. corrections
- Date: Tue, 28 Jul 2009 18:49:26 +0000 (UTC)
commit 54a3fe0cbd9e450c70773161f5ec36be0e475fe5
Author: Vivien Malerba <malerba gnome-db org>
Date: Tue Jul 28 18:39:29 2009 +0200
Misc. corrections
* SQLite provider: in add_oid_columns()
* GdaDataProxy: in gda_data_proxy_get_filtered_n_rows() where the mutex was
unlocked without ever being locked
* testing/gda-provider-status.c: also test for the identifier_quote() virtual
method's presence
libgda/gda-data-proxy.c | 5 ++++-
libgda/sqlite/gda-sqlite-provider.c | 2 +-
testing/gda-provider-status.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-data-proxy.c b/libgda/gda-data-proxy.c
index 4594739..c3b75f3 100644
--- a/libgda/gda-data-proxy.c
+++ b/libgda/gda-data-proxy.c
@@ -3207,8 +3207,11 @@ gda_data_proxy_get_filtered_n_rows (GdaDataProxy *proxy)
g_return_val_if_fail (GDA_IS_DATA_PROXY (proxy), -1);
g_return_val_if_fail (proxy->priv, -1);
- if (! proxy->priv->filtered_rows)
+ gda_mutex_lock (proxy->priv->mutex);
+ if (! proxy->priv->filtered_rows) {
+ gda_mutex_unlock (proxy->priv->mutex);
return -1;
+ }
else {
gint n = gda_data_model_get_n_rows (proxy->priv->filtered_rows);
gda_mutex_unlock (proxy->priv->mutex);
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index 6129ffc..a8a8cd6 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -1706,7 +1706,7 @@ add_oid_columns (GdaStatement *stmt, GHashTable **out_hash, gint *out_nb_cols_ad
else
name = target->table_name;
- tmp = gda_sql_identifier_quote (target->table_name, NULL, NULL, FALSE, FALSE);
+ tmp = gda_sql_identifier_quote (name, NULL, NULL, FALSE, FALSE);
str = g_strdup_printf ("%s.rowid", tmp);
g_free (tmp);
g_value_take_string ((field->expr->value = gda_value_new (G_TYPE_STRING)), str);
diff --git a/testing/gda-provider-status.c b/testing/gda-provider-status.c
index db31413..86b56c4 100644
--- a/testing/gda-provider-status.c
+++ b/testing/gda-provider-status.c
@@ -282,6 +282,7 @@ report_provider_status (GdaServerProvider *prov, GdaConnection *cnc)
{"statement_to_sql", TRUE, (AFunc) pclass->statement_to_sql},
{"statement_prepare", TRUE, (AFunc) pclass->statement_prepare},
{"statement_execute", TRUE, (AFunc) pclass->statement_execute},
+ {"identifier_quote", TRUE, (AFunc) pclass->identifier_quote}
};
ProvFunc md[] = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]