Skip to content

Commit daa164a

Browse files
committed
One more test
Signed-off-by: Zach Musgrave <zach@liquidata.co>
1 parent 9be9deb commit daa164a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

engine_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,6 +2023,12 @@ func TestInsertInto(t *testing.T) {
20232023
"SELECT i FROM mytable WHERE s = 'x';",
20242024
[]sql.Row{{int64(999)}},
20252025
},
2026+
{
2027+
"INSERT INTO niltable (f) VALUES (10.0), (12.0);",
2028+
[]sql.Row{{int64(2)}},
2029+
"SELECT f FROM niltable WHERE f in (10.0, 12.0) order by f;",
2030+
[]sql.Row{{10.0}, {12.0}},
2031+
},
20262032
{
20272033
"INSERT INTO mytable SET s = 'x', i = 999;",
20282034
[]sql.Row{{int64(1)}},

sql/plan/insert.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,7 @@ func (p *InsertInto) validateValueCount(ctx *sql.Context) error {
241241
return ErrInsertIntoMismatchValueCount.New()
242242
}
243243
}
244-
case *ResolvedTable:
245-
return p.assertColumnCountsMatch(node.Schema())
246-
case *Project:
247-
return p.assertColumnCountsMatch(node.Schema())
248-
case *InnerJoin:
244+
case *ResolvedTable, *Project, *InnerJoin:
249245
return p.assertColumnCountsMatch(node.Schema())
250246
default:
251247
return ErrInsertIntoUnsupportedValues.New(node)

0 commit comments

Comments
 (0)