zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #01165
[Merge] lp:~zorba-coders/zorba/f-testPerfScript into lp:zorba
Cezar Andrei has proposed merging lp:~zorba-coders/zorba/f-testPerfScript into lp:zorba.
Requested reviews:
Chris Hillery (ceejatec)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/f-testPerfScript/+merge/79622
Add zperf query scripts to be compile-checked.
--
https://code.launchpad.net/~zorba-coders/zorba/f-testPerfScript/+merge/79622
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog 2011-10-12 21:30:46 +0000
+++ ChangeLog 2011-10-17 21:17:26 +0000
@@ -41,17 +41,11 @@
* Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
* Implemented the probe-index-range-value for general indexes
* Fixed bug #867662 ("nullptr" warning)
- * Fixed bug #868258 (Assertion failure with two delete collection)
- * Fixed bug #871623 and #871629 (assertion failures with insertions in dynamic collections)
* Fixed bug #867262 (allow reuse of iterator over ExtFuncArgItemSequence)
* Fixed bug #869024 (segmentation fault with node-reference)
* Fixed bug #869025 (segmentation fault with node-reference)
* New node-reference module. References can be obtained for any node, and
different nodes cannot have the same identifier.
- * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
- * Added undo for node revalidation
- * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
- * Fixed bug #872799 (validate-in-place can set incorrect types)
version 2.0.1
=== modified file 'bin/CMakeLists.txt'
--- bin/CMakeLists.txt 2011-08-05 02:21:55 +0000
+++ bin/CMakeLists.txt 2011-10-17 21:17:26 +0000
@@ -84,3 +84,7 @@
# test the --option option to set an option in the static context
ZORBA_ADD_TEST(bin/zorba_option zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/option.xq" -f --option "{http://www.zorba-xquery.com}option=value")
ZORBA_SET_TEST_PROPERTY(bin/zorba_option PASS_REGULAR_EXPRESSION "value")
+
+# test compilation of the perf script
+ZORBA_ADD_TEST(bin/zorba_compilechk4 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/../test/zperf/src/start.xq" -f --compile-only)
+
=== modified file 'modules/DownloadModules.cmake'
--- modules/DownloadModules.cmake 2011-10-11 22:34:31 +0000
+++ modules/DownloadModules.cmake 2011-10-17 21:17:26 +0000
@@ -19,11 +19,9 @@
# Valid options:
# modname = short module name (see modules/ExternalModules.conf);
# may be a semicolon-separated list
-# allmodules = if true: download all known modules
+# allmodules = if true, download all known modules
# outdir = full path to Zorba's external modules directory to download
# modules into (will be created if necessary)
-# notags = if true: ignore tags, check out HEAD revision of module(s)
-# (bzr only - svn uses different URLs for tags)
# Figure out what directory we're running in - ExternalModules.txt is here too
get_filename_component (cwd ${CMAKE_CURRENT_LIST_FILE} PATH)
@@ -57,11 +55,6 @@
list (GET _modargs 0 _modname)
list (GET _modargs 1 _modvc)
list (GET _modargs 2 _modurl)
- set (_modtag)
- list (LENGTH _modargs _modargslen)
- if (_modargslen GREATER 3)
- list (GET _modargs 3 _modtag)
- endif (_modargslen GREATER 3)
# See if this is a module short-name we care about
set (_getmod)
@@ -95,13 +88,8 @@
message (FATAL_ERROR
"Bazaar client not found - required for ${_modname} module!")
endif (NOT bzr)
-
- set (_modtagargs)
- if (_modtag AND NOT notags)
- set (_modtagargs "-r" "${_modtag}")
- endif (_modtag AND NOT notags)
execute_process (COMMAND "${bzr}" branch "${_modurl}" "${_modname}"
- ${_modtagargs} WORKING_DIRECTORY "${outdir}" TIMEOUT 60)
+ WORKING_DIRECTORY "${outdir}" TIMEOUT 60)
else (${_modvc} STREQUAL "svn")
message (FATAL_ERROR "Unknown vc-type '${_modvc}' for module "
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf 2011-10-11 22:26:10 +0000
+++ modules/ExternalModules.conf 2011-10-17 21:17:26 +0000
@@ -16,26 +16,21 @@
# the Zorba Team may be downloaded from source control.
# Format:
-# short-mod-name vc-type url [ tag ]
-#
-# where:
-# "short-mod-name" is a convenient name for identifying the module
-# "vc-type" is the type of version control software (so far
-# only "bzr" and "svn" are supported)
-# "url" is the URL to check out
-# "tag" is the VCS tag to check out (optional - defaults to HEAD;
-# currently only works for bzr, since svn tags are just different URLS)
+# short-mod-name vc-type url
+# where "short-mod-name" is a convenient tag for identifying the module;
+# "vc-type" is the type of version control software (so far only "bzr"
+# and "svn" are supported); and "url" is the URL to check out.
-data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.0.3
-data-converters bzr lp:zorba/data-converters-module zorba-2.0.3
-data-formatting bzr lp:zorba/data-formatting-module zorba-2.0.3
-email bzr lp:zorba/email-module zorba-2.0.3
-excel bzr lp:zorba/excel-module zorba-2.0.3
-geo bzr lp:zorba/geo-module zorba-2.0.3
-http-client bzr lp:zorba/http-client-module zorba-2.0.3
-image bzr lp:zorba/image-module zorba-2.0.3
-languages bzr lp:zorba/languages-module zorba-2.0.3
-oauth bzr lp:zorba/oauth-module zorba-2.0.3
-process bzr lp:zorba/process-module zorba-2.0.3
-security bzr lp:zorba/security-module zorba-2.0.3
-system bzr lp:zorba/system-module zorba-2.0.3
+data-cleaning bzr lp:zorba/data-cleaning-module
+data-converters bzr lp:zorba/data-converters-module
+data-formatting bzr lp:zorba/data-formatting-module
+email bzr lp:zorba/email-module
+excel bzr lp:zorba/excel-module
+geo bzr lp:zorba/geo-module
+http-client bzr lp:zorba/http-client-module
+image bzr lp:zorba/image-module
+languages bzr lp:zorba/languages-module
+oauth bzr lp:zorba/oauth-module
+process bzr lp:zorba/process-module
+security bzr lp:zorba/security-module
+system bzr lp:zorba/system-module
=== modified file 'schemas/xslt-xquery-serialization.xsd'
--- schemas/xslt-xquery-serialization.xsd 2011-10-12 07:12:59 +0000
+++ schemas/xslt-xquery-serialization.xsd 2011-10-17 21:17:26 +0000
@@ -49,7 +49,7 @@
<xs:simpleType name="encoding-string-type">
<xs:restriction base="xs:string">
- <xs:pattern value="[A-Za-z]([A-Za-z0-9._\-])*"/>
+ <xs:pattern value="[A-Za-z]([A-Za-z0-9._]|-)*"/>
</xs:restriction>
</xs:simpleType>
=== modified file 'src/runtime/nodes/nodes_impl.cpp'
--- src/runtime/nodes/nodes_impl.cpp 2011-10-10 12:56:57 +0000
+++ src/runtime/nodes/nodes_impl.cpp 2011-10-17 21:17:26 +0000
@@ -34,7 +34,6 @@
namespace zorba {
/*******************************************************************************
-
********************************************************************************/
bool
NodeReferenceIterator::nextImpl(store::Item_t& aResult, PlanState& aPlanState) const
@@ -43,19 +42,17 @@
store::Item_t lGenerateIdentifier;
zstring lNodeId;
- PlanIteratorState* state;
+ PlanIteratorState *state;
DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState);
consumeNext(lNode, theChildren[0].getp(), aPlanState);
- STACK_PUSH(GENV_STORE.getNodeReference(aResult, lNode), state);
+ STACK_PUSH(GENV_STORE.getReference(aResult, lNode), state);
STACK_END (state);
}
-
/*******************************************************************************
-
********************************************************************************/
bool
NodeByReferenceIterator::nextImpl(store::Item_t& result, PlanState& planState) const
@@ -63,7 +60,7 @@
store::Item_t lUUID;
bool haveResult;
- PlanIteratorState* state;
+ PlanIteratorState *state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
consumeNext(lUUID, theChildren[0].getp(), planState);
@@ -381,8 +378,8 @@
zstring uri_string, lRes;
if(consumeNext(item, theChildren[0].getp(), planState))
{
- store::Item_t item_uri;
- if (GENV_STORE.getNodeReference(item_uri, item.getp()))
+ store::Item_t item_uri;
+ if (GENV_STORE.getReference(item_uri, item.getp()))
{
uri_string = item_uri->getStringValue();
// need to convert the opaque uri into a valid ncname
=== modified file 'src/runtime/schema/schema_impl.cpp'
--- src/runtime/schema/schema_impl.cpp 2011-10-13 19:44:33 +0000
+++ src/runtime/schema/schema_impl.cpp 2011-10-17 21:17:26 +0000
@@ -84,24 +84,27 @@
bool
ZorbaValidateInPlaceIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
- store::Item_t node;
+ store::Item_t item;
- PlanIteratorState* state;
- store::PUL_t pul;
+ PlanIteratorState *state;
+ std::auto_ptr<store::PUL> pul;
+ std::set<store::Item*> nodes;
+ SchemaValidatorImpl validator(loc, theSctx);
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
-
- if (consumeNext(node, theChild.getp(), planState))
+
+ if (consumeNext(item, theChild.getp(), planState))
{
- pul = GENV_ITEMFACTORY->createPendingUpdateList();
-
- pul->addRevalidate(&loc,node);
-
- result.transfer(pul);
+ pul.reset(GENV_ITEMFACTORY->createPendingUpdateList());
+
+ nodes.insert(item.getp());
+
+ validator.validate(nodes, *pul);
+ result = pul.release();
STACK_PUSH(true, state);
}
- STACK_END(state);
+ STACK_END (state);
}
=== modified file 'src/store/api/pul.h'
--- src/store/api/pul.h 2011-10-12 20:59:49 +0000
+++ src/store/api/pul.h 2011-10-17 21:17:26 +0000
@@ -141,9 +141,6 @@
Item_t& typeName,
std::vector<Item_t>& typedValue) = 0;
- virtual void addRevalidate(
- const QueryLoc* aQueryLoc,
- Item_t& target) = 0;
virtual void addPut(
const QueryLoc* aQueryLoc,
=== modified file 'src/store/api/store.h'
--- src/store/api/store.h 2011-10-10 12:56:57 +0000
+++ src/store/api/store.h 2011-10-17 21:17:26 +0000
@@ -95,7 +95,7 @@
* @param node XDM node
* @return the identifier as an item of type xs:anyURI
*/
- virtual bool getNodeReference(Item_t& result, Item* node) = 0;
+ virtual bool getReference(Item_t& result, Item* node) = 0;
/**
* Returns whether a reference has already been generated for the given node.
=== modified file 'src/store/api/update_consts.h'
--- src/store/api/update_consts.h 2011-10-12 20:59:49 +0000
+++ src/store/api/update_consts.h 2011-10-17 21:17:26 +0000
@@ -66,7 +66,6 @@
UP_RENAME_PI,
UP_SET_ATTRIBUTE_TYPE,
UP_SET_ELEMENT_TYPE,
- UP_REVALIDATE,
UP_PUT,
// collection primitives
@@ -207,8 +206,6 @@
return "setAttributeType";
case UP_SET_ELEMENT_TYPE:
return "setElementType";
- case UP_REVALIDATE:
- return "revalidate";
default:
return "unknownUpdatePrimitive";
}
=== modified file 'src/store/naive/node_items.cpp'
--- src/store/naive/node_items.cpp 2011-10-10 12:56:57 +0000
+++ src/store/naive/node_items.cpp 2011-10-17 21:17:26 +0000
@@ -1543,7 +1543,7 @@
InternalNode(store::StoreConsts::elementNode)
{
theName.transfer(nodeName);
- setHaveTypedValue();
+ setHaveValue();
resetRecursive();
if (numBindings > 0)
@@ -1592,10 +1592,10 @@
if (haveTypedValue)
{
- setHaveTypedValue();
+ setHaveValue();
if (haveEmptyValue)
- setHaveEmptyTypedValue();
+ setHaveEmptyValue();
}
if (isInSubstGroup)
@@ -1741,9 +1741,9 @@
if (copymode.theTypePreserve)
{
typeName = getType();
- haveValue = haveTypedValue();
- haveEmptyValue = haveEmptyTypedValue();
- inSubstGroup = isInSubstitutionGroup();
+ haveValue = this->haveValue();
+ haveEmptyValue = this->haveEmptyValue();
+ inSubstGroup = this->isInSubstitutionGroup();
}
else
{
@@ -2187,11 +2187,11 @@
********************************************************************************/
void ElementNode::getTypedValue(store::Item_t& val, store::Iterator_t& iter) const
{
- if (haveTypedValue())
+ if (haveValue())
{
TextNode* textChild;
- if (haveEmptyTypedValue())
+ if (haveEmptyValue())
{
val = NULL;
iter = NULL;
@@ -3470,7 +3470,7 @@
}
}
- ZORBA_ASSERT(p->haveTypedValue() && !p->haveEmptyTypedValue());
+ ZORBA_ASSERT(p->haveValue() && !p->haveEmptyValue());
setTypedValue(content);
if (isListValue)
=== modified file 'src/store/naive/node_items.h'
--- src/store/naive/node_items.h 2011-10-10 12:56:57 +0000
+++ src/store/naive/node_items.h 2011-10-17 21:17:26 +0000
@@ -309,57 +309,31 @@
public:
enum NodeFlags
{
- // Encodes the kind of the node (document, element, attribute, etc.)
- NodeKindMask = 0x7,
-
- // For element nodes only.
- HaveLocalBindings = 0x80,
-
- // For element nodes only.
- HaveBaseUri = 0x10,
-
- // For element nodes only. Set if the target element node has a typed value.
- // The only case when an element node does not have a typed value is when
- // the type of the node is complex with complex content, but with no mixed
- //content allowed.
- HaveTypedValue = 0x20,
-
- // For element nodes only. Set if the target element node has a complex
- // type with empty content. In this case, the typed value of the node is
- // the empty sequence.
- HaveEmptyTypedValue = 0x40,
-
- // For text nodes only. Set if the text node is actually used to store the
- // typed value of its parent element node. In such a case, the remaining
- // children (if any) of the parent node can be comment and/or pi nodes only.
- IsTyped = 0x80,
-
- // For text and attribute nodes only. Set if the typed value stored in the
- // node is actually a sequence of atomic items.
- HaveListValue = 0x100,
-
- // For attribute nodes only.
- IsBaseUri = 0x800,
-
- // For attribute nodes only.
- IsHidden = 0x1000,
-
- // For element nodes only.
- IsInSubstGroup = 0x2000,
+ NodeKindMask = 0x7,
+ IsId = 0x8,
+ IsIdRefs = 0x10,
+ HaveTypedValue = 0x20, // for element nodes only
+ HaveEmptyValue = 0x40, // for element nodes only
+ IsTyped = 0x80, // for text nodes only
+ HaveListValue = 0x100, // for text and attribute nodes only
+
+ HaveLocalBindings = 0x200, // for element nodes only
+ HaveBaseUri = 0x400, // for element nodes only
+ IsBaseUri = 0x800, // for attribute nodes only
+ IsHidden = 0x1000, // for attribute nodes only
+ IsInSubstGroup = 0x2000, // for element nodes only
// For element nodes only. The flag is set for a node N if there is another
// node M in its subtree such that N and M have the same name.
- IsRecursive = 0x4000,
+ IsRecursive = 0x4000,
#ifndef EMBEDED_TYPE
// For element and attribute nodes only. The flag is set if the node has
// a type other than untyped (for elements) or untypedAtomic (for attributes)
- HaveType = 0x8000,
+ HaveType = 0x8000,
#endif
- // For any kind of node. Set if an identifier has been generated for the node
- // (see SimpleStore::getNodeReference() method).
- HaveReference = 0x10000
+ HaveReference = 0x10000
};
protected:
@@ -522,18 +496,13 @@
void setFlags(uint32_t flags) { theFlags = flags; }
- bool haveReference() const { return (theFlags & HaveReference) != 0; }
-
- void setHaveReference() { theFlags |= HaveReference; }
-
- void resetHaveReference() { theFlags &= ~HaveReference; }
+ bool haveReference() const { return (theFlags & HaveReference) != 0; }
+ void setHaveReference() { theFlags |= HaveReference; }
+ void resetHaveReference() { theFlags &= ~HaveReference; }
#ifndef ZORBA_NO_FULL_TEXT
- FTTokenIterator_t getTokens(
- TokenizerProvider const&,
- Tokenizer::Numbers&,
- locale::iso639_1::type,
- bool = false ) const;
+ FTTokenIterator_t getTokens( TokenizerProvider const&, Tokenizer::Numbers&,
+ locale::iso639_1::type, bool = false ) const;
#endif /* ZORBA_NO_FULL_TEXT */
protected:
@@ -928,33 +897,32 @@
void setHaveBaseUri() { theFlags |= HaveBaseUri; }
void resetHaveBaseUri() { theFlags &= ~HaveBaseUri; }
- void setHaveTypedValue() { theFlags |= HaveTypedValue; }
- void resetHaveTypedValue() { theFlags &= ~HaveTypedValue; }
- bool haveTypedValue() const { return (theFlags & HaveTypedValue) != 0; }
-
- void setHaveEmptyTypedValue() { theFlags |= HaveEmptyTypedValue; }
- void resetHaveEmptyTypedValue() { theFlags &= ~HaveEmptyTypedValue; }
- bool haveEmptyTypedValue() const { return (theFlags & HaveEmptyTypedValue) != 0; }
+ void setHaveValue() { theFlags |= HaveTypedValue; }
+ void resetHaveValue() { theFlags &= ~HaveTypedValue; }
+ bool haveValue() const { return (theFlags & HaveTypedValue) != 0; }
+ void setHaveEmptyValue() { theFlags |= HaveEmptyValue; }
+ void resetHaveEmptyValue() { theFlags &= ~HaveEmptyValue; }
+ bool haveEmptyValue() const { return (theFlags & HaveEmptyValue) != 0; }
bool haveTypedTypedValue(TextNode*&) const;
TextNode* getUniqueTextChild() const;
- void setInSubstGroup() { theFlags |= IsInSubstGroup; }
+ void setInSubstGroup() { theFlags |= IsInSubstGroup; }
- void resetInSubstGroup() { theFlags &= ~IsInSubstGroup; }
+ void resetInSubstGroup() { theFlags &= ~IsInSubstGroup; }
#ifndef EMBEDED_TYPE
- bool haveType() const { return (theFlags & HaveType) != 0; }
-
- void setHaveType() { theFlags |= HaveType; }
-
- void resetHaveType() { theFlags &= ~HaveType; }
+ bool haveType() const { return (theFlags & HaveType) != 0; }
+
+ void setHaveType() { theFlags |= HaveType; }
+
+ void resetHaveType() { theFlags &= ~HaveType; }
#endif
- bool isRecursive() const { return (theFlags & IsRecursive) != 0; }
+ bool isRecursive() const { return (theFlags & IsRecursive) != 0; }
- void resetRecursive() { theFlags &= ~IsRecursive; }
+ void resetRecursive() { theFlags &= ~IsRecursive; }
void setRecursive()
{
=== modified file 'src/store/naive/node_updates.cpp'
--- src/store/naive/node_updates.cpp 2011-10-10 12:56:57 +0000
+++ src/store/naive/node_updates.cpp 2011-10-17 21:17:26 +0000
@@ -660,8 +660,8 @@
undoList.resize(++undoSize);
undoList[undoSize - 1].transfer(tinfo);
- n->setHaveTypedValue();
- n->resetHaveEmptyTypedValue();
+ n->setHaveValue();
+ n->resetHaveEmptyValue();
n->resetInSubstGroup();
revalidationNode = currNode;
=== modified file 'src/store/naive/pul_primitive_factory.cpp'
--- src/store/naive/pul_primitive_factory.cpp 2011-10-12 20:59:49 +0000
+++ src/store/naive/pul_primitive_factory.cpp 2011-10-17 21:17:26 +0000
@@ -230,18 +230,7 @@
{
return new UpdSetAttributeType(pul, aLoc, target, typeName, typedValue, haveListValue);
}
-
-/***************************************************************************
-
-***************************************************************************/
-UpdRevalidate*
-PULPrimitiveFactory::createUpdRevalidate(
- PULImpl* pul,
- const QueryLoc* aLoc,
- store::Item_t& target)
-{
- return new UpdRevalidate(pul, aLoc, target);
-}
+
/***************************************************************************
=== modified file 'src/store/naive/pul_primitive_factory.h'
--- src/store/naive/pul_primitive_factory.h 2011-10-12 20:59:49 +0000
+++ src/store/naive/pul_primitive_factory.h 2011-10-17 21:17:26 +0000
@@ -40,7 +40,6 @@
class UpdReplaceCommentValue;
class UpdSetElementType;
class UpdSetAttributeType;
- class UpdRevalidate;
class UpdPut;
class UpdCreateCollection;
class UpdDeleteCollection;
@@ -215,14 +214,6 @@
bool haveListValue);
/***************************************************************************
- ***************************************************************************/
- virtual UpdRevalidate*
- createUpdRevalidate(
- PULImpl* pul,
- const QueryLoc*,
- store::Item_t& target);
-
- /***************************************************************************
***************************************************************************/
virtual UpdPut*
createUpdPut(PULImpl* pul, const QueryLoc*, store::Item_t& target, store::Item_t& uri);
=== modified file 'src/store/naive/pul_primitives.cpp'
--- src/store/naive/pul_primitives.cpp 2011-10-13 19:44:33 +0000
+++ src/store/naive/pul_primitives.cpp 2011-10-17 21:17:26 +0000
@@ -25,14 +25,12 @@
#include "store/naive/node_items.h"
#include "store/naive/atomic_items.h"
#include "store/naive/simple_collection.h"
-#include "store/naive/simple_item_factory.h"
#include "store/naive/node_factory.h"
#include "store/naive/simple_index.h"
#include "store/naive/simple_index_value.h"
#include "store/api/iterator.h"
#include "store/api/copymode.h"
-#include "store/api/validator.h"
#include "diagnostics/xquery_diagnostics.h"
@@ -466,24 +464,13 @@
void UpdSetElementType::apply()
{
ElementNode* target = ELEM_NODE(theTarget);
+
+ target->setType(theTypeName);
+
TextNode* textChild;
- theOldTypeName = target->getType();
- theOldHaveTypedValue = target->haveTypedValue();
- theOldHaveTypedTypedValue = target->haveTypedTypedValue(textChild);
-
- if (theOldHaveTypedValue)
- theOldHaveEmptyTypedValue = target->haveEmptyTypedValue();
-
- theOldIsInSubstitutionGroup = target->isInSubstitutionGroup();
-
- target->setType(theTypeName);
-
- if (theOldHaveTypedTypedValue)
+ if (target->haveTypedTypedValue(textChild))
{
- theOldHaveListTypedValue = textChild->haveListValue();
- theOldTypedValue = textChild->getValue();
-
zstring textValue;
textChild->getStringValue2(textValue);
@@ -493,89 +480,31 @@
textChild->setText(textValue);
}
- if (theHaveTypedValue)
+ if (theHaveValue)
{
- target->setHaveTypedValue();
-
- if (theHaveEmptyTypedValue)
- target->setHaveEmptyTypedValue();
- else
- target->resetHaveEmptyTypedValue();
-
- if (theHaveTypedTypedValue)
+ target->setHaveValue();
+
+ if (theHaveEmptyValue)
+ target->setHaveEmptyValue();
+
+ if (theHaveTypedValue)
{
- textChild = target->getUniqueTextChild();
+ TextNode* textChild = target->getUniqueTextChild();
textChild->setTypedValue(theTypedValue);
-
- if (theHaveListTypedValue)
+ if (theHaveListValue)
textChild->setHaveListValue();
- else
- textChild->resetHaveListValue();
}
}
else
{
- target->resetHaveTypedValue();
+ target->resetHaveValue();
}
if (theIsInSubstitutionGroup)
target->setInSubstGroup();
- else
- target->resetInSubstGroup();
-
- theIsApplied = true;
-}
-
-
-void UpdSetElementType::undo()
-{
- if (theIsApplied)
- {
- ElementNode* target = ELEM_NODE(theTarget);
-
- target->setType(theOldTypeName);
-
- if (theHaveTypedTypedValue)
- {
- TextNode* textChild = target->getUniqueTextChild();
- textChild->revertToTextContent();
- }
-
- if (theOldHaveTypedValue)
- {
- target->setHaveTypedValue();
-
- if (theOldHaveEmptyTypedValue)
- target->setHaveEmptyTypedValue();
- else
- target->resetHaveEmptyTypedValue();
-
- if (theOldHaveTypedTypedValue)
- {
- TextNode* textChild = target->getUniqueTextChild();
-
- textChild->setTypedValue(theOldTypedValue);
-
- if (theOldHaveListTypedValue)
- textChild->setHaveListValue();
- else
- textChild->resetHaveListValue();
- }
- }
- else
- {
- target->resetHaveTypedValue();
- }
-
- if (theOldIsInSubstitutionGroup)
- target->setInSubstGroup();
- else
- target->resetInSubstGroup();
-
- theIsApplied = false;
- }
-}
+}
+
/*******************************************************************************
@@ -619,8 +548,7 @@
ElementNode* parent = reinterpret_cast<ElementNode*>(attr->getParent());
parent->checkUniqueAttrs();
}
- }
- catch (ZorbaException& e)
+ } catch (ZorbaException& e)
{
set_source(e, *theLoc);
throw;
@@ -635,76 +563,11 @@
{
AttributeNode* target = ATTR_NODE(theTarget);
- theOldTypeName = target->getType();
- theOldTypedValue.transfer(target->theTypedValue);
- theOldHaveListValue = target->haveListValue();
-
target->setType(theTypeName);
target->theTypedValue.transfer(theTypedValue);
if (theHaveListValue)
target->setHaveListValue();
- else
- target->resetHaveListValue();
-
- theIsApplied = true;
-}
-
-
-void UpdSetAttributeType::undo()
-{
- if (theIsApplied)
- {
- AttributeNode* target = ATTR_NODE(theTarget);
- target->setType(theOldTypeName);
- target->theTypedValue.transfer(theOldTypedValue);
-
- if (theOldHaveListValue)
- target->setHaveListValue();
- else
- target->resetHaveListValue();
-
- theIsApplied = false;
- }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
-void UpdRevalidate::apply()
-{
-#ifndef ZORBA_NO_XMLSCHEMA
- std::set<store::Item*> nodes;
-
- theRevalidationPul = GET_STORE().getItemFactory()->createPendingUpdateList();
-
- nodes.insert(theTarget.getp());
-
- if (!thePul->theValidator)
- return;
-
- thePul->theValidator->validate(nodes, *theRevalidationPul.getp());
-
- try
- {
- theRevalidationPul->applyUpdates(false);
- }
- catch (...)
- {
- ZORBA_FATAL(0, "Error during the in-place validation");
- }
-
- theIsApplied = true;
-#endif
-}
-
-
-void UpdRevalidate::undo()
-{
-#ifndef ZORBA_NO_XMLSCHEMA
- static_cast<PULImpl *>(theRevalidationPul.getp())->undoUpdates();
-#endif
}
@@ -944,8 +807,7 @@
void UpdDeleteCollection::apply()
{
theCollection = GET_STORE().getCollection(theName, theDynamicCollection);
- if (theCollection == NULL)
- return;//If two delete collection are issued in the same snapshot is a noop
+ assert(theCollection);
SimpleCollection* collection = static_cast<SimpleCollection*>(theCollection.getp());
std::vector<store::Index*> indexes;
=== modified file 'src/store/naive/pul_primitives.h'
--- src/store/naive/pul_primitives.h 2011-10-13 19:44:33 +0000
+++ src/store/naive/pul_primitives.h 2011-10-17 21:17:26 +0000
@@ -24,11 +24,11 @@
#include "store/api/collection.h"
#include "store/api/iterator.h"
#include "store/api/annotation.h"
-#include "store/api/pul.h"
#include "store/api/index.h" // for index spec obj
#include "store/api/ic.h" // for index spec obj
+
namespace zorba { namespace simplestore {
@@ -673,37 +673,17 @@
/*******************************************************************************
- theTypeName:
- ------------
- The qname of this node's data type.
-
- theTypedValue:
- --------------
-
- theHaveTypedValue:
- ------------------
- True if the target element node has a typed value. The only case when an
- element node does not have a typed value is when the type of the node is
- complex with complex content, but with no mixed content allowed.
-
- theHaveEmptyTypedValue:
- -----------------------
- True if the target element node has a complex type with empty content. In
- this case, the typed value of the node is the empty sequence.
-
- theHaveTypedTypedValue:
- ------------------
- True if the target element node has a typed value whose type is not
- untypedAtomic. Note: This can happen only if the type of the target element
- node has simple content.
-
- theHaveListTypedValue:
- -----------------
- True if theHaveTypedTypedValue is true, and the type of the typed value is a
- list type.
-
- theIsInSubstitutionGroup:
- -------------------------
+ theHaveValue : True if the target element node has a typed value. The only
+ case when an element node does not have a typed value is
+ when the type of the node is complex with complex content,
+ but with no mixed content allowed.
+ theHaveEmptyValue : True if the target element node has a complex type with
+ empty content.
+ theHaveTypedValue : True if the target element node has a typed value whose
+ type is not untypedAtomic. Note: This can happen only if
+ the type of the target element node has simple content.
+ theHaveListValue : True if theHaveTypedValue is true, and the type of the
+ typed value is a list type.
********************************************************************************/
class UpdSetElementType : public UpdatePrimitive
{
@@ -713,40 +693,29 @@
protected:
store::Item_t theTypeName;
store::Item_t theTypedValue;
-
+ bool theHaveValue;
+ bool theHaveEmptyValue;
bool theHaveTypedValue;
- bool theHaveEmptyTypedValue;
- bool theHaveTypedTypedValue;
- bool theHaveListTypedValue;
+ bool theHaveListValue;
bool theIsInSubstitutionGroup;
- store::Item_t theOldTypeName;
- store::Item_t theOldTypedValue;
-
- bool theOldHaveTypedValue;
- bool theOldHaveEmptyTypedValue;
- bool theOldHaveTypedTypedValue;
- bool theOldHaveListTypedValue;
- bool theOldIsInSubstitutionGroup;
-
-
UpdSetElementType(
PULImpl* pul,
const QueryLoc* aLoc,
store::Item_t& target,
store::Item_t& typeName,
store::Item_t& typedValue,
+ bool haveValue,
+ bool haveEmptyValue,
bool haveTypedValue,
- bool haveEmptyTypedValue,
- bool haveTypedTypedValue,
- bool haveListTypedValue,
+ bool haveListValue,
bool isInSubstitutionGroup)
:
UpdatePrimitive(pul, aLoc, target),
+ theHaveValue(haveValue),
+ theHaveEmptyValue(haveEmptyValue),
theHaveTypedValue(haveTypedValue),
- theHaveEmptyTypedValue(haveEmptyTypedValue),
- theHaveTypedTypedValue(haveTypedTypedValue),
- theHaveListTypedValue(haveListTypedValue),
+ theHaveListValue(haveListValue),
theIsInSubstitutionGroup(isInSubstitutionGroup)
{
theTypeName.transfer(typeName);
@@ -760,7 +729,7 @@
}
void apply();
- void undo();
+ void undo() {}
};
@@ -777,10 +746,6 @@
store::Item_t theTypedValue;
bool theHaveListValue;
- store::Item_t theOldTypeName;
- store::Item_t theOldTypedValue;
- bool theOldHaveListValue;
-
UpdSetAttributeType(
PULImpl* pul,
const QueryLoc* aLoc,
@@ -803,37 +768,7 @@
}
void apply();
- void undo();
-};
-
-
-/*******************************************************************************
- This primitive is generated by the validate-in-place function (in module
- http://www.zorba-xquery.com/modules/schema)
-********************************************************************************/
-class UpdRevalidate : public UpdatePrimitive
-{
- friend class PULImpl;
- friend class PULPrimitiveFactory;
-
-protected:
- store::PUL_t theRevalidationPul;
-
-protected:
- UpdRevalidate(PULImpl* pul, const QueryLoc* aLoc, store::Item_t& target)
- :
- UpdatePrimitive(pul, aLoc, target)
- {
- }
-
-public:
- store::UpdateConsts::UpdPrimKind getKind() const
- {
- return store::UpdateConsts::UP_REVALIDATE;
- }
-
- void apply();
- void undo();
+ void undo() {}
};
=== modified file 'src/store/naive/simple_item_factory.cpp'
--- src/store/naive/simple_item_factory.cpp 2011-10-12 07:17:05 +0000
+++ src/store/naive/simple_item_factory.cpp 2011-10-17 21:17:26 +0000
@@ -162,7 +162,7 @@
for ( unsigned int i = 0; i < atomicTextValues.size() ; i++)
{
store::Item_t resultItem;
- if ( createNMTOKEN(resultItem, atomicTextValues[i]) )
+ if ( createNMTOKENS(resultItem, atomicTextValues[i]) )
{
typedValues.push_back(resultItem.getp());
}
=== modified file 'src/store/naive/simple_pul.cpp'
--- src/store/naive/simple_pul.cpp 2011-10-14 08:01:44 +0000
+++ src/store/naive/simple_pul.cpp 2011-10-17 21:17:26 +0000
@@ -185,46 +185,47 @@
{
const QNameItem* collName;
- assert(target->isNode());
-
- const XmlNode* n = static_cast<const XmlNode*>(target);
-
- const store::Collection* collection = n->getCollection();
-
- if (collection != NULL)
- {
- collName = static_cast<const QNameItem*>(collection->getName())->getNormalized();
-
- if (collName == theLastCollection)
+ if (target->isNode())
+ {
+ const XmlNode* n = static_cast<const XmlNode*>(target);
+
+ const store::Collection* collection = n->getCollection();
+
+ if (collection != NULL)
+ {
+ collName = static_cast<const QNameItem*>(collection->getName())->getNormalized();
+
+ if (collName == theLastCollection)
+ return theLastPul;
+ }
+ else if (theNoCollectionPul != NULL)
+ {
+ return theNoCollectionPul;
+ }
+ else if (theCollectionPuls[NULL] != NULL)
+ {
+ theNoCollectionPul = theCollectionPuls[NULL];
+ return theNoCollectionPul;
+ }
+ else
+ {
+ theNoCollectionPul = new CollectionPul(this, NULL);
+ theCollectionPuls[NULL] = theNoCollectionPul;
+ return theNoCollectionPul;
+ }
+ }
+ else
+ {
+ // "taret" is the name of a collection.
+ if (target == theLastCollection)
+ {
return theLastPul;
- return getCollectionPulByName(collName,collection->isDynamic());
- }
- else if (theNoCollectionPul != NULL)
- {
- return theNoCollectionPul;
- }
- else if (theCollectionPuls[NULL] != NULL)
- {
- theNoCollectionPul = theCollectionPuls[NULL];
- return theNoCollectionPul;
- }
- else
- {
- theNoCollectionPul = new CollectionPul(this, NULL);
- theCollectionPuls[NULL] = theNoCollectionPul;
- return theNoCollectionPul;
- }
-}
-
-CollectionPul* PULImpl::getCollectionPulByName(const store::Item* name, bool dynamicCollection)
-{
- const QNameItem* collName = static_cast<const QNameItem*>(name)->getNormalized();
-
- assert(!name->isNode());
-
- // "name" is the name of a collection.
- if (name == theLastCollection)
- return theLastPul;
+ }
+ else
+ {
+ collName = static_cast<const QNameItem*>(target)->getNormalized();
+ }
+ }
CollectionPulMap::iterator ite = theCollectionPuls.find(collName);
@@ -237,7 +238,7 @@
else
{
SimpleCollection* collection = static_cast<SimpleCollection*>
- (GET_STORE().getCollection(collName,dynamicCollection).getp());
+ (GET_STORE().getCollection(collName).getp());
theLastPul = new CollectionPul(this, collection);
theCollectionPuls[collName] = theLastPul;
}
@@ -799,35 +800,6 @@
}
-void PULImpl::addRevalidate(
- const QueryLoc* aQueryLoc,
- store::Item_t& target)
-{
- CollectionPul* pul = getCollectionPul(target.getp());
-
- XmlNode* n = BASE_NODE(target);
-
- NodeUpdates* updates = 0;
- bool found = pul->theNodeToUpdatesMap.get(n, updates);
-
- UpdRevalidate* upd = GET_STORE().getPULFactory().
- createUpdRevalidate(this, aQueryLoc, target);
-
- pul->theRevalidateList.push_back(upd);
-
- if (!found)
- {
- updates = new NodeUpdates(1);
- (*updates)[0] = upd;
- pul->theNodeToUpdatesMap.insert(n, updates);
- }
- else
- {
- updates->push_back(upd);
- }
-}
-
-
/*******************************************************************************
Collection primitives
********************************************************************************/
@@ -838,7 +810,7 @@
const store::Item_t& nodeType,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theCreateCollectionList.push_back(
GET_STORE().getPULFactory().createUpdCreateCollection(
@@ -856,7 +828,7 @@
store::Item_t& name,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theDeleteCollectionList.push_back(
GET_STORE().getPULFactory().createUpdDeleteCollection(pul, aQueryLoc, name, dyn_collection));
@@ -869,7 +841,7 @@
std::vector<store::Item_t>& nodes,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theInsertIntoCollectionList.push_back(
GET_STORE().getPULFactory().createUpdInsertIntoCollection(pul, aQueryLoc, name, nodes, dyn_collection));
@@ -882,7 +854,7 @@
std::vector<store::Item_t>& nodes,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theInsertIntoCollectionList.push_back(
GET_STORE().getPULFactory().createUpdInsertFirstIntoCollection(pul, aQueryLoc, name, nodes, dyn_collection));
@@ -895,7 +867,7 @@
std::vector<store::Item_t>& nodes,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theInsertIntoCollectionList.push_back(
GET_STORE().getPULFactory().createUpdInsertLastIntoCollection(pul, aQueryLoc, name, nodes, dyn_collection));
@@ -909,7 +881,7 @@
std::vector<store::Item_t>& nodes,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theInsertIntoCollectionList.push_back(
GET_STORE().getPULFactory().createUpdInsertBeforeIntoCollection(pul, aQueryLoc, name, target, nodes, dyn_collection));
@@ -923,7 +895,7 @@
std::vector<store::Item_t>& nodes,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theInsertIntoCollectionList.push_back(
GET_STORE().getPULFactory().createUpdInsertAfterIntoCollection(pul, aQueryLoc, name, target, nodes, dyn_collection));
@@ -937,7 +909,7 @@
bool isLast,
bool dyn_collection)
{
- CollectionPul* pul = getCollectionPulByName(name.getp(),dyn_collection);
+ CollectionPul* pul = getCollectionPul(name.getp());
pul->theDeleteFromCollectionList.push_back(
GET_STORE().getPULFactory().createUpdDeleteNodesFromCollection(pul, aQueryLoc, name, nodes, isLast, dyn_collection));
@@ -1134,12 +1106,6 @@
otherPul->theDeleteList,
UP_LIST_DELETE);
- // Merge revalidation primitives
- mergeUpdateList(thisPul,
- thisPul->theRevalidateList,
- otherPul->theRevalidateList,
- UP_LIST_NONE);
-
// Merge collection primitives
mergeUpdateList(thisPul,
thisPul->theCreateCollectionList,
@@ -1186,21 +1152,22 @@
}
// Merge fn:put primitives
- csize numPuts = thePutList.size();
- csize numOtherPuts = otherp->thePutList.size();
+ ulong numPuts = (ulong)thePutList.size();
+ ulong numOtherPuts = (ulong)otherp->thePutList.size();
- for (csize i = 0; i < numOtherPuts; ++i)
+ for (ulong i = 0; i < numOtherPuts; ++i)
{
UpdPut* otherUpd = static_cast<UpdPut*>(otherp->thePutList[i]);
- for (csize j = 0; j < numPuts; ++j)
+ for (ulong j = 0; j < numPuts; ++j)
{
UpdPut* upd = static_cast<UpdPut*>(thePutList[j]);
if (upd->theTargetUri->equals(otherUpd->theTargetUri))
{
- throw XQUERY_EXCEPTION(err::XUDY0031,
- ERROR_PARAMS(upd->theTargetUri->getStringValue()));
+ throw XQUERY_EXCEPTION(
+ err::XUDY0031, ERROR_PARAMS( upd->theTargetUri->getStringValue() )
+ );
}
}
@@ -1275,18 +1242,18 @@
std::vector<UpdatePrimitive*>& otherList,
UpdListKind listKind)
{
- csize numUpdates;
- csize numOtherUpdates;
-
- numUpdates = myList.size();
- numOtherUpdates = otherList.size();
-
- for (csize i = 0; i < numOtherUpdates; ++i)
+ ulong numUpdates;
+ ulong numOtherUpdates;
+
+ numUpdates = (ulong)myList.size();
+ numOtherUpdates = (ulong)otherList.size();
+
+ for (ulong i = 0; i < numOtherUpdates; ++i)
{
if (listKind == UP_LIST_CREATE_COLLECTION)
{
UpdCreateCollection* otherUpd = static_cast<UpdCreateCollection*>(otherList[i]);
- for (csize j = 0; j < numUpdates; ++j)
+ for (ulong j = 0; j < myList.size(); ++j)
{
if (myList[j]->getKind() == store::UpdateConsts::UP_CREATE_COLLECTION)
{
@@ -1305,7 +1272,7 @@
else if (listKind == UP_LIST_CREATE_INDEX)
{
UpdCreateIndex* otherUpd = static_cast<UpdCreateIndex*>(otherList[i]);
- for (csize j = 0; j < numUpdates; ++j)
+ for (ulong j = 0; j < myList.size(); ++j)
{
if (myList[j]->getKind() == store::UpdateConsts::UP_CREATE_INDEX)
{
@@ -1367,18 +1334,22 @@
for (ulong j = 0; j < numTargetUpdates; j++)
{
if (store::UpdateConsts::isRename((*targetUpdates)[j]->getKind()))
- throw XQUERY_EXCEPTION(err::XUDY0015,
- ERROR_LOC((*targetUpdates)[j]->theLoc));
+ throw XQUERY_EXCEPTION(
+ err::XUDY0015,
+ ERROR_LOC( (*targetUpdates)[j]->theLoc )
+ );
}
}
else if (store::UpdateConsts::isReplaceValue(updKind))
{
- csize numTargetUpdates = targetUpdates->size();
- for (csize j = 0; j < numTargetUpdates; j++)
+ ulong numTargetUpdates = (ulong)targetUpdates->size();
+ for (ulong j = 0; j < numTargetUpdates; j++)
{
if (store::UpdateConsts::isReplaceValue((*targetUpdates)[j]->getKind()))
- throw XQUERY_EXCEPTION(err::XUDY0017,
- ERROR_LOC((*targetUpdates)[j]->theLoc));
+ throw XQUERY_EXCEPTION(
+ err::XUDY0017,
+ ERROR_LOC( (*targetUpdates)[j]->theLoc )
+ );
}
}
break;
@@ -1387,12 +1358,14 @@
{
if (store::UpdateConsts::isReplaceNode(updKind))
{
- csize numTargetUpdates = (ulong)targetUpdates->size();
- for (csize j = 0; j < numTargetUpdates; ++j)
+ ulong numTargetUpdates = (ulong)targetUpdates->size();
+ for (ulong j = 0; j < numTargetUpdates; ++j)
{
if (store::UpdateConsts::isReplaceNode((*targetUpdates)[j]->getKind()))
- throw XQUERY_EXCEPTION(err::XUDY0016,
- ERROR_LOC((*targetUpdates)[j]->theLoc));
+ throw XQUERY_EXCEPTION(
+ err::XUDY0016,
+ ERROR_LOC( (*targetUpdates)[j]->theLoc )
+ );
}
}
break;
@@ -1401,12 +1374,14 @@
{
if (updKind == store::UpdateConsts::UP_REPLACE_CONTENT)
{
- csize numTargetUpdates = targetUpdates->size();
- for (csize j = 0; j < numTargetUpdates; ++j)
+ ulong numTargetUpdates = (ulong)targetUpdates->size();
+ for (ulong j = 0; j < numTargetUpdates; ++j)
{
if ((*targetUpdates)[j]->getKind() == store::UpdateConsts::UP_REPLACE_CONTENT)
- throw XQUERY_EXCEPTION(err::XUDY0017,
- ERROR_LOC((*targetUpdates)[j]->theLoc));
+ throw XQUERY_EXCEPTION(
+ err::XUDY0017,
+ ERROR_LOC( (*targetUpdates)[j]->theLoc )
+ );
}
}
break;
@@ -1415,8 +1390,8 @@
{
if (updKind == store::UpdateConsts::UP_DELETE)
{
- csize numTargetUpdates = targetUpdates->size();
- csize j;
+ ulong numTargetUpdates = (ulong)targetUpdates->size();
+ ulong j;
for (j = 0; j < numTargetUpdates; ++j)
{
if ((*targetUpdates)[j]->getKind() == store::UpdateConsts::UP_DELETE)
@@ -1543,8 +1518,8 @@
UpdCollection* upd = static_cast<UpdCollection*>
(pul->theInsertIntoCollectionList[i]);
- csize numDocs = upd->numNodes();
- for (csize j = 0; j < numDocs; ++j)
+ ulong numDocs = upd->numNodes();
+ for (ulong j = 0; j < numDocs; ++j)
pul->theInsertedDocs.push_back(static_cast<XmlNode*>(upd->getNode(j)));
}
@@ -1555,8 +1530,8 @@
UpdCollection* upd = static_cast<UpdCollection*>
(pul->theDeleteFromCollectionList[i]);
- csize numDocs = upd->numNodes();
- for (csize j = 0; j < numDocs; ++j)
+ ulong numDocs = upd->numNodes();
+ for (ulong j = 0; j < numDocs; ++j)
pul->theDeletedDocs.push_back(static_cast<XmlNode*>(upd->getNode(j)));
}
}
@@ -1606,7 +1581,7 @@
store::Index* idx,
store::IndexEntryCreator* creator)
{
- CollectionPul* pul = getCollectionPulByName(collectionName,false);
+ CollectionPul* pul = getCollectionPul(collectionName);
pul->theIncrementalIndices.push_back(static_cast<IndexImpl*>(idx));
pul->theIndexEntryCreators.push_back(creator);
@@ -1735,8 +1710,6 @@
{
try
{
- undoList(theValidationList);
-
CollectionPulMap::iterator collIte = theCollectionPuls.begin();
CollectionPulMap::iterator collEnd = theCollectionPuls.end();
@@ -1790,7 +1763,6 @@
cleanList(theReplaceNodeList);
cleanList(theReplaceContentList);
cleanList(theDeleteList);
- cleanList(theRevalidateList);
cleanList(theCreateCollectionList);
cleanList(theInsertIntoCollectionList);
@@ -1816,8 +1788,6 @@
switchPulInPrimitivesList(theReplaceNodeList);
switchPulInPrimitivesList(theReplaceContentList);
switchPulInPrimitivesList(theDeleteList);
- switchPulInPrimitivesList(theRevalidateList);
-
switchPulInPrimitivesList(theCreateCollectionList);
switchPulInPrimitivesList(theInsertIntoCollectionList);
switchPulInPrimitivesList(theDeleteFromCollectionList);
@@ -2071,62 +2041,58 @@
{
InternalNode* node = (*it);
- for (csize i = 0; i < node->numChildren()-1; ++i)
- {
- if (node->getChild(i)->getNodeKind() == store::StoreConsts::textNode &&
+ for (csize i = 0; i < node->numChildren()-1; ++i)
+ {
+ if (node->getChild(i)->getNodeKind() == store::StoreConsts::textNode &&
node->getChild(i+1)->getNodeKind() == store::StoreConsts::textNode)
- {
+ {
TextNode* mergedNode = reinterpret_cast<TextNode*>(node->getChild(i));
- TextNodeMerge mergeInfo(node, i);
+ TextNodeMerge mergeInfo(node, i);
mergeInfo.theMergedNodes.push_back(mergedNode);
node->removeChild(i);
- zstring newContent = mergedNode->getText();
+ zstring newContent = mergedNode->getText();
csize j = i;
- while (j < node->numChildren() &&
- node->getChild(j)->getNodeKind() == store::StoreConsts::textNode)
- {
- TextNode* mergedNode = reinterpret_cast<TextNode*>(node->getChild(j));
- newContent += mergedNode->getText();
- node->removeChild(j);
- mergeInfo.theMergedNodes.push_back(mergedNode);
- }
+ while (j < node->numChildren() &&
+ node->getChild(j)->getNodeKind() == store::StoreConsts::textNode)
+ {
+ TextNode* mergedNode = reinterpret_cast<TextNode*>(node->getChild(j));
+ newContent += mergedNode->getText();
+ node->removeChild(j);
+ mergeInfo.theMergedNodes.push_back(mergedNode);
+ }
- theMergeList.push_back(mergeInfo);
+ theMergeList.push_back(mergeInfo);
(void)GET_NODE_FACTORY().createTextNode(node->getTree(),
- node,
- false,
- i,
- newContent);
- }
- }
+ node,
+ false,
+ i,
+ newContent);
+ }
+ }
}
#ifndef ZORBA_NO_XMLSCHEMA
// Revalidate the updated docs
if (thePul->theValidator != NULL && !theValidationNodes.empty())
{
- theValidationPul = GET_STORE().getItemFactory()->createPendingUpdateList();
+ store::PUL_t validationPul =
+ GET_STORE().getItemFactory()->createPendingUpdateList();
- thePul->theValidator->validate(theValidationNodes, *theValidationPul.getp());
+ thePul->theValidator->validate(theValidationNodes, *validationPul.getp());
try
{
- theValidationPul->applyUpdates(false);
+ validationPul->applyUpdates(false);
}
catch (...)
{
ZORBA_FATAL(0, "Error during the application of the validation PUL");
}
}
-
- if (thePul->theValidator != NULL)
- {
- applyList(theRevalidateList);
- }
#endif
// Apply collection primitives, except delete primitives
@@ -2172,8 +2138,8 @@
// If necessary, adjust the position of trees inside this collection.
if (theAdjustTreePositions)
{
- assert(theCollection);
- theCollection->adjustTreePositions();
+ if (theCollection) // ??? not set if the collection is dynamic
+ theCollection->adjustTreePositions();
}
// Detach nodes that were deleted from their trees due to replace-node,
@@ -2269,17 +2235,6 @@
undoList(theInsertIntoCollectionList);
undoList(theCreateCollectionList);
-#ifndef ZORBA_NO_XMLSCHEMA
- // Undo validate-in-place validation
- undoList(theRevalidateList);
-
- // Undo apply-updates caused validation
- if (theValidationPul)
- {
- undoList(static_cast<PULImpl *>(theValidationPul.getp())->theValidationList);
- }
-#endif
-
// Undo text node merging
std::vector<TextNodeMerge>::reverse_iterator rit = theMergeList.rbegin();
std::vector<TextNodeMerge>::reverse_iterator rend = theMergeList.rend();
=== modified file 'src/store/naive/simple_pul.h'
--- src/store/naive/simple_pul.h 2011-10-12 20:59:49 +0000
+++ src/store/naive/simple_pul.h 2011-10-17 21:17:26 +0000
@@ -166,8 +166,6 @@
std::set<store::Item*> theValidationNodes;
- store::PUL_t theValidationPul;
-
bool theAdjustTreePositions;
bool theIsApplied;
@@ -185,9 +183,6 @@
std::vector<UpdatePrimitive*> theDeleteFromCollectionList;
std::vector<UpdatePrimitive*> theDeleteCollectionList;
- // Validate in place primitives
- std::vector<UpdatePrimitive*> theRevalidateList;
-
// Index Maintenance
std::set<XmlNode*> theModifiedDocs;
std::vector<XmlNode*> theInsertedDocs;
@@ -256,7 +251,6 @@
class PULImpl : public store::PUL
{
friend class CollectionPul;
- friend class UpdRevalidate;
public:
enum UpdListKind
@@ -409,10 +403,6 @@
store::Item_t& typeName,
std::vector<store::Item_t>& typedValue);
- void addRevalidate(
- const QueryLoc* aQueryLoc,
- store::Item_t& target);
-
// Collection primitives
void addCreateCollection(
const QueryLoc* aQueryLoc,
@@ -573,10 +563,6 @@
CollectionPul* getCollectionPul(const store::Item* target);
- CollectionPul* getCollectionPulByName(
- const store::Item* name,
- bool dynamicCollection = false);
-
void undoUpdates();
};
=== modified file 'src/store/naive/simple_store.cpp'
--- src/store/naive/simple_store.cpp 2011-10-10 12:56:57 +0000
+++ src/store/naive/simple_store.cpp 2011-10-17 21:17:26 +0000
@@ -1348,7 +1348,7 @@
@param node XDM node
@return the identifier as an item of type xs:anyURI
********************************************************************************/
-bool SimpleStore::getNodeReference(store::Item_t& result, store::Item* node)
+bool SimpleStore::getReference(store::Item_t& result, store::Item* node)
{
XmlNode* xmlNode = static_cast<XmlNode*>(node);
=== modified file 'src/store/naive/simple_store.h'
--- src/store/naive/simple_store.h 2011-10-10 12:56:57 +0000
+++ src/store/naive/simple_store.h 2011-10-17 21:17:26 +0000
@@ -341,7 +341,7 @@
/* ------------------------ Node Reference Management ---------------------------*/
- bool getNodeReference(store::Item_t& result, store::Item* node);
+ bool getReference(store::Item_t& result, store::Item* node);
bool hasReference(const store::Item* node);
=== modified file 'src/util/stl_util.h'
--- src/util/stl_util.h 2011-10-11 17:59:20 +0000
+++ src/util/stl_util.h 2011-10-17 21:17:26 +0000
@@ -198,6 +198,26 @@
///////////////////////////////////////////////////////////////////////////////
+template<typename T>
+struct is_double {
+ static bool const value = false;
+};
+
+template<>
+struct is_double<double> {
+ static bool const value = true;
+};
+
+template<typename T>
+struct is_float {
+ static bool const value = false;
+};
+
+template<>
+struct is_float<float> {
+ static bool const value = true;
+};
+
template<typename NumericType> inline
typename std::enable_if<ZORBA_TR1_NS::is_signed<NumericType>::value,bool>::type
ge0( NumericType n ) {
=== modified file 'src/util/string_util.h'
--- src/util/string_util.h 2011-10-11 17:59:20 +0000
+++ src/util/string_util.h 2011-10-17 21:17:26 +0000
@@ -510,8 +510,7 @@
* @throws range_error if the number overflows/underflows.
*/
template<typename NumericType> inline
-typename std::enable_if<ZORBA_TR1_NS::is_same<NumericType,double>::value,
- NumericType>::type
+typename std::enable_if<is_double<NumericType>::value,NumericType>::type
aton( char const *s ) {
return atod( s );
}
@@ -528,8 +527,7 @@
* @throws range_error if the number overflows/underflows.
*/
template<typename NumericType> inline
-typename std::enable_if<ZORBA_TR1_NS::is_same<NumericType,float>::value,
- NumericType>::type
+typename std::enable_if<is_float<NumericType>::value,NumericType>::type
aton( char const *s ) {
return atof( s );
}
=== removed file 'test/rbkt/ExpQueryResults/zorba/collections/delete_double.xml.res'
--- test/rbkt/ExpQueryResults/zorba/collections/delete_double.xml.res 2011-10-06 12:48:27 +0000
+++ test/rbkt/ExpQueryResults/zorba/collections/delete_double.xml.res 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-OK
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/collections/dynamic3.xml.res'
--- test/rbkt/ExpQueryResults/zorba/collections/dynamic3.xml.res 2011-10-10 10:04:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/collections/dynamic3.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<center1/><c1/><c2/><oldlast/>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/collections/dynamic4.xml.res'
--- test/rbkt/ExpQueryResults/zorba/collections/dynamic4.xml.res 2011-10-10 10:04:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/collections/dynamic4.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<center1/><c1/><c2/><oldlast/>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/collections/dynamic5.xml.res'
--- test/rbkt/ExpQueryResults/zorba/collections/dynamic5.xml.res 2011-10-10 10:04:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/collections/dynamic5.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<c1/><c2/><center1/><oldlast/>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-18.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-18.xml.res 2011-10-12 07:17:05 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-18.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<note nmt="aaa"/>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/schemas/val-inplace3.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/val-inplace3.xml.res 2011-10-12 21:45:40 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/val-inplace3.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-new new
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/schemas/val-inplace4.xml.res'
--- test/rbkt/ExpQueryResults/zorba/schemas/val-inplace4.xml.res 2011-10-12 21:45:40 +0000
+++ test/rbkt/ExpQueryResults/zorba/schemas/val-inplace4.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doc><node name="smallEl" type="smallEl"/><node name="a" type="string"/></doc><doc2><node name="bigEl" type="bigEl"/><node name="a" type="string"/></doc2>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/updates/undo10.xml.res'
--- test/rbkt/ExpQueryResults/zorba/updates/undo10.xml.res 2011-10-06 16:21:41 +0000
+++ test/rbkt/ExpQueryResults/zorba/updates/undo10.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ELEM-items-a type="ItemsType-A"><ELEM-number type="positiveInteger"/></ELEM-items-a>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/updates/undo11.xml.res'
--- test/rbkt/ExpQueryResults/zorba/updates/undo11.xml.res 2011-10-13 08:12:41 +0000
+++ test/rbkt/ExpQueryResults/zorba/updates/undo11.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ELEM-shiporders type="xs:untyped"><ELEM-shiporder type="xs:untyped"><ATTR-orderid type="xs:untypedAtomic"/><ELEM-orderperson type="xs:untyped"/><ELEM-shipto type="xs:untyped"><ELEM-name type="xs:untyped"/><ELEM-address type="xs:untyped"/><ELEM-city type="xs:untyped"/><ELEM-country type="xs:untyped"/></ELEM-shipto><ELEM-item type="xs:untyped"><ELEM-title type="xs:untyped"/><ELEM-note type="xs:untyped"/><ELEM-quantity type="xs:untyped"/><ELEM-price type="xs:untyped"/></ELEM-item><ELEM-item type="xs:untyped"><ELEM-title type="xs:untyped"/><ELEM-quantity type="xs:untyped"/><ELEM-price type="xs:untyped"/></ELEM-item></ELEM-shiporder></ELEM-shiporders>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/updates/undo8.xml.res'
--- test/rbkt/ExpQueryResults/zorba/updates/undo8.xml.res 2011-10-06 15:53:15 +0000
+++ test/rbkt/ExpQueryResults/zorba/updates/undo8.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ELEM-shiporders type="xs:anyType"><ELEM-shiporder type="xs:anyType"><ATTR-orderid type="xs:untypedAtomic"/><ELEM-orderperson type="xs:anyType"/><ELEM-shipto type="xs:anyType"><ELEM-name type="xs:anyType"/><ELEM-address type="xs:anyType"/><ELEM-city type="xs:anyType"/><ELEM-country type="xs:anyType"/></ELEM-shipto><ELEM-item type="xs:anyType"><ELEM-title type="xs:anyType"/><ELEM-note type="xs:anyType"/><ELEM-quantity type="xs:anyType"/><ELEM-price type="xs:anyType"/></ELEM-item><ELEM-item type="xs:anyType"><ELEM-title type="xs:anyType"/><ELEM-quantity type="xs:anyType"/><ELEM-price type="xs:anyType"/></ELEM-item></ELEM-shiporder></ELEM-shiporders>
\ No newline at end of file
=== removed file 'test/rbkt/ExpQueryResults/zorba/updates/undo9.xml.res'
--- test/rbkt/ExpQueryResults/zorba/updates/undo9.xml.res 2011-10-06 15:53:15 +0000
+++ test/rbkt/ExpQueryResults/zorba/updates/undo9.xml.res 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ELEM-shiporders type="xs:untyped"><ELEM-shiporder type="xs:untyped"><ATTR-orderid type="xs:untypedAtomic"/><ELEM-orderperson type="xs:untyped"/><ELEM-shipto type="xs:untyped"><ELEM-name type="xs:untyped"/><ELEM-address type="xs:untyped"/><ELEM-city type="xs:untyped"/><ELEM-country type="xs:untyped"/></ELEM-shipto><ELEM-item type="xs:untyped"><ELEM-title type="xs:untyped"/><ELEM-note type="xs:untyped"/><ELEM-quantity type="xs:untyped"/><ELEM-price type="xs:untyped"/></ELEM-item><ELEM-item type="xs:untyped"><ELEM-title type="xs:untyped"/><ELEM-quantity type="xs:untyped"/><ELEM-price type="xs:untyped"/></ELEM-item></ELEM-shiporder></ELEM-shiporders>
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/collections/delete_double.xq'
--- test/rbkt/Queries/zorba/collections/delete_double.xq 2011-10-06 12:48:27 +0000
+++ test/rbkt/Queries/zorba/collections/delete_double.xq 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
-
-ddl:create(xs:QName("ddl:coll"),(<a/>,<b/>));
-(
-ddl:delete(xs:QName("ddl:coll")),
-ddl:delete(xs:QName("ddl:coll"))
-);
-
-"OK"
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/collections/dynamic3.xq'
--- test/rbkt/Queries/zorba/collections/dynamic3.xq 2011-10-10 10:04:00 +0000
+++ test/rbkt/Queries/zorba/collections/dynamic3.xq 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
-
-ddl:create(xs:QName("ddl:test2"),(<center1/>,<oldlast/>));
-dml:insert-nodes-after(xs:QName("ddl:test2"), dml:collection(xs:QName("ddl:test2"))[1], (<c1/>,<c2/>));
-
-dml:collection(xs:QName("ddl:test2"))/self::node()
=== removed file 'test/rbkt/Queries/zorba/collections/dynamic4.xq'
--- test/rbkt/Queries/zorba/collections/dynamic4.xq 2011-10-10 10:04:00 +0000
+++ test/rbkt/Queries/zorba/collections/dynamic4.xq 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
-
-ddl:create(xs:QName("ddl:test2"),(<center1/>,<oldlast/>));
-
-dml:insert-nodes-before(xs:QName("ddl:test2"), dml:collection(xs:QName("ddl:test2"))[2], (<c1/>,<c2/>));
-dml:collection(xs:QName("ddl:test2"))/self::node()
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/collections/dynamic5.xq'
--- test/rbkt/Queries/zorba/collections/dynamic5.xq 2011-10-10 10:04:00 +0000
+++ test/rbkt/Queries/zorba/collections/dynamic5.xq 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
-
-ddl:create(xs:QName("ddl:test2"),(<center1/>,<oldlast/>));
-
-dml:insert-nodes-first(xs:QName("ddl:test2"), (<c1/>,<c2/>));
-dml:collection(xs:QName("ddl:test2"))/self::node()
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq 2011-10-12 07:17:05 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-import module namespace x = "http://www.zorba-xquery.com/modules/xml";
-
-x:parse-xml-fragment("<?xml version='1.0'?>
-<!DOCTYPE note [
-<!ELEMENT note (#PCDATA)>
-<!ATTLIST note nmt NMTOKENS #REQUIRED>
-]>
-<note nmt='aaa'/>
-",
-"d")
=== removed file 'test/rbkt/Queries/zorba/schemas/val-inplace3.xq'
--- test/rbkt/Queries/zorba/schemas/val-inplace3.xq 2011-10-12 21:30:46 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace3.xq 1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-import schema namespace d="http://www.example.com/doc" at "val-inplace3.xsd";
-import module namespace file = "http://expath.org/ns/file";
-declare revalidation lax;
-
-variable $doc:=<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
- <a>old</a>
-</item>;
-
-(
- schema:validate-in-place($doc),
- replace value of node $doc//*:a with "new"
-);
-
-variable $res1:=string($doc//*:a);
-
-(
- replace value of node $doc//*:a with "new"
-);
-
-($res1,string($doc//*:a))
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/schemas/val-inplace3.xsd'
--- test/rbkt/Queries/zorba/schemas/val-inplace3.xsd 2011-10-12 21:30:46 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace3.xsd 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.zorba-xquery.org/schema" xmlns="http://www.zorba-xquery.org/schema"
- elementFormDefault="qualified">
-
- <xs:element name="item">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="a" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/schemas/val-inplace4.xq'
--- test/rbkt/Queries/zorba/schemas/val-inplace4.xq 2011-10-12 21:30:46 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace4.xq 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-import schema namespace d="http://www.example.com/doc" at "val-inplace4.xsd";
-import module namespace file = "http://expath.org/ns/file";
-declare revalidation lax;
-
-variable $doc:=<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
- <bigEl>
- <a>old</a>
- </bigEl>
-</items>;
-
-variable $doc-2:=<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
- <bigEl>
- <a>old</a>
- </bigEl>
-</items>;
-
-(
- schema:validate-in-place($doc),
- rename node $doc/*:bigEl as QName("http://www.zorba-xquery.org/schema","smallEl")
-);
-
-
-schema:validate-in-place($doc-2);
-(
-<doc>
-{
-for $x in ($doc//*)
-return (<node name="{node-name($x)}" type="{schema:schema-type($x)}"/>)
-}
-</doc>,
-<doc2>
-{
-for $x in ($doc-2//*)
-return (<node name="{node-name($x)}" type="{schema:schema-type($x)}"/>)
-}
-</doc2>
-)
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/schemas/val-inplace4.xsd'
--- test/rbkt/Queries/zorba/schemas/val-inplace4.xsd 2011-10-12 21:30:46 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace4.xsd 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.zorba-xquery.org/schema" xmlns="http://www.zorba-xquery.org/schema"
- elementFormDefault="qualified">
-
- <xs:element name="items">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="bigEl" type="bigEl" />
- <xs:element name="smallEl" type="smallEl" />
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="bigEl">
- <xs:sequence>
- <xs:element name="a" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="smallEl">
- <xs:sequence>
- <xs:element name="a" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
-
-</xs:schema>
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/updates/subst.xsd'
--- test/rbkt/Queries/zorba/updates/subst.xsd 2011-10-06 15:53:15 +0000
+++ test/rbkt/Queries/zorba/updates/subst.xsd 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-targetNamespace="http://www.zorba-xquery.org/schema" xmlns="http://www.zorba-xquery.org/schema"
- elementFormDefault="qualified">
-
- <xs:element name="items-a" type="ItemsType-A"/>
- <xs:complexType name="ItemsType-A">
- <xs:sequence>
- <xs:element ref="number-a"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="number-a" type="xs:integer"/>
-
- <xs:element name="number" type="xs:positiveInteger" substitutionGroup="number-a"/>
-
- <xs:element name="items-b" type="ItemsType-B"/>
- <xs:complexType name="ItemsType-B">
- <xs:sequence>
- <xs:element name="number" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
-
-</xs:schema>
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/updates/undo10.xq'
--- test/rbkt/Queries/zorba/updates/undo10.xq 2011-10-06 15:53:15 +0000
+++ test/rbkt/Queries/zorba/updates/undo10.xq 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-import module namespace m = 'xqueryzorba.org/test/xqddf/ic' at '../xqddf/ic.xqlib';
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
-import module namespace ic_ddl = "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/ddl";
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-import module namespace u = "http://www.zorba-xquery.com/test/undo/utils" at "utils.xqlib";
-import schema namespace s="http://www.zorba-xquery.org/schema" at "subst.xsd";
-
-declare revalidation lax;
-
-variable $x:=
-validate{
-<items-a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
- <number>111</number>
-</items-a>};
-
-ddl:create($m:empc);
-
-ic_ddl:activate(xs:QName("m:ic_simple"));
-
-try
-{
-(
- rename node $x as QName("http://www.zorba-xquery.org/schema", "items-b"),
-
- dml:insert-nodes($m:empc, <emp><salary>600</salary></emp>)
-);
-}
-catch *
-{
-}
-
-u:dump-types($x)
=== removed file 'test/rbkt/Queries/zorba/updates/undo11.xq'
--- test/rbkt/Queries/zorba/updates/undo11.xq 2011-10-13 08:12:41 +0000
+++ test/rbkt/Queries/zorba/updates/undo11.xq 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-import module namespace m = 'xqueryzorba.org/test/xqddf/ic' at '../xqddf/ic.xqlib';
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
-import module namespace ic_ddl = "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/ddl";
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-import module namespace u = "http://www.zorba-xquery.com/test/undo/utils" at "utils.xqlib";
-import schema namespace s="http://www.zorba-xquery.org/schema" at "shiporder.xsd";
-
-declare revalidation lax;
-declare construction strip;
-
-variable $x:=
-<shiporders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
-<shiporder orderid="889923">
- <orderperson>John Smith</orderperson>
- <shipto>
- <name>Ola Nordmann</name>
- <address>Langgt 23</address>
- <city>4000 Stavanger</city>
- <country>Norway</country>
- </shipto>
- <item>
- <title>Empire Burlesque</title>
- <note>Special Edition</note>
- <quantity>1</quantity>
- <price>10.90</price>
- </item>
- <item>
- <title>Hide your heart</title>
- <quantity>1</quantity>
- <price>9.90</price>
- </item>
-</shiporder>
-</shiporders>;
-
-
-ddl:create($m:empc);
-
-ic_ddl:activate(xs:QName("m:ic_simple"));
-
-try
-{
-(
- schema:validate-in-place($x),
-
- dml:insert-nodes($m:empc, <emp><salary>600</salary></emp>)
-);
-}
-catch *
-{
-}
-
-u:dump-types($x)
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/updates/undo8.xq'
--- test/rbkt/Queries/zorba/updates/undo8.xq 2011-10-06 15:53:15 +0000
+++ test/rbkt/Queries/zorba/updates/undo8.xq 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-import module namespace m = 'xqueryzorba.org/test/xqddf/ic' at '../xqddf/ic.xqlib';
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
-import module namespace ic_ddl = "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/ddl";
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-import module namespace u = "http://www.zorba-xquery.com/test/undo/utils" at "utils.xqlib";
-import schema namespace s="http://www.zorba-xquery.org/schema" at "shiporder.xsd";
-
-declare revalidation lax;
-declare construction preserve;
-
-variable $x:=
-<shiporders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
-<shiporder orderid="889923">
- <orderperson>John Smith</orderperson>
- <shipto>
- <name>Ola Nordmann</name>
- <address>Langgt 23</address>
- <city>4000 Stavanger</city>
- <country>Norway</country>
- </shipto>
- <item>
- <title>Empire Burlesque</title>
- <note>Special Edition</note>
- <quantity>1</quantity>
- <price>10.90</price>
- </item>
- <item>
- <title>Hide your heart</title>
- <quantity>1</quantity>
- <price>9.90</price>
- </item>
-</shiporder>
-</shiporders>;
-
-
-ddl:create($m:empc);
-
-ic_ddl:activate(xs:QName("m:ic_simple"));
-
-try
-{
-(
- insert node ($x//*:item)[1]/*:note after ($x//*:item)[last()]/*:title,
-
- dml:insert-nodes($m:empc, <emp><salary>600</salary></emp>)
-);
-}
-catch *
-{
-}
-
-u:dump-types($x)
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/updates/undo9.xq'
--- test/rbkt/Queries/zorba/updates/undo9.xq 2011-10-06 15:53:15 +0000
+++ test/rbkt/Queries/zorba/updates/undo9.xq 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-import module namespace m = 'xqueryzorba.org/test/xqddf/ic' at '../xqddf/ic.xqlib';
-import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
-import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
-import module namespace ic_ddl = "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/ddl";
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-import module namespace u = "http://www.zorba-xquery.com/test/undo/utils" at "utils.xqlib";
-import schema namespace s="http://www.zorba-xquery.org/schema" at "shiporder.xsd";
-
-declare revalidation lax;
-declare construction strip;
-
-variable $x:=
-<shiporders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.zorba-xquery.org/schema">
-<shiporder orderid="889923">
- <orderperson>John Smith</orderperson>
- <shipto>
- <name>Ola Nordmann</name>
- <address>Langgt 23</address>
- <city>4000 Stavanger</city>
- <country>Norway</country>
- </shipto>
- <item>
- <title>Empire Burlesque</title>
- <note>Special Edition</note>
- <quantity>1</quantity>
- <price>10.90</price>
- </item>
- <item>
- <title>Hide your heart</title>
- <quantity>1</quantity>
- <price>9.90</price>
- </item>
-</shiporder>
-</shiporders>;
-
-
-ddl:create($m:empc);
-
-ic_ddl:activate(xs:QName("m:ic_simple"));
-
-try
-{
-(
- insert node ($x//*:item)[1]/*:note after ($x//*:item)[last()]/*:title,
-
- dml:insert-nodes($m:empc, <emp><salary>600</salary></emp>)
-);
-}
-catch *
-{
-}
-
-u:dump-types($x)
\ No newline at end of file
=== removed file 'test/rbkt/Queries/zorba/updates/utils.xqlib'
--- test/rbkt/Queries/zorba/updates/utils.xqlib 2011-09-28 14:24:07 +0000
+++ test/rbkt/Queries/zorba/updates/utils.xqlib 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
-module namespace u = "http://www.zorba-xquery.com/test/undo/utils";
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
-
-declare function u:dump-types($nodes as node()*) as element()*
-{
-for $node in $nodes
-return
- if ($node instance of text()) then ()
- else
- (
- element
- {
- if ($node instance of element()) then concat("ELEM-",string(node-name($node)))
- else if ($node instance of attribute()) then concat("ATTR-",string(node-name($node)))
- else if ($node instance of text()) then 'TEXT'
- else if ($node instance of document-node()) then 'DOCU'
- else if ($node instance of comment()) then 'COMM'
- else if ($node instance of processing-instruction()) then 'PROC'
- else 'unknown'
- }
- {
- attribute type {schema:schema-type($node)},
- for $attr in $node/@*
- return u:dump-types($attr),
- for $elem in $node/node()
- return u:dump-types($elem)
- }
- )
-};
-
=== modified file 'test/zperf/src/start.xq'
--- test/zperf/src/start.xq 2011-08-05 02:21:55 +0000
+++ test/zperf/src/start.xq 2011-10-17 21:17:26 +0000
@@ -27,17 +27,20 @@
declare namespace err = "http://www.w3.org/2005/xqt-errors";
-declare %ann:sequential function local:getPlatform()
+declare %ann:sequential
+function local:getPlatform()
{
<pdash:platform site-osname="Ubuntu" os-version="11.04" os-platform="Linux"
- hostname="28msec.dyndns.org" is-64bits="true" vendor-id="Cezar" vendor-label="i7"
- number-of-logical-cpu="{xs:int(12)}" number-of-physical-cpu="1"
- total-virtual-memory="6117504000" total-physical-memory="0"
- number-of-logical-cpu-per-physical-cpu="12"/>
+ hostname="28msec.dyndns.org" is-64bits="true" vendor-id="Cezar"
+ vendor-label="santacruz"
+ number-of-logical-cpu="{xs:int(8)}" number-of-physical-cpu="1"
+ total-virtual-memory="12389692000" total-physical-memory="0"
+ number-of-logical-cpu-per-physical-cpu="8"/>
};
-declare %ann:sequential %ann:nondeterministic function local:makeDir($svnDir as xs:string)
+declare %ann:sequential %ann:nondeterministic
+function local:makeDir($svnDir as xs:string)
{
if( fn:not( file:exists($svnDir) ) )
then
@@ -50,57 +53,64 @@
then
{
fn:trace("", fn:concat("Error: ", $svnDir, " is not a dir."));
- fn:error(xs:QName("local:ZPERF0001"), fn:concat("Error: ", $svnDir, " is not a dir."));
+ fn:error(xs:QName("local:ZPERF0001"), fn:concat("Error: ", $svnDir,
+ " is not a dir."));
}
else fn:trace("", fn:concat("--- Found ", $svnDir, " directory."));
};
-declare %ann:sequential function local:svnCo($svnCmd as xs:string,
- $svnDir as xs:string, $svnRev as xs:integer)
+declare %ann:sequential
+function local:svnCo($svnCmd as xs:string,
+ $svnDir as xs:string, $svnRev as xs:string)
{
variable $svnCo := fn:concat($svnCmd, " co -r ", $svnRev,
" http://zorba.svn.sourceforge.net/svnroot/zorba/trunk/zorba ", $svnDir);
fn:trace($svnCo, "cmd");
variable $svnCoResult := proc:exec($svnCmd,
- ("co", "-r", xs:string($svnRev),
+ ("co", "-r", $svnRev,
"http://zorba.svn.sourceforge.net/svnroot/zorba/trunk/zorba", $svnDir));
- if( $svnCoResult/exit-code eq "0")
+ if( fn:data($svnCoResult/proc:exit-code) eq "0")
then
- fn:trace( fn:data($svnCoResult/stdout), "--- svn co: ");
+ fn:trace( fn:data($svnCoResult/proc:stdout), "--- svn co: ");
else
{
- fn:trace( fn:data($svnCoResult/stderr), "ERROR: ");
- fn:error(xs:QName("local:ZPERF0003"), fn:concat("Error svn co: ", fn:data($svnCoResult/stderr)));
+ fn:trace( fn:data($svnCoResult/proc:stderr), "ERROR: ");
+ fn:error(xs:QName("local:ZPERF0003"), fn:concat("Error svn co: ",
+ fn:data($svnCoResult/proc:stderr)));
}
- fn:data($svnCoResult/exit-code)
+ fn:data($svnCoResult/proc:exit-code)
};
-declare %ann:sequential %ann:nondeterministic function local:makeSvnDir($svnCmd as xs:string,
- $svnDir as xs:string, $svnRev as xs:integer)
+declare %ann:sequential %ann:nondeterministic
+function local:makeSvnDir($svnCmd as xs:string,
+ $svnDir as xs:string, $svnRev as xs:string)
{
if ( file:exists(fn:concat($svnDir, file:directory-separator(), "AUTHORS.txt")) and
file:exists(fn:concat($svnDir, file:directory-separator(), "src")) )
then
- fn:trace("", fn:concat("--- Assuming ", $svnDir, " is the Zorba svn checkout dir."));
+ fn:trace("", fn:concat("--- Assuming ", $svnDir,
+ " is the Zorba svn checkout dir."));
else
if ( fn:empty(file:list($svnDir)) )
then
local:svnCo($svnCmd, $svnDir, $svnRev);
else
{
- variable $msg := fn:concat("Error: ", $svnDir, " is not empty and it doesn't contain Zorba.");
+ variable $msg := fn:concat("Error: ", $svnDir,
+ " is not empty and it doesn't contain Zorba.");
fn:error(xs:QName("local:ZPERF0002"), $msg);
}
};
-declare %ann:sequential function local:update($svnCmd as xs:string,
- $svnDir as xs:string, $svnRev as xs:integer)
+declare %ann:sequential
+function local:update($svnCmd as xs:string,
+ $svnDir as xs:string, $svnRev as xs:string)
{
fn:trace("", fn:concat("--- Svn update @rev", $svnRev));
@@ -110,14 +120,15 @@
variable $svnUpResult := proc:exec($svnCmd,
("up", "-r", xs:string($svnRev), "--accept", "theirs-full", $svnDir));
- if( $svnUpResult/exit-code eq "0")
+ if( fn:data($svnUpResult/proc:exit-code) eq "0")
then
- fn:trace( fn:data($svnUpResult/stdout), "svn up: ");
+ fn:trace( fn:data($svnUpResult/proc:stdout), "svn up: ");
else
{
- fn:trace( fn:data($svnUpResult/stderr), "ERROR: ");
+ fn:trace( fn:data($svnUpResult/proc:stderr), "ERROR: ");
fn:trace( $svnUpResult, "svn up: ");
- fn:error(xs:QName("local:ZPERF0004"), fn:concat("Error svn up: ", fn:data($svnUpResult/stderr)));
+ fn:error(xs:QName("local:ZPERF0004"), fn:concat("Error svn up: ",
+ fn:data($svnUpResult/proc:stderr)));
}
@@ -126,27 +137,29 @@
variable $svnInfoResult := proc:exec($svnCmd,
("info", "--xml", $svnDir));
- if( $svnInfoResult/exit-code eq "0")
+ if( fn:data($svnInfoResult/proc:exit-code) eq "0")
then
{
- fn:trace( fn:data($svnInfoResult/stdout), "svn info: ");
+ fn:trace( fn:data($svnInfoResult/proc:stdout), "svn info: ");
(: need to find the revision date :)
- variable $strOut := fn:data($svnInfoResult/stdout);
+ variable $strOut := fn:data($svnInfoResult/proc:stdout);
variable $doc := fn:parse-xml($strOut);
xs:dateTime(fn:data($doc/info/entry/commit/date))
}
else
{
- fn:trace( fn:data($svnInfoResult/stderr), "ERROR: ");
+ fn:trace( fn:data($svnInfoResult/proc:stderr), "ERROR: ");
fn:trace( $svnInfoResult, "svn info: ");
- fn:error(xs:QName("local:ZPERF0004"), fn:concat("Error svn info: ", fn:data($svnInfoResult/stderr)));
+ fn:error(xs:QName("local:ZPERF0004"), fn:concat("Error svn info: ",
+ fn:data($svnInfoResult/proc:stderr)));
}
};
-declare %ann:sequential %ann:nondeterministic function local:build( $buildDir as xs:string,
+declare %ann:sequential %ann:nondeterministic
+function local:build( $buildDir as xs:string,
$clean as xs:boolean, $cmakeCmd as xs:string,
$makeCmd as xs:string, $makeThreads as xs:int)
{
@@ -156,13 +169,14 @@
then
{
variable $res := proc:exec("rm", ("-fR", $buildDir));
- if( $res/exit-code eq "0" )
+ if( fn:data($res/proc:exit-code) eq "0" )
then
fn:trace("", fn:concat(" - rm -fR ", $buildDir) );
else
{
fn:trace($res, fn:concat("ERROR: rm -fR ", $buildDir));
- fn:error(xs:QName("local:ZPERF0005"), fn:concat("Error rm -fR: ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0005"), fn:concat("Error rm -fR: ",
+ fn:data($res/proc:stderr)));
}
}
@@ -172,13 +186,14 @@
then
{
variable $res := proc:exec("mkdir", ($buildDir));
- if( $res/exit-code eq "0" )
+ if( fn:data($res/proc:exit-code) eq "0" )
then
- fn:trace(fn:data($res/stdout), fn:concat(" - mkdir ", $buildDir) );
+ fn:trace(fn:data($res/proc:stdout), fn:concat(" - mkdir ", $buildDir) );
else
{
fn:trace($res, fn:concat("ERROR: mkdir", $buildDir));
- fn:error(xs:QName("local:ZPERF0006"), fn:concat("Error mkdir: ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0006"), fn:concat("Error mkdir: ",
+ fn:data($res/proc:stderr)));
}
}
else {}
@@ -188,44 +203,54 @@
{
fn:trace("---", "--- Starting cmake ... ");
variable $res := proc:exec("cd", ($buildDir, "&&", $cmakeCmd, ".."));
- if( $res/exit-code eq "0" )
+
+ if( fn:data($res/proc:exit-code) eq "0" )
then
- fn:trace(fn:data($res/stdout), fn:concat(" - cd ", $buildDir, " && cmake ..") );
+ fn:trace(fn:data($res/proc:stdout), fn:concat(" - cd ", $buildDir,
+ " && cmake ..") );
else
{
fn:trace($res, fn:concat("ERROR: cd ", $buildDir, " && cmake .."));
- fn:error(xs:QName("local:ZPERF0007"), fn:concat("Error cd ", $buildDir, " && cmake ..: ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0007"),
+ fn:concat("Error cd ", $buildDir,
+ " && cmake ..: ", fn:data($res/proc:stderr)));
}
}
else {}
fn:trace("---", "--- Starting make ... ");
- variable $res := proc:exec("cd", ($buildDir, "&&", $makeCmd, "-j", fn:string($makeThreads)));
- if( $res/exit-code eq "0" )
+ variable $res := proc:exec("cd", ($buildDir, "&&", $makeCmd, "-j",
+ fn:string($makeThreads)));
+
+ if( fn:data($res/proc:exit-code) eq "0" )
then
- fn:trace(fn:data($res/stdout), fn:concat(" - cd ", $buildDir, " && make") );
+ fn:trace(fn:data($res/proc:stdout), fn:concat(" - cd ", $buildDir,
+ " && make") );
else
{
fn:trace($res, fn:concat("ERROR: cd ", $buildDir, " && make"));
- fn:error(xs:QName("local:ZPERF0008"), fn:concat("Error cd ", $buildDir, " && make : ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0008"), fn:concat("Error cd ", $buildDir,
+ " && make : ", fn:data($res/proc:stderr)));
}
fn:trace("---", " - ls");
$res := proc:exec("ls", ($buildDir));
- if( $res/exit-code eq "0" )
+ if( fn:data($res/proc:exit-code) eq "0" )
then
- fn:trace(fn:data($res/stdout), fn:concat("ls ", $buildDir) );
+ fn:trace(fn:data($res/proc:stdout), fn:concat("ls ", $buildDir) );
else
{
fn:trace($res, fn:concat("ERROR: ls ", $buildDir));
- fn:error(xs:QName("local:ZPERF0009"), fn:concat("Error ls: ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0009"), fn:concat("Error ls: ",
+ fn:data($res/proc:stderr)));
}
};
-declare %ann:sequential function local:runXMarkTestSuits($zorbaCmd as xs:string, $xmarkDir as xs:string,
- $initialNoOfRuns as xs:int, $revision as xs:integer, $revDate as xs:dateTime)
+declare %ann:sequential
+function local:runXMarkTestSuits($zorbaCmd as xs:string, $xmarkDir as xs:string,
+ $initialNoOfRuns as xs:int, $revision as xs:string, $revDate as xs:dateTime)
{
fn:trace("---", "--- Running xmark tests ... ");
@@ -238,7 +263,8 @@
variable $noOfRuns := $inputTimes[$pos];
<rez rev="{$revision}" revDate="{$revDate}">
- <pdash:suite id="{fn:concat("xmark-", $inputCtx, "-", xs:string($noOfRuns), "x")}">
+ <pdash:suite id="{fn:concat("xmark-", $inputCtx, "-",
+ xs:string($noOfRuns), "x")}">
{
local:runXMarkTests($zorbaCmd, $xmarkDir, $noOfRuns, $inputCtx)
}
@@ -248,26 +274,29 @@
};
-declare %ann:sequential function local:runXMarkTests($zorbaCmd as xs:string, $xmarkDir as xs:string,
+declare %ann:sequential
+function local:runXMarkTests($zorbaCmd as xs:string, $xmarkDir as xs:string,
$noOfRuns as xs:integer, $inputCtx as xs:string)
{
fn:trace("---", fn:concat(" -- xmark tests ", $noOfRuns, " ", $inputCtx));
- for $i in 1 to 20
+ for $i in 1 to 20 (: for all q1.xq to q20.xq tests :)
return
{
variable $testName := fn:concat("q", $i);
- variable $testFile := fn:concat($xmarkDir, file:directory-separator(), "q", $i, ".xq");
+ variable $testFile := fn:concat($xmarkDir, file:directory-separator(),
+ "q", $i, ".xq");
fn:trace($testFile, "test file");
-
- variable $res := proc:exec($zorbaCmd, ("-m", xs:string($noOfRuns), "-e", $inputCtx,
- "-t", "-f", "-q", $testFile));
-
- if( $res/exit-code eq "0" )
+ fn:trace( fn:concat($zorbaCmd, "-m", xs:string($noOfRuns), "-e", $inputCtx,
+ "-t", "-f", "-q", $testFile), " - cmd: ");
+ variable $res := proc:exec($zorbaCmd, ("-m", xs:string($noOfRuns), "-e",
+ $inputCtx, "-t", "-f", "-q", $testFile));
+
+ if( fn:data($res/proc:exit-code) eq "0" )
then
{
- (: fn:trace(fn:data($res/stdout), fn:concat("zorba ", $testFile)); :)
- variable $times := tims:substring-after-last( fn:data($res/stdout),
+ (: fn:trace(fn:data($res/proc:stdout), fn:concat("zorba ", $testFile)); :)
+ variable $times := tims:substring-after-last( fn:data($res/proc:stdout),
'Number of executions');
fn:trace( $times, fn:concat("zorba ", $testFile));
@@ -276,18 +305,24 @@
{
$t := tims:parseTimings($times);
}
- catch *
+ catch *
{
- fn:trace("", fn:concat(" - Test ", $testName, " failed, skip submiting it: ", $err:code, " ", $err:description ));
+ fn:trace("", fn:concat(" - Test ", $testName,
+ " failed, skip submiting it: ", $err:code, " ",
+ $err:description ));
exit returning
<pdash:test id="{$testName}" iterations="{$noOfRuns}">
- <pdash:measurements><pdash:error>1</pdash:error></pdash:measurements>
+ <pdash:measurements><pdash:error>1</pdash:error>
+ </pdash:measurements>
<error>
{
- fn:concat(" - Test ", $testName, " failed: erorcode=", $err:code,
- " desc=", $err:description, " exit-code=", fn:data($res/exit-code),
- " stdout=", fn:data($res/stdout), " stderr=", fn:data($res/stderr) )
+ fn:concat(" - Test ", $testName, " failed: erorcode=",
+ $err:code,
+ " desc=", $err:description, " exit-code=",
+ fn:data($res/proc:exit-code),
+ " stdout=", fn:data($res/proc:stdout), " stderr=",
+ fn:data($res/proc:stderr) )
}
</error>
</pdash:test>
@@ -306,7 +341,8 @@
else
{
fn:trace($res, fn:concat("ERROR: zorba ", $testFile));
- fn:error(xs:QName("local:ZPERF0010"), fn:concat("Error zorba ", $testFile, " : ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0010"), fn:concat("Error zorba ",
+ $testFile, " : ", fn:data($res/proc:stderr)));
exit returning
<pdash:test id="{$testName}" iterations="{$noOfRuns}">
@@ -314,8 +350,9 @@
<error>
{
fn:concat(" - Test ", $testName, " failed: ",
- " exit-code=", fn:data($res/exit-code), " stdout=", fn:data($res/stdout),
- " stderr=", fn:data($res/stderr) )
+ " exit-code=", fn:data($res/proc:exit-code), " stdout=",
+ fn:data($res/proc:stdout),
+ " stderr=", fn:data($res/proc:stderr) )
}
</error>
</pdash:test>
@@ -325,14 +362,16 @@
};
-declare %ann:sequential function local:publishResults($allResults, $platform, $buildName as xs:string)
+declare %ann:sequential
+function local:publishResults($allResults, $platform, $buildName as xs:string)
{
fn:trace(fn:count($allResults), "--- Publish results ...");
for $rez in $allResults
return
{
- variable $msg := local:makeMessage($rez/pdash:suite, $platform, fn:data($rez/@rev),
+ variable $msg := local:makeMessage($rez/pdash:suite, $platform,
+ fn:data($rez/@rev),
fn:data($rez/@revDate), $buildName);
local:submitMessage($msg);
@@ -340,7 +379,8 @@
};
-declare %ann:sequential function local:makeMessage($suite, $platform, $revision as xs:string,
+declare %ann:sequential
+function local:makeMessage($suite, $platform, $revision as xs:string,
$revDate as xs:string, $buildName as xs:string)
{
fn:trace("", " - makeMessage");
@@ -356,7 +396,9 @@
</pdash:submission>
};
-declare %ann:sequential function local:submitMessage($msg)
+
+declare %ann:sequential
+function local:submitMessage($msg)
{
fn:trace(fn:serialize($msg), " - submitMessage");
@@ -373,9 +415,9 @@
};
-declare %ann:sequential function local:runXRayTestSuits($zorbaCmd as xs:string,
- $xrayDir as xs:string, $initialNoOfRuns as xs:int, $revision as xs:integer,
- $revDate as xs:dateTime)
+declare %ann:sequential
+function local:runXRayTestSuits($zorbaCmd as xs:string, $xrayDir as xs:string,
+ $initialNoOfRuns as xs:int, $revision as xs:string, $revDate as xs:dateTime)
{
fn:trace("---", "--- Running xray tests ... ");
@@ -386,7 +428,7 @@
if ( fn:exists($resXRay) )
then
<rez rev="{$revision}" revDate="{$revDate}">
- <pdash:suite id="{fn:concat("xray-320x240-", xs:string($noOfRuns), "x")}">
+ <pdash:suite id="{fn:concat('xray-320x240-', xs:string($noOfRuns), 'x')}">
{
$resXRay
}
@@ -397,7 +439,8 @@
};
-declare %ann:sequential function local:runXRayTests($zorbaCmd as xs:string,
+declare %ann:sequential function
+local:runXRayTests($zorbaCmd as xs:string,
$xrayDir as xs:string, $noOfRuns as xs:integer)
{
fn:trace("---", fn:concat(" -- xray test ", $noOfRuns, "x"));
@@ -407,11 +450,11 @@
variable $res := proc:exec($zorbaCmd, ("-m", xs:string($noOfRuns),
"-t", "-f", "-q", $testFile));
-
- variable $times := tims:substring-after-last( fn:data($res/stdout),
+ fn:trace(fn:data($res/proc:exit-code), " - xray execution exit-code - ");
+ variable $times := tims:substring-after-last( fn:data($res/proc:stdout),
'Number of executions');
-
- if( $res/exit-code eq "0" )
+
+ if( fn:data($res/proc:exit-code) eq "0" )
then
{
fn:trace($times, fn:concat("zorba ", $testFile));
@@ -423,15 +466,19 @@
}
catch *
{
- fn:trace("", fn:concat(" - Test xray failed, skip submiting it: ", $err:code, " ", $err:description ));
+ fn:trace("", fn:concat(" - Test xray failed, skip submiting it: ",
+ $err:code, " ", $err:description ));
exit returning
<pdash:test id="xray" iterations="{$noOfRuns}">
<pdash:measurements><pdash:error>1</pdash:error></pdash:measurements>
<error>
{
- fn:concat(" - Test xray failed, skip submiting it: erorcode=", $err:code, " desc=", $err:description,
- " exit-code=", fn:data($res/exit-code), " stdout=", fn:data($res/stdout), " stderr=", fn:data($res/stderr) )
+ fn:concat(" - Test xray failed, skip submiting it: erorcode=",
+ $err:code, " desc=", $err:description,
+ " exit-code=", fn:data($res/proc:exit-code), " stdout=",
+ fn:data($res/proc:stdout), " stderr=",
+ fn:data($res/proc:stderr) )
}
</error>
</pdash:test>
@@ -449,7 +496,8 @@
else
{
fn:trace($res, fn:concat("ERROR: zorba ", $testFile));
- fn:error(xs:QName("local:ZPERF0010"), fn:concat("Error zorba ", $testFile, " : ", fn:data($res/stderr)));
+ fn:error(xs:QName("local:ZPERF0010"), fn:concat("Error zorba ",
+ $testFile, " : ", fn:data($res/proc:stderr)));
exit returning
<pdash:test id="xray" iterations="{$noOfRuns}">
@@ -457,7 +505,8 @@
<error>
{
fn:concat("Error zorba ", $testFile, " : ",
- " exit-code=", fn:data($res/exit-code), " stdout=", fn:data($res/stdout), " stderr=", fn:data($res/stderr) )
+ " exit-code=", fn:data($res/proc:exit-code), " stdout=",
+ fn:data($res/proc:stdout), " stderr=", fn:data($res/proc:stderr) )
}
</error>
</pdash:test>
@@ -480,37 +529,42 @@
let $xrayDir := "xray"
let $svnCmd := "/usr/bin/svn"
let $cmakeCmd := "/usr/bin/cmake"
-let $zorbaCmd := fn:concat($buildDir, file:directory-separator(),"bin", file:directory-separator(),"zorba")
+let $zorbaCmd := fn:concat($buildDir, file:directory-separator(),
+ "bin", file:directory-separator(), "zorba")
let $makeCmd := xs:string("/usr/bin/make")
-(: let $svnRevs := (8625, 8709, 8852, 9023, 9252, 9496, 9745, 9938, 10069, 10237,
- 10431, 10742, 10766)
-:)
-(: let $svnRevs := (8625, 8709, 8852, 9023, 9252, 9496, 9938, 10069, 10237,
- 10916 )
-let $svnRevs := ( 9500, 9600, 9650, 9700, 9750, 9800, 9850, 9900,
- 10100, 10133, 10166, 10200) :)
-let $svnRevs := (11238)
+let $svnRevs := ("HEAD")
-let $buildName := "ztest2"
+let $buildName := "santacruz"
let $initialNoOfRuns := xs:int(100)
let $platform := local:getPlatform()
return
{
fn:trace(fn:current-dateTime(), "----- Starting time");
+ (:
local:makeDir($svnDir);
local:makeSvnDir($svnCmd, $svnDir, $svnRevs[1]);
+ :)
for $i in ($svnRevs)
return
{
- variable $revDate as xs:dateTime := local:update($svnCmd, $svnDir, $i);
- local:build($buildDir, fn:false(), $cmakeCmd, $makeCmd, $platform/@number-of-logical-cpu);
+ variable $revDate as xs:dateTime := fn:current-dateTime();
+
+ (:
+ local:update($svnCmd, $svnDir, $i);
+ :)
+ local:build($buildDir, fn:false(), $cmakeCmd, $makeCmd,
+ $platform/@number-of-logical-cpu);
+
- variable $resXRay := local:runXRayTestSuits($zorbaCmd, $xrayDir, xs:int(3), $i, $revDate);
+ variable $resXRay := local:runXRayTestSuits($zorbaCmd, $xrayDir,
+ xs:int(3), $i, $revDate);
local:publishResults($resXRay, $platform, $buildName);
- variable $resXMark := local:runXMarkTestSuits($zorbaCmd, $xmarkDir, $initialNoOfRuns, $i, $revDate);
+
+ variable $resXMark := local:runXMarkTestSuits($zorbaCmd, $xmarkDir,
+ $initialNoOfRuns, $i, $revDate);
local:publishResults($resXMark, $platform, $buildName);
}
Follow ups