Skip to content

Commit 661c0e6

Browse files
authored
isProc: added COMMIT and ROLLBACK command to the builtin commands list (#261)
1 parent a3ce042 commit 661c0e6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

mssql.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ func (s *Stmt) sendQuery(ctx context.Context, args []namedValue) (err error) {
565565

566566
// Builtin commands are not stored procs, but rather T-SQL commands
567567
// those commands can be invoke without extra options
568-
var builtinCommands = []string{"RECONFIGURE", "SHUTDOWN", "CHECKPOINT"}
568+
var builtinCommands = []string{
569+
"RECONFIGURE", "SHUTDOWN", "CHECKPOINT",
570+
"COMMIT", "ROLLBACK",
571+
}
569572

570573
// isProc takes the query text in s and determines if it is a stored proc name
571574
// or SQL text.

mssql_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ func TestIsProc(t *testing.T) {
5151
{"RECONFIGURE", false},
5252
{"SHUTDOWN", false},
5353
{"CHECKPOINT", false},
54+
{"COMMIT", false},
55+
{"ROLLBACK", false},
5456
}
5557

5658
for _, item := range list {

0 commit comments

Comments
 (0)