-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
BIT(1) type cannot load <<1>>
as type :boolean
#1366
Comments
Beautiful, can you please send a PR? Thank you! |
paulgithub
added a commit
to paulgithub/ecto
that referenced
this issue
Apr 13, 2016
paulgithub
added a commit
to paulgithub/ecto
that referenced
this issue
Apr 13, 2016
josevalim
pushed a commit
that referenced
this issue
Apr 13, 2016
josevalim
pushed a commit
that referenced
this issue
Apr 13, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Precheck
When reading a boolean value from the database which is represented as a BIT(1) in the MySQL server (version 5.5.29) and using this value in model as a :boolean
There is a suggested fix for this on the mariaex github issue: xerions/mariaex#107 that works.
Environment
Current behavior
error / stacktrace
** (exit) an exception was raised:
** (ArgumentError) cannot load <<1>> as type :boolean
(ecto) lib/ecto/schema.ex:982: Ecto.Schema.load!/3
(ecto) lib/ecto/schema.ex:974: anonymous fn/3 in Ecto.Schema.do_load/4
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto) lib/ecto/schema.ex:972: Ecto.Schema.do_load/4
(ecto) lib/ecto/schema.ex:957: Ecto.Schema.load/6
(ecto) lib/ecto/adapters/sql.ex:519: anonymous fn/3 in Ecto.Adapters.SQL.process_row/3
(elixir) lib/enum.ex:1151: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(ecto) lib/ecto/adapters/sql.ex:513: Ecto.Adapters.SQL.process_row/3
(elixir) lib/enum.ex:1088: Enum."-map/2-lists^map/1-0-"/2
(ecto) lib/ecto/adapters/sql.ex:283: Ecto.Adapters.SQL.decode/2
(stdlib) timer.erl:166: :timer.tc/1
(ecto) lib/ecto/adapters/sql.ex:278: Ecto.Adapters.SQL.decode/3
(ecto) lib/ecto/adapters/sql.ex:225: Ecto.Adapters.SQL.query/5
(ecto) lib/ecto/adapters/sql.ex:183: Ecto.Adapters.SQL.query!/5
(ecto) lib/ecto/adapters/sql.ex:481: Ecto.Adapters.SQL.execute/6
(ecto) lib/ecto/repo/queryable.ex:95: Ecto.Repo.Queryable.execute/5
(ecto) lib/ecto/repo/queryable.ex:15: Ecto.Repo.Queryable.all/4
(ecto) lib/ecto/repo/queryable.ex:44: Ecto.Repo.Queryable.one/4
Expected behavior
The BIT(1) should be translated as a boolen and not a number
The text was updated successfully, but these errors were encountered: