diff --git a/pkg/sqlcmd/batch.go b/pkg/sqlcmd/batch.go index 545ee44e..7d564d49 100644 --- a/pkg/sqlcmd/batch.go +++ b/pkg/sqlcmd/batch.go @@ -242,10 +242,6 @@ func (b *Batch) readString(r []rune, i, end int, quote rune, line uint) (int, bo } else { return i, false, syntaxError(line) } - case quote == '\'' && c == '\\': - i++ - prev = 0 - continue case quote == '\'' && c == '\'' && next == '\'': i++ continue diff --git a/pkg/sqlcmd/batch_test.go b/pkg/sqlcmd/batch_test.go index 948c2a93..85a6796a 100644 --- a/pkg/sqlcmd/batch_test.go +++ b/pkg/sqlcmd/batch_test.go @@ -117,6 +117,7 @@ func TestReadString(t *testing.T) { // double quoted string {`"str\""`, 0, `"str\"`, true}, {` "str\"" `, 1, `"str\"`, true}, + {`'str\'`, 0, `'str\'`, true}, {`''''`, 0, `''''`, true}, {` '''' `, 1, `''''`, true}, {`''''''`, 0, `''''''`, true},