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

0.8.1 incompatibility with ecto 2.1.3 (Solved NOT an issue) #169

Closed
paulgithub opened this issue Feb 2, 2017 · 1 comment
Closed

0.8.1 incompatibility with ecto 2.1.3 (Solved NOT an issue) #169

paulgithub opened this issue Feb 2, 2017 · 1 comment

Comments

@paulgithub
Copy link

When running a test using mariaex 0.8.1 and ecto 2.1.3 I get the following error:

** (Protocol.UndefinedError) protocol String.Chars not implemented for %Mariaex.Query{binary_as: :field_type_var_string, name: "", num_params: 50, ref: #Reference<0.0.7.943>, reserved?: false, statement: "INSERT INTO accounts (...) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", type: :binary}
stacktrace:
(elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
(elixir) lib/string/chars.ex:17: String.Chars.to_string/1
(ecto) lib/ecto/adapters/sql.ex:653: Ecto.Adapters.SQL.log/4
(db_connection) lib/db_connection.ex:1177: DBConnection.log/6
(ecto) lib/ecto/adapters/mysql/connection.ex:22: Ecto.Adapters.MySQL.Connection.execute/4
(ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
(ecto) lib/ecto/adapters/mysql.ex:179: Ecto.Adapters.MySQL.insert/6
(ecto) lib/ecto/repo/schema.ex:467: Ecto.Repo.Schema.apply/4
(ecto) lib/ecto/repo/schema.ex:205: anonymous fn/13 in Ecto.Repo.Schema.do_insert/4
(ecto) lib/ecto/repo/schema.ex:131: Ecto.Repo.Schema.insert!/4
test...

If I run the same test using mariaex 0.8.1 and ecto 2.1.2 everything works fine. The same thing happens with many tests. The line in my code causing the problem is a simple Repo.insert! function.

My temporary solution is to set ecto to 2.1.2 (using: {:ecto, "2.1.2"}) in my mix.exs file rather than using {:ecto, "~> 2.1"}

@paulgithub
Copy link
Author

paulgithub commented Feb 3, 2017

Actually the above was not the issue.

I was in an umbrella project and the creation of a new application within the project caused the issue. Even though the new application had no reference with the application which contained the Ecto code in the initial post.

The solution is to force a recompilation of all the code before running the tests again. This can be achieved by explicitly changing the ecto version in the mix.exs file run:

$ mix.deps.update ecto

followed by:

$ mix test

Then change the ecto version back again and run the two commands above again.

This is strange and I have no idea as to what may be causing it.

This should probably be closed which I will do next week if you have not already done so. Sorry for the inconvenience.

@paulgithub paulgithub changed the title 0.8.1 incompatibility with ecto 2.1.3 0.8.1 incompatibility with ecto 2.1.3 (Solved NOT an issue) Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant