Closed aeneasr closed 2 years ago
This situation is almost the same as executing an empty Query
.
github.com/gobuffalo/pop/v5.(*Model).TableName(0x0, 0x0, 0x0)
/Users/foobar/go/src/github.com/gobuffalo/pop/model.go:79 +0x52
Even though the panic point is in Model
,
github.com/gobuffalo/pop/v5.(*sqlBuilder).buildColumns(0xc0001fb868, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/foobar/go/src/github.com/gobuffalo/pop/sql_builder.go:218 +0x65
github.com/gobuffalo/pop/v5.(*sqlBuilder).buildSelectSQL(0xc0001fb868, 0x0, 0x0)
/Users/foobar/go/src/github.com/gobuffalo/pop/sql_builder.go:102 +0x40
github.com/gobuffalo/pop/v5.(*sqlBuilder).compile(0xc0001fb868)
/Users/foobar/go/src/github.com/gobuffalo/pop/sql_builder.go:87 +0x369
github.com/gobuffalo/pop/v5.(*sqlBuilder).String(...)
/Users/foobar/go/src/github.com/gobuffalo/pop/sql_builder.go:57
within a call chain from buildSelectSQL()
called by the empty sqlBuilder
for the empty Query
,
github.com/gobuffalo/pop/v5.Query.ToSQL(0xc0000333b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/foobar/go/src/github.com/gobuffalo/pop/query.go:206 +0x1db
github.com/gobuffalo/pop/v5.(*Query).Exec.func1(0xbfaffeb74d0bc090, 0xcc6278)
/Users/foobar/go/src/github.com/gobuffalo/pop/executors.go:25 +0x91
github.com/gobuffalo/pop/v5.(*Connection).timeFunc(0xc0007a4900, 0x4f07ee0, 0x4, 0xc000079cd0, 0x30, 0x4ded6e0)
/Users/foobar/go/src/github.com/gobuffalo/pop/connection.go:231 +0x50
github.com/gobuffalo/pop/v5.(*Query).Exec(0xc000079e70, 0xc0000333b0, 0x0)
/Users/foobar/go/src/github.com/gobuffalo/pop/executors.go:24 +0x6a
executing the Exec()
on an empty Query
is problematic in the first place.
Filing a PR.
Description
Running an empty RawQuery causes a panic.
Steps to Reproduce the Problem
Expected Behavior
No panic.
Actual Behavior
A panic happens:
Info