Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/ecto/integration/type_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
# Binaries
assert [^blob] =
TestRepo.all(
from p in Post,

Check warning on line 69 in test/ecto/integration/type_test.exs

View workflow job for this annotation

GitHub Actions / test (Elixir 1.15 / OTP 25 / ClickHouse latest / TZ UTC)

this check/guard will always yield the same result
where: p.blob == <<0, 1>>,
select: p.blob
)
Expand Down Expand Up @@ -301,7 +301,11 @@
# fails: select * from tags t where 0 in t.ints

expected_error_message =
if clickhouse_version() > [24], do: ~r/UNSUPPORTED_METHOD/, else: ~r/UNKNOWN_TABLE/
cond do
clickhouse_version() > [26] -> ~r/ILLEGAL_TYPE_OF_ARGUMENT/
clickhouse_version() > [24] -> ~r/UNSUPPORTED_METHOD/
true -> ~r/UNKNOWN_TABLE/
end

assert_raise Ch.Error, expected_error_message, fn ->
TestRepo.all(from t in Tag, where: 0 in t.ints, select: t.ints)
Expand Down
5 changes: 3 additions & 2 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ alias Ecto.Integration.TestRepo
env = [
adapter: Ecto.Adapters.ClickHouse,
database: "ecto_ch_test",
show_sensitive_data_on_connection_error: true
show_sensitive_data_on_connection_error: true,
settings: [async_insert: 0]
Copy link
Collaborator Author

@ruslandoga ruslandoga Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps us keep the previous behavior which the current tests assume when asserting on result.num_rows from INSERT operations.

]

env =
if ch_version >= "25" do
Keyword.put(env, :settings, enable_json_type: 1)
Keyword.update!(env, :settings, fn settings -> Keyword.put(settings, :enable_json_type, 1) end)
else
env
end
Expand Down
Loading