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

Static optimization gives wrong result (1 + NULL = -127) #6243

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

Static optimization gives wrong result (1 + NULL = -127) #6243

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

Comments

@monetdb-team
Copy link

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

Date: 2017-03-15 16:04:41 +0100
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>
To: SQL devs <>
Version: 11.25.5 (Dec2016-SP1)
CC: @njnes

Last updated: 2017-03-31 13:28:31 +0200

Comment 25151

Date: 2017-03-15 16:04:41 +0100
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>

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

It's probably close to the issue 6205, where a static optimization doesn't produce the correct value.

Reproducible: Always

Steps to Reproduce:

  1. SELECT 1 + NULL

Actual Results:

sql>select 1 + null;
+------+
| L2 |
+======+
| -127 |
+------+
1 tuple (1.179ms)

Expected Results:

A NULL value instead.

No problem (fortunately) when done through a table:

sql>select a + b from (select 1, null) q(a, b);
+------+
| L6 |
+======+
| null |
+------+
1 tuple (1.301ms)

(Tested with Dec2016-SP3, not currently listed.)

Comment 25152

Date: 2017-03-15 23:04:34 +0100
From: MonetDB Mercurial Repository <>

Changeset 25a00e2e9008 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=25a00e2e9008

Changeset description:

Use VARcalc* functions to do calculations.
This way you get nil handling and overflow checking.
This fixes bug #6243.
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