Tom Lane [Wed, 11 Aug 2004 04:08:02 +0000 (04:08 +0000)]
Fix failure to guarantee that a checkpoint will write out pg_clog updates
for transaction commits that occurred just before the checkpoint. This is
an EXTREMELY serious bug --- kudos to Satoshi Okada for creating a
reproducible test case to prove its existence.
Joe Conway [Wed, 11 Aug 2004 01:02:08 +0000 (01:02 +0000)]
Hashed crosstab was dying with an SPI_finish error when the source SQL
produced no rows. Now it returns 0 rows instead. Adjusted regression
test for this case.
Tom Lane [Sat, 17 Jul 2004 17:28:47 +0000 (17:28 +0000)]
When renaming a column that participates in a foreign key, we must
force relcache rebuild for the other table as well as the column's
own table. Otherwise, already-cached foreign key triggers will stop
working. Per example from Alexander Pravking.
Tom Lane [Sat, 10 Jul 2004 18:39:44 +0000 (18:39 +0000)]
Test HAVING condition before computing targetlist of an Aggregate node.
This is required by SQL spec to avoid failures in cases like
SELECT sum(win)/sum(lose) FROM ... GROUP BY ... HAVING sum(lose) > 0;
AFAICT we have gotten this wrong since day one. Kudos to Holger Jakobs
for being the first to notice.
Michael Meskes [Sun, 27 Jun 2004 12:32:47 +0000 (12:32 +0000)]
- Only use typedefs inside their scope.
- Variables that are out of scope, were not removed all the time.
- Make a varchar NULL set everything to 0 when not using indicators.
Kris Jurka [Mon, 21 Jun 2004 03:12:01 +0000 (03:12 +0000)]
Fix some problems with result sets positioned before the start or
after the end of results. You could still call a number of methods
on them like getXXX, updateXXX, and updateRow().
Kris Jurka [Mon, 21 Jun 2004 02:01:12 +0000 (02:01 +0000)]
Fix updatable ResultSets stream methods (ascii, character, binary).
The existing code didn't correctly allocate data arrays, and it
failed to loop when a stream didn't provide the full amount of
data requested of it.
Kris Jurka [Wed, 16 Jun 2004 18:28:45 +0000 (18:28 +0000)]
Don't throw an Exception in locatorsUpdateCopy() even though the
ability to update LOBs is unimplemented. The 1.5 JDK's CachedRowSet
implementation calls this method regardless of whether large objects
are used or not.
Kris Jurka [Wed, 16 Jun 2004 03:36:56 +0000 (03:36 +0000)]
Fix DatabaseMetaData results for determining foreign key
relationships. Resulting columns from getImportedExportedKeys should
be FKTABLE_SCHEM and PKTABLE_SCHEM, not _SCHEMA.
Tom Lane [Mon, 31 May 2004 18:32:23 +0000 (18:32 +0000)]
I think I've finally identified the cause of the off-by-one-second
issue in timestamp conversion that we hacked around for so long by
ignoring the seconds field from localtime(). It's simple: you have
to watch out for platform-specific roundoff error when reducing a
possibly-fractional timestamp to integral time_t form. In particular
we should subtract off the already-determined fractional fsec field.
This should be enough to get an exact answer with int64 timestamps;
with float timestamps, throw in a rint() call just to be sure.
Tom Lane [Tue, 25 May 2004 19:11:26 +0000 (19:11 +0000)]
Fix erroneous error message printout when a configuration file contains
an overlength token. Printout was always garbage and could dump core
entirely :-(. Per report from Martin Pitt.
Tom Lane [Sat, 22 May 2004 21:58:41 +0000 (21:58 +0000)]
Reduce pg_listener lock taken by NOTIFY et al from AccessExclusiveLock
to ExclusiveLock. This still serializes the operations of this module,
but doesn't conflict with concurrent ANALYZE operations. Per trouble
report from Philip Warner a few weeks ago.
Kris Jurka [Mon, 17 May 2004 20:38:56 +0000 (20:38 +0000)]
Fix setting timestamp values with very early year values, like 2, by
formatting all years with four digits. Previously 0002-10-30 was
being sent as 2-10-30 which got turned into 2030-02-10.
Tom Lane [Fri, 14 May 2004 00:20:51 +0000 (00:20 +0000)]
Propagate enlargeStringInfo() fixes into the equivalent code in
pqexpbuffer.c. While a client-side failure doesn't seem like a
security issue, it's still a bug.
Tom Lane [Wed, 12 May 2004 22:39:00 +0000 (22:39 +0000)]
Tighten up overflow check in path_recv, pursuant to code review inspired
by Ken Ashcraft's report. I think there is no actual bug here since if
the int32 value does wrap a little bit, palloc will still reject it.
Still it's better that the code be obviously correct.
Tom Lane [Tue, 11 May 2004 02:21:55 +0000 (02:21 +0000)]
Repair recalculation failure for nested sub-SELECTs, per bug report from
Didier Moens. Bug is new in 7.4, and was caused by not updating everyplace
I should've when replacing locParam markers by allParam.
Tom Lane [Fri, 7 May 2004 03:20:01 +0000 (03:20 +0000)]
NATURAL CROSS JOIN is a contradiction in terms, not to mention disallowed
by the SQL spec and by our parser. Thanks to Jonathan Scott for finding
this longstanding error.
Tom Lane [Thu, 29 Apr 2004 19:56:35 +0000 (19:56 +0000)]
I thought we'd made initdb safe against newline-munging issues, but on
inspection we fixed only one of the two uses of COPY :-(. Fix the other.
This is already correct in CVS tip, but 7.4.3 could use the patch.
Tom Lane [Sun, 18 Apr 2004 18:13:31 +0000 (18:13 +0000)]
Tweak findTargetlistEntry so that bare names occurring in GROUP BY clauses
are sought first as local FROM columns, then as local SELECT-list aliases,
and finally as outer FROM columns; the former behavior made outer FROM
columns take precedence over aliases. This does not change spec
conformance because SQL99 allows only the first case anyway, and it seems
more useful and self-consistent. Per gripe from Dennis Bjorklund 2004-04-05.
Tom Lane [Tue, 6 Apr 2004 18:46:25 +0000 (18:46 +0000)]
Support FULL JOIN with no join clauses, such as X FULL JOIN Y ON TRUE.
That particular corner case is not exactly compelling, but given 7.4's
ability to discard redundant join clauses, it is possible for the situation
to arise from queries that are not so obviously silly. Per bug report
of 6-Apr-04.
Tom Lane [Tue, 6 Apr 2004 16:39:40 +0000 (16:39 +0000)]
ALTER SEQUENCE RESTART did the wrong thing if sequence last_value was
equal to the desired restart value (must clear is_called, did not).
Per bug report #1127 from Piotr Konieczny.
Bruce Momjian [Mon, 22 Mar 2004 03:57:19 +0000 (03:57 +0000)]
In working through a pg_autovacuum problem with Joe Conway (which turned
out to be the same problem reported by Cott Lang which the previous
patch resolved) a new bug was uncovered when running with a debug level
of greater than 1.
This patch resolves this new found bug and fixes some of the other
debugging output to be more consistent.
Tom Lane [Sat, 13 Mar 2004 00:54:35 +0000 (00:54 +0000)]
Repair memory leakage introduced into the non-hashed aggregate case by
7.4 rewrite for hashed aggregate support. If the transition data type
is pass-by-reference, the transValue must be pfreed when starting a new
group boundary, else we have a one-value-per-group leakage. Thanks to
Rae Steining for providing a reproducible test case.