Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling logger makes errors become nil, and generates nil pointer dereferences #55

Open
manuel-huez opened this issue Jan 11, 2017 · 3 comments

Comments

@manuel-huez
Copy link

manuel-huez commented Jan 11, 2017

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.

@aksentyev
Copy link

The same issue.

@aksentyev
Copy link

And such behavior breaks errors handling, because all errors becomes nil

@mgutz
Copy link
Owner

mgutz commented Feb 5, 2017

This is a problem within the logging package (one I wrote). I found the bug in logger and will update dat soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants