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

Sqlitelogictest aritmetic expressions with negative numbers handling #6576

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Sqlitelogictest aritmetic expressions with negative numbers handling #6576

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2018-04-12 10:12:08 +0200
From: @PedroTadim
To: SQL devs <>
Version: 11.29.3 (Mar2018)
CC: @njnes

Last updated: 2019-09-02 16:05:27 +0200

Comment 26361

Date: 2018-04-12 10:12:08 +0200
From: @PedroTadim

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Build Identifier:

Running several simple SELECT queries with math expressions involving negatives numbers causes a MAL exception to be thrown.

Reproducible: Always

Steps to Reproduce:

At the end of each line after the comment the expected result is shown.

SELECT -2 * 50; -- -100
SELECT ALL - 0 * 36; -- 0
SELECT ALL - 33 + - 77 * 0 AS col1; -- -33
SELECT + 12 + - 0 * + 70; -- 12
SELECT - ( ( 0 ) ) * 78; -- 0
SELECT ALL - 4 * + 0 * - - 48 col1; -- 0
SELECT - 0 * - 15 AS col0; -- 0
SELECT - 48 * + + 0 + + 94 AS col1; -- 94
SELECT ALL + - 32 * - 32 + - - 76 - - - 43 * COUNT ( * ) + - + 84 * 0 * + + 39 + + 44 * + 76; -- 4401
SELECT 38 + - 63 * 0 * - 13 AS col2; -- 38
SELECT 64 + - 0 * 40 AS col1; -- 64
SELECT ALL - 35 * - 0 AS col2; -- 0
SELECT + - 36 * - + 33 * - + 49 * + CASE 50 WHEN - 21 + 0 + - COUNT ( * ) THEN NULL
WHEN + 99 * - 43 + - - 35 THEN - 75 ELSE NULL END * - - 51 * + 0 AS col2; -- NULL
SELECT - 66 * 0 * - 87 AS col2; -- 0
SELECT - 13 * - ( + 0 ) + 39 * - COUNT ( * ) * - COUNT ( * ) col1; -- 39
SELECT COUNT ( - + 70 ) - - 99 * - 0 AS col2; -- 1
SELECT - ( - - 15 ) + - 53 * - 0; -- -15
SELECT - + 22 * + COUNT ( * ) + - - 58 - + 83 * + MAX ( - 94 * 0 ); -- 36
SELECT DISTINCT - 16 + ( + 37 ) - - 56 * - - 11 * - 0 + + MAX ( + 29 ) AS col2; -- 50
SELECT - 54 * + 0; -- 0
SELECT ALL - 30 + + 85, - ( - + 43 ) - 71 + - 0 * - - 78 + - 78 + - - 47 * - 93 + 32 * + SUM ( 90 ) AS col0; -- 55, -1597
SELECT ALL + COUNT ( * ) - - + 0 * - 32; -- 1

Actual Results:

MAL exception:
TypeException:user.main[6]:'calc.-' undefined in: X_162759:sht := calc.-(X_162758:bte);

Expected Results:

Check the steps above.

Comment 26362

Date: 2018-04-12 10:12:53 +0200
From: MonetDB Mercurial Repository <>

Changeset 780897b729df made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=780897b729df

Changeset description:

Added tests for bugs 6574 and 6576

Comment 26366

Date: 2018-04-14 16:02:58 +0200
From: MonetDB Mercurial Repository <>

Changeset efe5b9e9ef51 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=efe5b9e9ef51

Changeset description:

fixes for bug #6576

Comment 26991

Date: 2019-05-02 14:31:58 +0200
From: @PedroTadim

Updated test with failing query.

Comment 26995

Date: 2019-05-03 10:37:52 +0200
From: MonetDB Mercurial Repository <>

Changeset 2ecd89950f47 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2ecd89950f47

Changeset description:

Adding more sqlite tests failing queries:

Bug #6560 gives right results in Apr2019 branch, but wrong on default.
Bug #6561 we should analyze first, but I think MonetDB outputs wrong results.
Bug #6576 more overflows in calculations.

Comment 27001

Date: 2019-05-06 11:25:56 +0200
From: @PedroTadim

The overflows were fixed on changeset e8c60cd2b678

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

Successfully merging a pull request may close this issue.

None yet
1 participant