You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/ecto/adapters/myxql_test.exs
+61Lines changed: 61 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1184,6 +1184,67 @@ defmodule Ecto.Adapters.MyXQLTest do
1184
1184
assertquery==~s{DELETE FROM `schema` WHERE `x` IS NULL AND `y` = ?}
1185
1185
end
1186
1186
1187
+
# Values List
1188
+
1189
+
test"values list: all"do
1190
+
uuid=Ecto.UUID.generate()
1191
+
values=[%{bid: uuid,num: 1},%{num: 2,bid: uuid}]
1192
+
types=%{bid: Ecto.UUID,num: :integer}
1193
+
1194
+
query=
1195
+
from(v1invalues(values,types),
1196
+
join: v2invalues(values,types),
1197
+
on: v1.bid==v2.bid,
1198
+
select: v2,
1199
+
where: v1.num==^2
1200
+
)
1201
+
|>plan()
1202
+
|>all()
1203
+
1204
+
assertquery==
1205
+
~s{SELECT v1.`bid`, v1.`num` }<>
1206
+
~s{FROM (VALUES ROW(CAST(? AS binary(16)),CAST(? AS unsigned)),ROW(CAST(? AS binary(16)),CAST(? AS unsigned))) AS v0 (`bid`,`num`) }<>
1207
+
~s{INNER JOIN (VALUES ROW(CAST(? AS binary(16)),CAST(? AS unsigned)),ROW(CAST(? AS binary(16)),CAST(? AS unsigned))) AS v1 (`bid`,`num`) ON v0.`bid` = v1.`bid` }<>
0 commit comments