dat
dat copied to clipboard
Disabling logger makes errors become nil, and generates nil pointer dereferences
We had to disable error logging coming from dat- especially since some queries are extremely long and we don't want to print them when a query crashes. Doing so started generating pointer dereferences in sqlx-runner/execer.go
when trying to access res.RowsAffected
, meaning res
is nil
.
Doing some digging, it turns out the exec
function is returning nil
for both values, even when an error should be returned. In fact, logSQLError
now seems to be returning nil
, even if the parameter isn't.
Our environment variable is set to LOGXI=dat*=OFF
.
I'm not sure if this is an intended behavior of the logger, but it is generating some extremely bad side-effects on our production environment.
The same issue.
And such behavior breaks errors handling, because all errors becomes nil
This is a problem within the logging package (one I wrote). I found the bug in logger and will update dat soon.