1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

17060 Commits

Author SHA1 Message Date
Bruce Momjian
6067403326 Add WSACleanup() for Win32 socket cleanup.
Backpatch to 7.4.X.

Jason Erickson
2005-05-05 16:37:04 +00:00
Tom Lane
cff25fa049 Alter the signature for encoding conversion functions to declare the
output area as INTERNAL not CSTRING.  This is to prevent people from
calling the functions by hand.  This is a permanent solution for the
back branches but I hope it is just a stopgap for HEAD.
2005-05-03 19:18:31 +00:00
Tom Lane
308f01c304 Change tsearch2 to not use the unsafe practice of creating functions
that return INTERNAL without also having INTERNAL arguments.  Since the
functions in question aren't meant to be called by hand anyway, I just
redeclared them to take 'internal' instead of 'text'.  Also add code
to ProcedureCreate() to enforce the restriction, as I should have done
to start with :-(
2005-05-03 16:51:45 +00:00
Neil Conway
a935e36ae9 GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.

Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.
2005-04-30 08:36:18 +00:00
Neil Conway
15ea6d5a2f This patch fixes a bug in the error message emitted by pg_restore on an
incorrect -F argument: write_msg() expects its first parameter to be a
"module name", not the format string.
2005-04-30 08:00:55 +00:00
Tom Lane
3b15457092 Repair two TIME WITH TIME ZONE bugs found by Dennis Vshivkov. Comparison
of timetz values misbehaved in --enable-integer-datetime cases, and
EXTRACT(EPOCH) subtracted the zone instead of adding it in all cases.
Backpatch to all supported releases (except --enable-integer-datetime code
does not exist in 7.2).
2005-04-23 22:53:44 +00:00
Tom Lane
c7b94bbad9 int_aggregate's int_enum() doesn't work correctly with arrays that
aren't 1-D, so give an error message instead of failing.  Per report
from Ron Mayer.
2005-04-23 05:39:01 +00:00
Kris Jurka
5eed8ce382 Release build 216. 2005-04-22 15:10:52 +00:00
Kris Jurka
a44f99024c Updatable ResultSets need to check for an empty ResultSet because
isBeforeFirst and isAfterLast both return false for an empty result
so the checking to make sure the user is on a valid row wasn't
working.

Also don't allow an insert without specifying at least one column
value because INSERT INTO tab() values() is a syntax error.
2005-04-22 14:48:18 +00:00
Kris Jurka
f5517ddbda When moveToCurrentRow is called and the current row is off the
end of the ResultSet we can't try to load that row because it
doesn't exist and will throw an Exception.

Reported by Prasanth.
2005-04-22 14:36:48 +00:00
Tom Lane
08008de909 Don't try to run clauseless index scans on index types that don't support
it.  Per report from Marinos Yannikos.
2005-04-20 21:48:22 +00:00
Tom Lane
387c398c37 Fix mis-display of negative fractional seconds in interval values for
--enable-integer-datetimes case.  Per report from Oliver Siegmar.
2005-04-20 17:15:09 +00:00
Teodor Sigaev
6091d62c9d Add comment about permissions on pg_ts* tables 2005-04-19 13:59:06 +00:00
Kris Jurka
e1d55f7917 When positioned before the start of a ResultSet issuing relative(0)
results in an exception being thrown when it really should be a
no-op.
2005-04-18 18:25:11 +00:00
Tom Lane
2a35291952 Don't try to constant-fold functions returning RECORD, since the optimizer
isn't presently set up to pass them an expected tuple descriptor.  Bug has
been there since 7.3 but was just recently reported by Thomas Hallgren.
2005-04-14 21:44:35 +00:00
Tom Lane
29028762a9 Make constant-folding produce sane output for COALESCE(NULL,NULL),
that is a plain NULL and not a COALESCE with no inputs.  Fixes crash
reported by Michael Williamson.
2005-04-10 20:58:03 +00:00
Tom Lane
5c5c797cb2 In cost_mergejoin, the early-exit effect should not apply to the
outer side of an outer join.  Per andrew@supernews.
2005-04-04 01:43:33 +00:00
Tom Lane
3ea32d7b1f Flush any remaining statistics counts out to the collector at process
exit.  Without this, operations triggered during backend exit (such as
temp table deletions) won't be counted ... which given heavy usage of
temp tables can lead to pg_autovacuum falling way behind on the need
to vacuum pg_class and pg_attribute.  Per reports from Steve Crawford
and others.
2005-03-31 23:21:32 +00:00
Teodor Sigaev
7d19650a79 Fix various comparing functions 2005-03-31 15:12:08 +00:00
Tom Lane
12fa5c57ac Prevent to_char(interval) from dumping core on month-related formats
when a zero-month interval is given.  Per discussion with Karel.
2005-03-26 00:42:21 +00:00
Tom Lane
3e65431bc1 array_map can't use the fn_extra field of the provided fcinfo struct as
its private storage, because that belongs to the function that it is
supposed to call.  Per report from Ezequiel Tolnay.
2005-03-24 21:51:04 +00:00
Tom Lane
b4fd104204 Previous "64-bit fix" for intagg didn't actually work. This is already
fixed properly in CVS tip, but we need a band-aid for back branches.
Per report from Ron Mayer.
2005-03-23 19:07:03 +00:00
Tom Lane
80fba0f8ee Fix ALTER DATABASE RENAME to allow the operation if user is a superuser
who for some reason isn't marked usecreatedb.  Per report from Alexander
Pravking.  Also fix sloppy coding in have_createdb_privilege().
2005-03-12 21:12:18 +00:00
Neil Conway
2450224e6b Some builds (depends on crypto engine support?) of OpenSSL
0.9.7x have EVP_DigestFinal function which which clears all of
EVP_MD_CTX.  This makes pgcrypto crash in functions which
re-use one digest context several times: hmac() and crypt()
with md5 algorithm.

Following patch fixes it by carring the digest info around
EVP_DigestFinal and re-initializing cipher.

Marko Kreen.
2005-03-12 06:55:14 +00:00
Teodor Sigaev
989a17a68c Prevent rank change in case of duplicate search terms 2005-03-05 16:19:33 +00:00
Tom Lane
89dcff555f Release proclock immediately in RemoveFromWaitQueue() if it represents
no held locks.  This maintains the invariant that proclocks are present
only for procs that are holding or awaiting a lock; when this is not
true, LockRelease will fail.  Per report from Stephen Clouse.
2005-03-01 21:15:26 +00:00
Tom Lane
510f058932 Document that only a table's owner may TRUNCATE it. Per Keith Worthington. 2005-02-22 19:06:49 +00:00
Tom Lane
2df2c3dca2 Ensure that the resolved datatype of any unknown Param is propagated
into the sub-SELECT targetlist when it appears in the context
INSERT INTO foo SELECT $1 ...  Per report from Abhijit Menon-Sen.
2005-02-19 19:33:42 +00:00
Tom Lane
42e386f257 ALTER LANGUAGE RENAME has never worked. Per Sergey Yatskevich. 2005-02-14 06:18:09 +00:00
Tom Lane
6d28a8fee9 Back-patch fix for a typo that unintentionally disabled backward scans
for all SPI-created cursors.
2005-02-10 20:37:15 +00:00
Tom Lane
d60b1f5689 If we're gonna check for array overrun, we really should do so before
overrunning the array, not after.
2005-02-08 18:22:11 +00:00
Neil Conway
5c057d4b44 Prevent 4 more buffer overruns in the PL/PgSQL parser. This is just a
minimally-invasive fix for stable branches; a cleaner fix will be
committed to HEAD soon.
2005-02-07 03:55:28 +00:00
Tom Lane
3f8235ba24 Repair CLUSTER failure after ALTER TABLE SET WITHOUT OIDS. Turns out
there are corner cases involving dropping toasted columns in which the
previous coding would fail, too: the new version of the table might not
have any TOAST table, but we'd still propagate possibly-wide values of
dropped columns forward.
2005-02-06 20:19:42 +00:00
Tom Lane
5bb38455e6 Back-port heap_deformtuple() into 7.4 branch; needed for planned fix for
CLUSTER failure after ALTER TABLE SET WITHOUT OIDS.
2005-02-06 20:15:32 +00:00
Tom Lane
6508888ded Recommend security@postgresql.org as the contact point for security-related bugs. REL7_4_7 2005-01-30 21:32:10 +00:00
Tom Lane
9c1bb68356 Stamp release 7.4.7. 2005-01-30 19:32:22 +00:00
Tom Lane
f3610577bd We haven't had a fixed limit on rule recursion depth since 7.3 ...
but the documentation still said so.
2005-01-29 23:46:16 +00:00
Tom Lane
ae8db9a7ab Make sure contrib C functions are marked strict where needed.
Kris Jurka
2005-01-29 22:35:30 +00:00
Tom Lane
2fd184b8cf Check that aggregate creator has the right to execute the transition
functions of the aggregate, at both aggregate creation and execution times.
2005-01-27 23:43:16 +00:00
Tom Lane
b9fccbb71c Now that I look at it, int_array_enum() didn't work either. 2005-01-27 21:50:15 +00:00
Tom Lane
3393e65c6d Fix security and 64-bit issues in contrib/intagg. This code could
stand to be rewritten altogether, but for now just stick a finger in
the dike.
2005-01-27 21:35:56 +00:00
Tom Lane
03a7dd013e Back-patch 8.0 version of plperl_hash_from_tuple() into prior releases
to fix failure to cope with quote marks in field values; not to mention
that it is shorter and faster.  Per report from Charles Haron.
2005-01-26 17:09:21 +00:00
Neil Conway
db78e53fac Mark the text_soundex() function as "strict", to avoid crashing on NULL
input. Also, may as well mark it "cacheable" as well. From Kris Jurka.
2005-01-26 08:10:08 +00:00
Tom Lane
6508bf5254 Disallow LOAD to non-superusers. Per report from John Heasman. 2005-01-24 17:46:41 +00:00
Tom Lane
bb4b504d51 Fix memory leak in rtdosplit, per report from Clive Page. 2005-01-24 02:48:15 +00:00
Tom Lane
dddc2afb6e The result of a FULL or RIGHT join can't be assumed to be sorted by the
left input's sorting, because null rows may be inserted at various points.
Per report from Ferenc Lutischá¸n.
2005-01-23 02:23:30 +00:00
Neil Conway
3b01217d7d Prevent overrunning a heap-allocated buffer if more than 1024 parameters
to a refcursor declaration are specified. This is a minimally-invasive fix
for the buffer overrun -- a more thorough cleanup will be checked into
HEAD.
2005-01-21 00:31:21 +00:00
Kris Jurka
ce69fa9768 Fix mapping infinite timestamp values to arbitrary dates.
Report from Oliver Siegmar.
2005-01-13 14:22:23 +00:00
Tom Lane
0c8b52bf8b interval_out failed to mention 'ago' for negative intervals in SQL and
GERMAN datestyles.  Ancient bug reported by Terry Lee Tucker.
2005-01-11 18:34:01 +00:00
Tom Lane
715a73427e Avoid memory leakage during VACUUM FULL when an index expression or
index predicate uses temporary memory for evaluation.  Per example
from Jean-Gerard Pailloncy.
2004-12-23 22:42:32 +00:00