Kris Jurka [Tue, 3 Feb 2004 05:43:24 +0000 (05:43 +0000)]
V3 NotificationResonse messages were trying to be received as V2
messages. Also the PID was being read in the wrong byte order.
Finally add a test case for listen/notify.
Kris Jurka [Tue, 3 Feb 2004 05:28:17 +0000 (05:28 +0000)]
ConnectionPool and SimpleDataSource are marked Serializable, but their
superclass (which contains a number of state variables) is not. To
correctly serialize these objects we need to manually implement
writeObject and readObject.
Kris Jurka [Tue, 3 Feb 2004 05:25:38 +0000 (05:25 +0000)]
ResultSet.next() and previous() incremented or decremented the
internal current_row variable regardless of wether they succeeded or
not. This generated some ArrayIndexOutOfBoundsExceptions when the
errorneous adjustment current_row led to out of range values.
Kris Jurka [Tue, 3 Feb 2004 05:13:56 +0000 (05:13 +0000)]
Fix the setXXXStream methods. If passed a null InputStream, convert
this to a setNull call. The code originally would try to read the
whole stream in one call to read(), but this doesn't work. The
InputStream API makes it clear you must be prepared to loop and
continue reading if you didn't get the whole request on the first
try.
Neil Conway [Mon, 2 Feb 2004 01:00:58 +0000 (01:00 +0000)]
Use Tcl_PutEnv() in place of putenv() in libpgtcl, as the latter can
apparently corrupt the Tcl runtime. Per suggestion from Michael
Brusser <michael@synchronicity.com>
Tom Lane [Wed, 28 Jan 2004 07:47:07 +0000 (07:47 +0000)]
Fix oversight in check_ungrouped_columns optimization that avoids
unnecessary checks for complex grouping expressions: we cannot check
whether the expressions are simple Vars until after we apply
flatten_join_alias_vars, because in the case of FULL JOIN that routine
can introduce non-Var expressions. Per example from Joel Knight.
Tom Lane [Wed, 28 Jan 2004 00:05:25 +0000 (00:05 +0000)]
simplify_function() mustn't try to evaluate functions that return
composite types, because TupleTableSlots aren't Datums and can't be
stored in Const nodes. We can remove this restriction if we ever
adopt a cleaner runtime representation for whole-tuple results, but
at the moment it's broken. Per example from Thomas Hallgren.
Tom Lane [Tue, 27 Jan 2004 00:50:52 +0000 (00:50 +0000)]
Run stats test separately, not as part of a parallel group, to avoid
possible failures due to stats collector not updating fast enough under
heavy load. Per report from Jeremy Yoder.
Tom Lane [Mon, 26 Jan 2004 19:16:23 +0000 (19:16 +0000)]
Repair incorrect order of operations in GetNewTransactionId(). We must
complete ExtendCLOG() before advancing nextXid, so that if that routine
fails, the next incoming transaction will try it again. Per trouble
report from Christopher Kings-Lynne.
Tom Lane [Sat, 24 Jan 2004 00:37:42 +0000 (00:37 +0000)]
Repair planner failure for cases involving Cartesian products inside
IN (sub-SELECT) constructs. We must force a clauseless join of the
sub-select member relations, but it wasn't happening because the code
thought it would be able to use the join clause arising from the IN.
Tom Lane [Thu, 22 Jan 2004 02:23:35 +0000 (02:23 +0000)]
Fix oversight in optimization that avoids an unnecessary projection step
when scanning a table that we need all the columns from. In case of
SELECT INTO, we have to check that the hasoids flag matches the desired
output type, too. Per report from Mike Mascari.
Tom Lane [Sun, 18 Jan 2004 02:15:57 +0000 (02:15 +0000)]
Don't use %s-with-precision format spec to truncate data being displayed
in a COPY error message. It seems that glibc gets indigestion if it is
asked to truncate strings that contain invalid UTF-8 encoding sequences.
vsnprintf will return -1 in such cases, leading to looping and eventual
memory overflow in elog.c. Instead use our own, more robust pg_mbcliplen
routine. I believe this problem accounts for several recent reports of
unexpected 'out of memory' errors during COPY IN.
Tom Lane [Sun, 18 Jan 2004 00:31:53 +0000 (00:31 +0000)]
Repair faulty plan generation in cases where we choose to implement an
IN clause by mergejoin, and a type coercion is needed just above the subplan.
A more extensive patch will follow in HEAD.
Tom Lane [Wed, 14 Jan 2004 03:47:12 +0000 (03:47 +0000)]
pg_settings should have UPDATE privilege allowed to public.
(Can't force initdb for this in 7.4 branch, but we can at least see to it
that post-7.4.2 installations will get it right.)
Tom Lane [Wed, 14 Jan 2004 03:39:29 +0000 (03:39 +0000)]
Revert ill-starred change of 13-Feb-02: it appeared to fix a problem of
incorrect permissions checking, but in fact disabled most all permissions
checks for view updates. This corrects problems reported by Sergey
Yatskevich among others, at the cost of re-introducing the problem
previously reported by Tim Burgess. However, since we'd lived with that
problem for quite awhile without knowing it, we can live with it awhile
longer until a proper fix can be made in 7.5.
Tom Lane [Sat, 10 Jan 2004 00:30:39 +0000 (00:30 +0000)]
Fix subquery pullup logic to not be fooled when a view that appears
'simple' references another view that is not simple. Must recheck
conditions after performing recursive pullup. Per example from
Laurent Perez, 9-Jan-04.
Tom Lane [Thu, 8 Jan 2004 23:40:36 +0000 (23:40 +0000)]
Remove broken (and unnecessary) definition of operator <> for _int4
datatype; the generic array comparators added in 7.4 supersede this.
Per report and patch from Korea PostgreSQL Users' Group.
Tom Lane [Thu, 1 Jan 2004 19:27:28 +0000 (19:27 +0000)]
Do an explicit fflush after writing a progress message with puts.
This ensures stdout is kept in sync with messages on stderr.
Per report from Olaf Ferger.
Tom Lane [Tue, 30 Dec 2003 20:05:15 +0000 (20:05 +0000)]
Avoid running out of memory during hash_create, by not passing a
number-of-buckets that exceeds the size we actually plan to allow
the hash table to grow to. Per trouble report from Sean Shanny.
Tom Lane [Sat, 20 Dec 2003 18:46:02 +0000 (18:46 +0000)]
Dept. of third thoughts: in fact, libpq should support SCM_CREDS challenge
even when HAVE_GETPEEREID is defined, else it will be unable to connect to
pre-7.4 backends that are using IDENT authentication.
Tom Lane [Sat, 20 Dec 2003 18:25:02 +0000 (18:25 +0000)]
Fix broken IDENT support for FreeBSD (appears to have been broken by
ill-considered conditional logic in getpeereid patch of 3-Dec-2002).
Per bug #1021.
Bruce Momjian [Fri, 19 Dec 2003 23:29:29 +0000 (23:29 +0000)]
Supress ecpg thread test if configure didn't enable threads. Fix
tools/thread to run even if configure didn't enable threads because this
test is used before enabling threads for the OS.
Joe Conway [Fri, 19 Dec 2003 00:00:27 +0000 (00:00 +0000)]
Use a shutdown callback to ensure proper clean up when rescanning
partially-evaluated SRFs. Per report found here:
http://archives.postgresql.org/pgsql-general/2003-12/msg00851.php
Tom Lane [Thu, 18 Dec 2003 22:23:55 +0000 (22:23 +0000)]
Use a shutdown callback to clear setArgsValid in a FuncExprState that is
evaluating a set-valued function. This fixes some additional problems
with rescanning partially-evaluated SRFs.
Tom Lane [Thu, 18 Dec 2003 20:21:53 +0000 (20:21 +0000)]
Ensure set-returning functions in the targetlist of a plan node will be
shut down cleanly if the plan node is ReScanned before the SRFs are run
to completion. This fixes the problem for SQL-language functions, but
still need work on functions using the SRF_XXX() macros.
Peter Eisentraut [Thu, 18 Dec 2003 18:55:06 +0000 (18:55 +0000)]
Move Informix compatibility include files out of the way. compatlib.h
was integrated into ecpg_informix.h, the other ones go into their own
subdirectory that is automatically considered by the embedded preprocessor
when in Informix mode.
Tom Lane [Wed, 17 Dec 2003 22:11:42 +0000 (22:11 +0000)]
information_schema.constraint_column_usage and key_column_usage should
not discriminate against system columns, since we support constraints on
system columns, and in fact constraints on OID are moderately useful.
Tom Lane [Wed, 17 Dec 2003 19:49:52 +0000 (19:49 +0000)]
Reorder tests in parse_coerce so that ANY/ANYELEMENT/ANYARRAY coercion
does not affect UNKNOWN-type literals or Params. This fixes the recent
complaint about count('x') being broken, and improves consistency in
a few other respects too.
Tom Lane [Wed, 17 Dec 2003 17:08:06 +0000 (17:08 +0000)]
Repair planner failure when there are multiple IN clauses, each with
a join in its subselect. In this situation we *must* build a bushy
plan because there are no valid left-sided or right-sided join trees.
Accordingly, hoary sanity check needs an update. Per report from
Alessandro Depase.