Skip to content

mysql decoder doesn't recognise negative ints #36

Open
@mrmonkington

Description

@mrmonkington

I had a dump fail on an int field with -1 in it. I'm afraid I haven't put together an MRE, but it's very obvious that in https://github.com/andersinno/python-database-sanitizer/blob/master/database_sanitizer/utils/mysql.py#L67 MIN_INT_PATTERN doesn't cover negative numbers.

MYSQL_FLOAT_PATTERN = re.compile(r"^[+-]?\d*\.\d+([eE][+-]?\d+)?$")
MYSQL_INT_PATTERN = re.compile(r"^\d+$")

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