Bug 3781 - feature request: please allow boolean x double
Summary: feature request: please allow boolean x double
Status: RESOLVED DUPLICATE of bug 3378
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: -- development
Hardware: x86_64 (amd64/em64t) Windows
: Normal enhancement
Assignee: SQL devs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-08 04:27 CEST by Anthony Damico
Modified: 2016-04-29 07:57 CEST (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Damico 2015-08-08 04:27:58 CEST
User-Agent:       Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build Identifier: 

hi, i think it'd be good to add a function to deal with boolean x non-integer numeric types

right now things crash unless you multiply by 1

SELECT: no such binary operator 'sql_mul(boolean,double)'

Reproducible: Always

Steps to Reproduce:
CREATE TABLE test (i INTEGER , d DOUBLE , b BOOLEAN);
INSERT INTO test VALUES ( 1 , 1.0 , TRUE ) ;
SELECT ( i * d ) FROM test ;
SELECT ( i * b ) FROM test ;
SELECT ( b * d ) FROM test ;

Actual Results:  

sql>CREATE TABLE test (i INTEGER , d DOUBLE , b BOOLEAN);
operation successful (8.904ms)
sql>INSERT INTO test VALUES ( 1 , 1.0 , TRUE ) ;
1 affected row (3.957ms)
sql>SELECT ( i * d ) FROM test ;
+--------------------------+
| sql_mul_i                |
+==========================+
|                        1 |
+--------------------------+
1 tuple (2.359ms)
sql>SELECT ( i * b ) FROM test ;
+-----------+
| sql_mul_i |
+===========+
|         1 |
+-----------+
1 tuple (1.351ms)
sql>SELECT ( b * d ) FROM test ;
SELECT: no such binary operator 'sql_mul(boolean,double)'
sql>
Comment 1 Anthony Damico 2016-04-29 07:57:38 CEST

*** This bug has been marked as a duplicate of bug 3378 ***