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

Value not converted into integer from sub query #9624

Closed
e-dard opened this issue Mar 23, 2018 · 1 comment · Fixed by #9665
Closed

Value not converted into integer from sub query #9624

e-dard opened this issue Mar 23, 2018 · 1 comment · Fixed by #9665
Assignees
Milestone

Comments

@e-dard
Copy link
Contributor

e-dard commented Mar 23, 2018

I noticed this:

> create database db
> use db
Using database db
>
> insert cpu value=5
> insert cpu value=2
>
> SELECT value FROM (SELECT MEAN(value) AS value FROM cpu)
name: cpu
time value
---- -----
0    3.5
>
> SELECT value::float FROM (SELECT MEAN(value) AS value FROM cpu)
name: cpu
time value
---- -----
0    3.5
>
> SELECT value::integer FROM (SELECT MEAN(value) AS value FROM cpu)
name: cpu
time value
---- -----
0
>

Tested on 1.5.0. Also seems broken on 1.4.2

@jsternberg
Copy link
Contributor

This is partially fixed on master, but not completely. On master, this does not perform the final cast to coerce it to be the correct type, which the cursor should absolutely do.

The fix on master will likely be different than the fix for 1.5.0 and 1.4.2.

@jsternberg jsternberg self-assigned this Mar 27, 2018
@rbetts rbetts added this to the 1.5.2 milestone Mar 29, 2018
@ghost ghost added the review label Mar 30, 2018
@ghost ghost removed the review label Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants