There is an issue in the parseSqlText function when the query text contains a line feed character just after a bind variable.
Exemple of such a query :
text := "select * from t where x = :x\nand y = :y "
In this exemple, as the line feed character is ignored in the function, the name captured is :xand instead of :x.
According to me, the solution is to keep the line feed character in the text when it is not inside a comment :
case '\n':
if lineComment {
lineComment = false
} else {
textBuffer = append(textBuffer, ch) // oheurtel : keep the line feed character
}
There is an issue in the parseSqlText function when the query text contains a line feed character just after a bind variable. Exemple of such a query :
text := "select * from t where x = :x\nand y = :y "
In this exemple, as the line feed character is ignored in the function, the name captured is:xand
instead of:x
. According to me, the solution is to keep the line feed character in the text when it is not inside a comment :