Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug in _counter - Increment/Decrement truncates to integer. #210

@kobalicek

Description

@kobalicek

When knex increment/decrement calls _counter() it uses parseInt() and truncates the incoming value to an integer. This is a problem if there is a numeric type in DB (Postgres).

I think that the _counter should do parseFloat() and if the number is given it should do nothing or just use isFinite() instead of using isNaN() that is truthy for Infinity and -Infinity.

I can provide a pull request for this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions