[libgda] Corrected GdaMetaStruct wrong error reporting



commit 29d82fd5474bad8093867e498f1e94f3d1e9e3d1
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue Jun 23 20:41:16 2009 +0200

    Corrected GdaMetaStruct wrong error reporting
    
    When GdaMetaStruct's flag includes GDA_META_STRUCT_FEATURE_FOREIGN_KEYS and
    not all the tables are referenced in the GdaMetaStore, then an error
    was reported.

 libgda/gda-meta-struct.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libgda/gda-meta-struct.c b/libgda/gda-meta-struct.c
index 4e2dc88..d617f2c 100644
--- a/libgda/gda-meta-struct.c
+++ b/libgda/gda-meta-struct.c
@@ -894,7 +894,13 @@ _meta_struct_complement (GdaMetaStruct *mstruct, GdaMetaDbObjectType type,
 					if (fk_nrows != ref_pk_nrows) {
 						/*gda_data_model_dump (fk_cols, stdout);
 						  gda_data_model_dump (ref_pk_cols, stdout);*/
-						fkerror = TRUE;
+						if (ref_pk_nrows > 0)
+							fkerror = TRUE;
+						else {
+							/* not an error, only the referenced table is not present
+							 * in the meta store, which is possible if the meta
+							 * store was only partially updated */
+						}
 					}
 					else {
 						gint n;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]