Skip to content

Commit 5e12429

Browse files
committed
fix: preserve boolean source cast during execute rebinding
1 parent 550e0e1 commit 5e12429

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

pkg/sql/plan/utils.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6127,17 +6127,7 @@ func preparedSQLExecuteNumericParamExpr(
61276127
return appendExplicitCastBeforeExpr(ctx, source, makeSimplePlan2Type(types.T_float64))
61286128
}
61296129
if sourceType.Oid == types.T_bool {
6130-
value := int64(0)
6131-
if literal := source.GetLit(); literal != nil && literal.GetBval() {
6132-
value = 1
6133-
}
6134-
return &Expr{
6135-
Typ: makeSimplePlan2Type(types.T_int64),
6136-
Expr: &plan.Expr_Lit{Lit: &plan.Literal{
6137-
IsBin: isBin,
6138-
Value: &plan.Literal_I64Val{I64Val: value},
6139-
}},
6140-
}, nil
6130+
return makePlan2CastExpr(ctx, source, makeSimplePlan2Type(types.T_int64))
61416131
}
61426132
if sourceType.Oid == types.T_bit {
61436133
return makePlan2CastExpr(ctx, source, makeSimplePlan2Type(types.T_uint64))

0 commit comments

Comments
 (0)