Merge lp:~zorba-coders/zorba/feature-compare_null into lp:zorba

Proposed by Matthias Brantner
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: no longer in the source branch.
Merged at revision: 11315
Proposed branch: lp:~zorba-coders/zorba/feature-compare_null
Merge into: lp:zorba
Diff against target: 46 lines (+12/-1)
3 files modified
src/runtime/booleans/BooleanImpl.cpp (+10/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/null09.xml.res (+1/-0)
test/rbkt/Queries/zorba/jsoniq/null09.jq (+1/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/feature-compare_null
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Approve
Review via email: mp+155377@code.launchpad.net

Commit message

allow comparison of null to any other atomic type

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) :
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 feature-compare_null-2013-03-26T00-20-38.878Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve, 2 Pending.

11314. By [u'Matthias Brantner <matthias.brantner@28msec.com>']

expose setDefaultFunctionNamespaces in the C++ api Approved: Markos Zaharioudakis, Matthias Brantner

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 feature-compare_null-2013-03-26T18-16-43.557Z is finished. The final status was:

All tests succeeded!

11315. By [u'Matthias Brantner <matthias.brantner@28msec.com>']

allow comparison of null to any other atomic type Approved: Markos Zaharioudakis, Matthias Brantner

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/booleans/BooleanImpl.cpp'
2--- src/runtime/booleans/BooleanImpl.cpp 2013-03-24 19:05:42 +0000
3+++ src/runtime/booleans/BooleanImpl.cpp 2013-03-26 00:19:23 +0000
4@@ -890,13 +890,14 @@
5 }
6 else
7 {
8- // There are 2 cases when two types are comparable without one being a
9+ // There are 3 cases when two types are comparable without one being a
10 // subtype of the other: (a) they belong to different branches under of
11 // the type-inheritance subtree rooted at xs:integer, (b) they belong to
12 // different branches under of the type-inheritance subtree rooted at
13 // xs::duration (i.e. one is xs:yearMonthDuration and the other is
14 // xs:dayTimeDuration).
15 // The same case happens when there are two types derived from xs:NOTATION.
16+ // (c) either of the types is a subtype of NULL.
17 if (TypeOps::is_subtype(type0, store::XS_INTEGER) &&
18 TypeOps::is_subtype(type1, store::XS_INTEGER))
19 {
20@@ -912,6 +913,14 @@
21 {
22 return item0->equals(item1);
23 }
24+ else if (TypeOps::is_subtype(type0, store::JS_NULL))
25+ {
26+ return item0->equals(item1);
27+ }
28+ else if (TypeOps::is_subtype(type1, store::JS_NULL))
29+ {
30+ return item1->equals(item0);
31+ }
32 else
33 {
34 xqtref_t type0 = tm->create_value_type(item0.getp());
35
36=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/null09.xml.res'
37--- test/rbkt/ExpQueryResults/zorba/jsoniq/null09.xml.res 1970-01-01 00:00:00 +0000
38+++ test/rbkt/ExpQueryResults/zorba/jsoniq/null09.xml.res 2013-03-26 00:19:23 +0000
39@@ -0,0 +1,1 @@
40+false false false true
41
42=== added file 'test/rbkt/Queries/zorba/jsoniq/null09.jq'
43--- test/rbkt/Queries/zorba/jsoniq/null09.jq 1970-01-01 00:00:00 +0000
44+++ test/rbkt/Queries/zorba/jsoniq/null09.jq 2013-03-26 00:19:23 +0000
45@@ -0,0 +1,1 @@
46+null eq 1, null eq current-dateTime(), null ne null, null ne 42

Subscribers

People subscribed via source and target branches