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

« back to all changes in this revision

Viewing changes to contrib/dblink/dblink.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:
977
977
 
978
978
        PG_TRY();
979
979
        {
 
980
                /* Create short-lived memory context for data conversions */
 
981
                sinfo.tmpcontext = AllocSetContextCreate(CurrentMemoryContext,
 
982
                                                                                                 "dblink temporary context",
 
983
                                                                                                 ALLOCSET_DEFAULT_MINSIZE,
 
984
                                                                                                 ALLOCSET_DEFAULT_INITSIZE,
 
985
                                                                                                 ALLOCSET_DEFAULT_MAXSIZE);
 
986
 
980
987
                /* execute query, collecting any tuples into the tuplestore */
981
988
                res = storeQueryResult(&sinfo, conn, sql);
982
989
 
1041
1048
                        PQclear(res);
1042
1049
                        res = NULL;
1043
1050
                }
 
1051
 
 
1052
                /* clean up data conversion short-lived memory context */
 
1053
                if (sinfo.tmpcontext != NULL)
 
1054
                        MemoryContextDelete(sinfo.tmpcontext);
 
1055
                sinfo.tmpcontext = NULL;
 
1056
 
1044
1057
                PQclear(sinfo.last_res);
1045
1058
                sinfo.last_res = NULL;
1046
1059
                PQclear(sinfo.cur_res);
1204
1217
                if (sinfo->cstrs)
1205
1218
                        pfree(sinfo->cstrs);
1206
1219
                sinfo->cstrs = (char **) palloc(nfields * sizeof(char *));
1207
 
 
1208
 
                /* Create short-lived memory context for data conversions */
1209
 
                if (!sinfo->tmpcontext)
1210
 
                        sinfo->tmpcontext =
1211
 
                                AllocSetContextCreate(CurrentMemoryContext,
1212
 
                                                                          "dblink temporary context",
1213
 
                                                                          ALLOCSET_DEFAULT_MINSIZE,
1214
 
                                                                          ALLOCSET_DEFAULT_INITSIZE,
1215
 
                                                                          ALLOCSET_DEFAULT_MAXSIZE);
1216
1220
        }
1217
1221
 
1218
1222
        /* Should have a single-row result if we get here */
2397
2401
         * Build sql statement to look up tuple of interest, ie, the one matching
2398
2402
         * src_pkattvals.  We used to use "SELECT *" here, but it's simpler to
2399
2403
         * generate a result tuple that matches the table's physical structure,
2400
 
         * with NULLs for any dropped columns.  Otherwise we have to deal with two
 
2404
         * with NULLs for any dropped columns.  Otherwise we have to deal with two
2401
2405
         * different tupdescs and everything's very confusing.
2402
2406
         */
2403
2407
        appendStringInfoString(&buf, "SELECT ");
2623
2627
}
2624
2628
 
2625
2629
/*
2626
 
 * For non-superusers, insist that the connstr specify a password.      This
 
2630
 * For non-superusers, insist that the connstr specify a password.  This
2627
2631
 * prevents a password from being picked up from .pgpass, a service file,
2628
2632
 * the environment, etc.  We don't want the postgres user's passwords
2629
2633
 * to be accessible to non-superusers.