Skip to content

the first value in VALUES should not determine the column type #1648

@jennifersp

Description

@jennifersp

Repro:

In Doltgres:

postgres=> SELECT SUM(n::numeric) FROM (VALUES(1),(2.01),(3)) v(n);
ERROR:  integer: unhandled type: decimal.Decimal (errno 1105) (sqlstate HY000)
postgres=> SELECT SUM(n::numeric) FROM (VALUES(1.01),(2),(3)) v(n);
ERROR:  interface conversion: interface {} is int32, not decimal.Decimal

In Postgres:

postgres=> postgres=# SELECT SUM(n::numeric) FROM (VALUES(1),(2.01),(3)) v(n);
 sum  
------
 6.01
(1 row)

postgres=# SELECT SUM(n::numeric) FROM (VALUES(1.01),(2),(3)) v(n);
 sum  
------
 6.01
(1 row)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions