fn-deep-equal/K2-SeqDeepEqualFunc-36

Bug #1180023 reported by Cezar Andrei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Committed
High
Markos Zaharioudakis

Bug Description

testcase: fn-deep-equal/K2-SeqDeepEqualFunc-36 which is:

deep-equal(validate type xs:integer {<e>2012</e>}, validate type xs:gYear{<e>2012</e>})

It seems from the spec: http://www.w3.org/TR/xquery-operators/#func-deep-equal

If $i1 and $i2 are both atomic values, they are deep-equal if and only if ($i1 eq $i2) is true, or if both values are NaN. If the eq operator is not defined for $i1 and $i2, the function returns false.

And here there is no eq defined between gYear and anything else:

http://www.w3.org/TR/xquery/#mapping

So the test is correct, imo.

But the code doesn't implement this.

I came to the following code: src/runtime/sequences/sequences_impl.cpp:1009 where it compares only the utf string representation:

    case store::StoreConsts::textNode:
    case store::StoreConsts::commentNode:
    {
      return (0 == utf8::compare(item1->getStringValue(),
                                 item2->getStringValue(),
                                 collator));
      break;
    }

tags: added: fots
Changed in zorba:
importance: Undecided → High
tags: added: performance-problem
Changed in zorba:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.