cmu-db / noisepage

Self-Driving Database Management System from Carnegie Mellon University
https://noise.page
MIT License
1.75k stars 502 forks source link

Trig functions fail if given wrong data type #1079

Open jkosh44 opened 4 years ago

jkosh44 commented 4 years ago

When giving a trig function the wrong data type we get an error. For example if we give an integer or NULL to a trig function, it errors out:

terrier=# SELECT tan(0);
ERROR:  Procedure not registered

Also

terrier=# SELECT cos(NULL);
ERROR:  Procedure not registered

However when we give it a decimal value if works fine

terrier=# SELECT tan(0.0);
   tan    
----------
 0.000000
(1 row)
lmwnshn commented 3 years ago

This is related to whether we want to handle casting in the optimizer or in the execution engine.