8000 Fix test_decoding schema parsing with quoted identifier by arajkumar · Pull Request #852 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix test_decoding schema parsing with quoted identifier #852

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

Merged

Conversation

arajkumar
Copy link
Contributor
@arajkumar arajkumar commented Jul 23, 2024

The current parser fails when the DML message table schema is escaped with quotes.

Remove the quote check, as the existing logic already parses schemas with quotes.

@dimitri
Copy link
Owner
dimitri commented Jul 23, 2024

The problem with quoted identifier is that our parser is not smart enough about identifiers that contain either dots or columns characters in their name, which now could happen. We need to implement an actual parser for a quoted identifier that knows how to walk through it and skip the right set of characters etc. I think it would be best to include that work in the current PR.

@arajkumar
Copy link
Contributor Author
arajkumar commented Jul 23, 2024

The problem with quoted identifier is that our parser is not smart enough about identifiers that contain either dots or columns characters in their name, which now could happen. We need to implement an actual parser for a quoted identifier that knows how to walk through it and skip the right set of characters etc. I think it would be best to include that work in the current PR.

@dimitri Should we build an equivalent parser like Postgres parse_ident? or may be we can assume we will a valid identifier here and implement some dumb parser which finds first dot after all escaping?

@dimitri
Copy link
Owner
dimitri commented Jul 23, 2024

@dimitri Should we build an equivalent parser like Postgres parse_ident? or may be we can assume we will a valid identifier here and implement some dumb parser which finds first dot after all escaping?

We should assume a valid identifier here, for sure. I think all we need is to be able to navigate through the chars knowing if we are still within the quoted identifier text, reading the delimiter quote, or reading something that's not in the quoting (the dot, for instance, is never quoted).

@arajkumar arajkumar force-pushed the arajkumar/test-decoding-quoted-schema branch from 0d7729c to 9090857 Compare July 26, 2024 14:04
@arajkumar
Copy link
Contributor Author

@dimitri I attempted to parse the identifier with the assumption that it would be well-formed.

@arajkumar arajkumar force-pushed the arajkumar/test-decoding-quoted-schema branch from 9090857 to 995ea1b Compare July 26, 2024 14:09
@arajkumar arajkumar force-pushed the arajkumar/test-decoding-quoted-schema branch 2 times, most recently from bbd0da7 to 819bf3e Compare July 27, 2024 03:21
@arajkumar arajkumar requested a review from dimitri July 27, 2024 03:21
The current parser fails when the DML message table schema is escaped with quotes.

Remove the quote check, as the existing logic already covers schemas with quotes.

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@arajkumar arajkumar force-pushed the arajkumar/test-decoding-quoted-schema branch from 819bf3e to 70badaa Compare July 29, 2024 13:10
@dimitri dimitri merged commit 30d7bcd into dimitri:main Jul 29, 2024
19 checks passed
@dimitri dimitri added bug Something isn't working enhancement New feature or request labels Jul 29, 2024
@dimitri dimitri added this to the v0.17 milestone Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0