- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit8daf82e
committed
Fix pg_restore's direct-to-database mode for standard_conforming_strings.
pg_backup_db.c contained a mini SQL lexer with which it tried to identifyboundaries between SQL commands, but that code was not designed to copewith standard_conforming_strings, and would get the wrong answer if abackslash immediately precedes a closing single quote in such a string,as per report from Julian Mehnle. The bug only affects direct-to-databaserestores from archive files made with standard_conforming_strings = on.Rather than complicating the code some more to try to fix that, let's justrip it all out. The only reason it was needed was to cope with COPY dataembedded into ordinary archive entries, which was a layout that was usedonly for about the first three weeks of the archive format's existence,and never in any production release of pg_dump. Instead, just rely on thearchive file layout to tell us whether we're printing COPY data or not.This bug represents a data corruption hazard in all releases in whichstandard_conforming_strings can be turned on, ie 8.2 and later, soback-patch to all supported branches.1 parentc4222d3 commit8daf82e
File tree
4 files changed
+65
-378
lines changed- src/bin/pg_dump
4 files changed
+65
-378
lines changedLines changed: 16 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| 67 | + | |
67 | 68 |
| |
68 | 69 |
| |
69 | 70 |
| |
| |||
364 | 365 |
| |
365 | 366 |
| |
366 | 367 |
| |
367 |
| - | |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
| 368 | + | |
375 | 369 |
| |
376 | 370 |
| |
377 | 371 |
| |
| |||
381 | 375 |
| |
382 | 376 |
| |
383 | 377 |
| |
384 |
| - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
385 | 387 |
| |
386 | 388 |
| |
387 | 389 |
| |
| |||
1006 | 1008 |
| |
1007 | 1009 |
| |
1008 | 1010 |
| |
1009 |
| - | |
| 1011 | + | |
1010 | 1012 |
| |
1011 | 1013 |
| |
1012 | 1014 |
| |
1013 | 1015 |
| |
1014 |
| - | |
1015 |
| - | |
1016 |
| - | |
1017 |
| - | |
1018 |
| - | |
1019 |
| - | |
| 1016 | + | |
| 1017 | + | |
1020 | 1018 |
| |
1021 | 1019 |
| |
1022 | 1020 |
| |
| |||
1096 | 1094 |
| |
1097 | 1095 |
| |
1098 | 1096 |
| |
1099 |
| - | |
| 1097 | + | |
1100 | 1098 |
| |
1101 | 1099 |
| |
1102 | 1100 |
| |
| |||
1148 | 1146 |
| |
1149 | 1147 |
| |
1150 | 1148 |
| |
1151 |
| - | |
| 1149 | + | |
1152 | 1150 |
| |
1153 | 1151 |
| |
1154 | 1152 |
| |
| |||
1693 | 1691 |
| |
1694 | 1692 |
| |
1695 | 1693 |
| |
1696 |
| - | |
1697 |
| - | |
1698 |
| - | |
1699 | 1694 |
| |
1700 | 1695 |
| |
1701 | 1696 |
| |
|
Lines changed: 0 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
134 | 134 |
| |
135 | 135 |
| |
136 | 136 |
| |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 |
| - | |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 | 137 |
| |
160 | 138 |
| |
161 | 139 |
| |
| |||
191 | 169 |
| |
192 | 170 |
| |
193 | 171 |
| |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 | 172 |
| |
198 | 173 |
| |
199 | 174 |
| |
| |||
241 | 216 |
| |
242 | 217 |
| |
243 | 218 |
| |
244 |
| - | |
245 |
| - | |
246 | 219 |
| |
247 | 220 |
| |
248 | 221 |
| |
|
0 commit comments
Comments
(0)