~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to src/interfaces/libpq/fe-protocol3.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
                         * ERROR messages are displayed using the notice processor;
167
167
                         * ParameterStatus is handled normally; anything else is just
168
168
                         * dropped on the floor after displaying a suitable warning
169
 
                         * notice.      (An ERROR is very possibly the backend telling us why
 
169
                         * notice.  (An ERROR is very possibly the backend telling us why
170
170
                         * it is about to close the connection, so we don't want to just
171
171
                         * discard it...)
172
172
                         */
364
364
                                case 'd':               /* Copy Data */
365
365
 
366
366
                                        /*
367
 
                                         * If we see Copy Data, just silently drop it.  This would
 
367
                                         * If we see Copy Data, just silently drop it.  This would
368
368
                                         * only occur if application exits COPY OUT mode too
369
369
                                         * early.
370
370
                                         */
373
373
                                case 'c':               /* Copy Done */
374
374
 
375
375
                                        /*
376
 
                                         * If we see Copy Done, just silently drop it.  This is
 
376
                                         * If we see Copy Done, just silently drop it.  This is
377
377
                                         * the normal case during PQendcopy.  We will keep
378
378
                                         * swallowing data, expecting to see command-complete for
379
379
                                         * the COPY command.
603
603
        pqSaveErrorResult(conn);
604
604
 
605
605
        /*
606
 
         * Return zero to allow input parsing to continue.      Subsequent "D"
 
606
         * Return zero to allow input parsing to continue.  Subsequent "D"
607
607
         * messages will be ignored until we get to end of data, since an error
608
608
         * result is already set up.
609
609
         */
785
785
        pqSaveErrorResult(conn);
786
786
 
787
787
        /*
788
 
         * Return zero to allow input parsing to continue.      Subsequent "D"
 
788
         * Return zero to allow input parsing to continue.  Subsequent "D"
789
789
         * messages will be ignored until we get to end of data, since an error
790
790
         * result is already set up.
791
791
         */
812
812
 
813
813
        /*
814
814
         * Since the fields might be pretty long, we create a temporary
815
 
         * PQExpBuffer rather than using conn->workBuffer.      workBuffer is intended
816
 
         * for stuff that is expected to be short.      We shouldn't use
 
815
         * PQExpBuffer rather than using conn->workBuffer.  workBuffer is intended
 
816
         * for stuff that is expected to be short.  We shouldn't use
817
817
         * conn->errorMessage either, since this might be only a notice.
818
818
         */
819
819
        initPQExpBuffer(&workBuf);
820
820
 
821
821
        /*
822
 
         * Make a PGresult to hold the accumulated fields.      We temporarily lie
 
822
         * Make a PGresult to hold the accumulated fields.  We temporarily lie
823
823
         * about the result status, so that PQmakeEmptyPGresult doesn't uselessly
824
824
         * copy conn->errorMessage.
825
825
         */
1031
1031
        /*
1032
1032
         * Each character might occupy multiple physical bytes in the string, and
1033
1033
         * in some Far Eastern character sets it might take more than one screen
1034
 
         * column as well.      We compute the starting byte offset and starting
 
1034
         * column as well.  We compute the starting byte offset and starting
1035
1035
         * screen column of each logical character, and store these in qidx[] and
1036
1036
         * scridx[] respectively.
1037
1037
         */
1059
1059
        /*
1060
1060
         * Within the scanning loop, cno is the current character's logical
1061
1061
         * number, qoffset is its offset in wquery, and scroffset is its starting
1062
 
         * logical screen column (all indexed from 0).  "loc" is the logical
1063
 
         * character number of the error location.      We scan to determine loc_line
 
1062
         * logical screen column (all indexed from 0).  "loc" is the logical
 
1063
         * character number of the error location.  We scan to determine loc_line
1064
1064
         * (the 1-based line number containing loc) and ibeg/iend (first character
1065
1065
         * number and last+1 character number of the line containing loc). Note
1066
1066
         * that qidx[] and scridx[] are filled only as far as iend.
1511
1511
        for (;;)
1512
1512
        {
1513
1513
                /*
1514
 
                 * Collect the next input message.      To make life simpler for async
 
1514
                 * Collect the next input message.  To make life simpler for async
1515
1515
                 * callers, we keep returning 0 until the next message is fully
1516
1516
                 * available, even if it is not Copy Data.
1517
1517
                 */
1718
1718
        /*
1719
1719
         * Non blocking connections may have to abort at this point.  If everyone
1720
1720
         * played the game there should be no problem, but in error scenarios the
1721
 
         * expected messages may not have arrived yet.  (We are assuming that the
 
1721
         * expected messages may not have arrived yet.  (We are assuming that the
1722
1722
         * backend's packetizing will ensure that CommandComplete arrives along
1723
1723
         * with the CopyDone; are there corner cases where that doesn't happen?)
1724
1724
         */