Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about test case K2-OrderbyExprWithout-26 and K2-OrderbyExprWithout-27 #46

Open
adamretter opened this issue Sep 3, 2022 · 2 comments

Comments

@adamretter
Copy link
Contributor

These two tests use a sequence of two items for the Order spec key, and allow either a result or an error of XPTY004.
However the XQuery 1.0 and 3.1 specs both state:

The process of evaluating and comparing the orderspecs is based on the following rules:

  • Atomization is applied to the result of the expression in each orderspec. If the result of atomization is neither a single atomic value nor an empty sequence, a type error is raised [err:XPTY0004].

As far as I can see these tests should only allow an error of XPTY004... or did I miss something?

@adamretter
Copy link
Contributor Author

The same goes for test cases:

  • K2-OrderbyExprWithout-8
  • K2-OrderbyExprWithout-9
  • K2-OrderbyExprWithout-19
  • K2-OrderbyExprWithout-20
  • K2-OrderbyExprWithout-23
  • K2-OrderbyExprWithout-24
  • K2-OrderbyExprWithout-25
  • K2-OrderbyExprWithout-28
  • K2-OrderbyExprWithout-31
  • K2-OrderbyExprWithout-32
  • K2-OrderbyExprWithout-39

It seems unlikely to me that all of these tests are incorrect, and so I feel that I must be missing some vital piece of information...

@michaelhkay
Copy link
Contributor

I don't know the history, but my guess would be that someone decided that in all these cases, the sort can be optimised away because the input to the sort is a singleton, and that it therefore falls under the rule that if you can get the answer to a query without ever evaluating some subexpression (in this case, the sort key), then an error in that subexpression doesn't need to be reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants