1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-18 12:22:09 +03:00
Commit Graph

19872 Commits

Author SHA1 Message Date
Neil Conway
8ac04d4d78 Fix three Python reference leaks in PLy_traceback(). This would result
in leaking memory when invoking a PL/Python procedure that raises an
exception. Unfortunately this still leaks memory, but at least the
largest leak has been plugged.

This patch also fixes a reference counting mistake in PLy_modify_tuple()
for 8.0, 8.1 and HEAD: we don't actually own a reference to `platt', so
we shouldn't Py_DECREF() it.
2006-02-20 20:10:43 +00:00
Neil Conway
74f615766c Patch from Marko Kreen:
pgcrypto crypt()/md5 and hmac() leak memory when compiled against
OpenSSL as openssl.c digest ->reset will do two DigestInit calls
against a context.  This happened to work with OpenSSL 0.9.6
but not with 0.9.7+.

Reason for the messy code was that I tried to avoid creating
wrapper structure to transport algorithm info and tried to use
OpenSSL context for it.  The fix is to create wrapper structure.

It also uses newer digest API to avoid memory allocations
on reset with newer OpenSSLs.

Thanks to Daniel Blaisdell for reporting it.
2006-02-18 20:48:56 +00:00
Tom Lane
f5ab0a2597 Move btbulkdelete's vacuum_delay_point() call to a place in the loop where
we are not holding a buffer content lock; where it was, InterruptHoldoffCount
is positive and so we'd not respond to cancel signals as intended.  Also
add missing vacuum_delay_point() call in btvacuumcleanup.  This should fix
complaint from Evgeny Gridasov about failure to respond to SIGINT/SIGTERM
in a timely fashion (bug #2257).
2006-02-14 17:20:17 +00:00
Tom Lane
dc9d11dc33 Fix qual_is_pushdown_safe to not try to push down quals involving a whole-row
Var referencing the subselect output.  While this case could possibly be made
to work, it seems not worth expending effort on.  Per report from Magnus
Naeslund(f).
2006-02-13 16:22:38 +00:00
Tom Lane
a5746b8b09 Stamp 8.0.7. REL8_0_7 2006-02-12 22:38:05 +00:00
Tom Lane
2d584b5c1b Update release notes. 2006-02-12 22:35:52 +00:00
Tom Lane
df2c740c94 Fix bug in SET SESSION AUTHORIZATION that allows unprivileged users to crash
the server, if it has been compiled with Asserts enabled (CVE-2006-0553).
Thanks to Akio Ishida for reporting this problem.
2006-02-12 22:33:14 +00:00
Bruce Momjian
9bb401cd73 Update FAQ latest version 2006-02-12 18:50:45 +00:00
Bruce Momjian
5ae9c6138b Stamp releases for 2006-02-14 release 2006-02-12 18:41:53 +00:00
Bruce Momjian
dfa879bc98 Update release notes for 2006-02-14 release 2006-02-12 18:23:46 +00:00
Tom Lane
9878d9a1f1 Check that SID is enabled while checking for Windows admin privileges.
Magnus
2006-02-10 21:52:43 +00:00
Tom Lane
bce1d83ee5 Change search for default operator classes so that it examines all opclasses
regardless of the current schema search path.  Since CREATE OPERATOR CLASS
only allows one default opclass per datatype regardless of schemas, this
should have minimal impact, and it fixes problems with failure to find a
desired opclass while restoring dump files.  Per discussion at
http://archives.postgresql.org/pgsql-hackers/2006-02/msg00284.php.
Remove now-redundant-or-unused code in typcache.c and namespace.c,
and backpatch as far as 8.0.
2006-02-10 19:01:33 +00:00
Tom Lane
f28106381a Provide the libpq error message when PQputline or PQendcopy fails. 2006-02-09 18:28:43 +00:00
Tom Lane
a14302080f Reject out-of-range dates in date_in().
Kris Jurka
2006-02-09 03:40:42 +00:00
Tom Lane
f9ce97c5a1 Fix pg_restore to properly discard COPY data when trying to continue
after an error in a COPY statement.  Formerly it thought the COPY data
was SQL commands, and got quite confused.

Stephen Frost
2006-02-05 20:59:06 +00:00
Bruce Momjian
3002acda43 Fix const cast in get_progname().
Backpatch.
2006-02-01 12:42:30 +00:00
Bruce Momjian
5eb493ab98 Set progname early in the postmaster/postgres binary, rather than doing
it later.  This fixes a problem where EXEC_BACKEND didn't have progname
set, causing a segfault if log_min_messages was set below debug2 and our
own snprintf.c was being used.

Also alway strdup() progname.

Backpatch to 8.1.X and 8.0.X.
2006-02-01 00:47:03 +00:00
Tom Lane
2426c62140 Fix ALTER COLUMN TYPE bug: it sometimes tried to drop UNIQUE or PRIMARY KEY
constraints before FOREIGN KEY constraints that depended on them.  Originally
reported by Neil Conway on 29-Jun-2005.  Patch by Nakano Yoshihisa.
2006-01-30 16:19:12 +00:00
Andrew Dunstan
a021ea021c Undo perl's nasty locale setting on Windows. Since we can't do that as
elsewhere by setting the environment appropriately, we make perl do it
right after interpreter startup by calling its POSIX::setlocale().
2006-01-28 16:22:49 +00:00
Tom Lane
6f2d775218 Fix display of whole-row Var appearing at the top level of a SELECT list.
While we normally prefer the notation "foo.*" for a whole-row Var, that does
not work at SELECT top level, because in that context the parser will assume
that what is wanted is to expand the "*" into a list of separate target
columns, yielding behavior different from a whole-row Var.  We have to emit
just "foo" instead in that context.  Per report from Sokolov Yura.
2006-01-26 17:08:34 +00:00
Tom Lane
6a928e11fa Repair longstanding bug in slru/clog logic: it is possible for two backends
to try to create a log segment file concurrently, but the code erroneously
specified O_EXCL to open(), resulting in a needless failure.  Before 7.4,
it was even a PANIC condition :-(.  Correct code is actually simpler than
what we had, because we can just say O_CREAT to start with and not need a
second open() call.  I believe this accounts for several recent reports of
hard-to-reproduce "could not create file ...: File exists" errors in both
pg_clog and pg_subtrans.
2006-01-21 04:38:36 +00:00
Bruce Momjian
1f57f2e311 Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path for Darwin. 2006-01-19 21:20:32 +00:00
Bruce Momjian
2f90c781e8 Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path. 2006-01-19 20:45:20 +00:00
Tom Lane
a290087cd1 Avoid crashing if relcache flush occurs while trying to load data into an
index's support-function cache (in index_getprocinfo).  Since none of that
data can change for an index that's in active use, it seems sufficient to
treat all open indexes the same way we were treating "nailed" system indexes
--- that is, just re-read the pg_class row and leave the rest of the relcache
entry strictly alone.  The pg_class re-read might not be strictly necessary
either, but since the reltablespace and relfilenode can change in normal
operation it seems safest to do it.  (We don't support changing any of the
other info about an index at all, at the moment.)

Back-patch as far as 8.0.  It might be possible to adapt the patch to 7.4,
but it would take more work than I care to expend for such a low-probability
problem.  7.3 is out of luck for sure.
2006-01-19 20:28:57 +00:00
Bruce Momjian
92d1dd845f Fix pgxs -L library path specification for Win32 and Cygwin, was /bin,
now /lib.
2006-01-19 20:01:32 +00:00
Tom Lane
9fad6e338b It turns out that TablespaceCreateDbspace fails badly if a relcache flush
occurs when it tries to heap_open pg_tablespace.  When control returns to
smgrcreate, that routine will be holding a dangling pointer to a closed
SMgrRelation, resulting in mayhem.  This is of course a consequence of
the violation of proper module layering inherent in having smgr.c call
a tablespace command routine, but the simplest fix seems to be to change
the locking mechanism.  There's no real need for TablespaceCreateDbspace
to touch pg_tablespace at all --- it's only opening it as a way of locking
against a parallel DROP TABLESPACE command.  A much better answer is to
create a special-purpose LWLock to interlock these two operations.
This drops TablespaceCreateDbspace quite a few layers down the food chain
and makes it something reasonably safe for smgr to call.
2006-01-19 04:45:58 +00:00
Tom Lane
754da88e19 Repair problems with the result of lookup_rowtype_tupdesc() possibly being
discarded by cache flush while still in use.  This is a minimal patch that
just copies the tupdesc anywhere it could be needed across a flush.  Applied
to back branches only; Neil Conway is working on a better long-term solution
for HEAD.
2006-01-17 17:33:37 +00:00
Neil Conway
8372956243 When using GCC on AMD64 and PPC, ECPGget_variable() takes a va_list *, not
a va_list. Christof Petig's previous patch made this change, but neglected
to update ecpglib/descriptor.c, resulting in a compiler warning (and a
likely runtime crash) on AMD64 and PPC.
2006-01-15 22:47:21 +00:00
Peter Eisentraut
9d570f7e21 Fix pg_ctl crash on "unregister" when a data directory is not specified.
by Magnus Hagander
2006-01-14 16:18:30 +00:00
Neil Conway
b0b8bab575 We neglected to apply domain constraints on UNKNOWN parameters to
prepared statements, per report from David Wheeler.
2006-01-12 22:29:22 +00:00
Tom Lane
e26b09618b Repair "Halloween problem" in EvalPlanQual: a tuple that's been inserted by
our own command (or more generally, xmin = our xact and cmin >= current
command ID) should not be seen as good.  Else we may try to update rows
we already updated.  This error was inserted last August while fixing the
even bigger problem that the old coding wouldn't see *any* tuples inserted
by our own transaction as good.  Per report from Euler Taveira de Oliveira.
2006-01-12 21:49:19 +00:00
Tom Lane
01e2a15ada Use a more bulletproof test for whether finite() and isinf() are present.
It seems that recent gcc versions can optimize away calls to these functions
even when the functions do not exist on the platform, resulting in a bogus
positive result.  Avoid this by using a non-constant argument and ensuring
that the function result is not simply discarded.  Per report from
François Laupretre.
2006-01-12 19:24:02 +00:00
Tom Lane
2946ccf35f Fix pg_tzset() to ensure that 'lclmem' (the static variable holding
the localtime timezone data) is not overwritten until we know the data
is good.  tzload() is capable of failing after having begun modifying
the struct it's pointed at, and in such cases the static data was left
in a corrupt state.  Bug does not exist pre-8.0 (since we didn't have
this code then) nor post-8.0 (since we already changed the code to
tzload into local variables initially).  Per report from Nick Martens.
2006-01-10 20:16:25 +00:00
Neil Conway
95f88ddf49 In PLy_function_build_args(), the code loops repeatedly, constructing
one argument at a time and then inserting the argument into a Python
list via PyList_SetItem(). This "steals" the reference to the argument:
that is, the reference to the new list member is now held by the Python
list itself. This works fine, except if an elog occurs. This causes the
function's PG_CATCH() block to be invoked, which decrements the
reference counts on both the current argument and the list of arguments.
If the elog happens to occur during the second or subsequent iteration
of the loop, the reference count on the current argument will be
decremented twice.

The fix is simple: set the local pointer to the current argument to NULL
immediately after adding it to the argument list. This ensures that the
Py_XDECREF() in the PG_CATCH() block doesn't double-decrement.
2006-01-10 00:33:48 +00:00
Tom Lane
59327401cc Fix pg_dump to add the required OPERATOR() decoration to schema-qualified
operator names.  This is needed when dumping operator definitions that have
COMMUTATOR (or similar) links to operators in other schemas.
Apparently Daniel Whitter is the first person ever to try this :-(
2006-01-09 21:16:37 +00:00
Andrew Dunstan
d984548ac9 Stop perl from hijacking stdio and other stuff on Windows. 2006-01-08 15:51:19 +00:00
Tom Lane
b443043d18 Add RelationOpenSmgr() calls to ensure rd_smgr is valid when we try to
use it.  While it normally has been opened earlier during btree index
build, testing shows that it's possible for the link to be closed again
if an sinval reset occurs while the index is being built.
2006-01-07 22:46:07 +00:00
Tom Lane
2aee785469 Fix failure to apply domain constraints to a NULL constant that's added to
an INSERT target list during rule rewriting.  Per report from John Supplee.
2006-01-06 20:11:24 +00:00
Tom Lane
e82858f013 Release-note updates and copy editing. REL8_0_6 2006-01-06 03:00:20 +00:00
Tom Lane
5d0def8d52 Fix Windows-only postmaster code to reject a connection request and continue,
rather than elog(FATAL), when there is no more room in ShmemBackendArray.
This is a security issue since too many connection requests arriving close
together could cause the postmaster to shut down, resulting in denial of
service.  Reported by Yoshiyuki Asaba, fixed by Magnus Hagander.
2006-01-06 02:58:40 +00:00
Tom Lane
240112222c Generate back-branch configure scripts with the appropriate version of autoconf. 2006-01-06 02:30:52 +00:00
Tom Lane
a2dca8e9e3 Convert Assert checking for empty page into a regular test and elog.
The consequences of overwriting a non-empty page are bad enough that
we should not omit this test in production builds.
2006-01-06 00:16:09 +00:00
Tom Lane
718d3232af Fix ReadBuffer() to correctly handle the case where it's trying to extend
the relation but it finds a pre-existing valid buffer.  The buffer does not
correspond to any page known to the kernel, so we *must* do smgrextend to
ensure that the space becomes allocated.  The 7.x branches all do this
correctly, but the corner case got lost somewhere during 8.0 bufmgr rewrites.
(My fault no doubt :-( ... I think I assumed that such a buffer must be
not-BM_VALID, which is not so.)
2006-01-06 00:04:33 +00:00
Bruce Momjian
0add52b4f6 New pgcrypto item wording. 2006-01-05 15:18:29 +00:00
Bruce Momjian
240fb6dd4f Wording improvements. 2006-01-05 15:12:03 +00:00
Bruce Momjian
4011909a02 Improve markup. 2006-01-05 14:53:18 +00:00
Bruce Momjian
748a71fbff Update release notes. 2006-01-05 05:23:09 +00:00
Bruce Momjian
2a35aedd97 Stamp relesae 8.0.6. 2006-01-05 04:00:29 +00:00
Tom Lane
7179b96be9 Arrange to set the LC_XXX environment variables to match our locale setup.
Back-patch of previous fix in HEAD for plperl-vs-locale issue.
2006-01-05 00:55:07 +00:00
Joe Conway
6c2fa48885 When the remote query result has a different number of columns
than the local query specifies (e.g. in the FROM clause),
throw an ERROR (instead of crashing). Fix for bug #2129 reported
by Akio Iwaasa.
2006-01-03 23:47:24 +00:00