python-database-sanitizer icon indicating copy to clipboard operation
python-database-sanitizer copied to clipboard

mysql decoder doesn't recognise negative ints

Open mrmonkington opened this issue 2 years ago • 0 comments

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+$")

mrmonkington avatar Feb 03 '23 11:02 mrmonkington