mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
you should be able to cast an id as a string (#2334)
This commit is contained in:
parent
ad350c2d49
commit
e599f12ee4
2 changed files with 10 additions and 1 deletions
|
|
@ -753,6 +753,8 @@ func typesCanBeCast(sourceType parser.ExprDataType, targetType parser.ExprDataTy
|
|||
*parser.DataTypeDecimal,
|
||||
*parser.DataTypeID:
|
||||
return true
|
||||
case *parser.DataTypeString:
|
||||
return true
|
||||
}
|
||||
|
||||
case *parser.DataTypeIDSet:
|
||||
|
|
|
|||
|
|
@ -484,7 +484,14 @@ var castID = TableTest{
|
|||
SQLs: sqls(
|
||||
"select _id, cast(id1 as string) from cast_id",
|
||||
),
|
||||
ExpErr: "'id' cannot be cast to 'string'",
|
||||
ExpHdrs: hdrs(
|
||||
hdr("_id", fldTypeID),
|
||||
hdr("", fldTypeString),
|
||||
),
|
||||
ExpRows: rows(
|
||||
row(int64(1), string("20")),
|
||||
),
|
||||
Compare: CompareExactUnordered,
|
||||
},
|
||||
{
|
||||
SQLs: sqls(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue