- Notifications
You must be signed in to change notification settings - Fork4.9k
Commita6060f1
pg_dump: Fix array literals in fetchAttributeStats().
Presently, fetchAttributeStats() builds array literals by treatingthe elements as SQL identifiers. This is incorrect for a couple ofreasons:* Array literal content must match the external text representation of the array, i.e., what array_out() would return. One notable problem is that double quotes are escaped with "" in identifiers but with \" in array literals. To fix, build the array content using the pre-existing appendPGArray() function.* Array literals must be written as string constants. A notable problem here is that single quotes are escaped via '' in strings but are not escaped in the text representation of an array. To fix, append the aforementioned array literal content to the query with appendStringLiteralAH().While at it, modify a test case to use an identifier that wouldcause the test to fail without this change.Oversight in commit9c02e3a.Reported-by: Philippe Beaudoin <pbh.emaj@free.fr>Author: Jian He <jian.universality@gmail.com>Co-authored-by: Nathan Bossart <nathandbossart@gmail.com>Co-authored-by: Stepan Neretin <slpmcf@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Bug: #18923Discussion:https://postgr.es/m/18923-e79273f87c6bed69%40postgresql.org1 parentcbf53e2 commita6060f1
2 files changed
+16
-11
lines changedLines changed: 13 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10765 | 10765 |
| |
10766 | 10766 |
| |
10767 | 10767 |
| |
| 10768 | + | |
| 10769 | + | |
| 10770 | + | |
10768 | 10771 |
| |
10769 | 10772 |
| |
10770 | 10773 |
| |
| |||
10776 | 10779 |
| |
10777 | 10780 |
| |
10778 | 10781 |
| |
10779 |
| - | |
10780 |
| - | |
10781 |
| - | |
10782 |
| - | |
| 10782 | + | |
| 10783 | + | |
10783 | 10784 |
| |
10784 | 10785 |
| |
10785 | 10786 |
| |
10786 | 10787 |
| |
| 10788 | + | |
| 10789 | + | |
| 10790 | + | |
10787 | 10791 |
| |
10788 | 10792 |
| |
10789 | 10793 |
| |
10790 | 10794 |
| |
10791 | 10795 |
| |
10792 |
| - | |
10793 |
| - | |
10794 |
| - | |
10795 |
| - | |
| 10796 | + | |
| 10797 | + | |
| 10798 | + | |
| 10799 | + | |
| 10800 | + | |
10796 | 10801 |
| |
10797 | 10802 |
| |
10798 | 10803 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4834 | 4834 |
| |
4835 | 4835 |
| |
4836 | 4836 |
| |
4837 |
| - | |
| 4837 | + | |
4838 | 4838 |
| |
4839 | 4839 |
| |
4840 | 4840 |
| |
4841 | 4841 |
| |
4842 | 4842 |
| |
4843 |
| - | |
| 4843 | + | |
4844 | 4844 |
| |
4845 | 4845 |
| |
4846 | 4846 |
| |
| |||
4849 | 4849 |
| |
4850 | 4850 |
| |
4851 | 4851 |
| |
4852 |
| - | |
| 4852 | + | |
4853 | 4853 |
| |
4854 | 4854 |
| |
4855 | 4855 |
| |
|
0 commit comments
Comments
(0)