forked from denisenkom/go-mssqldb
-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Describe the bug
Function batch.Split(sqlString, "GO") wrongly splits the sqlString on all go occourrecnces, even if it's part of a statement, like goto or columns identifiers, like gone.
To Reproduce
Call batch.Split(sqlString, "GO") with an sqlString that has goXXX as identifier on an newline.
E.g.:
sqlString = `
select 1
go
select
gone_ts
from t
go`
statements := batch.Split(sqlString, "GO")
// statements = ["\nselect 1\n", "\nselect\n ", "ne_ts\nfrom t\n"]Expected behavior
I would expect statements from above to be
// statements = ["\nselect 1\n", "\nselect\n gone_ts\nfrom t\n"]Further technical details
go-mssqldb version: 1.8.0
SQL Server version: N/A
Operating system: N/A
Metadata
Metadata
Assignees
Labels
No labels