keysim.js icon indicating copy to clipboard operation
keysim.js copied to clipboard

build(deps): bump cached-path-relative from 1.0.2 to 1.1.0

Open dependabot[bot] opened this issue 3 years ago • 0 comments

Bumps cached-path-relative from 1.0.2 to 1.1.0.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

dependabot[bot] avatar Jan 27 '22 15:01 dependabot[bot]

Interesting, thank you for reporting this. So is it true that attaching ORDER BY to a query is redundant unless LIMIT or OFFSET is also provided? In which case I wonder why the standard allows it!

tomjaguarpaw avatar Jan 10 '22 11:01 tomjaguarpaw

My understanding is that ORDER BY without LIMIT or OFFSET makes sense only:

  • At the very "top level" of the query, to get the final result rows in the desired order.
  • When using DISTINCT ON to get predictable/deterministic values for the non-distinct columns (this is relevant also for nested queries)
  • Inside an aggregate function (but this is a different syntactical form of ORDER BY than we are talking about here)

But there may be other scenarios I'm not aware of. In any case, I would be happy to hear more about all this from a real SQL/PostgreSQL expert.

bitc avatar Jan 10 '22 12:01 bitc

[...] In which case I wonder why the standard allows it!

After a bit of research, I've discovered that at least MS SQL Server does not allow it, and gives the following error:

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries,
and common table expressions, unless TOP, OFFSET or FOR XML is also specified.

(TOP is the SQL Server equivalent of LIMIT)

Here is the sqlfiddle I used: http://sqlfiddle.com/#!18/a7540/47886


Finding official documentation about the issues I have raised is tricky, but I've found some stack overflow answers :) like this one:

https://dba.stackexchange.com/questions/82930/database-implementations-of-order-by-in-a-subquery/83500#83500

And in Oracle and PostGres, just because the syntax is supported, does not mean it is obeyed. And just because you observe it as being obeyed in some scenario, does not mean that it will continue to be obeyed as new versions come out or with subtle changes to your data, statistics, the query itself, or the environment.

I can assure you that, without a doubt, if you want a guarantee about order, you need to put the ORDER BY on the outermost query. This should be a doctrine you hold close no matter what platform you're using.

And some more discussion here: https://dba.stackexchange.com/questions/184149/is-it-really-possible-that-the-order-will-not-be-guaranteed-for-this-particular

And also wikipedia, from https://en.wikipedia.org/wiki/Order_by (which sadly does not supply any official references for this claim):

Although some database systems allow the specification of an ORDER BY clause in subselects or view definitions, the presence there has no effect. A view is a logical relational table, and the relational model mandates that a table is a set of rows, implying no sort order whatsoever.

bitc avatar Jan 11 '22 07:01 bitc

That's very interesting. Thank you for digging further. If someone can come up with a reproducible test case then I will fix this. On the other hand, without a reproducible test case I fear that any such "bug fix" is liable to get undone by accident.

tomjaguarpaw avatar Jan 16 '22 18:01 tomjaguarpaw