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
There is a panic in qbs.Count when the rows returned to count don't exist (because the table doesn't exist yet, the connection hasn't come up yet, etc).
2015/02/10 01:46:58 setting up DB: postgres://postgres:seekret@localhost/candidate?sslmode=disable
qbs:2015/02/10 01:46:58 pq: the database system is starting up
qbs:2015/02/10 01:46:58 pq: the database system is starting up
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x6ba924]
goroutine 26 [running]:
runtime.panic(0x863220, 0xb4ddd3)
/opt/go/src/pkg/runtime/panic.c:279 +0xf5
database/sql.(*Row).Scan(0x0, 0x7f715abf8d90, 0x1, 0x1, 0x0, 0x0)
/opt/go/src/pkg/database/sql/sql.go:1636 +0x44
github.com/coocood/qbs.(*Qbs).Count(0xc208060880, 0x891fc0, 0xc208029b20, 0x0)
/go/src/github.com/coocood/qbs/qbs.go:610 +0x293
If you look at qbs.go:610, you'll see that it calls the following:
In this case q.prepare is failing, as postgres is still coming up. Thus return nil is called, and not checked in the callers of QueryRow. I see this as a bug in:
ContainsValue on line 578
Count on line 610
Whereas doQueryRow returns the errors all the way out. I'm pushing a pull request that fixes this up a bit in a moment.
The text was updated successfully, but these errors were encountered:
There is a panic in qbs.Count when the rows returned to count don't exist (because the table doesn't exist yet, the connection hasn't come up yet, etc).
If you look at qbs.go:610, you'll see that it calls the following:
And
QueryRow
can return a nilrow
, thus calling therow.Scan
with a nilrow
value:In this case q.prepare is failing, as postgres is still coming up. Thus
return nil
is called, and not checked in the callers of QueryRow. I see this as a bug in:ContainsValue
on line 578Count
on line 610Whereas
doQueryRow
returns the errors all the way out. I'm pushing a pull request that fixes this up a bit in a moment.The text was updated successfully, but these errors were encountered: