Skip to content

Commit 93960e7

Browse files
committed
Support MariaDB versioned tables, closes #549
1 parent c9d21f1 commit 93960e7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/ecto/adapters/myxql.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ defmodule Ecto.Adapters.MyXQL do
309309
"This may happen if you have trigger or other database conditions rejecting operations. " <>
310310
"The emitted SQL was: #{sql}"
311311

312-
{:ok, %{num_rows: 1, last_insert_id: last_insert_id}} ->
313-
{:ok, last_insert_id(key, last_insert_id)}
314-
315-
{:ok, %{num_rows: 2, last_insert_id: last_insert_id}} ->
312+
# We were used to check if num_rows was 1 or 2 (in case of upserts)
313+
# but MariaDB supports tables with System Versioning, and in those
314+
# cases num_rows can be more than 2.
315+
{:ok, %{last_insert_id: last_insert_id}} ->
316316
{:ok, last_insert_id(key, last_insert_id)}
317317

318318
{:error, err} ->

0 commit comments

Comments
 (0)