We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 969ce15 commit 0b34acaCopy full SHA for 0b34aca
1 file changed
lib/ecto/adapters/myxql.ex
@@ -278,6 +278,11 @@ defmodule Ecto.Adapters.MyXQL do
278
end
279
280
case Ecto.Adapters.SQL.query(adapter_meta, sql, values ++ query_params, opts) do
281
+ {:ok, %{num_rows: 0}} ->
282
+ raise "insert operation failed to insert any row in the database. " <>
283
+ "This may happen if you have trigger or other database conditions rejecting operations. " <>
284
+ "The emitted SQL was: #{sql}"
285
+
286
{:ok, %{num_rows: 1, last_insert_id: last_insert_id}} ->
287
{:ok, last_insert_id(key, last_insert_id)}
288
0 commit comments