Skip to content

Cast bug #9810

@Fallenyasha

Description

@Fallenyasha

Received exception: DB::Exception: Second argument to CAST must be a constant string describing type (version 19.17.2.4 (official build))
select cast(1 as String)
from (select 1 as iid) as t1
join (select '1' as sid) as t2 on t2.sid = cast(t1.iid as String)

On version 19.4.5.1 this query works fine.

Also if I change some parts in this query it will be work without exceptions, for example:
select cast(1 as Date) -- or another type except String
from (select 1 as iid) as t1
join (select '1' as sid) as t2 on t2.sid = cast(t1.iid as String)

select cast(1 as String)
from (select 1 as iid) as t1

select cast(1 as String) -- or another type
from (select 1 as iid) as t1
join (select '1' as sid) as t2 on cast(t2.sid as UInt8) = t1.iid

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasest-acceptedThe issue is in our backlog, ready to take

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions