[libgda/LIBGDA_4.0] Corrected the GdaMetaContext validation routine



commit ff0818b67537d16d3076882a058e1ee30482f5cc
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue Jul 7 21:10:07 2009 +0200

    Corrected the GdaMetaContext validation routine

 libgda/gda-meta-store.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index 1031b9d..f23bffb 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -3505,11 +3505,6 @@ _gda_meta_store_validate_context (GdaMetaStore *store, GdaMetaContext *context,
 			     _("Missing table name in meta data context"));
 		return NULL;
 	}
-	if (context->size <= 0) {
-		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_META_CONTEXT_ERROR,
-			     _("Missing condition in meta data context"));
-		return NULL;
-	}
 
 	klass = GDA_META_STORE_CLASS (G_OBJECT_GET_CLASS (store));
 
@@ -3522,8 +3517,10 @@ _gda_meta_store_validate_context (GdaMetaStore *store, GdaMetaContext *context,
 		lcontext = g_new0 (GdaMetaContext, 1);
 		lcontext->table_name = context->table_name;
 		lcontext->size = context->size;
-		lcontext->column_names = g_new0 (gchar*, lcontext->size);
-		lcontext->column_values = g_new0 (GValue*, lcontext->size);
+		if (lcontext->size > 0) {
+			lcontext->column_names = g_new0 (gchar*, lcontext->size);
+			lcontext->column_values = g_new0 (GValue*, lcontext->size);
+		}
 		
 		tinfo = TABLE_INFO (dbobj);
 		for (i = 0; i < lcontext->size; i++) {



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