- Notifications
You must be signed in to change notification settings - Fork5
Commite85a5ff
committed
Fix tracking of psql script line numbers during \copy from another place.
Commit0814677 changed do_copy() totemporarily scribble on pset.cur_cmd_source. That was a mighty ugly bit ofcode in any case, but in particular it broke handleCopyIn's ability to tellwhether it was reading from the current script source file (in which casepset.lineno should be incremented for each line of COPY data), or fromsomeplace else (in which case it shouldn't). The former case still worked,the latter not so much. The visible effect was that line numbers reportedfor errors in a script file would be wrong if there were an earlier \copythat was reading anything other than inline-in-the-script-file data.To fix, introduce another pset field that holds the file do_copy wants theCOPY code to use. This is a little bit ugly, but less so than passing thefile down explicitly through several layers that aren't COPY-specific.Extracted from a larger patch by Kumar Rajeev Rastogi; that patch alsochanges printing of COPY command tags, which is not a bug fix and shouldn'tget back-patched. This particular idea was from a suggestion by AmitKhandekar, if I'm reading the thread correctly.Back-patch to 9.2 where the faulty code was introduced.1 parent8722017 commite85a5ff
4 files changed
+25
-14
lines changedLines changed: 18 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
628 | 628 |
| |
629 | 629 |
| |
630 | 630 |
| |
631 |
| - | |
| 631 | + | |
632 | 632 |
| |
633 | 633 |
| |
634 | 634 |
| |
| |||
688 | 688 |
| |
689 | 689 |
| |
690 | 690 |
| |
| 691 | + | |
| 692 | + | |
| 693 | + | |
691 | 694 |
| |
| 695 | + | |
| 696 | + | |
692 | 697 |
| |
693 | 698 |
| |
694 |
| - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
695 | 705 |
| |
696 |
| - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
697 | 711 |
| |
| 712 | + | |
698 | 713 |
| |
699 | 714 |
| |
700 | 715 |
| |
|
Lines changed: 4 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
269 | 269 |
| |
270 | 270 |
| |
271 | 271 |
| |
272 |
| - | |
273 |
| - | |
274 | 272 |
| |
275 | 273 |
| |
276 |
| - | |
277 | 274 |
| |
278 | 275 |
| |
279 | 276 |
| |
| |||
287 | 284 |
| |
288 | 285 |
| |
289 | 286 |
| |
290 |
| - | |
291 |
| - | |
292 | 287 |
| |
293 | 288 |
| |
294 | 289 |
| |
| |||
308 | 303 |
| |
309 | 304 |
| |
310 | 305 |
| |
311 |
| - | |
312 |
| - | |
313 | 306 |
| |
314 | 307 |
| |
315 | 308 |
| |
| |||
345 | 338 |
| |
346 | 339 |
| |
347 | 340 |
| |
| 341 | + | |
348 | 342 |
| |
349 | 343 |
| |
350 | 344 |
| |
| |||
375 | 369 |
| |
376 | 370 |
| |
377 | 371 |
| |
378 |
| - | |
379 |
| - | |
380 |
| - | |
| 372 | + | |
| 373 | + | |
381 | 374 |
| |
382 |
| - | |
| 375 | + | |
383 | 376 |
| |
384 | 377 |
| |
385 | 378 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
| 73 | + | |
| 74 | + | |
73 | 75 |
| |
74 | 76 |
| |
75 | 77 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
| 121 | + | |
121 | 122 |
| |
122 | 123 |
| |
123 | 124 |
| |
|
0 commit comments
Comments
(0)