File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ func (c Commands) SetBatchTerminator(terminator string) error {
210210
211211// isExitParenBalanced checks if the parentheses in an EXIT command argument are balanced.
212212// It tracks quotes to avoid counting parens inside string literals.
213- // It handles SQL Server's quote escaping: ” inside strings and ]] inside bracket identifiers.
213+ // It handles SQL Server's quote escaping: ” inside single-quoted strings, "" inside double-quoted strings, and ]] inside bracket identifiers.
214214func isExitParenBalanced (s string ) bool {
215215 depth := 0
216216 var quote rune
Original file line number Diff line number Diff line change @@ -516,7 +516,7 @@ func TestReadExitContinuation(t *testing.T) {
516516
517517 result , err := readExitContinuation (s , "(select 1" )
518518 assert .NoError (t , err )
519- assert .Equal (t , "(select 1\r \n + 2)" , result )
519+ assert .Equal (t , "(select 1" + SqlcmdEol + " + 2)" , result )
520520
521521 // Verify prompt was set
522522 tc := s .lineIo .(* testConsole )
@@ -560,7 +560,7 @@ func TestReadExitContinuation(t *testing.T) {
560560
561561 result , err := readExitContinuation (s , "(select 1" )
562562 assert .NoError (t , err )
563- assert .Equal (t , "(select 1\r \n + 2 \r \n + 3 \r \n )" , result )
563+ assert .Equal (t , "(select 1" + SqlcmdEol + "+ 2" + SqlcmdEol + "+ 3" + SqlcmdEol + " )" , result )
564564 })
565565
566566 t .Run ("returns immediately if already balanced" , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments