Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11064
Merged at revision: 11379
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 106 lines (+47/-17)
3 files modified
ChangeLog (+2/-0)
src/store/naive/node_items.cpp (+45/-16)
test/fots/CMakeLists.txt (+0/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+159349@code.launchpad.net

Commit message

fixed bug in raising XQTY0086 (copying of namespace-sensitive values during node construction)

Description of the change

fixed bug in raising XQTY0086 (copying of namespace-sensitive values during node construction)

To post a comment you must log in.
11064. By Markos Zaharioudakis

fixed bug in raising XQTY0086 (copying of namespace-sensitive values during node construction

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2013-04-17T12-46-53.592Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-04-16 13:34:59 +0000
3+++ ChangeLog 2013-04-17 12:40:44 +0000
4@@ -69,6 +69,8 @@
5 * Fixed bug #1023168 (Non-single-char-escapes in regex character ranges not
6 caught)
7 * Throw XQST0048 for groupby clause, as specified by XQuery 3.0.
8+ * Fixed bug in raising XQTY0086 (copying of namespace-sensitive values during
9+ node construction).
10 * Fixed bug #866874 (regex "range subtraction" not supported for ICU)
11 * Fixed bug in computing the static type of an allowing-empty FOR variable.
12 * Fixed bug #1099648 and #1088886 (XML parsing failures on Red Hat)
13
14=== modified file 'src/store/naive/node_items.cpp'
15--- src/store/naive/node_items.cpp 2013-04-08 08:54:50 +0000
16+++ src/store/naive/node_items.cpp 2013-04-17 12:40:44 +0000
17@@ -2517,15 +2517,28 @@
18 }
19 else // ! nsPreserve
20 {
21- if (copymode.theTypePreserve)
22+ if (copymode.theTypePreserve && haveTypedValue())
23 {
24- store::Item* typeName = getType();
25-
26- if (typeName != NULL &&
27- (typeName->equals(GET_STORE().theSchemaTypeNames[store::XS_QNAME]) ||
28- typeName->equals(GET_STORE().theSchemaTypeNames[store::XS_NOTATION])))
29- {
30- throw XQUERY_EXCEPTION(err::XQTY0086);
31+ store::Item_t typedValue;
32+ store::Iterator_t typedValues;
33+ getTypedValue(typedValue, typedValues);
34+
35+ if (typedValue != NULL)
36+ {
37+ store::SchemaTypeCode typecode = typedValue->getTypeCode();
38+
39+ if (typecode == store::XS_QNAME || typecode == store::XS_NOTATION)
40+ throw XQUERY_EXCEPTION(err::XQTY0086);
41+ }
42+ else if (typedValues != NULL)
43+ {
44+ while (typedValues->next(typedValue))
45+ {
46+ store::SchemaTypeCode typecode = typedValue->getTypeCode();
47+
48+ if (typecode == store::XS_QNAME || typecode == store::XS_NOTATION)
49+ throw XQUERY_EXCEPTION(err::XQTY0086);
50+ }
51 }
52 }
53
54@@ -3991,16 +4004,32 @@
55
56 bool isListValue;
57
58- if (parent == rootParent &&
59- typeName != NULL &&
60- (typeName->equals(GET_STORE().theSchemaTypeNames[store::XS_QNAME]) ||
61- typeName->equals(GET_STORE().theSchemaTypeNames[store::XS_NOTATION])))
62- {
63- throw XQUERY_EXCEPTION(err::XQTY0086);
64- }
65-
66 if (copymode.theTypePreserve)
67 {
68+ if ((parent == rootParent || copymode.theNsPreserve == false) &&
69+ typeName != NULL)
70+ {
71+ if (theTypedValue->isAtomic())
72+ {
73+ store::SchemaTypeCode typecode = theTypedValue->getTypeCode();
74+
75+ if (typecode == store::XS_QNAME || typecode == store::XS_NOTATION)
76+ throw XQUERY_EXCEPTION(err::XQTY0086);
77+ }
78+ else
79+ {
80+ const std::vector<store::Item_t>& values = getValueVector().getItems();
81+ csize numValues = values.size();
82+ for (csize i = 0; i < numValues; ++i)
83+ {
84+ store::SchemaTypeCode typecode = values[i]->getTypeCode();
85+
86+ if (typecode == store::XS_QNAME || typecode == store::XS_NOTATION)
87+ throw XQUERY_EXCEPTION(err::XQTY0086);
88+ }
89+ }
90+ }
91+
92 typedValue = theTypedValue;
93 isListValue = haveListValue();
94 }
95
96=== modified file 'test/fots/CMakeLists.txt'
97--- test/fots/CMakeLists.txt 2013-04-17 11:11:24 +0000
98+++ test/fots/CMakeLists.txt 2013-04-17 12:40:44 +0000
99@@ -239,7 +239,6 @@
100 EXPECTED_FOTS_FAILURE (math-acos math-acos-003 0)
101 EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0085 0)
102 EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0093a 0)
103-EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQTY0086_3 0)
104 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-1 0)
105 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-2 0)
106 EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-3 0)

Subscribers

People subscribed via source and target branches