Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshi-yb committed Jan 21, 2025
1 parent ff7fb07 commit 6df033f
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions yb-voyager/cmd/analyzeSchema.go
Original file line number Diff line number Diff line change
Expand Up @@ -926,14 +926,25 @@ sqlParsingLoop:
codeBlockDelimiter = "END" //SQL body to determine the end of BEGIN ATOMIC ... END; sql body
}
case CODE_BLOCK_STARTED:
if strings.Contains(currLine, codeBlockDelimiter) ||
strings.Contains(currLine, strings.ToLower(codeBlockDelimiter)) {
//TODO: anyways we should be using pg-parser: but for now for the END sql body delimiter checking the UPPER and LOWER both
dollarQuoteFlag = 2 //denotes end of code/body part
if isEndOfSqlStmt(currLine) {
break sqlParsingLoop
switch codeBlockDelimiter {
case "END":
if strings.Contains(currLine, codeBlockDelimiter) ||
strings.Contains(currLine, strings.ToLower(codeBlockDelimiter)) {
//TODO: anyways we should be using pg-parser: but for now for the END sql body delimiter checking the UPPER and LOWER both
dollarQuoteFlag = 2 //denotes end of code/body part
if isEndOfSqlStmt(currLine) {
break sqlParsingLoop
}
}
default:
if strings.Contains(currLine, codeBlockDelimiter) {
dollarQuoteFlag = 2 //denotes end of code/body part
if isEndOfSqlStmt(currLine) {
break sqlParsingLoop
}
}
}

case CODE_BLOCK_COMPLETED:
if isEndOfSqlStmt(currLine) {
break sqlParsingLoop
Expand Down

0 comments on commit 6df033f

Please sign in to comment.