Bug #6051
open

Bug on exist() with non-existing attribute
0%
Updated by Michael Kay 11 days ago
- Status changed from New to Rejected
- Assignee set to Michael Kay
Thanks.
But Saxon appears to give the correct result.
Test case fn-exists-101 added to qt4tests.
Updated by Michael Kay 11 days ago
- Status changed from Rejected to In Progress
Reopening. The test is working from the command line but not in the test driver.
The test is working in 12.x but not in 11.x. In 11.x, the predicate is being rewritten to [exists(data(@n1) ge -1)]
which is incorrect; the ge
operator returns ()
when one of the operands is ()
.
Updated by Michael Kay 11 days ago
In 11.x, GeneralComparison.typeCheck() line 305 rewrites the comparison to a value comparison like this:
Expression vun = makeCompareUntypedToNumeric(getLhsExpression(), getRhsExpression(), singletonOperator);
return vun.typeCheck(visitor, contextInfo);
In 12.x this has been changed to:
setAtomicComparer(new UntypedNumericComparer());
return this;
Git Blame dates this as 19/08/22 and attributes it to bytecode changes, I suspect a bug fix mixed into the same commit as something else.
Updated by Michael Kay 11 days ago
I've done a fair bit of digging in the history and I can't find any record of what motivated this code change on 2022-08-19. So I'm going to have to deal with it from first principles.
Updated by Christian Grün 11 days ago
Coincidental bug fixes are not the worst ;)
Updated by Michael Kay 11 days ago
- Category set to XPath conformance
- Status changed from In Progress to Resolved
- Priority changed from Low to Normal
- Applies to branch 11 added
- Fix Committed on Branch 11 added
- Platforms .NET, Java added
I've retrofitted the code change from 12.x to 11.x and it seems to regression test OK.
Updated by John Lumley 11 days ago
The worst I’ve had was where a bug went away when run under the debugger, due to a bug in the debugger!
Sent from my iPad
On 25 May 2023, at 18:04, Saxonica Developer Community notifications@plan.io wrote:
Updated by Michael Kay 10 days ago
- Status changed from Resolved to In Progress
Reopened because there are reports that this fails on 12.2 see https://github.com/BaseXdb/basex/issues/2212
Please register to edit this issue