Kris Jurka [Thu, 21 Oct 2004 19:13:55 +0000 (19:13 +0000)]
Correctly cast the return value of a CallableStatement when getShort
is called. getByte presents a can't happen situation as no function
can return a TINYINT because pg doesn't have an equivalent type.
Make this throw an exception if we get to this point.
Tom Lane [Wed, 13 Oct 2004 22:22:03 +0000 (22:22 +0000)]
Repair possible failure to update hint bits back to disk, per
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php.
I plan a more permanent fix in HEAD, but for the back branches it seems
best to just touch the places that actually have a problem.
Tom Lane [Fri, 1 Oct 2004 21:09:46 +0000 (21:09 +0000)]
Convert pg_stat_get_backend_idset to use the existing SRF support.
This seems the cleanest way of fixing its lack of a shutdown callback,
which was preventing it from working correctly in a query that didn't
run it to completion. Per bug report from Szima GÄbor.
Tom Lane [Sun, 26 Sep 2004 00:26:56 +0000 (00:26 +0000)]
Repair bug that would allow libpq to think a command had succeeded when
it really hadn't, due to double output of previous command's response.
Fix prevents recursive entry to libpq routines. Found by Jan Wieck.
Tom Lane [Fri, 17 Sep 2004 18:29:10 +0000 (18:29 +0000)]
Hashed LEFT JOIN would miss outer tuples with no inner match if the join
was large enough to be batched and the tuples fell into a batch where
there were no inner tuples at all. Thanks to Xiaoyu Wang for finding a
test case that exposed this long-standing bug.
Protected access to variable m_preparedCount via synchronized
function to prevent multiple threads using automatic cursors on
the same connection from stomping over each others cursor.
Originally Jan Wieck, re-reported by Jack Orenstein after
accidental removal.
ResultSet.moveToCurrentRow was checking the cached updateability flag
assuming it had been set instead of correctly calling the
isUpdateable() method which sets the flag if needed. This usually
worked because moveToCurrentRow is only useful after a
moveToInsertRow call which would set the flag, but this is not
required.
Tom Lane [Mon, 6 Sep 2004 18:23:09 +0000 (18:23 +0000)]
Back-patch fix to disallow BEGIN/COMMIT/ROLLBACK inside SQL functions.
Not sure why this isn't causing serious problems in some simple tests,
but it definitely isn't going to do anything desirable...
Tom Lane [Tue, 31 Aug 2004 23:16:36 +0000 (23:16 +0000)]
Repair 'expected both swapped tables to have TOAST tables' bug in 7.4
branch. I wasn't excited about doing this when the first report came in,
but now that we have two of 'em, I suppose it had better get fixed.
Tom Lane [Fri, 27 Aug 2004 17:47:56 +0000 (17:47 +0000)]
Make gistindex_keytest safe against NULL values. Same fix was already
made in passing for 8.0, but now that we have a bug report showing it's
needed, we should put it into 7.4 branch.
Tom Lane [Tue, 17 Aug 2004 23:16:07 +0000 (23:16 +0000)]
Fix bug introduced into _bt_getstackbuf() on 2003-Feb-21: the initial
value of 'start' could be past the end of the page, if the page was
split by some concurrent inserting process since we visited it. In
this situation the code could look at bogus entries and possibly find
a match (since after all those entries still contain what they had
before the split). This would lead to 'specified item offset is too large'
followed by 'PANIC: failed to add item to the page', as reported by Joe
Conway for scenarios involving heavy concurrent insertion activity.
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.