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

Unexpected error when using a number instead of a boolean #3821

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

Unexpected error when using a number instead of a boolean #3821

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

Comments

@monetdb-team
Copy link

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

Date: 2015-10-09 17:26:57 +0200
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>
To: SQL devs <>
Version: 11.21.5 (Jul2015)
CC: @njnes

Last updated: 2015-11-03 10:18:08 +0100

Comment 21324

Date: 2015-10-09 17:26:57 +0200
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>

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

Not an important issue, but the following query:

 select case when 1 then 2 else 3 end;

outputs:

 TypeException:user.s28_1[6]:'calc.ifthenelse' undefined in: calc.ifthenelse(X_7:bit,X_8:bit,X_10:bte);
 program contains errors

while it should probably not even create the MAL instruction, and display an SQL error instead.

At some other place, an integer (a byte in this case) is automatically cast to a boolean without error:

 select 1 where 2;
 => [1 ]

For reference, PostgreSQL in both cases throws an error of the form "argument of <...> must be type boolean, not type integer".

Reproducible: Always

Comment 21325

Date: 2015-10-09 17:29:21 +0200
From: Frédéric Jolliton <<frederic.jolliton+monetdb>>

(Each time, it seems that the Version detail is lost when submitting a bug.)

Comment 21327

Date: 2015-10-14 10:39:41 +0200
From: MonetDB Mercurial Repository <>

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

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

Changeset description:

fixed bug #3821, ie check type of condition properly

Comment 21328

Date: 2015-10-14 10:42:29 +0200
From: @njnes

added missing type check

Comment 21435

Date: 2015-11-03 10:18:08 +0100
From: @sjoerdmullender

Jul2015 SP1 has been released.

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