8000 Disabling logger makes errors become nil, and generates nil pointer dereferences · Issue #55 · mgutz/dat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Disabling logger makes errors become nil, and generates nil pointer dereferences #55
Open
@manuel-huez

Description

@manuel-huez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0