[libgda] GdaMetaStore: correctly fill the GdaMetaStoreChange structure when data is deleted
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaMetaStore: correctly fill the GdaMetaStoreChange structure when data is deleted
- Date: Sun, 8 Jan 2012 19:54:22 +0000 (UTC)
commit e07b39f81f7b0385eaa3ea2302bdd3328e534220
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Jan 8 20:43:50 2012 +0100
GdaMetaStore: correctly fill the GdaMetaStoreChange structure when data is deleted
libgda/gda-meta-store.c | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index eee1dfc..2cb2b5a 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -2876,6 +2876,7 @@ gda_meta_store_modify_v (GdaMetaStore *store, const gchar *table_name,
goto out;
}
if (change) {
+ /*g_print ("CH %p key=[%s] value=[%s]\n", change, pid, gda_value_stringify (value)); */
g_hash_table_insert (change->keys, pid, gda_value_copy (value));
pid = NULL;
}
@@ -2921,6 +2922,7 @@ gda_meta_store_modify_v (GdaMetaStore *store, const gchar *table_name,
goto out;
}
if (change) {
+ /* g_print ("CH %p key=[%s] value=[%s]\n", change, pid, gda_value_stringify (value)); */
g_hash_table_insert (change->keys, pid, gda_value_copy (value));
pid = NULL;
}
@@ -3019,26 +3021,23 @@ gda_meta_store_modify_v (GdaMetaStore *store, const gchar *table_name,
for (j = 0; j < current_n_cols; j++) {
gchar *pid = g_strdup_printf ("-%d", j);
GdaHolder *h;
+ const GValue *value;
+ value = gda_data_model_get_value_at (current, j, i, error);
+ if (!value) {
+ g_free (pid);
+ retval = FALSE;
+ goto out;
+ }
+
h = gda_set_get_holder (schema_set->params, pid);
- if (h) {
- const GValue *value;
- value = gda_data_model_get_value_at (current, j, i, error);
- if (!value) {
- g_free (pid);
- retval = FALSE;
- goto out;
- }
- if (! gda_holder_set_value (h, value, error)) {
- g_free (pid);
- retval = FALSE;
- goto out;
- }
- if (change) {
- g_hash_table_insert (change->keys, pid, gda_value_copy (value));
- pid = NULL;
- }
+ if (h && ! gda_holder_set_value (h, value, error)) {
+ g_free (pid);
+ retval = FALSE;
+ goto out;
}
- g_free (pid);
+
+ /* g_print ("CH %p key=[%s] value=[%s]\n", change, pid, gda_value_stringify (value)); */
+ g_hash_table_insert (change->keys, pid, gda_value_copy (value));
}
#ifdef DEBUG_STORE_MODIFY
g_print ("Delete existing row %d from table %s\n", i, table_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]