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

SQRT in CASE does not work as of Oct2014 #3627

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

SQRT in CASE does not work as of Oct2014 #3627

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2014-11-24 11:45:46 +0100
From: @bartscheers
To: SQL devs <>
Version: 11.19.3 (Oct2014)
CC: @njnes

Last updated: 2015-08-28 13:41:44 +0200

Comment 20455

Date: 2014-11-24 11:45:46 +0100
From: @bartscheers

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0
Build Identifier:

SQRT in CASE statement is executed when it shouldn't.
The case statement precalculates the values, and when negative values are encountered the sqrt gives a Math exception: Numerical argument out of domain message.
A workaround exists (for this example, but maybe not for all), by pulling the SQRT out of the CASE statement.
It gives the same error for the CASE statement in the SELECT projection and WHERE clause

Reproducible: Always

Steps to Reproduce:

  1. run run.sh

Actual Results:

Math exception: Numerical argument out of domain

Expected Results:

Result set

Comment 20456

Date: 2014-11-24 11:49:08 +0100
From: @bartscheers

Created attachment 311
zip file of 3 files: run.sh, t1.sql and queries.sql

Use the run.sh to run it all

Attached file: case_sqrt.zip (application/zip, 1024 bytes)
Description: zip file of 3 files: run.sh, t1.sql and queries.sql

Comment 20457

Date: 2014-11-24 15:41:06 +0100
From: MonetDB Mercurial Repository <>

Changeset 682d22ac9255 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=682d22ac9255

Changeset description:

Added test for bug #3627.

Comment 20706

Date: 2015-03-11 17:01:06 +0100
From: @njnes

fixed by the relational optimizer

Comment 21184

Date: 2015-08-28 13:41:44 +0200
From: @sjoerdmullender

Jul2015 has been released.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants