We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9d21f1 commit 93960e7Copy full SHA for 93960e7
1 file changed
lib/ecto/adapters/myxql.ex
@@ -309,10 +309,10 @@ defmodule Ecto.Adapters.MyXQL do
309
"This may happen if you have trigger or other database conditions rejecting operations. " <>
310
"The emitted SQL was: #{sql}"
311
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}} ->
+ # We were used to check if num_rows was 1 or 2 (in case of upserts)
+ # but MariaDB supports tables with System Versioning, and in those
+ # cases num_rows can be more than 2.
+ {:ok, %{last_insert_id: last_insert_id}} ->
316
{:ok, last_insert_id(key, last_insert_id)}
317
318
{:error, err} ->
0 commit comments