[redland-dev] PATCH: rdf_storage_virtuoso: Bug fix (wrong SPARQL query results)

lenrek at me.com lenrek at me.com
Fri Dec 18 05:04:52 CET 2009


I found a bug that causes incorrect query results, and attached a  
patch below.

In early versions of Virtuoso, only one bit (BF_IRI) is defined for  
the value of ``flag'',
though three bits are defined in recent versions.  So the value of  
``flag'' should be masked
whenever it is checked.

lenrek

diff -urN redland-1.0.10/src/rdf_storage_virtuoso.c redland-1.0.10- 
fixed/src/rdf_storage_virtuoso.c
--- redland-1.0.10/src/rdf_storage_virtuoso.c	2009-12-14  
15:18:04.000000000 +0900
+++ redland-1.0.10-fixed/src/rdf_storage_virtuoso.c	2009-12-17  
16:20:59.000000000 +0900
@@ -358,7 +358,7 @@
   switch(dvtype) {
     case VIRTUOSO_DV_STRING:
       {
-	if(flag) {
+	if(flag & VIRTUOSO_BF_IRI) {
	  if(strncmp((char*)data, "_:",2)==0) {
	    node=librdf_new_node_from_blank_identifier(storage->world, (const  
unsigned char*)data+2);
	  } else {
diff -urN redland-1.0.10/src/rdf_storage_virtuoso_internal.h  
redland-1.0.10-fixed/src/rdf_storage_virtuoso_internal.h
--- redland-1.0.10/src/rdf_storage_virtuoso_internal.h	2009-08-26  
14:17:24.000000000 +0900
+++ redland-1.0.10-fixed/src/rdf_storage_virtuoso_internal.h	 
2009-12-17 16:19:52.000000000 +0900
@@ -170,4 +170,12 @@
#define VIRTUOSO_DT_TYPE_DATE		2
#define VIRTUOSO_DT_TYPE_TIME		3

+
+/*
+ *  Virtuoso - ODBC SQL_DESC_COL_BOX_FLAGS
+ */
+#define VIRTUOSO_BF_IRI                0x1
+#define VIRTUOSO_BF_UTF8               0x2
+#define VIRTUOSO_BF_DEFAULT_SERVER_ENC 0x4
+
#endif


More information about the redland-dev mailing list