Skip to content

Commit

Permalink
Improve comparison predicate logic (#163)
Browse files Browse the repository at this point in the history
Replace existing Value.cmp(), with the full rules layed out by
ISO/IEC 9075-2:2016(E), 8.2, <comparison predicate>

SQL Standard E011-06
  • Loading branch information
elliotchance authored Oct 19, 2023
1 parent 6da3ebf commit 90cad24
Show file tree
Hide file tree
Showing 9 changed files with 534 additions and 91 deletions.
4 changes: 2 additions & 2 deletions docs/sql-compliance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Mandatory Features
------------------

As of the latest version (or at least the version of this documentation)
**vsql supports 59 of the 164 mandatory features** of the
**vsql supports 60 of the 164 mandatory features** of the
`SQL:2016 Standard <https://www.iso.org/standard/63556.html>`_.

.. list-table:: Table 43 — Feature taxonomy and definition for mandatory features
Expand All @@ -40,7 +40,7 @@ As of the latest version (or at least the version of this documentation)
* - ✅ E011-05
- Numeric comparison

* - E011-06
* - E011-06
- Implicit casting among the numeric data types

* - ⭕ **E021**
Expand Down
4 changes: 2 additions & 2 deletions tests/bigint.sql
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ VALUES CAST(123 AS BIGINT) / 53.7;
-- COL1: 2

VALUES -123.7 / CAST(53 AS BIGINT);
-- COL1: -3
-- COL1: -2

VALUES CAST(-5000000000000000000 AS BIGINT) / 0.02;
-- error 22012: division by zero

VALUES -5000000000000000000.7 / CAST(3.2 AS BIGINT);
-- COL1: -1666666666666666667
-- COL1: -1666666666666666666

VALUES CAST(-5000000000000000000 AS BIGINT) / 0;
-- error 22012: division by zero
Expand Down
Loading

0 comments on commit 90cad24

Please sign in to comment.