Skip to content

Commit

Permalink
Add a regression test for the zero-column Query case
Browse files Browse the repository at this point in the history
Signed-off-by: Cole Miller <cole.miller@canonical.com>
  • Loading branch information
cole-miller committed Jul 17, 2023
1 parent 945a3da commit f7320ed
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,22 @@ func Test_ColumnTypesEnd(t *testing.T) {
assert.NoError(t, conn.Close())
}

func Test_ZeroColumns(t *testing.T) {
drv, cleanup := newDriver(t)
defer cleanup()

conn, err := drv.Open("test.db")
require.NoError(t, err)
queryer := conn.(driver.Queryer)

rows, err := queryer.Query("CREATE TABLE foo (bar INTEGER)", []driver.Value{})
require.NoError(t, err)
values := []driver.Value{}
require.Equal(t, io.EOF, rows.Next(values))

require.NoError(t, conn.Close())
}

func newDriver(t *testing.T) (*dqlitedriver.Driver, func()) {
t.Helper()

Expand Down

0 comments on commit f7320ed

Please sign in to comment.