Merge lp:~zorba-coders/zorba/bug-1041445 into lp:zorba
- bug-1041445
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Ghislain Fourny |
Approved revision: | 11044 |
Merged at revision: | 11044 |
Proposed branch: | lp:~zorba-coders/zorba/bug-1041445 |
Merge into: | lp:zorba |
Diff against target: |
981 lines (+338/-120) 42 files modified
ChangeLog (+1/-0) include/zorba/store_consts.h (+1/-1) modules/org/jsoniq/www/functions.xq (+20/-3) src/api/serialization/serializer.cpp (+1/-1) src/context/static_context.cpp (+2/-2) src/context/static_context.h (+1/-1) src/functions/func_jsoniq_functions_impl.cpp (+1/-1) src/functions/pregenerated/func_jsoniq_functions.cpp (+29/-1) src/functions/pregenerated/func_jsoniq_functions.h (+16/-0) src/functions/pregenerated/function_enum.h (+1/-0) src/runtime/booleans/BooleanImpl.cpp (+22/-13) src/runtime/core/arithmetic_impl.cpp (+20/-16) src/runtime/json/jsoniq_functions_impl.cpp (+25/-1) src/runtime/json/pregenerated/jsoniq_functions.cpp (+25/-0) src/runtime/json/pregenerated/jsoniq_functions.h (+32/-0) src/runtime/pregenerated/iterator_enum.h (+1/-0) src/runtime/spec/json/jsoniq_functions.xml (+36/-18) src/runtime/spec/mappings.xml (+1/-1) src/runtime/visitors/pregenerated/planiter_visitor.h (+7/-0) src/runtime/visitors/pregenerated/printer_visitor.cpp (+15/-0) src/runtime/visitors/pregenerated/printer_visitor.h (+5/-0) src/store/naive/json_items.cpp (+4/-4) src/store/naive/json_items.h (+1/-1) src/store/naive/store.cpp (+7/-7) src/store/naive/store.h (+4/-4) src/types/casting.cpp (+2/-2) src/types/root_typemanager.cpp (+25/-25) src/types/root_typemanager.h (+5/-5) src/zorbaserialization/serialize_zorba_types.cpp (+2/-2) test/rbkt/ExpQueryResults/zorba/jsoniq/null02.xml.res (+1/-1) test/rbkt/ExpQueryResults/zorba/jsoniq/null04.xml.res (+1/-0) test/rbkt/ExpQueryResults/zorba/jsoniq/null05.xml.res (+1/-0) test/rbkt/ExpQueryResults/zorba/jsoniq/null08.xml.res (+1/-0) test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res (+1/-1) test/rbkt/Queries/zorba/jsoniq/null01.xq (+1/-3) test/rbkt/Queries/zorba/jsoniq/null02.xq (+1/-3) test/rbkt/Queries/zorba/jsoniq/null03.xq (+1/-3) test/rbkt/Queries/zorba/jsoniq/null04.xq (+2/-0) test/rbkt/Queries/zorba/jsoniq/null05.xq (+2/-0) test/rbkt/Queries/zorba/jsoniq/null06.xq (+3/-0) test/rbkt/Queries/zorba/jsoniq/null07.xq (+1/-0) test/rbkt/Queries/zorba/jsoniq/null08.xq (+10/-0) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug-1041445 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Till Westmann | Approve | ||
Review via email: mp+124191@code.launchpad.net |
Commit message
Implementing semantics of arithmetics and comparison operators for JSON nulls.
Description of the change
Implementing semantics of arithmetics and comparison operators for JSON nulls.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/bug-1041445 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug-1041445-2012-09-
final status was:
2 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-1041445-2012-09-
All tests succeeded!
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Pending.
Matthias Brantner (matthias-brantner) wrote : | # |
Maybe we should add the change to the ChangeLog.
Till Westmann (tillw) : | # |
- 11043. By Ghislain Fourny
-
Merged trunk back.
- 11044. By Ghislain Fourny
-
Edited ChangeLog.
Ghislain Fourny (gislenius) wrote : | # |
I edited the ChangeLog.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-1041445-2012-09-
All tests succeeded!
Preview Diff
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2012-09-14 04:33:18 +0000 | |||
3 | +++ ChangeLog 2012-09-14 14:40:27 +0000 | |||
4 | @@ -12,6 +12,7 @@ | |||
5 | 12 | functions. jn:object is also supported. | 12 | functions. jn:object is also supported. |
6 | 13 | * jn:parse-json can parse multiple top-level JSON items. Also, there is jn:parse-json#2 that | 13 | * jn:parse-json can parse multiple top-level JSON items. Also, there is jn:parse-json#2 that |
7 | 14 | takes options to parameterize the parsing process (see bug #1047547) | 14 | takes options to parameterize the parsing process (see bug #1047547) |
8 | 15 | * Implemented semantics of null for comparison and arithmetics operations. | ||
9 | 15 | 16 | ||
10 | 16 | Optimizations: | 17 | Optimizations: |
11 | 17 | * New memory management for compiler expressions (no more ref counting) | 18 | * New memory management for compiler expressions (no more ref counting) |
12 | 18 | 19 | ||
13 | === modified file 'include/zorba/store_consts.h' | |||
14 | --- include/zorba/store_consts.h 2012-09-11 22:55:05 +0000 | |||
15 | +++ include/zorba/store_consts.h 2012-09-14 14:40:27 +0000 | |||
16 | @@ -84,7 +84,7 @@ | |||
17 | 84 | XS_QNAME = 43, | 84 | XS_QNAME = 43, |
18 | 85 | XS_NOTATION = 44, | 85 | XS_NOTATION = 44, |
19 | 86 | 86 | ||
21 | 87 | JDM_NULL = 45, | 87 | JS_NULL = 45, |
22 | 88 | 88 | ||
23 | 89 | XS_LAST | 89 | XS_LAST |
24 | 90 | }; | 90 | }; |
25 | 91 | 91 | ||
26 | === modified file 'modules/org/jsoniq/www/functions.xq' | |||
27 | --- modules/org/jsoniq/www/functions.xq 2012-09-11 22:55:05 +0000 | |||
28 | +++ modules/org/jsoniq/www/functions.xq 2012-09-14 14:40:27 +0000 | |||
29 | @@ -35,11 +35,9 @@ | |||
30 | 35 | 35 | ||
31 | 36 | import module namespace schema = "http://www.zorba-xquery.com/modules/schema"; | 36 | import module namespace schema = "http://www.zorba-xquery.com/modules/schema"; |
32 | 37 | 37 | ||
33 | 38 | declare namespace jdm = "http://www.jsoniq.org/"; | ||
34 | 39 | |||
35 | 40 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; | 38 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; |
36 | 41 | |||
37 | 42 | declare namespace jerr = "http://www.jsoniq.org/errors"; | 39 | declare namespace jerr = "http://www.jsoniq.org/errors"; |
38 | 40 | declare namespace js = "http://www.jsoniq.org/types"; | ||
39 | 43 | 41 | ||
40 | 44 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; | 42 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
41 | 45 | declare option ver:module-version "1.0"; | 43 | declare option ver:module-version "1.0"; |
42 | @@ -180,3 +178,22 @@ | |||
43 | 180 | : @error jerr:JNDY0003 if there is a pair collision. | 178 | : @error jerr:JNDY0003 if there is a pair collision. |
44 | 181 | :) | 179 | :) |
45 | 182 | declare function jn:object($o as object()*) as object() external; | 180 | declare function jn:object($o as object()*) as object() external; |
46 | 181 | |||
47 | 182 | (:~ | ||
48 | 183 | : Returns the JSON null. | ||
49 | 184 | : | ||
50 | 185 | : @return The JSON null. | ||
51 | 186 | :) | ||
52 | 187 | declare function jn:null() as js:null external; | ||
53 | 188 | |||
54 | 189 | (:~ | ||
55 | 190 | : Tests whether the supplied atomic item is a JSON null. | ||
56 | 191 | : | ||
57 | 192 | : @param An atomic item. | ||
58 | 193 | : | ||
59 | 194 | : @return true if the item is of type js:null. | ||
60 | 195 | :) | ||
61 | 196 | declare function jn:is-null($i as xs:anyAtomicType) as xs:boolean external; | ||
62 | 197 | |||
63 | 198 | |||
64 | 199 | |||
65 | 183 | 200 | ||
66 | === modified file 'src/api/serialization/serializer.cpp' | |||
67 | --- src/api/serialization/serializer.cpp 2012-09-13 08:28:50 +0000 | |||
68 | +++ src/api/serialization/serializer.cpp 2012-09-14 14:40:27 +0000 | |||
69 | @@ -1040,7 +1040,7 @@ | |||
70 | 1040 | tr << (item->getBooleanValue() ? "true" : "false"); | 1040 | tr << (item->getBooleanValue() ? "true" : "false"); |
71 | 1041 | break; | 1041 | break; |
72 | 1042 | 1042 | ||
74 | 1043 | case store::JDM_NULL: | 1043 | case store::JS_NULL: |
75 | 1044 | tr << "null"; | 1044 | tr << "null"; |
76 | 1045 | break; | 1045 | break; |
77 | 1046 | 1046 | ||
78 | 1047 | 1047 | ||
79 | === modified file 'src/context/static_context.cpp' | |||
80 | --- src/context/static_context.cpp 2012-09-11 22:55:05 +0000 | |||
81 | +++ src/context/static_context.cpp 2012-09-14 14:40:27 +0000 | |||
82 | @@ -397,8 +397,8 @@ | |||
83 | 397 | #ifdef ZORBA_WITH_JSON | 397 | #ifdef ZORBA_WITH_JSON |
84 | 398 | 398 | ||
85 | 399 | const char* | 399 | const char* |
88 | 400 | static_context::JSONIQ_NS = | 400 | static_context::JSONIQ_DM_NS = |
89 | 401 | "http://www.jsoniq.org/"; | 401 | "http://www.jsoniq.org/types"; |
90 | 402 | 402 | ||
91 | 403 | const char* | 403 | const char* |
92 | 404 | static_context::JSONIQ_FN_NS = | 404 | static_context::JSONIQ_FN_NS = |
93 | 405 | 405 | ||
94 | === modified file 'src/context/static_context.h' | |||
95 | --- src/context/static_context.h 2012-09-11 22:55:05 +0000 | |||
96 | +++ src/context/static_context.h 2012-09-14 14:40:27 +0000 | |||
97 | @@ -527,7 +527,7 @@ | |||
98 | 527 | static const char* ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS; | 527 | static const char* ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS; |
99 | 528 | 528 | ||
100 | 529 | #ifdef ZORBA_WITH_JSON | 529 | #ifdef ZORBA_WITH_JSON |
102 | 530 | static const char* JSONIQ_NS; | 530 | static const char* JSONIQ_DM_NS; |
103 | 531 | static const char* JSONIQ_FN_NS; | 531 | static const char* JSONIQ_FN_NS; |
104 | 532 | #endif | 532 | #endif |
105 | 533 | 533 | ||
106 | 534 | 534 | ||
107 | === modified file 'src/functions/func_jsoniq_functions_impl.cpp' | |||
108 | --- src/functions/func_jsoniq_functions_impl.cpp 2012-09-13 08:28:50 +0000 | |||
109 | +++ src/functions/func_jsoniq_functions_impl.cpp 2012-09-14 14:40:27 +0000 | |||
110 | @@ -145,7 +145,7 @@ | |||
111 | 145 | return type; | 145 | return type; |
112 | 146 | 146 | ||
113 | 147 | if (type->max_card() == 0) | 147 | if (type->max_card() == 0) |
115 | 148 | return GENV_TYPESYSTEM.JDM_NULL_TYPE_ONE; | 148 | return GENV_TYPESYSTEM.JS_NULL_TYPE_ONE; |
116 | 149 | 149 | ||
117 | 150 | return theSignature.returnType(); | 150 | return theSignature.returnType(); |
118 | 151 | } | 151 | } |
119 | 152 | 152 | ||
120 | === modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp' | |||
121 | --- src/functions/pregenerated/func_jsoniq_functions.cpp 2012-09-11 22:55:05 +0000 | |||
122 | +++ src/functions/pregenerated/func_jsoniq_functions.cpp 2012-09-14 14:40:27 +0000 | |||
123 | @@ -142,6 +142,18 @@ | |||
124 | 142 | 142 | ||
125 | 143 | #endif | 143 | #endif |
126 | 144 | #ifdef ZORBA_WITH_JSON | 144 | #ifdef ZORBA_WITH_JSON |
127 | 145 | PlanIter_t fn_jsoniq_is_null::codegen( | ||
128 | 146 | CompilerCB*, | ||
129 | 147 | static_context* sctx, | ||
130 | 148 | const QueryLoc& loc, | ||
131 | 149 | std::vector<PlanIter_t>& argv, | ||
132 | 150 | expr& ann) const | ||
133 | 151 | { | ||
134 | 152 | return new JSONIsNullIterator(sctx, loc, argv[0]); | ||
135 | 153 | } | ||
136 | 154 | |||
137 | 155 | #endif | ||
138 | 156 | #ifdef ZORBA_WITH_JSON | ||
139 | 145 | PlanIter_t op_zorba_json_array_insert::codegen( | 157 | PlanIter_t op_zorba_json_array_insert::codegen( |
140 | 146 | CompilerCB*, | 158 | CompilerCB*, |
141 | 147 | static_context* sctx, | 159 | static_context* sctx, |
142 | @@ -379,7 +391,7 @@ | |||
143 | 379 | { | 391 | { |
144 | 380 | DECL_WITH_KIND(sctx, fn_jsoniq_null, | 392 | DECL_WITH_KIND(sctx, fn_jsoniq_null, |
145 | 381 | (createQName("http://www.jsoniq.org/functions","","null"), | 393 | (createQName("http://www.jsoniq.org/functions","","null"), |
147 | 382 | GENV_TYPESYSTEM.JDM_NULL_TYPE_ONE), | 394 | GENV_TYPESYSTEM.JS_NULL_TYPE_ONE), |
148 | 383 | FunctionConsts::FN_JSONIQ_NULL_0); | 395 | FunctionConsts::FN_JSONIQ_NULL_0); |
149 | 384 | 396 | ||
150 | 385 | } | 397 | } |
151 | @@ -392,6 +404,22 @@ | |||
152 | 392 | 404 | ||
153 | 393 | 405 | ||
154 | 394 | { | 406 | { |
155 | 407 | DECL_WITH_KIND(sctx, fn_jsoniq_is_null, | ||
156 | 408 | (createQName("http://www.jsoniq.org/functions","","is-null"), | ||
157 | 409 | GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, | ||
158 | 410 | GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), | ||
159 | 411 | FunctionConsts::FN_JSONIQ_IS_NULL_1); | ||
160 | 412 | |||
161 | 413 | } | ||
162 | 414 | |||
163 | 415 | |||
164 | 416 | #endif | ||
165 | 417 | |||
166 | 418 | |||
167 | 419 | #ifdef ZORBA_WITH_JSON | ||
168 | 420 | |||
169 | 421 | |||
170 | 422 | { | ||
171 | 395 | DECL_WITH_KIND(sctx, op_zorba_json_array_insert, | 423 | DECL_WITH_KIND(sctx, op_zorba_json_array_insert, |
172 | 396 | (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","json-array-insert"), | 424 | (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","json-array-insert"), |
173 | 397 | GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE, | 425 | GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE, |
174 | 398 | 426 | ||
175 | === modified file 'src/functions/pregenerated/func_jsoniq_functions.h' | |||
176 | --- src/functions/pregenerated/func_jsoniq_functions.h 2012-09-13 08:28:50 +0000 | |||
177 | +++ src/functions/pregenerated/func_jsoniq_functions.h 2012-09-14 14:40:27 +0000 | |||
178 | @@ -234,6 +234,22 @@ | |||
179 | 234 | #endif | 234 | #endif |
180 | 235 | #ifdef ZORBA_WITH_JSON | 235 | #ifdef ZORBA_WITH_JSON |
181 | 236 | 236 | ||
182 | 237 | //fn-jsoniq:is-null | ||
183 | 238 | class fn_jsoniq_is_null : public function | ||
184 | 239 | { | ||
185 | 240 | public: | ||
186 | 241 | fn_jsoniq_is_null(const signature& sig, FunctionConsts::FunctionKind kind) | ||
187 | 242 | : | ||
188 | 243 | function(sig, kind) | ||
189 | 244 | { | ||
190 | 245 | |||
191 | 246 | } | ||
192 | 247 | |||
193 | 248 | CODEGEN_DECL(); | ||
194 | 249 | }; | ||
195 | 250 | #endif | ||
196 | 251 | #ifdef ZORBA_WITH_JSON | ||
197 | 252 | |||
198 | 237 | //op-zorba:json-array-insert | 253 | //op-zorba:json-array-insert |
199 | 238 | class op_zorba_json_array_insert : public function | 254 | class op_zorba_json_array_insert : public function |
200 | 239 | { | 255 | { |
201 | 240 | 256 | ||
202 | === modified file 'src/functions/pregenerated/function_enum.h' | |||
203 | --- src/functions/pregenerated/function_enum.h 2012-09-13 08:28:50 +0000 | |||
204 | +++ src/functions/pregenerated/function_enum.h 2012-09-14 14:40:27 +0000 | |||
205 | @@ -238,6 +238,7 @@ | |||
206 | 238 | FN_JSONIQ_FLATTEN_1, | 238 | FN_JSONIQ_FLATTEN_1, |
207 | 239 | OP_ZORBA_JSON_ITEM_ACCESSOR_2, | 239 | OP_ZORBA_JSON_ITEM_ACCESSOR_2, |
208 | 240 | FN_JSONIQ_NULL_0, | 240 | FN_JSONIQ_NULL_0, |
209 | 241 | FN_JSONIQ_IS_NULL_1, | ||
210 | 241 | OP_ZORBA_JSON_ARRAY_INSERT_3, | 242 | OP_ZORBA_JSON_ARRAY_INSERT_3, |
211 | 242 | OP_ZORBA_JSON_DELETE_2, | 243 | OP_ZORBA_JSON_DELETE_2, |
212 | 243 | OP_ZORBA_JSON_REPLACE_VALUE_3, | 244 | OP_ZORBA_JSON_REPLACE_VALUE_3, |
213 | 244 | 245 | ||
214 | === modified file 'src/runtime/booleans/BooleanImpl.cpp' | |||
215 | --- src/runtime/booleans/BooleanImpl.cpp 2012-09-11 22:55:05 +0000 | |||
216 | +++ src/runtime/booleans/BooleanImpl.cpp 2012-09-14 14:40:27 +0000 | |||
217 | @@ -142,7 +142,7 @@ | |||
218 | 142 | TypeOps::is_subtype(type, store::XS_STRING) || | 142 | TypeOps::is_subtype(type, store::XS_STRING) || |
219 | 143 | TypeOps::is_subtype(type, store::XS_ANY_URI) || | 143 | TypeOps::is_subtype(type, store::XS_ANY_URI) || |
220 | 144 | type == store::XS_UNTYPED_ATOMIC || | 144 | type == store::XS_UNTYPED_ATOMIC || |
222 | 145 | type == store::JDM_NULL || | 145 | type == store::JS_NULL || |
223 | 146 | TypeOps::is_numeric(type))) | 146 | TypeOps::is_numeric(type))) |
224 | 147 | { | 147 | { |
225 | 148 | // atomic type xs_boolean, xs_string, xs_anyURI, xs_untypedAtomic | 148 | // atomic type xs_boolean, xs_string, xs_anyURI, xs_untypedAtomic |
226 | @@ -488,19 +488,23 @@ | |||
227 | 488 | if (consumeNext(item0, theChild0.getp(), planState) && | 488 | if (consumeNext(item0, theChild0.getp(), planState) && |
228 | 489 | consumeNext(item1, theChild1.getp(), planState)) | 489 | consumeNext(item1, theChild1.getp(), planState)) |
229 | 490 | { | 490 | { |
240 | 491 | STACK_PUSH(GENV_ITEMFACTORY-> | 491 | if (item0->getTypeCode() != store::JS_NULL && |
241 | 492 | createBoolean(result, | 492 | item1->getTypeCode() != store::JS_NULL) |
242 | 493 | CompareIterator::valueComparison(loc, | 493 | { |
243 | 494 | item0, | 494 | STACK_PUSH(GENV_ITEMFACTORY-> |
244 | 495 | item1, | 495 | createBoolean(result, |
245 | 496 | theCompType, | 496 | CompareIterator::valueComparison(loc, |
246 | 497 | theTypeManager, | 497 | item0, |
247 | 498 | theTimezone, | 498 | item1, |
248 | 499 | theCollation)), | 499 | theCompType, |
249 | 500 | state); | 500 | theTypeManager, |
250 | 501 | theTimezone, | ||
251 | 502 | theCollation)), | ||
252 | 503 | state); | ||
253 | 501 | 504 | ||
256 | 502 | assert(!consumeNext(item0, theChild0.getp(), planState) && | 505 | assert(!consumeNext(item0, theChild0.getp(), planState) && |
257 | 503 | !consumeNext(item1, theChild1.getp(), planState)); | 506 | !consumeNext(item1, theChild1.getp(), planState)); |
258 | 507 | } | ||
259 | 504 | } | 508 | } |
260 | 505 | } | 509 | } |
261 | 506 | 510 | ||
262 | @@ -685,6 +689,11 @@ | |||
263 | 685 | long timezone, | 689 | long timezone, |
264 | 686 | XQPCollator* aCollation) | 690 | XQPCollator* aCollation) |
265 | 687 | { | 691 | { |
266 | 692 | if (aItem0->getTypeCode() == store::JS_NULL || | ||
267 | 693 | aItem1->getTypeCode() == store::JS_NULL) | ||
268 | 694 | { | ||
269 | 695 | return false; | ||
270 | 696 | } | ||
271 | 688 | try | 697 | try |
272 | 689 | { | 698 | { |
273 | 690 | switch(aCompType) | 699 | switch(aCompType) |
274 | 691 | 700 | ||
275 | === modified file 'src/runtime/core/arithmetic_impl.cpp' | |||
276 | --- src/runtime/core/arithmetic_impl.cpp 2012-09-11 22:55:05 +0000 | |||
277 | +++ src/runtime/core/arithmetic_impl.cpp 2012-09-14 14:40:27 +0000 | |||
278 | @@ -115,24 +115,28 @@ | |||
279 | 115 | { | 115 | { |
280 | 116 | if (this->consumeNext(n1, this->theChild1.getp(), planState)) | 116 | if (this->consumeNext(n1, this->theChild1.getp(), planState)) |
281 | 117 | { | 117 | { |
291 | 118 | status = compute(result, | 118 | if (n0->getTypeCode() != store::JS_NULL && |
292 | 119 | planState.theLocalDynCtx, | 119 | n1->getTypeCode() != store::JS_NULL) |
284 | 120 | this->theSctx->get_typemanager(), | ||
285 | 121 | this->loc, | ||
286 | 122 | n0, | ||
287 | 123 | n1); | ||
288 | 124 | /* | ||
289 | 125 | if (this->consumeNext(n0, this->theChild0.getp(), planState) || | ||
290 | 126 | this->consumeNext(n1, this->theChild1.getp(), planState)) | ||
293 | 127 | { | 120 | { |
299 | 128 | throw XQUERY_EXCEPTION( | 121 | status = compute(result, |
300 | 129 | err::XPTY0004, | 122 | planState.theLocalDynCtx, |
301 | 130 | ERROR_PARAMS( ZED( NoSeqAsArithOp ) ), | 123 | this->theSctx->get_typemanager(), |
302 | 131 | ERROR_LOC( this->loc ) | 124 | this->loc, |
303 | 132 | ); | 125 | n0, |
304 | 126 | n1); | ||
305 | 127 | /* | ||
306 | 128 | if (this->consumeNext(n0, this->theChild0.getp(), planState) || | ||
307 | 129 | this->consumeNext(n1, this->theChild1.getp(), planState)) | ||
308 | 130 | { | ||
309 | 131 | throw XQUERY_EXCEPTION( | ||
310 | 132 | err::XPTY0004, | ||
311 | 133 | ERROR_PARAMS( ZED( NoSeqAsArithOp ) ), | ||
312 | 134 | ERROR_LOC( this->loc ) | ||
313 | 135 | ); | ||
314 | 136 | } | ||
315 | 137 | */ | ||
316 | 138 | STACK_PUSH ( status, state ); | ||
317 | 133 | } | 139 | } |
318 | 134 | */ | ||
319 | 135 | STACK_PUSH ( status, state ); | ||
320 | 136 | } | 140 | } |
321 | 137 | } | 141 | } |
322 | 138 | 142 | ||
323 | 139 | 143 | ||
324 | === modified file 'src/runtime/json/jsoniq_functions_impl.cpp' | |||
325 | --- src/runtime/json/jsoniq_functions_impl.cpp 2012-09-11 22:55:05 +0000 | |||
326 | +++ src/runtime/json/jsoniq_functions_impl.cpp 2012-09-14 14:40:27 +0000 | |||
327 | @@ -512,7 +512,7 @@ | |||
328 | 512 | 512 | ||
329 | 513 | 513 | ||
330 | 514 | /******************************************************************************* | 514 | /******************************************************************************* |
332 | 515 | j:null()) as jdm:null | 515 | jn:null() as jn:null |
333 | 516 | ********************************************************************************/ | 516 | ********************************************************************************/ |
334 | 517 | bool | 517 | bool |
335 | 518 | JSONNullIterator::nextImpl( | 518 | JSONNullIterator::nextImpl( |
336 | @@ -529,6 +529,30 @@ | |||
337 | 529 | 529 | ||
338 | 530 | 530 | ||
339 | 531 | /******************************************************************************* | 531 | /******************************************************************************* |
340 | 532 | jn:is-null(xs:anyAtomicType) as xs:boolean | ||
341 | 533 | ********************************************************************************/ | ||
342 | 534 | bool | ||
343 | 535 | JSONIsNullIterator::nextImpl( | ||
344 | 536 | store::Item_t& result, | ||
345 | 537 | PlanState& planState) const | ||
346 | 538 | { | ||
347 | 539 | PlanIteratorState* state; | ||
348 | 540 | store::Item_t lItem; | ||
349 | 541 | bool lIsNull; | ||
350 | 542 | |||
351 | 543 | DEFAULT_STACK_INIT(PlanIteratorState, state, planState); | ||
352 | 544 | |||
353 | 545 | consumeNext(lItem, theChild.getp(), planState); | ||
354 | 546 | |||
355 | 547 | lIsNull = (lItem->getTypeCode() == store::JS_NULL); | ||
356 | 548 | |||
357 | 549 | STACK_PUSH(GENV_ITEMFACTORY->createBoolean(result, lIsNull), state); | ||
358 | 550 | |||
359 | 551 | STACK_END(state); | ||
360 | 552 | } | ||
361 | 553 | |||
362 | 554 | |||
363 | 555 | /******************************************************************************* | ||
364 | 532 | updating function op-zorba:object-insert( | 556 | updating function op-zorba:object-insert( |
365 | 533 | $o as object(), | 557 | $o as object(), |
366 | 534 | $name1 as xs:string, $value1 as item(), | 558 | $name1 as xs:string, $value1 as item(), |
367 | 535 | 559 | ||
368 | === modified file 'src/runtime/json/pregenerated/jsoniq_functions.cpp' | |||
369 | --- src/runtime/json/pregenerated/jsoniq_functions.cpp 2012-09-11 22:55:05 +0000 | |||
370 | +++ src/runtime/json/pregenerated/jsoniq_functions.cpp 2012-09-14 14:40:27 +0000 | |||
371 | @@ -327,6 +327,31 @@ | |||
372 | 327 | 327 | ||
373 | 328 | #endif | 328 | #endif |
374 | 329 | #ifdef ZORBA_WITH_JSON | 329 | #ifdef ZORBA_WITH_JSON |
375 | 330 | // <JSONIsNullIterator> | ||
376 | 331 | SERIALIZABLE_CLASS_VERSIONS(JSONIsNullIterator) | ||
377 | 332 | |||
378 | 333 | void JSONIsNullIterator::serialize(::zorba::serialization::Archiver& ar) | ||
379 | 334 | { | ||
380 | 335 | serialize_baseclass(ar, | ||
381 | 336 | (UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>*)this); | ||
382 | 337 | } | ||
383 | 338 | |||
384 | 339 | |||
385 | 340 | void JSONIsNullIterator::accept(PlanIterVisitor& v) const | ||
386 | 341 | { | ||
387 | 342 | v.beginVisit(*this); | ||
388 | 343 | |||
389 | 344 | theChild->accept(v); | ||
390 | 345 | |||
391 | 346 | v.endVisit(*this); | ||
392 | 347 | } | ||
393 | 348 | |||
394 | 349 | JSONIsNullIterator::~JSONIsNullIterator() {} | ||
395 | 350 | |||
396 | 351 | // </JSONIsNullIterator> | ||
397 | 352 | |||
398 | 353 | #endif | ||
399 | 354 | #ifdef ZORBA_WITH_JSON | ||
400 | 330 | // <JSONArrayInsertIterator> | 355 | // <JSONArrayInsertIterator> |
401 | 331 | SERIALIZABLE_CLASS_VERSIONS(JSONArrayInsertIterator) | 356 | SERIALIZABLE_CLASS_VERSIONS(JSONArrayInsertIterator) |
402 | 332 | 357 | ||
403 | 333 | 358 | ||
404 | === modified file 'src/runtime/json/pregenerated/jsoniq_functions.h' | |||
405 | --- src/runtime/json/pregenerated/jsoniq_functions.h 2012-09-11 22:55:05 +0000 | |||
406 | +++ src/runtime/json/pregenerated/jsoniq_functions.h 2012-09-14 14:40:27 +0000 | |||
407 | @@ -418,6 +418,38 @@ | |||
408 | 418 | #ifdef ZORBA_WITH_JSON | 418 | #ifdef ZORBA_WITH_JSON |
409 | 419 | /** | 419 | /** |
410 | 420 | * | 420 | * |
411 | 421 | * Author: | ||
412 | 422 | */ | ||
413 | 423 | class JSONIsNullIterator : public UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState> | ||
414 | 424 | { | ||
415 | 425 | public: | ||
416 | 426 | SERIALIZABLE_CLASS(JSONIsNullIterator); | ||
417 | 427 | |||
418 | 428 | SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONIsNullIterator, | ||
419 | 429 | UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>); | ||
420 | 430 | |||
421 | 431 | void serialize( ::zorba::serialization::Archiver& ar); | ||
422 | 432 | |||
423 | 433 | JSONIsNullIterator( | ||
424 | 434 | static_context* sctx, | ||
425 | 435 | const QueryLoc& loc, | ||
426 | 436 | PlanIter_t& child) | ||
427 | 437 | : | ||
428 | 438 | UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>(sctx, loc, child) | ||
429 | 439 | {} | ||
430 | 440 | |||
431 | 441 | virtual ~JSONIsNullIterator(); | ||
432 | 442 | |||
433 | 443 | void accept(PlanIterVisitor& v) const; | ||
434 | 444 | |||
435 | 445 | bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; | ||
436 | 446 | }; | ||
437 | 447 | |||
438 | 448 | #endif | ||
439 | 449 | |||
440 | 450 | #ifdef ZORBA_WITH_JSON | ||
441 | 451 | /** | ||
442 | 452 | * | ||
443 | 421 | * internal function | 453 | * internal function |
444 | 422 | * | 454 | * |
445 | 423 | * Author: Zorba Team | 455 | * Author: Zorba Team |
446 | 424 | 456 | ||
447 | === modified file 'src/runtime/pregenerated/iterator_enum.h' | |||
448 | --- src/runtime/pregenerated/iterator_enum.h 2012-09-13 08:28:50 +0000 | |||
449 | +++ src/runtime/pregenerated/iterator_enum.h 2012-09-14 14:40:27 +0000 | |||
450 | @@ -161,6 +161,7 @@ | |||
451 | 161 | TYPE_JSONArrayFlattenIterator, | 161 | TYPE_JSONArrayFlattenIterator, |
452 | 162 | TYPE_JSONItemAccessorIterator, | 162 | TYPE_JSONItemAccessorIterator, |
453 | 163 | TYPE_JSONNullIterator, | 163 | TYPE_JSONNullIterator, |
454 | 164 | TYPE_JSONIsNullIterator, | ||
455 | 164 | TYPE_JSONArrayInsertIterator, | 165 | TYPE_JSONArrayInsertIterator, |
456 | 165 | TYPE_JSONDeleteIterator, | 166 | TYPE_JSONDeleteIterator, |
457 | 166 | TYPE_JSONReplaceValueIterator, | 167 | TYPE_JSONReplaceValueIterator, |
458 | 167 | 168 | ||
459 | === modified file 'src/runtime/spec/json/jsoniq_functions.xml' | |||
460 | --- src/runtime/spec/json/jsoniq_functions.xml 2012-09-13 08:28:50 +0000 | |||
461 | +++ src/runtime/spec/json/jsoniq_functions.xml 2012-09-14 14:40:27 +0000 | |||
462 | @@ -267,24 +267,42 @@ | |||
463 | 267 | </zorba:iterator> | 267 | </zorba:iterator> |
464 | 268 | 268 | ||
465 | 269 | 269 | ||
484 | 270 | <!-- | 270 | <!-- |
485 | 271 | /******************************************************************************* | 271 | /******************************************************************************* |
486 | 272 | ********************************************************************************/ | 272 | ********************************************************************************/ |
487 | 273 | --> | 273 | --> |
488 | 274 | <zorba:iterator name="JSONNullIterator" arity="noary" | 274 | <zorba:iterator name="JSONNullIterator" arity="noary" |
489 | 275 | preprocessorGuard="#ifdef ZORBA_WITH_JSON"> | 275 | preprocessorGuard="#ifdef ZORBA_WITH_JSON"> |
490 | 276 | 276 | ||
491 | 277 | <zorba:function isDeterministic="true"> | 277 | <zorba:function isDeterministic="true"> |
492 | 278 | <zorba:signature localname="null" prefix="fn-jsoniq"> | 278 | <zorba:signature localname="null" prefix="fn-jsoniq"> |
493 | 279 | <zorba:output>jdm:null</zorba:output> | 279 | <zorba:output>js:null</zorba:output> |
494 | 280 | </zorba:signature> | 280 | </zorba:signature> |
495 | 281 | 281 | ||
496 | 282 | </zorba:function> | 282 | </zorba:function> |
497 | 283 | 283 | ||
498 | 284 | </zorba:iterator> | 284 | </zorba:iterator> |
499 | 285 | 285 | ||
500 | 286 | 286 | ||
501 | 287 | <!-- | 287 | <!-- |
502 | 288 | /******************************************************************************* | ||
503 | 289 | ********************************************************************************/ | ||
504 | 290 | --> | ||
505 | 291 | <zorba:iterator name="JSONIsNullIterator" arity="unary" | ||
506 | 292 | preprocessorGuard="#ifdef ZORBA_WITH_JSON"> | ||
507 | 293 | |||
508 | 294 | <zorba:function isDeterministic="true"> | ||
509 | 295 | <zorba:signature localname="is-null" prefix="fn-jsoniq"> | ||
510 | 296 | <zorba:param>xs:anyAtomicType</zorba:param> | ||
511 | 297 | <zorba:output>xs:boolean</zorba:output> | ||
512 | 298 | </zorba:signature> | ||
513 | 299 | |||
514 | 300 | </zorba:function> | ||
515 | 301 | |||
516 | 302 | </zorba:iterator> | ||
517 | 303 | |||
518 | 304 | |||
519 | 305 | <!-- | ||
520 | 288 | /******************************************************************************* | 306 | /******************************************************************************* |
521 | 289 | ********************************************************************************/ | 307 | ********************************************************************************/ |
522 | 290 | <zorba:iterator name="JSONObjectInsertIterator" arity="nary" | 308 | <zorba:iterator name="JSONObjectInsertIterator" arity="nary" |
523 | 291 | 309 | ||
524 | === modified file 'src/runtime/spec/mappings.xml' | |||
525 | --- src/runtime/spec/mappings.xml 2012-09-11 22:55:05 +0000 | |||
526 | +++ src/runtime/spec/mappings.xml 2012-09-14 14:40:27 +0000 | |||
527 | @@ -207,7 +207,7 @@ | |||
528 | 207 | <zorba:type zorbaType="JSON_ITEM">json-item()</zorba:type> | 207 | <zorba:type zorbaType="JSON_ITEM">json-item()</zorba:type> |
529 | 208 | <zorba:type zorbaType="JSON_ARRAY">array()</zorba:type> | 208 | <zorba:type zorbaType="JSON_ARRAY">array()</zorba:type> |
530 | 209 | <zorba:type zorbaType="JSON_OBJECT">object()</zorba:type> | 209 | <zorba:type zorbaType="JSON_OBJECT">object()</zorba:type> |
532 | 210 | <zorba:type zorbaType="JDM_NULL">jdm:null</zorba:type> | 210 | <zorba:type zorbaType="JS_NULL">js:null</zorba:type> |
533 | 211 | </zorba:types> | 211 | </zorba:types> |
534 | 212 | 212 | ||
535 | 213 | <!-- XQuery Occurrence Indicators --> | 213 | <!-- XQuery Occurrence Indicators --> |
536 | 214 | 214 | ||
537 | === modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h' | |||
538 | --- src/runtime/visitors/pregenerated/planiter_visitor.h 2012-09-13 08:28:50 +0000 | |||
539 | +++ src/runtime/visitors/pregenerated/planiter_visitor.h 2012-09-14 14:40:27 +0000 | |||
540 | @@ -339,6 +339,9 @@ | |||
541 | 339 | class JSONNullIterator; | 339 | class JSONNullIterator; |
542 | 340 | #endif | 340 | #endif |
543 | 341 | #ifdef ZORBA_WITH_JSON | 341 | #ifdef ZORBA_WITH_JSON |
544 | 342 | class JSONIsNullIterator; | ||
545 | 343 | #endif | ||
546 | 344 | #ifdef ZORBA_WITH_JSON | ||
547 | 342 | class JSONArrayInsertIterator; | 345 | class JSONArrayInsertIterator; |
548 | 343 | #endif | 346 | #endif |
549 | 344 | #ifdef ZORBA_WITH_JSON | 347 | #ifdef ZORBA_WITH_JSON |
550 | @@ -1179,6 +1182,10 @@ | |||
551 | 1179 | virtual void endVisit ( const JSONNullIterator& ) = 0; | 1182 | virtual void endVisit ( const JSONNullIterator& ) = 0; |
552 | 1180 | #endif | 1183 | #endif |
553 | 1181 | #ifdef ZORBA_WITH_JSON | 1184 | #ifdef ZORBA_WITH_JSON |
554 | 1185 | virtual void beginVisit ( const JSONIsNullIterator& ) = 0; | ||
555 | 1186 | virtual void endVisit ( const JSONIsNullIterator& ) = 0; | ||
556 | 1187 | #endif | ||
557 | 1188 | #ifdef ZORBA_WITH_JSON | ||
558 | 1182 | virtual void beginVisit ( const JSONArrayInsertIterator& ) = 0; | 1189 | virtual void beginVisit ( const JSONArrayInsertIterator& ) = 0; |
559 | 1183 | virtual void endVisit ( const JSONArrayInsertIterator& ) = 0; | 1190 | virtual void endVisit ( const JSONArrayInsertIterator& ) = 0; |
560 | 1184 | #endif | 1191 | #endif |
561 | 1185 | 1192 | ||
562 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp' | |||
563 | --- src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-09-13 08:28:50 +0000 | |||
564 | +++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-09-14 14:40:27 +0000 | |||
565 | @@ -2114,6 +2114,21 @@ | |||
566 | 2114 | 2114 | ||
567 | 2115 | #endif | 2115 | #endif |
568 | 2116 | #ifdef ZORBA_WITH_JSON | 2116 | #ifdef ZORBA_WITH_JSON |
569 | 2117 | // <JSONIsNullIterator> | ||
570 | 2118 | void PrinterVisitor::beginVisit ( const JSONIsNullIterator& a) { | ||
571 | 2119 | thePrinter.startBeginVisit("JSONIsNullIterator", ++theId); | ||
572 | 2120 | printCommons( &a, theId ); | ||
573 | 2121 | thePrinter.endBeginVisit( theId ); | ||
574 | 2122 | } | ||
575 | 2123 | |||
576 | 2124 | void PrinterVisitor::endVisit ( const JSONIsNullIterator& ) { | ||
577 | 2125 | thePrinter.startEndVisit(); | ||
578 | 2126 | thePrinter.endEndVisit(); | ||
579 | 2127 | } | ||
580 | 2128 | // </JSONIsNullIterator> | ||
581 | 2129 | |||
582 | 2130 | #endif | ||
583 | 2131 | #ifdef ZORBA_WITH_JSON | ||
584 | 2117 | // <JSONArrayInsertIterator> | 2132 | // <JSONArrayInsertIterator> |
585 | 2118 | void PrinterVisitor::beginVisit ( const JSONArrayInsertIterator& a) { | 2133 | void PrinterVisitor::beginVisit ( const JSONArrayInsertIterator& a) { |
586 | 2119 | thePrinter.startBeginVisit("JSONArrayInsertIterator", ++theId); | 2134 | thePrinter.startBeginVisit("JSONArrayInsertIterator", ++theId); |
587 | 2120 | 2135 | ||
588 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.h' | |||
589 | --- src/runtime/visitors/pregenerated/printer_visitor.h 2012-09-13 08:28:50 +0000 | |||
590 | +++ src/runtime/visitors/pregenerated/printer_visitor.h 2012-09-14 14:40:27 +0000 | |||
591 | @@ -523,6 +523,11 @@ | |||
592 | 523 | #endif | 523 | #endif |
593 | 524 | 524 | ||
594 | 525 | #ifdef ZORBA_WITH_JSON | 525 | #ifdef ZORBA_WITH_JSON |
595 | 526 | void beginVisit( const JSONIsNullIterator& ); | ||
596 | 527 | void endVisit ( const JSONIsNullIterator& ); | ||
597 | 528 | #endif | ||
598 | 529 | |||
599 | 530 | #ifdef ZORBA_WITH_JSON | ||
600 | 526 | void beginVisit( const JSONArrayInsertIterator& ); | 531 | void beginVisit( const JSONArrayInsertIterator& ); |
601 | 527 | void endVisit ( const JSONArrayInsertIterator& ); | 532 | void endVisit ( const JSONArrayInsertIterator& ); |
602 | 528 | #endif | 533 | #endif |
603 | 529 | 534 | ||
604 | === modified file 'src/store/naive/json_items.cpp' | |||
605 | --- src/store/naive/json_items.cpp 2012-09-14 01:18:48 +0000 | |||
606 | +++ src/store/naive/json_items.cpp 2012-09-14 14:40:27 +0000 | |||
607 | @@ -38,7 +38,7 @@ | |||
608 | 38 | *******************************************************************************/ | 38 | *******************************************************************************/ |
609 | 39 | store::Item* JSONNull::getType() const | 39 | store::Item* JSONNull::getType() const |
610 | 40 | { | 40 | { |
612 | 41 | return GET_STORE().JDM_NULL_QNAME; | 41 | return GET_STORE().JS_NULL_QNAME; |
613 | 42 | } | 42 | } |
614 | 43 | 43 | ||
615 | 44 | 44 | ||
616 | @@ -50,7 +50,7 @@ | |||
617 | 50 | long /* timezone */, | 50 | long /* timezone */, |
618 | 51 | const XQPCollator* /* collation */) const | 51 | const XQPCollator* /* collation */) const |
619 | 52 | { | 52 | { |
621 | 53 | return other->getTypeCode() == store::JDM_NULL; | 53 | return other->getTypeCode() == store::JS_NULL; |
622 | 54 | } | 54 | } |
623 | 55 | 55 | ||
624 | 56 | 56 | ||
625 | @@ -204,7 +204,7 @@ | |||
626 | 204 | *******************************************************************************/ | 204 | *******************************************************************************/ |
627 | 205 | store::Item* JSONObject::getType() const | 205 | store::Item* JSONObject::getType() const |
628 | 206 | { | 206 | { |
630 | 207 | return GET_STORE().JDM_OBJECT_QNAME; | 207 | return GET_STORE().JS_OBJECT_QNAME; |
631 | 208 | } | 208 | } |
632 | 209 | 209 | ||
633 | 210 | 210 | ||
634 | @@ -732,7 +732,7 @@ | |||
635 | 732 | *******************************************************************************/ | 732 | *******************************************************************************/ |
636 | 733 | store::Item* JSONArray::getType() const | 733 | store::Item* JSONArray::getType() const |
637 | 734 | { | 734 | { |
639 | 735 | return GET_STORE().JDM_ARRAY_QNAME; | 735 | return GET_STORE().JS_ARRAY_QNAME; |
640 | 736 | } | 736 | } |
641 | 737 | 737 | ||
642 | 738 | 738 | ||
643 | 739 | 739 | ||
644 | === modified file 'src/store/naive/json_items.h' | |||
645 | --- src/store/naive/json_items.h 2012-09-14 01:18:48 +0000 | |||
646 | +++ src/store/naive/json_items.h 2012-09-14 14:40:27 +0000 | |||
647 | @@ -68,7 +68,7 @@ | |||
648 | 68 | 68 | ||
649 | 69 | void getTypedValue(store::Item_t& val, store::Iterator_t& iter) const; | 69 | void getTypedValue(store::Item_t& val, store::Iterator_t& iter) const; |
650 | 70 | 70 | ||
652 | 71 | store::SchemaTypeCode getTypeCode() const { return store::JDM_NULL; } | 71 | store::SchemaTypeCode getTypeCode() const { return store::JS_NULL; } |
653 | 72 | 72 | ||
654 | 73 | store::Item* getType() const; | 73 | store::Item* getType() const; |
655 | 74 | 74 | ||
656 | 75 | 75 | ||
657 | === modified file 'src/store/naive/store.cpp' | |||
658 | --- src/store/naive/store.cpp 2012-09-11 22:55:05 +0000 | |||
659 | +++ src/store/naive/store.cpp 2012-09-14 14:40:27 +0000 | |||
660 | @@ -86,7 +86,7 @@ | |||
661 | 86 | const char* Store::XS_URI = "http://www.w3.org/2001/XMLSchema"; | 86 | const char* Store::XS_URI = "http://www.w3.org/2001/XMLSchema"; |
662 | 87 | const char* Store::XML_URI = "http://www.w3.org/2001/XML/1998/namespace"; | 87 | const char* Store::XML_URI = "http://www.w3.org/2001/XML/1998/namespace"; |
663 | 88 | const char* Store::ZXSE_URI = "http://www.zorba-xquery.com/zorba/schema-extensions"; | 88 | const char* Store::ZXSE_URI = "http://www.zorba-xquery.com/zorba/schema-extensions"; |
665 | 89 | const char* Store::JDM_URI = "http://www.jsoniq.org/"; | 89 | const char* Store::JS_URI = "http://www.jsoniq.org/types"; |
666 | 90 | 90 | ||
667 | 91 | const ulong Store::XML_URI_LEN = sizeof(Store::XML_URI); | 91 | const ulong Store::XML_URI_LEN = sizeof(Store::XML_URI); |
668 | 92 | 92 | ||
669 | @@ -185,9 +185,9 @@ | |||
670 | 185 | theSchemaTypeNames.resize(store::XS_LAST); | 185 | theSchemaTypeNames.resize(store::XS_LAST); |
671 | 186 | 186 | ||
672 | 187 | #ifdef ZORBA_WITH_JSON | 187 | #ifdef ZORBA_WITH_JSON |
676 | 188 | JDM_NULL_QNAME = theQNamePool->insert(JDM_URI, "jdm", "null"); | 188 | JS_NULL_QNAME = theQNamePool->insert(JS_URI, "js", "null"); |
677 | 189 | JDM_OBJECT_QNAME = theQNamePool->insert(JDM_URI, "jdm", "object"); | 189 | JS_OBJECT_QNAME = theQNamePool->insert(JS_URI, "js", "object"); |
678 | 190 | JDM_ARRAY_QNAME = theQNamePool->insert(JDM_URI, "jdm", "array"); | 190 | JS_ARRAY_QNAME = theQNamePool->insert(JS_URI, "js", "array"); |
679 | 191 | #endif | 191 | #endif |
680 | 192 | 192 | ||
681 | 193 | XS_UNTYPED_QNAME = theQNamePool->insert(ns, "xs", "untyped"); | 193 | XS_UNTYPED_QNAME = theQNamePool->insert(ns, "xs", "untyped"); |
682 | @@ -323,9 +323,9 @@ | |||
683 | 323 | XS_ANY_SIMPLE_QNAME = NULL; | 323 | XS_ANY_SIMPLE_QNAME = NULL; |
684 | 324 | 324 | ||
685 | 325 | #ifdef ZORBA_WITH_JSON | 325 | #ifdef ZORBA_WITH_JSON |
689 | 326 | JDM_OBJECT_QNAME = NULL; | 326 | JS_OBJECT_QNAME = NULL; |
690 | 327 | JDM_ARRAY_QNAME = NULL; | 327 | JS_ARRAY_QNAME = NULL; |
691 | 328 | JDM_NULL_QNAME = NULL; | 328 | JS_NULL_QNAME = NULL; |
692 | 329 | #endif | 329 | #endif |
693 | 330 | 330 | ||
694 | 331 | delete theQNamePool; | 331 | delete theQNamePool; |
695 | 332 | 332 | ||
696 | === modified file 'src/store/naive/store.h' | |||
697 | --- src/store/naive/store.h 2012-09-13 08:28:50 +0000 | |||
698 | +++ src/store/naive/store.h 2012-09-14 14:40:27 +0000 | |||
699 | @@ -136,7 +136,7 @@ | |||
700 | 136 | static const char* XS_URI; | 136 | static const char* XS_URI; |
701 | 137 | static const char* XML_URI; | 137 | static const char* XML_URI; |
702 | 138 | static const char* ZXSE_URI; | 138 | static const char* ZXSE_URI; |
704 | 139 | static const char* JDM_URI; | 139 | static const char* JS_URI; |
705 | 140 | 140 | ||
706 | 141 | static const ulong XML_URI_LEN; | 141 | static const ulong XML_URI_LEN; |
707 | 142 | 142 | ||
708 | @@ -159,9 +159,9 @@ | |||
709 | 159 | store::Item_t XS_ANY_SIMPLE_QNAME; | 159 | store::Item_t XS_ANY_SIMPLE_QNAME; |
710 | 160 | 160 | ||
711 | 161 | #ifdef ZORBA_WITH_JSON | 161 | #ifdef ZORBA_WITH_JSON |
715 | 162 | store::Item_t JDM_OBJECT_QNAME; | 162 | store::Item_t JS_OBJECT_QNAME; |
716 | 163 | store::Item_t JDM_ARRAY_QNAME; | 163 | store::Item_t JS_ARRAY_QNAME; |
717 | 164 | store::Item_t JDM_NULL_QNAME; | 164 | store::Item_t JS_NULL_QNAME; |
718 | 165 | #endif | 165 | #endif |
719 | 166 | 166 | ||
720 | 167 | protected: | 167 | protected: |
721 | 168 | 168 | ||
722 | === modified file 'src/types/casting.cpp' | |||
723 | --- src/types/casting.cpp 2012-09-11 22:55:05 +0000 | |||
724 | +++ src/types/casting.cpp 2012-09-14 14:40:27 +0000 | |||
725 | @@ -1818,7 +1818,7 @@ | |||
726 | 1818 | 20, // 42 XS_ANY_URI | 1818 | 20, // 42 XS_ANY_URI |
727 | 1819 | 21, // 43 XS_QNAME | 1819 | 21, // 43 XS_QNAME |
728 | 1820 | 22, // 44 XS_NOTATION | 1820 | 22, // 44 XS_NOTATION |
730 | 1821 | 23 // 45 JDM_NULL | 1821 | 23 // 45 JS_NULL |
731 | 1822 | }; | 1822 | }; |
732 | 1823 | 1823 | ||
733 | 1824 | 1824 | ||
734 | @@ -2159,7 +2159,7 @@ | |||
735 | 2159 | sourceTypeCode != store::XS_UNTYPED_ATOMIC) | 2159 | sourceTypeCode != store::XS_UNTYPED_ATOMIC) |
736 | 2160 | throwTypeException(err::XPTY0004, errorInfo); | 2160 | throwTypeException(err::XPTY0004, errorInfo); |
737 | 2161 | 2161 | ||
739 | 2162 | if (targetTypeCode == store::JDM_NULL) | 2162 | if (targetTypeCode == store::JS_NULL) |
740 | 2163 | throwTypeException(err::XPTY0004, errorInfo); | 2163 | throwTypeException(err::XPTY0004, errorInfo); |
741 | 2164 | 2164 | ||
742 | 2165 | CastFunc castFunc = theCastMatrix[theMapping[sourceTypeCode]] | 2165 | CastFunc castFunc = theCastMatrix[theMapping[sourceTypeCode]] |
743 | 2166 | 2166 | ||
744 | === modified file 'src/types/root_typemanager.cpp' | |||
745 | --- src/types/root_typemanager.cpp 2012-09-11 22:55:05 +0000 | |||
746 | +++ src/types/root_typemanager.cpp 2012-09-14 14:40:27 +0000 | |||
747 | @@ -281,9 +281,9 @@ | |||
748 | 281 | XSQNDECL(XS_UNTYPED_QNAME, "untyped"); | 281 | XSQNDECL(XS_UNTYPED_QNAME, "untyped"); |
749 | 282 | 282 | ||
750 | 283 | #ifdef ZORBA_WITH_JSON | 283 | #ifdef ZORBA_WITH_JSON |
754 | 284 | GENV_STORE.getItemFactory()->createQName(JDM_NULL_QNAME, | 284 | GENV_STORE.getItemFactory()->createQName(JS_NULL_QNAME, |
755 | 285 | static_context::JSONIQ_NS, | 285 | static_context::JSONIQ_DM_NS, |
756 | 286 | "", | 286 | "jn", |
757 | 287 | "null"); | 287 | "null"); |
758 | 288 | #endif | 288 | #endif |
759 | 289 | 289 | ||
760 | @@ -389,43 +389,43 @@ | |||
761 | 389 | new StructuredItemXQType(this, TypeConstants::QUANT_PLUS, true); | 389 | new StructuredItemXQType(this, TypeConstants::QUANT_PLUS, true); |
762 | 390 | 390 | ||
763 | 391 | #ifdef ZORBA_WITH_JSON | 391 | #ifdef ZORBA_WITH_JSON |
766 | 392 | JDM_NULL_TYPE_ONE = new AtomicXQType(this, | 392 | JS_NULL_TYPE_ONE = new AtomicXQType(this, |
767 | 393 | store::JDM_NULL, | 393 | store::JS_NULL, |
768 | 394 | TypeConstants::QUANT_ONE, | 394 | TypeConstants::QUANT_ONE, |
769 | 395 | true); | 395 | true); |
770 | 396 | 396 | ||
773 | 397 | JDM_NULL_TYPE_QUESTION = new AtomicXQType(this, | 397 | JS_NULL_TYPE_QUESTION = new AtomicXQType(this, |
774 | 398 | store::JDM_NULL, | 398 | store::JS_NULL, |
775 | 399 | TypeConstants::QUANT_QUESTION, | 399 | TypeConstants::QUANT_QUESTION, |
776 | 400 | true); | 400 | true); |
777 | 401 | 401 | ||
780 | 402 | JDM_NULL_TYPE_STAR = new AtomicXQType(this, | 402 | JS_NULL_TYPE_STAR = new AtomicXQType(this, |
781 | 403 | store::JDM_NULL, | 403 | store::JS_NULL, |
782 | 404 | TypeConstants::QUANT_STAR, | 404 | TypeConstants::QUANT_STAR, |
783 | 405 | true); | 405 | true); |
784 | 406 | 406 | ||
787 | 407 | JDM_NULL_TYPE_PLUS = new AtomicXQType(this, | 407 | JS_NULL_TYPE_PLUS = new AtomicXQType(this, |
788 | 408 | store::JDM_NULL, | 408 | store::JS_NULL, |
789 | 409 | TypeConstants::QUANT_PLUS, | 409 | TypeConstants::QUANT_PLUS, |
790 | 410 | true); | 410 | true); |
791 | 411 | 411 | ||
793 | 412 | m_atomic_typecode_qname_map[store::JDM_NULL] = JDM_NULL_QNAME; | 412 | m_atomic_typecode_qname_map[store::JS_NULL] = JS_NULL_QNAME; |
794 | 413 | 413 | ||
797 | 414 | tempQN = JDM_NULL_QNAME.getp(); | 414 | tempQN = JS_NULL_QNAME.getp(); |
798 | 415 | tempCode = store::JDM_NULL; | 415 | tempCode = store::JS_NULL; |
799 | 416 | m_atomic_qnametype_map.insert(tempQN, tempCode); | 416 | m_atomic_qnametype_map.insert(tempQN, tempCode); |
800 | 417 | 417 | ||
803 | 418 | m_atomic_typecode_map[store::JDM_NULL][TypeConstants::QUANT_ONE] = | 418 | m_atomic_typecode_map[store::JS_NULL][TypeConstants::QUANT_ONE] = |
804 | 419 | &JDM_NULL_TYPE_ONE; | 419 | &JS_NULL_TYPE_ONE; |
805 | 420 | 420 | ||
814 | 421 | m_atomic_typecode_map[store::JDM_NULL][TypeConstants::QUANT_QUESTION] = | 421 | m_atomic_typecode_map[store::JS_NULL][TypeConstants::QUANT_QUESTION] = |
815 | 422 | &JDM_NULL_TYPE_QUESTION; | 422 | &JS_NULL_TYPE_QUESTION; |
816 | 423 | 423 | ||
817 | 424 | m_atomic_typecode_map[store::JDM_NULL][TypeConstants::QUANT_STAR] = | 424 | m_atomic_typecode_map[store::JS_NULL][TypeConstants::QUANT_STAR] = |
818 | 425 | &JDM_NULL_TYPE_STAR; | 425 | &JS_NULL_TYPE_STAR; |
819 | 426 | 426 | ||
820 | 427 | m_atomic_typecode_map[store::JDM_NULL][TypeConstants::QUANT_PLUS] = | 427 | m_atomic_typecode_map[store::JS_NULL][TypeConstants::QUANT_PLUS] = |
821 | 428 | &JDM_NULL_TYPE_PLUS; | 428 | &JS_NULL_TYPE_PLUS; |
822 | 429 | 429 | ||
823 | 430 | #define JSON_TYPE_DEFN(basename, kind) \ | 430 | #define JSON_TYPE_DEFN(basename, kind) \ |
824 | 431 | basename##_TYPE_ONE = new JSONXQType(this, \ | 431 | basename##_TYPE_ONE = new JSONXQType(this, \ |
825 | @@ -558,7 +558,7 @@ | |||
826 | 558 | DELETE_TYPE(STRUCTURED_ITEM) | 558 | DELETE_TYPE(STRUCTURED_ITEM) |
827 | 559 | 559 | ||
828 | 560 | #ifdef ZORBA_WITH_JSON | 560 | #ifdef ZORBA_WITH_JSON |
830 | 561 | DELETE_TYPE(JDM_NULL) | 561 | DELETE_TYPE(JS_NULL) |
831 | 562 | 562 | ||
832 | 563 | DELETE_TYPE(JSON_ITEM) | 563 | DELETE_TYPE(JSON_ITEM) |
833 | 564 | DELETE_TYPE(JSON_OBJECT) | 564 | DELETE_TYPE(JSON_OBJECT) |
834 | 565 | 565 | ||
835 | === modified file 'src/types/root_typemanager.h' | |||
836 | --- src/types/root_typemanager.h 2012-09-11 22:55:05 +0000 | |||
837 | +++ src/types/root_typemanager.h 2012-09-14 14:40:27 +0000 | |||
838 | @@ -132,11 +132,11 @@ | |||
839 | 132 | * | 132 | * |
840 | 133 | * N, N?, N+, N*, where N is the jdm::null atomic type | 133 | * N, N?, N+, N*, where N is the jdm::null atomic type |
841 | 134 | */ | 134 | */ |
847 | 135 | store::Item_t JDM_NULL_QNAME; | 135 | store::Item_t JS_NULL_QNAME; |
848 | 136 | xqtref_t JDM_NULL_TYPE_ONE; | 136 | xqtref_t JS_NULL_TYPE_ONE; |
849 | 137 | xqtref_t JDM_NULL_TYPE_QUESTION; | 137 | xqtref_t JS_NULL_TYPE_QUESTION; |
850 | 138 | xqtref_t JDM_NULL_TYPE_STAR; | 138 | xqtref_t JS_NULL_TYPE_STAR; |
851 | 139 | xqtref_t JDM_NULL_TYPE_PLUS; | 139 | xqtref_t JS_NULL_TYPE_PLUS; |
852 | 140 | #endif | 140 | #endif |
853 | 141 | 141 | ||
854 | 142 | /** | 142 | /** |
855 | 143 | 143 | ||
856 | === modified file 'src/zorbaserialization/serialize_zorba_types.cpp' | |||
857 | --- src/zorbaserialization/serialize_zorba_types.cpp 2012-09-11 22:55:05 +0000 | |||
858 | +++ src/zorbaserialization/serialize_zorba_types.cpp 2012-09-14 14:40:27 +0000 | |||
859 | @@ -770,7 +770,7 @@ | |||
860 | 770 | } | 770 | } |
861 | 771 | 771 | ||
862 | 772 | #ifdef ZORBA_WITH_JSON | 772 | #ifdef ZORBA_WITH_JSON |
864 | 773 | case store::JDM_NULL: | 773 | case store::JS_NULL: |
865 | 774 | { | 774 | { |
866 | 775 | break; | 775 | break; |
867 | 776 | } | 776 | } |
868 | @@ -1076,7 +1076,7 @@ | |||
869 | 1076 | } | 1076 | } |
870 | 1077 | 1077 | ||
871 | 1078 | #ifdef ZORBA_WITH_JSON | 1078 | #ifdef ZORBA_WITH_JSON |
873 | 1079 | case store::JDM_NULL: | 1079 | case store::JS_NULL: |
874 | 1080 | { | 1080 | { |
875 | 1081 | store::Item_t lRes; | 1081 | store::Item_t lRes; |
876 | 1082 | GENV_ITEMFACTORY->createJSONNull(lRes); | 1082 | GENV_ITEMFACTORY->createJSONNull(lRes); |
877 | 1083 | 1083 | ||
878 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null02.xml.res' | |||
879 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/null02.xml.res 2012-01-30 18:37:03 +0000 | |||
880 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/null02.xml.res 2012-09-14 14:40:27 +0000 | |||
881 | @@ -1,1 +1,1 @@ | |||
883 | 1 | true | 1 | false |
884 | 2 | 2 | ||
885 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null04.xml.res' | |||
886 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/null04.xml.res 1970-01-01 00:00:00 +0000 | |||
887 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/null04.xml.res 2012-09-14 14:40:27 +0000 | |||
888 | @@ -0,0 +1,1 @@ | |||
889 | 1 | true | ||
890 | 0 | 2 | ||
891 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null05.xml.res' | |||
892 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/null05.xml.res 1970-01-01 00:00:00 +0000 | |||
893 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/null05.xml.res 2012-09-14 14:40:27 +0000 | |||
894 | @@ -0,0 +1,1 @@ | |||
895 | 1 | false | ||
896 | 0 | 2 | ||
897 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null06.xml.res' | |||
898 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null07.xml.res' | |||
899 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null08.xml.res' | |||
900 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/null08.xml.res 1970-01-01 00:00:00 +0000 | |||
901 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/null08.xml.res 2012-09-14 14:40:27 +0000 | |||
902 | @@ -0,0 +1,1 @@ | |||
903 | 1 | true true true true true false false false false false | ||
904 | 0 | 2 | ||
905 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res' | |||
906 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res 2012-09-10 17:47:37 +0000 | |||
907 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res 2012-09-14 14:40:27 +0000 | |||
908 | @@ -1,1 +1,1 @@ | |||
910 | 1 | html: invalid serialization method for item type (jdm:object) text: invalid serialization method for item type (jdm:object) xml: invalid serialization method for item type (jdm:object) xhtml: invalid serialization method for item type (jdm:object) | 1 | html: invalid serialization method for item type (js:object) text: invalid serialization method for item type (js:object) xml: invalid serialization method for item type (js:object) xhtml: invalid serialization method for item type (js:object) |
911 | 2 | 2 | ||
912 | === modified file 'test/rbkt/Queries/zorba/jsoniq/null01.xq' | |||
913 | --- test/rbkt/Queries/zorba/jsoniq/null01.xq 2012-01-27 23:00:49 +0000 | |||
914 | +++ test/rbkt/Queries/zorba/jsoniq/null01.xq 2012-09-14 14:40:27 +0000 | |||
915 | @@ -1,3 +1,1 @@ | |||
919 | 1 | import module namespace j = "http://www.jsoniq.org/functions"; | 1 | jn:null() |
917 | 2 | |||
918 | 3 | j:null() | ||
920 | 4 | 2 | ||
921 | === modified file 'test/rbkt/Queries/zorba/jsoniq/null02.xq' | |||
922 | --- test/rbkt/Queries/zorba/jsoniq/null02.xq 2012-01-30 18:37:03 +0000 | |||
923 | +++ test/rbkt/Queries/zorba/jsoniq/null02.xq 2012-09-14 14:40:27 +0000 | |||
924 | @@ -1,3 +1,1 @@ | |||
928 | 1 | import module namespace j = "http://www.jsoniq.org/functions"; | 1 | jn:null() = jn:null() |
926 | 2 | |||
927 | 3 | j:null() = j:null() | ||
929 | 4 | 2 | ||
930 | === modified file 'test/rbkt/Queries/zorba/jsoniq/null03.xq' | |||
931 | --- test/rbkt/Queries/zorba/jsoniq/null03.xq 2012-01-31 04:17:50 +0000 | |||
932 | +++ test/rbkt/Queries/zorba/jsoniq/null03.xq 2012-09-14 14:40:27 +0000 | |||
933 | @@ -1,4 +1,2 @@ | |||
937 | 1 | import module namespace j = "http://www.jsoniq.org/functions"; | 1 | fn:data(jn:null()) |
935 | 2 | |||
936 | 3 | fn:data(j:null()) | ||
938 | 4 | 2 | ||
939 | 5 | 3 | ||
940 | === added file 'test/rbkt/Queries/zorba/jsoniq/null04.xq' | |||
941 | --- test/rbkt/Queries/zorba/jsoniq/null04.xq 1970-01-01 00:00:00 +0000 | |||
942 | +++ test/rbkt/Queries/zorba/jsoniq/null04.xq 2012-09-14 14:40:27 +0000 | |||
943 | @@ -0,0 +1,2 @@ | |||
944 | 1 | jn:is-null(jn:null()) | ||
945 | 2 | |||
946 | 0 | 3 | ||
947 | === added file 'test/rbkt/Queries/zorba/jsoniq/null05.xq' | |||
948 | --- test/rbkt/Queries/zorba/jsoniq/null05.xq 1970-01-01 00:00:00 +0000 | |||
949 | +++ test/rbkt/Queries/zorba/jsoniq/null05.xq 2012-09-14 14:40:27 +0000 | |||
950 | @@ -0,0 +1,2 @@ | |||
951 | 1 | jn:is-null("null") | ||
952 | 2 | |||
953 | 0 | 3 | ||
954 | === added file 'test/rbkt/Queries/zorba/jsoniq/null06.xq' | |||
955 | --- test/rbkt/Queries/zorba/jsoniq/null06.xq 1970-01-01 00:00:00 +0000 | |||
956 | +++ test/rbkt/Queries/zorba/jsoniq/null06.xq 2012-09-14 14:40:27 +0000 | |||
957 | @@ -0,0 +1,3 @@ | |||
958 | 1 | null + 1, null - 1, null * 1, null div 1, null mod 1 | ||
959 | 2 | |||
960 | 3 | |||
961 | 0 | 4 | ||
962 | === added file 'test/rbkt/Queries/zorba/jsoniq/null07.xq' | |||
963 | --- test/rbkt/Queries/zorba/jsoniq/null07.xq 1970-01-01 00:00:00 +0000 | |||
964 | +++ test/rbkt/Queries/zorba/jsoniq/null07.xq 2012-09-14 14:40:27 +0000 | |||
965 | @@ -0,0 +1,1 @@ | |||
966 | 1 | null eq 1, 1 ne null, null le 1, 1 ge null, 1 lt null, null gt 1 | ||
967 | 0 | 2 | ||
968 | === added file 'test/rbkt/Queries/zorba/jsoniq/null08.xq' | |||
969 | --- test/rbkt/Queries/zorba/jsoniq/null08.xq 1970-01-01 00:00:00 +0000 | |||
970 | +++ test/rbkt/Queries/zorba/jsoniq/null08.xq 2012-09-14 14:40:27 +0000 | |||
971 | @@ -0,0 +1,10 @@ | |||
972 | 1 | (null, 1, 2, null) = (4, null, 1, 6), | ||
973 | 2 | (null, 1, 2, null) < (4, null, 1, 6), | ||
974 | 3 | (null, 1, 2, null) > (4, null, 1, 6), | ||
975 | 4 | (null, 1, 2, null) <= (4, null, 1, 6), | ||
976 | 5 | (null, 1, 2, null) >= (4, null, 1, 6), | ||
977 | 6 | (null, 1, 2) = (3, 4, null), | ||
978 | 7 | (null, 3, 4) < (1, 2, null), | ||
979 | 8 | (null, 1, 2) > (3, 4, null), | ||
980 | 9 | (null, 3, 4) <= (1, 2, null), | ||
981 | 10 | (null, 1, 2) >= (3, 4, null) |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ bug-1041445- 2012-09- 13T12-55- 25.237Z/ log.html
Log at: http://