-
Notifications
You must be signed in to change notification settings - Fork 27
Field Occurrence.breadcrumbs is broken for MariaDB #150
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
Comments
Instead of using `{:array, :string}` for the `:breakcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.Array`. It uses `Jason` to encode and decode arrays when storing and retrieving arrays. Therefore it works very similarly to the `:array` type but without crashing on retrieval when using MySQL/MariaDB. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breakcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.Array`. It uses `Jason` to encode and decode arrays when storing and retrieving arrays. Therefore it works very similarly to the `:array` type but without crashing on retrieval when using MySQL/MariaDB. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breakcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to encode and decode arrays when storing and retrieving arrays. Therefore it works very similarly to the `:array` type but without crashing on retrieval when using MySQL/MariaDB. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breakcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to encode and decode arrays when storing and retrieving arrays. Therefore it works very similarly to the `:array` type but without crashing on retrieval when using MySQL/MariaDB. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breakcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to encode and decode arrays when storing and retrieving arrays. Therefore it works very similarly to the `:array` type but without crashing on retrieval when using MySQL/MariaDB. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breakcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to encode and decode arrays when storing and retrieving arrays. Therefore it works very similarly to the `:array` type but without crashing on retrieval when using MySQL/MariaDB. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to encode and decode arrays when retrieving arrays with MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to encode and decode arrays when retrieving arrays with MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to decode arrays when retrieving data from MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to decode arrays when retrieving data from MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to decode arrays when retrieving data from MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Interesting. In my tests I was using MariaDB v11.5.2 and myxql v0.6.4. The table schema looks like this:
According to the MariaDB docs |
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to decode arrays when retrieving data from MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to decode arrays when retrieving data from MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Instead of using `{:array, :string}` for the `:breadcrumbs` field in `ErrorTracker.Occurrence` we use a new custom field type `ErrorTracker.Types.StringArray`. It uses `Jason` to decode arrays when retrieving data from MySQL/MariaDB. Therefore it works very similarly to the `:array` type but without crashing on retrieval. This fix does not make a schema migration necessary. An additional test module `ErrorTracker.StoreFetchTest` was implemented to avoid regreessions in the future. Fixes elixir-error-tracker#150.
Hi, @odarriba I added a separate CI test run for mysql and added the old field type I know that the real bug is in the database driver, but would you accept this workaround regardless? |
Hi @phihos! First of all, thanks for your efforts on trying to solve this issue and to add the CI pipeline - it is really appreciated. Also, I'm sorry for my slow responses. Many changes are happening these days on my life and I could not be as quick as I would like to. I checked the issue on my local environment, and it looks like the issue is what you pointed: Maria DB is storing JSON as longtext. The issue here is that MySQL/MariaDB does not have a column type for an array of strings, so we used a JSON column because, well, an arrray of strings is a valid JSON after all. However, using a I was able to path Ecto SQL on my local environment and check that it worked, but I'm not sure about the implications of the change from a global point of view, so I'm keen towards opening a issue on the EctoSQL repo and see if they think it is a good addition. If we can fix the issue in the library, I prefer it rather than implementing a custom type. It is technically a good solution, but after talking about this with @crbelaus we botyh agree that not having to maintain a custom type is better (if possible). I will open an issue in a few moments and lets see what are the thoughts of the EctoSQL team. |
Hi @odarriba,
No worries. I know how it is.
Understandable. Thank you very much for opening the report upstream! |
Of course! In fact, I think many other tests should fail even without that specific StoreFetch test. To see how many tests fail, can you please update the PR to remove the custom field and leave the CI update and the new test? Btw, the Ecto SQL merge request has been merged today. We are closer to fix this! |
No, I think we need that test. I originally ran the tests on MariaDB and nothing failed. I think none of the existing tests load a record of
Done. As you can see only the new test fails.
That is great news! Thank you! 🥇 |
Great! Lets maintain that new test and, once EctoSQL gerts a new release, we can merge it. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Hey folks, I recently upgraded from v0.3.0 to v0.6.0 and the detail page of any error crashed with
I already debugged this and it seems that the Ecto adapter
Ecto.Adapters.MyXQL
correctly stores arrays (like "[]" for an empty array), but crashes on retrieval.I think there are two hints that we can not make this work just by configuration:
:array
work with MyXQL. The closest thing I found was this entry in the docs that describes how to store type:map
in a JSON column. But no word about:array
.def loaders(:array, type)...
.In order to fix this I propose implementing a custom type. I already implemented a proposal that I will show in a PR soon.
To Reproduce
Steps to reproduce the behavior:
/errors/1
).Expected behavior
Detail page should not crash.
The text was updated successfully, but these errors were encountered: