Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,18 @@ func (ss *session) Loop(ctx context.Context, commandIn commandIn) error {
err = doSelect(ctx, ss, query, nil, commandIn)
case "ROLLBACK":
misc.Echo(ss.spool, query)
arg, _ = misc.CutField(arg)
var rest string
arg, rest = misc.CutField(arg)
if arg == "" {
err = ss.rollback()
} else if strings.EqualFold(arg, "TO") || strings.EqualFold(arg, "TRANSACTION") {
} else if strings.EqualFold(arg, "TO") {
err = doTCL(ctx, ss, query)
} else if strings.EqualFold(arg, "TRANSACTION") {
if strings.TrimSpace(rest) == "" {
err = ss.rollback()
} else {
err = doTCL(ctx, ss, query)
}
} else {
err = ErrInvalidRollback
}
Expand Down
1 change: 1 addition & 0 deletions release_note_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bug fixes

- Fix: Errors were not reported during execution of `SAVEPOINT` and `SAVE TRANSACTION`. (#19)
- SQL Server: Fixed an issue where `ROLLBACK TRANSACTION` without a savepoint was not recognized as ending the transaction, causing the prompt to remain as `SQL*`. (#22)

### Specification Changes

Expand Down
1 change: 1 addition & 0 deletions release_note_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 不具合修正

- `SAVEPOINT`, `SAVE TRANSACTION` の実行中にエラーが発生してもメッセージが表示されなかった問題を修正 (#19)
- SQL Server: SAVEPOINT を指定しない `ROLLBACK TRANSACTION` でトランザクションは終了するのに、それを認識せず、プロンプトがトランザクション中を意味する `SQL*` のままになっていた問題を修正 (#22)

### 仕様変更

Expand Down