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

possible to support double x boolean type casting in the next update? #3378

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed
Labels
enhancement New feature or request SQL wontfix This will not be worked on

Comments

@monetdb-team
Copy link

Date: 2013-09-30 14:48:52 +0200
From: Anthony Damico <>
To: SQL devs <>
Version: -- development
CC: ajdamico, @drstmane

Last updated: 2016-04-29 07:57:38 +0200

Comment 19219

Date: 2013-09-30 14:48:52 +0200
From: Anthony Damico <>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
Build Identifier:

i know you don't support every type casting/conversion, but double x boolean seems like a common combination. is it possible to start supporting this? thanks!!

Reproducible: Always

Steps to Reproduce:

only two of these three commands work in monetdb..

integer x boolean works
SELECT SUM( 10 * TRUE ) FROM ( values ( 1 ) ) AS temp;

double x boolean breaks
SELECT SUM( 10.0 * TRUE ) FROM ( values ( 1 ) ) AS temp;

double x integer works
SELECT SUM( 10.0 * CAST( TRUE AS INTEGER ) ) FROM ( values ( 1 ) ) AS temp;

Actual Results:

sql> integer x boolean works
sql>SELECT SUM( 10 * TRUE ) FROM ( values ( 1 ) ) AS temp;
+------+
| L3 |
+======+
| 10 |
+------+
1 tuple (11.546ms)
sql>
sql> double x boolean breaks
sql>SELECT SUM( 10.0 * TRUE ) FROM ( values ( 1 ) ) AS temp;
TypeException:user.s8_2[5]:'calc.sht' undefined in: _11:any := calc.sht(_10:bit,
_12:int, _8:int)
TypeException:user.s8_2[7]:'sql.single' undefined in: _14:bat[:oid,:int] := sql.
single(_13:dbl)
program contains errors
sql>
sql> double x integer works
sql>SELECT SUM( 10.0 * CAST( TRUE AS INTEGER ) ) FROM ( values ( 1 ) ) AS temp;
+----------------------+
| L3 |
+======================+
| 10.00 |
+----------------------+
1 tuple (0.435ms)
sql>

Expected Results:

convert TRUE to CAST( TRUE AS INTEGER ) i guess?

Comment 19228

Date: 2013-09-30 19:00:52 +0200
From: @drstmane

FYI:

While the reported case uses / missed a BOOLEAN to DECIMAL conversion,
also the BOOLEAN to REA/DOUBLE appears to be "missing" (assuming we want that at all):

sql>\f
Current formatter: sql

sql>\f raw

sql>\f
Current formatter: raw

sql>select 10;
% .L table_name
% single_value name
% tinyint type
% 2 length
[ 10 ]

sql>select 10 * true;
% .L table_name
% sql_mul_single_value name
% smallint type
% 2 length
[ 10 ]

sql>select 10.0;
% .L table_name
% single_value name
% decimal type
% 5 length
[ 10.0 ]

sql>select 10.0 * true;
MAPI = monetdb@localhost:50000
QUERY = select 10.0 * true;
ERROR = !TypeException:user.s19_1[5]:'calc.sht' undefined in: _10:any := calc.sht(_9:bit, _11:int, _7:int)
!program contains errors

sql>select cast(10.0 as real);
% .L table_name
% single_value name
% real type
% 15 length
[ 10 ]

sql>select cast(10.0 as real) * true;
MAPI = monetdb@localhost:50000
QUERY = select cast(10.0 as real) * true;
ERROR = !TypeException:user.s21_1[5]:'calc.lng' undefined in: _10:any := calc.lng(_9:bit, _11:int, _8:int)
!program contains errors

sql>select cast(10.0 as double);
% .L table_name
% single_value name
% double type
% 24 length
[ 10 ]

sql>select cast(10.0 as double) * true;
MAPI = monetdb@localhost:50000
QUERY = select cast(10.0 as double) * true;
ERROR = !TypeException:user.s23_1[5]:'calc.lng' undefined in: _10:any := calc.lng(_9:bit, _11:int, _8:int)
!program contains errors

Comment 22114

Date: 2016-04-29 07:57:38 +0200
From: Anthony Damico <>

*** Bug #3781 has been marked as a duplicate of this bug. ***

@monetdb-team monetdb-team added enhancement New feature or request SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the NEXTRELEASE milestone Aug 11, 2022
@sjoerdmullender sjoerdmullender added the wontfix This will not be worked on label Aug 15, 2022
@sjoerdmullender sjoerdmullender removed this from the NEXTRELEASE milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SQL wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants