Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/bug-1047538
into lp:zorba.
Requested reviews:
Markos Zaharioudakis (markos-za)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1047538/+merge/124076
Fixed bug #1047538 (jsoniq: SourceFinder::findLocalNodeSources missing json
expressions)
Fixed bug #1043976 (compiler warning in serialiser code)
--
https://code.launchpad.net/~zorba-coders/zorba/bug-1047538/+merge/124076
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog 2012-09-12 08:06:26 +
+++ ChangeLog 2012-09-12 22:32:25 +
@@ -35,8 +35,11 @@
* Fixed bug #1039488 (inserting more than one pair at once in a JSON object)
* Fixed bug #1042840 (qname pool free-list corruption)
* Fixed bug #866984 (better error message for an eval error)
+ * Fixed bug #1047538 (jsoniq: SourceFinder::findLocalNodeSources missing
+json expressions)
* Fixed bug #932884 (HTML and XHTML serialization of empty elements)
* Fixed bug #1045902 (file:last-modified returns current date time)
+ * Fixed bug #1043976 (compiler warning in serialiser code)
version 2.6
=== modified file 'src/api/serialization/serializer.cpp'
--- src/api/serialization/serializer.cpp 2012-09-12 08:06:26 +
+++ src/api/serialization/serializer.cpp 2012-09-12 22:32:25 +
@@ -587,8 +587,8 @@
}
default:
{
-ZORBA_ASSERT(false);
-tr << "node of type: " << item->getNodeKind();
+int k = static_cast(item->getNodeKind());
+ZORBA_ASSERT_WITH_MSG(false, BUILD_STRING("node of type: ", k));
}
}
}
@@ -1475,11 +1475,16 @@
{
const store::Item* element_parent = item->getParent();
- if( item->getNodeKind() == store::StoreConsts::documentNode)
+ store::NodeKind kind = item->getNodeKind();
+
+ switch (kind)
+ {
+ case store::StoreConsts::documentNode:
{
emit_node_children(item, depth);
+break;
}
- else if (item->getNodeKind() == store::StoreConsts::elementNode)
+ case store::StoreConsts::elementNode:
{
store::Item* qnameItem = item->getNodeName();
@@ -1568,8 +1573,10 @@
}
previous_item = PREVIOUS_ITEM_WAS_NODE;
+
+break;
}
- else if (item->getNodeKind() == store::StoreConsts::attributeNode)
+ case store::StoreConsts::attributeNode:
{
// The HTML output method MUST output boolean attributes (that is attributes
// with only a single allowed value that is equal to the name of the
@@ -1593,8 +1600,10 @@
}
previous_item = PREVIOUS_ITEM_WAS_NODE;
+
+break;
}
- else if (item->getNodeKind() == store::StoreConsts::textNode)
+ case store::StoreConsts::textNode:
{
bool expand = true;
@@ -1623,23 +1632,27 @@
}
previous_item = PREVIOUS_ITEM_WAS_TEXT;
+break;
}
- else if (item->getNodeKind() == store::StoreConsts::commentNode)
+ case store::StoreConsts::commentNode:
{
tr << "";
previous_item = PREVIOUS_ITEM_WAS_NODE;
+break;
}
- else if (item->getNodeKind() == store::StoreConsts::piNode )
+ case store::StoreConsts::piNode:
{
tr << "getTarget() << " " << item->getStringValue() << "?>";
previous_item = PREVIOUS_ITEM_WAS_NODE;
+break;
}
- else
+ default:
{
-tr << "node of type: " << item->getNodeKind();
-assert(0);
+int k = static_cast(kind);
+ZORBA_ASSERT_WITH_MSG(false, BUILD_STRING("node of type: ", k));
+ }
}
}
=== modified file 'src/compiler/rewriter/tools/dataflow_annotations.cpp'
--- src/compiler/rewriter/tools/dataflow_annotations.cpp 2012-09-10 22:53:04 +
+++ src/compiler/rewriter/tools/dataflow_annotations.cpp 2012-09-12 22:32:25 +
@@ -1311,7 +1311,7 @@
/***
-
+ This method is called when we serialize a udf, if the query has an eval expr.
/
void SourceFinder::findLocalNodeSources(
expr* node,
@@ -1494,6 +1494,17 @@
return;
}
+#ifdef ZORBA_WITH_JSON
+ case json_direct_object_expr_kind:
+ case json_object_expr_kind:
+ case json_array_expr_kind:
+ {
+// TODO? We need to drill inside a json pair or array constructor only
+// if we are coming from an unbox or flatten call
+break;
+ }
+#endif
+
case relpath_expr_kind:
{
relpath_expr* e = static_cast(node);
=== modified file 'src/functions/func_jsoniq_functions_impl.cpp'
--- src/functions/func_jsoniq_functions_impl.cpp 2012-09-11 15:53:52 +
+++ src/functions/func_jsoniq_functions_impl.cpp 2012-09-12 22:32:25 +
@@ -134,24 +134,6 @@
}
-#if 1
-/***
-
-/
-bool op_zorba_json_box::mustCopyInputNodes(expr* fo, csize producer) const
-{
- static_context* sctx = fo->get_sctx();
-
- if (sctx->preserve_mode() !=