Skip to content

Fix FDW previews when column names have percentage signs #619

Merged
mildbyte merged 2 commits intomasterfrom
bugfix/percentage-sign-in-column-names
Jan 24, 2022
Merged

Fix FDW previews when column names have percentage signs #619
mildbyte merged 2 commits intomasterfrom
bugfix/percentage-sign-in-column-names

Conversation

@mildbyte
Copy link
Contributor

These column names issues when using argument interpolation, as psycopg2 treats
them as arguments and raises an IndexError (not enough arguments). Fix by
escaping them with double-percentage signs.

Note that this isn't fixed everywhere, just on the FDW data source preview code
path.

Also add a test using a CSV file with a percentage sign, as this is how this bug
was first discovered.

These column names issues when using argument interpolation, as psycopg2 treats
them as arguments and raises an IndexError (not enough arguments). Fix by
escaping them with double-percentage signs.

Note that this isn't fixed everywhere, just on the FDW data source preview code
path.

Also add a test using a CSV file with a percentage sign, as this is how this bug
was first discovered.
@mildbyte mildbyte merged commit 891966b into master Jan 24, 2022
@mildbyte mildbyte deleted the bugfix/percentage-sign-in-column-names branch January 24, 2022 13:31
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 this pull request may close these issues.

1 participant