Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to insert data into tables using System Versioning tables with MariaDB #549

Closed
sleipnir opened this issue Aug 11, 2023 · 4 comments
Labels

Comments

@sleipnir
Copy link

Elixir version

1.14.0-otp-25

Database and Version

11-0-2-MariaDB

Ecto Versions

3.8

Database Adapter and Versions (postgrex, myxql, etc)

myxql 0.6

Current behavior

When trying to insert records in MariaDB tables with System Versioning support activated, a cause match error occurs, probably related to the number of rows returned, which in the case of versioned tables can be greater than two records.

2023-08-11 18:16:47.777 [spawn_a3@127.0.0.1]:[pid=<0.1498.0> ]:[error]:Task #PID<0.1498.0> started from #PID<0.1497.0> terminating
** (CaseClauseError) no case clause matching: {:ok, %MyXQL.Result{columns: nil, connection_id: 214, last_insert_id: 0, num_rows: 3, rows: nil, num_warnings: 0}}
    (ecto_sql 3.10.1) lib/ecto/adapters/myxql.ex:284: Ecto.Adapters.MyXQL.insert/6
    (ecto 3.10.3) lib/ecto/repo/schema.ex:764: Ecto.Repo.Schema.apply/4
    (ecto 3.10.3) lib/ecto/repo/schema.ex:377: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
    (spawn_statestores_mariadb 0.0.0-local.dev) lib/statestores/adapters/mariadb_snapshot_adapter.ex:29: Statestores.Adapters.MariaDBSnapshotAdapter.save/1
    (elixir 1.14.0) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2
    (elixir 1.14.0) lib/task/supervised.ex:34: Task.Supervised.reply/4
    (stdlib 4.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Function: #Function<0.59912717/0 in Actors.Actor.StateManager.save_async/3>

Expected behavior

Cannot return error.

@sleipnir
Copy link
Author

I was sending a PR 😄

But thanks!

@sleipnir
Copy link
Author

sleipnir commented Aug 21, 2023

Hello @josevalim, how are you? Can you tell me when there would be the intention to launch a new version of the hex package for ecto_sql? I have a library that depends on this issue here to be updated.
Thanks!

@josevalim
Copy link
Member

i backported and shipped 3.10.2

@sleipnir
Copy link
Author

i backported and shipped 3.10.2

Awesome. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants