Skip to content

Commit

Permalink
do faster literal replace for non-select statement
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Jan 23, 2025
1 parent 26d2e00 commit 99aec4f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go/vt/sqlparser/normalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ func (nz *normalizer) walkStatementUp(cursor *Cursor) bool {
case *Select:
nz.inSelect--
case *Literal:
if nz.inSelect == 0 {
nz.convertLiteral(node, cursor)
return nz.err == nil
}
parent := cursor.Parent()
switch parent.(type) {
case *Order, *GroupBy:
return true
case *Limit:
nz.convertLiteral(node, cursor)
default:
if nz.inSelect == 0 {
nz.convertLiteral(node, cursor)
} else {
nz.convertLiteralDedup(node, cursor)
}
nz.convertLiteralDedup(node, cursor)
}
}
return nz.err == nil // only continue if we haven't found any errors
Expand Down

0 comments on commit 99aec4f

Please sign in to comment.