Commit Graph

19938 Commits

Author SHA1 Message Date
Tom Lane
96fc1a4f77 Reject operator names >= NAMEDATALEN characters. These will not work
anyway, and in assert-enabled builds you are likely to get an assertion
failure.  Backpatch as far as 7.3; 7.2 seems not to have the problem.
2005-08-16 00:48:29 +00:00
Tom Lane
ab648632eb array_in() and array_recv() need to be more paranoid about validating
their OID parameter.  It was possible to crash the backend with
select array_in('{123}',0,0); because that would bypass the needed step
of initializing the workspace.  These seem to be the only two places
with a problem, though (record_in and record_recv don't have the issue,
and the other array functions aren't depending on user-supplied input).
Back-patch as far as 7.4; 7.3 does not have the bug.
2005-08-15 19:40:43 +00:00
Tom Lane
497f11845c int_array_enum function should be using fcinfo->flinfo->fn_extra for
working state, not fcinfo->context.  Silly oversight on my part in last
go-round of fixes.
2005-08-15 19:05:30 +00:00
Bruce Momjian
0c9f00506b This patch fixes the event type used to log output from the
stderr-in-service or output-from-syslogger-in-service code. Previously
everything was flagged as ERRORs there, which caused all instances to
log "LOG: logger shutting down" as error...

Please apply for 8.1. I'd also like it considered for 8.0 since logging
non-errors as errors can be cause for alarm amongst people who actually
look at their logs...

Magnus Hagander
2005-08-12 21:38:00 +00:00
Bruce Momjian
18b15c3946 [ backpatched to 8.0.X.]
> >> 3) I restarted the postmaster both times. I got this error
> both times.
> >> :25: ERROR:  could not load library "C:/Program
> >> Files/PostgreSQL/8.0/lib/testtrigfuncs.dll": dynamic load error
>
> > Yes. We really need to look at fixing that error message. I had
> > forgotten it completely :-(
>
> > Bruce, you think we can sneak that in after feature freeze? I would
> > call it a bugfix :-)
>
> Me too.  That's been on the radar for awhile --- please do
> send in a patch.

Here we go, that wasn't too hard :-)

Apart from adding the error handling, it does one more thing: it changes
the errormode when loading the DLLs. Previously if a DLL was broken, or
referenced other DLLs that couldn't be found, a popup dialog box would
appear on the screen. Which had to be clicked before the backend could
continue. This patch also disables the popup error message for DLL
loads.

I think this is something we should consider doing for the entire
backend - disable those popups, and say we deal with it ourselves. What
do you other win32 hackers thinnk about this?

In the meantime, this patch fixes the error msgs. Please apply for 8.1
and please consider a backpatch to 8.0.


Magnus Hagander
2005-08-12 21:23:18 +00:00
Bruce Momjian
66c2f44b85 Backpatch fseeko fix for seeking from end of file. 2005-08-12 00:29:22 +00:00
Bruce Momjian
18e615979e Backpatch new CVS home page URL. 2005-08-11 13:54:10 +00:00
Tom Lane
1c09a3c46d Fix crash when reading 'timezone = unknown' from postgresql.conf during
SIGHUP; it's not OK for an assign_hook to return a non-malloc'd string.
Problem was introduced during timezone library rewrite.
2005-08-08 23:39:14 +00:00
Tom Lane
4cf0feae2c Fix count_usable_fds() to stop trying to open files once it reaches
max_files_per_process.  Going further than that is just a waste of
cycles, and it seems that current Cygwin does not cope gracefully
with deliberately running the system out of FDs.  Per Andrew Dunstan.
2005-08-07 18:47:38 +00:00
Tom Lane
668448d6f0 rmtree() reported the wrong pathname if final rmdir failed. 2005-08-02 15:14:56 +00:00
Tom Lane
ae1d34f23a Back-port several small portability fixes to get contrib building
cleanly on AIX in the 8.0 branch.  Rocco Altier
2005-08-02 01:35:23 +00:00
Bruce Momjian
61dc3df71f Update AIX FAQ.
Chris Browne
2005-07-30 03:39:40 +00:00
Tom Lane
81f2d972a8 Back-patch fix for NOT-below-a-NOT case. 2005-07-29 21:40:26 +00:00
Neil Conway
f4bbe13491 Avoid crashing pg_dump if we can't connect to the database server, and
no database has been explicitly specified. Per gripe from Omar Kilani.
2005-07-27 05:15:03 +00:00
Tom Lane
4ee7e8213c Fix compare_fuzzy_path_costs() to behave a bit more sanely. The original
coding would ignore startup cost differences of less than 1% of the
estimated total cost; which was OK for normal planning but highly not OK
if a very small LIMIT was applied afterwards, so that startup cost becomes
the name of the game.  Instead, compare startup and total costs fuzzily
but independently.  This changes the plan selected for two queries in the
regression tests; adjust expected-output files for resulting changes in
row order.  Per reports from Dawid Kuroczko and Sam Mason.
2005-07-22 19:12:33 +00:00
Tom Lane
ea72596db5 It appears that Darwin (OS X) does not cope well with C functions that
have the same name as the containing shared library --- as best I can
tell, the compiler internally creates a function of that name, and does
not warn you about the conflict.  Fix buildfarm failure in back branches
by renaming tsearch() trigger function at the C level.
2005-07-18 21:37:23 +00:00
Tom Lane
2486a88b06 Back-patch fix for erroneous backslashing of LIKE pattern. 2005-07-18 19:18:19 +00:00
Tom Lane
183b1bf84f MemSet() must not cast its pointer argument to int32* until after it has
checked that the pointer is actually word-aligned.  Casting a non-aligned
pointer to int32* is technically illegal per the C spec, and some recent
versions of gcc actually generate bad code for the memset() when given
such a pointer.  Per report from Andrew Morrow.
2005-07-18 15:53:46 +00:00
Tom Lane
f6cb7198ed Make pg_regress accept a command-line option for the temporary installation's
port number, and use a default value for it that is dependent on the
configuration-time DEF_PGPORT.  Should make the world safe for running
parallel 'make check' in different branches.  Back-patch as far as 7.4
so that this actually is useful.
2005-07-17 18:29:13 +00:00
Tom Lane
091c97ff3b Back-patch recent changes to alter the order of -L flags inserted from
LDFLAGS versus those built into the Makefiles.  This looks like it will
fix several buildfarm failures in the back branches.
2005-07-17 04:05:49 +00:00
Tom Lane
123e25b3a3 Check for out-of-range varoattno in deparse_context_for_subplan.
I have seen this case in CVS tip due to new "physical tlist" optimization
for subqueries.  I believe it probably can't happen in existing releases,
but the check is not going to hurt anything, so backpatch to 8.0 just
in case.
2005-07-15 18:40:20 +00:00
Tom Lane
1e31942a33 Fix overenthusiastic optimization of 'x IN (SELECT DISTINCT ...)' and related
cases: we can't just consider whether the subquery's output is unique on its
own terms, we have to check whether the set of output columns we are going to
use will be unique.  Per complaint from Luca Pireddu and test case from
Michael Fuhr.
2005-07-15 17:09:50 +00:00
Tom Lane
35a0fc32f5 Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
2005-07-13 15:26:06 +00:00
Tom Lane
18e64f6c81 Fix config file lexer to not barf if postgresql.conf ends with a comment
that has no terminating newline.  Per report from maps.on at gmx.net.
2005-07-08 18:41:55 +00:00
Tom Lane
a646e4874a Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
2005-07-08 15:24:53 +00:00
Bruce Momjian
75aed9f0c2 Backpatch to 8.0.X openssl portability fixes to pgcrypto. 2005-07-04 14:42:39 +00:00
Bruce Momjian
0a056c3716 Fix date_trunct for December dates that are in the next year, e.g.:
SELECT date_trunc('week', '2002-12-31'::date);

Backpatch to 8.0.X.

Per report from Nick Johnson.
2005-07-04 14:12:45 +00:00
Tom Lane
bb630623a4 Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond. 2005-07-03 21:56:27 +00:00
Tom Lane
ddfbdd46d8 Modify pg_dump to assume that a check constraint is inherited if its
name matches the name of any parent-table constraint, without looking
at the constraint text.  This is a not-very-bulletproof workaround for
the problem exhibited by Berend Tober last month.  We really ought to
record constraint inheritance status in pg_constraint, but it's looking
like that may not get done for 8.1 --- and even if it does, we will
need this kluge for dumping from older servers.
2005-06-27 02:18:14 +00:00
Tom Lane
894889ecc4 Force a checkpoint before committing a CREATE DATABASE command. This
should fix the recent reports of "index is not a btree" failures,
as well as preventing a more obscure race condition involving changes
to a template database just after copying it with CREATE DATABASE.
2005-06-25 22:47:49 +00:00
Tom Lane
dfb30486d7 Fix ancient memory leak in index_create(): RelationInitIndexAccessInfo
was being called twice in normal operation, leading to a leak of one set
of relcache subsidiary info.  Per report from Jeff Gold.
2005-06-25 16:54:00 +00:00
Neil Conway
5ba26d48fc Correct some code in pg_restore when reading the header of a tar archive:
(1) The code doesn't initialize `sum', so the initial "does the checksum
    match?" test is wrong.

(2) The loop that is intended to check for a "null block" just checks
    the first byte of the tar block 512 times, rather than each of the
    512 bytes one time (!), which I'm guessing was the intent.

It was only through sheer luck that this worked in the first place.

Per Coverity static analysis performed by EnterpriseDB.
2005-06-22 02:02:09 +00:00
Neil Conway
5bcb851c92 Fix a potential backend crash during authentication when parsing a
malformed ident map file.  This was introduced by the linked list
rewrite in 8.0 -- mea maxima culpa.

Per Coverity static analysis performed by EnterpriseDB.
2005-06-21 01:23:25 +00:00
Tom Lane
7d32f099d7 exec_eval_datum leaks memory when dealing with ROW or REC values.
It never leaked memory before PG 8.0, so none of the callers are
expecting this.  Cleanest fix seems to be to make it allocate the needed
memory in estate->eval_econtext, where it will be cleaned up by
the next exec_eval_cleanup.  Per report from Bill Rugolsky.
2005-06-20 22:51:49 +00:00
Tom Lane
c541ca6403 plpgsql's exec_assign_value() freed the old value of a variable before
copying/converting the new value, which meant that it failed badly on
"var := var" if var is of pass-by-reference type.  Fix this and a similar
hazard in exec_move_row(); not sure that the latter can manifest before
8.0, but patch it all the way back anyway.  Per report from Dave Chapeskie.
2005-06-20 20:44:50 +00:00
Tom Lane
558ff41f27 When using C-string lookup keys in a dynahash.c hash table, use strncpy()
not memcpy() to copy the offered key into the hash table during HASH_ENTER.
This avoids possible core dump if the passed key is located very near the
end of memory.  Per report from Stefan Kaltenbrunner.
2005-06-18 20:51:44 +00:00
Bruce Momjian
9f64e10225 NetBSD uses "options" not "option". 2005-06-17 16:46:45 +00:00
Peter Eisentraut
7a91540202 Translation updates 2005-06-17 11:42:02 +00:00
Tom Lane
d9de1bb47a The random selection in function linear() could deliver a value equal to max
if geqo_rand() returns exactly 1.0, resulting in failure due to indexing
off the end of the pool array.  Also, since this is using inexact float math,
it seems wise to guard against roundoff error producing values slightly
outside the expected range.  Per report from bug@zedware.org.
2005-06-14 14:21:23 +00:00
Tatsuo Ishii
8bedb71888 Fix bug in MIC -> EUC_JP conversion. Per Atsushi Ogawa. 2005-06-11 02:46:16 +00:00
Tom Lane
887a7255d1 Repair error in description of nonblocking usage of PQgetCopyData().
Per Volkan Yazici.
2005-06-09 19:08:36 +00:00
Tom Lane
6bbd271a1e Use just NULL not NULL::TEXT --- the latter coding is unnecessary and
not schema-safe.  Per report from Jochem van Dieten.
2005-06-07 14:05:01 +00:00
Tom Lane
2f5b2558d3 Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP.  Per report from Guillaume Beaudoin.
2005-06-05 01:48:45 +00:00
Bruce Momjian
272f23c814 Update Chinese FAQ to fix XHTML format.
Weiping (Laser)
2005-06-04 03:33:25 +00:00
Bruce Momjian
1d03f3f027 Update Russian FAQ.
Viktor Vislobokov
2005-06-03 18:17:54 +00:00
Tom Lane
543bb05a8b Push enable/disable of notify and catchup interrupts all the way down
to just around the bare recv() call that gets a command from the client.
The former placement in PostgresMain was unsafe because the intermediate
processing layers (especially SSL) use facilities such as malloc that are
not necessarily re-entrant.  Per report from counterstorm.com.
2005-06-02 21:03:46 +00:00
Michael Meskes
53b4a1ce4b Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit hardware.
[One half already was committed with the last commit.]
2005-06-02 12:49:26 +00:00
Michael Meskes
d014a21624 Fixed memory leak in ecpglib by adding some missing free() commands. 2005-06-02 12:37:25 +00:00
Bruce Momjian
7b21f26ea7 Fix log_statement to properly recognize SELECT INTO and CREATE TABLE AS
and DDL statements.

Backpatch fix to 8.0.X.

Per report from Murthy Kambhampaty
2005-06-01 23:27:12 +00:00
Tom Lane
64f40008ec patternsel() was improperly stripping RelabelType from the derived
expressions it constructed, causing scalarineqsel to become confused
if the underlying variable was of a domain type.  Per report from
Kevin Grittner.
2005-06-01 17:05:25 +00:00