-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FDW previews when column names have percentage signs
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.
- Loading branch information
Showing
3 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/architecture/data/objectstorage/test_csv/some_prefix/percentage_sign.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"Id","Submit time","Profile","Status","Source currency","Amount paid by","Fee","Amount converted","Excess refund","Target currency","Converted and sent to","Exchange rate","Exchange Rate Date","Payout time","Name","Account details","Reference","VAT (10%)" | ||
"123456789","2022/02/19 18:52:18","business","transferred","USD","15000.20","75.00","15000.00","0.0","GBP","12000.0","0.7336","2022/02/21 19:00:20","2022/02/21 19:00:36","Some Company","","", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters