Skip to content

Commit

Permalink
Trim unnecessary CR and LF in queries
Browse files Browse the repository at this point in the history
Fix #751
  • Loading branch information
k1LoW committed Jan 10, 2024
1 parent 4f62aa9 commit 4055e65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ func nestTx(client Querier) (TxQuerier, error) {
}

func separateStmt(stmt string) []string {
stmt = strings.Trim(stmt, " \n\r")
if !strings.Contains(stmt, ";") {
return []string{stmt}
}
Expand All @@ -340,7 +341,7 @@ func separateStmt(stmt string) []string {
ind = !ind
case ';':
if !ins && !ind {
stmts = append(stmts, strings.Trim(string(s), " \n"))
stmts = append(stmts, strings.Trim(string(s), " \n\r"))
s = []rune{}
}
}
Expand Down

0 comments on commit 4055e65

Please sign in to comment.