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

sql result discrepency with sqlite, postgres and duckdb #13780

Open
Tracked by #13811
Omega359 opened this issue Dec 14, 2024 · 0 comments
Open
Tracked by #13811

sql result discrepency with sqlite, postgres and duckdb #13780

Omega359 opened this issue Dec 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Omega359
Copy link
Contributor

Omega359 commented Dec 14, 2024

Describe the bug

External error: query result mismatch:
[SQL] SELECT - NULLIF ( + 15, - 27 + + CAST ( NULL AS REAL ) + + + MIN ( 35 ) * - COUNT ( * ) * - 14 + 64 ) * 87 * + 75 * 34 * + 76 + - - 31 AS col0, - 10 * - + 33 * ( + - NULLIF ( 21, + 70 * + 71 ) ) * - 15
at test_files/sqlite/random/expr/slt_good_11.slt:9790

SELECT - NULLIF ( + 15, - 27 + + CAST ( NULL AS REAL ) + + + MIN ( 35 ) * - COUNT ( * ) * - 14 + 64 ) * 87 * + 75 * 34 * + 76 + - - 31 AS col0, - 10 * - + 33 * ( + - NULLIF ( 21, + 70 * + 71 ) ) * - 15;

df result:

> SELECT - NULLIF ( + 15, - 27 + + CAST ( NULL AS REAL ) + + + MIN ( 35 ) * - COUNT ( * ) * - 14 + 64 ) * 87 * + 75 * 34 * + 76 + - - 31 AS col0, - 10 * - + 33 * ( + - NULLIF ( 21, + 70 * + 71 ) ) * - 15
;
+--------------+---------------------------------------------------------------------------------------+
| col0         | Int64(-10) * (- Int64(33)) * (- nullif(Int64(21),Int64(70) * Int64(71))) * Int64(-15) |
+--------------+---------------------------------------------------------------------------------------+
| -252908960.0 | 103950                                                                                |
+--------------+---------------------------------------------------------------------------------------+

postgres, duckdb and sqlite result:

D SELECT - NULLIF ( + 15, - 27 + + CAST ( NULL AS REAL ) + + + MIN ( 35 ) * - COUNT ( * ) * - 14 + 64 ) * 87 * + 75 * 34 * + 76 + - - 31 AS col0, - 10 * - + 33 * ( + - NULLIF ( 21, + 70 * + 71 ) ) * - 15;
┌────────────┬──────────────────────────────────────────────────────────────────┐
│    col0    │ (((-10 * -(+(33))) * +(-("nullif"(21, (+(70) * +(71)))))) * -15) │
│   int32    │                              int32                               │
├────────────┼──────────────────────────────────────────────────────────────────┤
│ -252908969103950 │
└────────────┴──────────────────────────────────────────────────────────────────┘

Duckdb and sqlite have col0 as an integer, pg and df have it as a float.

To Reproduce

sql above.

Expected behavior

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant