Re: [gnome-db] database xml - xml database new from uri



On Tue, 2003-08-26 at 18:18 +0200, Philippe CHARLIER wrote:
> Hi,
> 
> Sorry, I was unable to check out the release-1-0-branch, so I didn't
> make a patch, but the correction is easy to do.
> 
> Phil
> 
> Still in the function "xml_database_new_from_uri" :
> 
> When using the function "database =
> gda_xml_database_new_from_uri(filename);" to read an existing XML
> database, the following errors appear :
> 
>   ** (program:12636): WARNING **: add_xml_row(): there are missing
> values on the XML node
> 
>   ** (program:12636): CRITICAL **: file gda-value.c: line 826
> (gda_value_free): assertion `value != NULL' failed
> 
>   ** (program:12636): CRITICAL **: file gda-value.c: line 826
> (gda_value_free): assertion `value != NULL' failed
>  
>   ** (program:12636): WARNING **: Could not add the data from the XML
> node
>  
>   ** (program:12636): WARNING **: add_xml_row(): there are missing
> values on the XML node
>  
>   ** (program:12636): CRITICAL **: file gda-value.c: line 826
> (gda_value_free): assertion `value != NULL' failed
> 
>   ** (program:12636): WARNING **: Could not add the data from the XML
> node
> 
> >From all those error messages, the first one seems to be the important
> as the other ones are just caused by "add_xml_row(): there are missing
> values on the XML node".
> 
> After some search, it seems that in the file "gda_data_model.c", in the
> function "add_xml_row()", line 939, there is a test "if (!strcmp
> (xml_field->name, "value")) continue;".  The purpose of this test is, I
> suppose, a seek for "<value>".  The problem, is that when "<value>" is
> found, the function does nothing with it.
> If you change the test in "if (strcmp (xml_field->name, "value"))
> continue;", it works.
> 
right, attached is the patch to fix it.

cheers
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgda/ChangeLog,v
retrieving revision 1.560
diff -u -p -r1.560 ChangeLog
--- ChangeLog	25 Aug 2003 19:59:23 -0000	1.560
+++ ChangeLog	26 Aug 2003 17:01:57 -0000
@@ -1,3 +1,7 @@
+2003-08-26  Philippe CHARLIER <p charlier chello be>
+
+	* libgda/gda-data-model.c (add_xml_row): fixed typo in call to strcmp().
+
 2003-08-25  Rodrigo Moya <rodrigo gnome-db org>
 
 	* libgda/gda-xml-database.c (gda_xml_database_new_table_from_node):
Index: libgda/gda-data-model.c
===================================================================
RCS file: /cvs/gnome/libgda/libgda/gda-data-model.c,v
retrieving revision 1.36
diff -u -p -r1.36 gda-data-model.c
--- libgda/gda-data-model.c	24 Aug 2003 03:31:59 -0000	1.36
+++ libgda/gda-data-model.c	26 Aug 2003 17:01:57 -0000
@@ -936,7 +936,7 @@ add_xml_row (GdaDataModel *model, xmlNod
 		gint pos;
 		GdaValue *value;
 
-		if (!strcmp (xml_field->name, "value"))
+		if (strcmp (xml_field->name, "value"))
 			continue;
 
 		pos = atoi (xmlGetProp (xml_field, "position"));


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