Skip to content

Commit 718c0e8

Browse files
authored
Merge pull request #20 from hymkor/replace
Enable `REPLACE` to execute within a transaction and returns count of affected rows
2 parents 2884c10 + c039112 commit 718c0e8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

loop.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ func (ss *session) Loop(ctx context.Context, commandIn commandIn) error {
175175
case "SAVEPOINT", "SAVE", "RELEASE":
176176
misc.Echo(ss.spool, query)
177177
err = doTCL(ctx, ss, query)
178-
case "DELETE", "INSERT", "UPDATE", "MERGE":
178+
179+
// Updates returning affected row count, safe in transaction
180+
case "DELETE", "INSERT", "UPDATE", "MERGE", "REPLACE":
179181
misc.Echo(ss.spool, query)
180182
isNewTx := (ss.tx == nil)
181183
err = ss.beginTx(ctx, ss.stdErr)

release_note_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### Specification Changes
88

9-
- Enable `RELEASE SAVEPOINT` to execute within a transaction. (#19)
9+
- Enable `RELEASE SAVEPOINT`(#19) and `REPLACE INTO`(#20,MySQL) to execute within a transaction.
1010

1111
v0.26.0
1212
=======

release_note_ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### 仕様変更
88

9-
- `RELEASE SAVEPOINT` もトランザクション内で実行できるようにした。(#19)
9+
- `RELEASE SAVEPOINT` (#19), `REPLACE INTO` (#20,MySQL) もトランザクション内で実行できるようにした。
1010

1111
v0.26.0
1212
=======

0 commit comments

Comments
 (0)