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

Crashes on parsing big double values #527

Open
bartoszpijet opened this issue Feb 14, 2024 · 0 comments · May be fixed by #532
Open

Crashes on parsing big double values #527

bartoszpijet opened this issue Feb 14, 2024 · 0 comments · May be fixed by #532

Comments

@bartoszpijet
Copy link

PGSync version: Version: 3.1.0

Postgres version: PostgreSQL 15.1 (Ubuntu 15.1-1.pgdg20.04+1) on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit

Elasticsearch/OpenSearch version: 2.11.1

Redis version: Redis server v=6.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6

Python version: Python 3.10.12

Problem Description:

Floats with big values are crashing sync since postgres is sending values like "2e+09" and LOGICAL_SLOT_SUFFIX regex is not parsing them properly causing the code to parse float('2e') which does not work. I changed this regex so it does work for my case, but idk if it would work for other cases.

LOGICAL_SLOT_SUFFIX = re.compile(
    '\s(?P<key>"?\w+"?)\[(?P<type>[\w\s]+)\]:(?P<value>[\w\'"\-\\.\\+]+)'
)
@bartoszpijet bartoszpijet linked a pull request Feb 26, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant