Skip to content

Commit 4ddcf53

Browse files
committed
merge test cases from jmoiron/sqlx#962
2 parents 826b797 + b638d7d commit 4ddcf53

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

named_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,30 @@ func TestFixBounds(t *testing.T) {
479479
)`,
480480
loop: 2,
481481
},
482+
{
483+
name: "use of VALUES not for insert",
484+
query: `
485+
UPDATE t
486+
SET
487+
foo = u.foo,
488+
bar = u.bar
489+
FROM (
490+
VALUES (:id, :foo, :bar)
491+
) AS u(id, foo, bar)
492+
WHERE t.id = u.id
493+
`,
494+
expect: `
495+
UPDATE t
496+
SET
497+
foo = u.foo,
498+
bar = u.bar
499+
FROM (
500+
VALUES (:id, :foo, :bar),(:id, :foo, :bar)
501+
) AS u(id, foo, bar)
502+
WHERE t.id = u.id
503+
`,
504+
loop: 2,
505+
},
482506
}
483507

484508
for _, tc := range table {

0 commit comments

Comments
 (0)