Skip to content

Commit

Permalink
Switch with default error
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Nov 28, 2023
1 parent a4213c7 commit dba2cda
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/ast/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,15 @@ func nodeExpr(node tree.Expr) (vitess.Expr, error) {
return nil, err
}

if node.SyntaxMode == tree.CastShort {
switch node.SyntaxMode {
case tree.CastExplicit:
// only acceptable cast type
case tree.CastShort:
return nil, fmt.Errorf("TYPECAST is not yet supported")
}

if node.SyntaxMode == tree.CastPrepend {
case tree.CastPrepend:
return nil, fmt.Errorf("typed literals are not yet supported")
default:
return nil, fmt.Errorf("unknown cast syntax")
}

params, err := nodeResolvableTypeReference(node.Type)
Expand Down

0 comments on commit dba2cda

Please sign in to comment.