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

17179 Commits

Author SHA1 Message Date
Tom Lane
a025aa179c In a nestloop inner indexscan, it's OK to use pushed-down baserestrictinfo
clauses even if it's an outer join.  This is a corner case since such
clauses could only arise from weird OUTER JOIN ON conditions, but worth
fixing.  Per example from Ron at cheapcomplexdevices.com.
2005-12-06 16:59:22 +00:00
Tom Lane
8b20f8a51d Add regression test to see if the min/max values of int8 convert correctly. 2005-12-05 04:14:27 +00:00
Tom Lane
22868b9e39 Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.
Per example from Dirk Pirschel.
2005-12-03 20:17:00 +00:00
Tom Lane
22fff8b9f1 Check for overflow in strtol() while parsing datetime inputs.
Michael Fuhr.
2005-12-01 17:57:07 +00:00
Tom Lane
e03c5e2d5a Fix performance issue in exprTypmod(): for a COALESCE expression, it
recursed twice on its first argument, leading to exponential time spent
on a deep nest of COALESCEs ... such as a deeply nested FULL JOIN would
produce.  Per report from Matt Carter.
2005-11-18 23:08:43 +00:00
Bruce Momjian
48fabd257f Properly document return value of strpos(). 2005-11-16 03:56:52 +00:00
Tom Lane
63b2342072 When in transaction-aborted state, reject Bind message for portals containing
anything but transaction-exiting commands (ROLLBACK etc).  We already rejected
Parse and Execute in such cases, so there seems little point in allowing Bind.
This prevents at least an Assert failure, and probably worse things, since
there's a lot of infrastructure that doesn't work when not in a live
transaction.  We can also simplify the Bind logic a bit by rejecting messages
with a nonzero number of parameters, instead of the former kluge to silently
substitute NULL for each parameter.  Per bug #2033 from Joel Stevenson.
2005-11-10 00:31:59 +00:00
Tom Lane
74f224fad4 Fix longstanding race condition in transaction log management: there was a
very narrow window in which SimpleLruReadPage or SimpleLruWritePage could
think that I/O was needed when it wasn't (and indeed the buffer had already
been assigned to another page).  This would result in an Assert failure if
Asserts were enabled, and probably in silent data corruption if not.
Reported independently by Jim Nasby and Robert Creager.

I intend a more extensive fix when 8.2 development starts, but this is a
reasonably low-impact patch for the existing branches.
2005-11-03 00:23:50 +00:00
Tom Lane
fcd978c57d Fix longstanding bug that would sometimes let the planner generate a bad plan
for an outer join; symptom is bogus error "RIGHT JOIN is only supported with
merge-joinable join conditions".  Problem was that select_mergejoin_clauses
did its tests in the wrong order.  We need to force left join not right join
for a merge join when there are non-mergeable join clauses; but the test for
this only accounted for mergejoinability of the clause operator, and not
whether the left and right Vars were of the proper relations.  Per report
from Jean-Pierre Pelletier.
2005-10-25 20:30:45 +00:00
Tom Lane
01145f963f Prevent core dump in contrib version of autovacuum when a table has been
dropped.  Per report from daveg (not his patch, though).
2005-10-20 16:14:47 +00:00
Tom Lane
52e98f8415 Don't convert debug/notice/warning messages into errors just because
they occur inside error processing.  This is a back-port of a logic
change already present in 8.0.  Partial fix for bug#1976 --- doesn't
cure the wrong-encoding problem, but at least stops it from causing
unintended ERRORs.
2005-10-20 01:31:50 +00:00
Tom Lane
a4baf229a4 Pass a strdup'd ident string to openlog(), to ensure that reallocation
of GUC memory doesn't cause us to start emitting a bogus ident string.
Per report from Han Holl.  Also some trivial code cleanup in write_syslog.
2005-10-14 16:41:28 +00:00
Bruce Momjian
e257f28db0 [ Backpatch to 7.4.X.]
Also I fixed a bug in a bug fix I committed a few weeks ago. he check
for a varchar pointer was incomplete.

Michael Meskes
2005-10-14 01:50:58 +00:00
Tom Lane
5c05d165af Fix longstanding bug found by Atsushi Ogawa: _bt_check_unique would mark
the wrong buffer dirty when trying to kill a dead index entry that's on
a page after the one it started on.  No risk of data corruption, just
inefficiency, but still a bug.
2005-10-12 17:18:31 +00:00
Neil Conway
25a5b740cd Fix typo in sample pg_hba.conf; per IRC report from Bernhard Neuhauser. 2005-10-11 23:00:39 +00:00
Tom Lane
31d276d0ed COPY's test for read-only transaction was backward; it prohibited COPY TO
where it should prohibit COPY FROM.  Found by Alon Goldshuv.
REL7_4_9
2005-10-03 23:43:45 +00:00
Tom Lane
4082f5e34f Stamp release 7.4.9. 2005-10-03 17:14:24 +00:00
Tom Lane
fd366be49a Update release notes for pending back-branch releases. 2005-10-03 16:05:09 +00:00
Tom Lane
196c9d289e Repair planning bug introduced in 7.4: outer-join ON clauses that referenced
only the inner-side relation would be considered as potential equijoin clauses,
which is wrong because the condition doesn't necessarily hold above the point
of the outer join.  Per test case from Kevin Grittner (bug#1916).
2005-09-28 21:17:50 +00:00
Bruce Momjian
6a2c659b31 [ Patch to 7.4.X.]
In several places PL/Python was calling PyObject_Str() and then
PyString_AsString() without checking if the former had returned
NULL to indicate an error.  PyString_AsString() doesn't expect a
NULL argument, so passing one causes a segmentation fault.  This
patch adds checks for NULL and raises errors via PLy_elog(), which
prints details of the underlying Python exception.  The patch also
adds regression tests for these checks.  All tests pass on my
Solaris 9 box running HEAD and Python 2.4.1.
2005-09-25 03:18:16 +00:00
Teodor Sigaev
8fb4451a4d Update Snowball. I have to update it because of
old version doesn't available on Snowball's site and new version
of stemmers can't be compiled with old interface.
2005-09-15 12:41:52 +00:00
Neil Conway
e3523f52f7 Fix a mistake in the documentation for SPI_getbinval(), per Michael Fuhr. 2005-09-12 18:51:29 +00:00
Peter Eisentraut
752b861067 Translation update 2005-09-03 07:41:11 +00:00
Teodor Sigaev
d4235f9f18 Fix missing rows in query
update a=.. where a... with GiST index on column 'a'
Backpatch from 8.0 branch
2005-08-30 08:36:52 +00:00
Tom Lane
2ba0540024 Back-patch fixes for problems with VACUUM destroying t_ctid chains too soon,
and with insufficient paranoia in code that follows t_ctid links.
This patch covers the 7.4 branch.
2005-08-25 22:07:21 +00:00
Tom Lane
c9e69d71bd Back-patch fix to correctly quote schema names in --no-owner mode.
Per gripe from Dick Kniep.
2005-08-25 00:11:36 +00:00
Michael Meskes
d00f6b249a - Check for NULL before checking whether argument is an array.
- Removed stray character from string quoting.
	- Fixed check to report missing varchar pointer implementation.
2005-08-24 10:35:54 +00:00
Tom Lane
e2e2e15cf8 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:43 +00:00
Tom Lane
ec70ca7954 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:41:06 +00:00
Tom Lane
6f0da9545a 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:43 +00:00
Tom Lane
c98a606f4d 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:48:00 +00:00
Tom Lane
c76de7d85e 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:54:11 +00:00
Tom Lane
027b62384e 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:37 +00:00
Tom Lane
86494de248 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:06:04 +00:00
Tom Lane
6ec28d8503 ecpglib depends on last_path_separator from src/port/path.c, so we'd
better include that in the library build.  This was fixed in 8.0 and
later, backport to 7.4 to fix buildfarm failure.
2005-07-16 20:39:24 +00:00
Tom Lane
bf84d6e3bb Back-patch 8.0's tightening of ORDER BY clauses in join regression test,
in hopes of eliminating buildfarm regression failure.  (Not clear if we
will need a join_1.out variant in this branch.)
2005-07-16 20:20:49 +00:00
Tom Lane
dc59b47518 cube_1 variant is needed in 7.4 branch, per results from buildfarm
machine 'kudu'.
2005-07-16 20:11:12 +00:00
Tom Lane
d96e0462c7 The geometry_2 variant appears to be needed in 7.4 branch as well as
later, per results from buildfarm member 'wallaroo'.
2005-07-16 18:39:26 +00:00
Tom Lane
0a719d8935 Fix bogus "extern int errno;" in back branches, per Andrew Dunstan. 2005-07-16 15:23:29 +00:00
Tom Lane
ecafa828c3 Fix mis-backport of libpq memory leak fix. Per Michael Fuhr. 2005-07-14 14:07:41 +00:00
Tom Lane
57bdab7d35 Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
2005-07-13 15:26:16 +00:00
Tom Lane
a5d10d66d1 Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
2005-07-08 15:25:19 +00:00
Tom Lane
4677334ced 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:12 +00:00
Neil Conway
0592a1ebc1 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:12:19 +00:00
Tom Lane
a6f0dee775 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:57 +00:00
Tom Lane
41d28499a2 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:59 +00:00
Peter Eisentraut
2b6dd51a5f Translation updates 2005-06-17 11:30:57 +00:00
Tom Lane
a1f08fcf80 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:31 +00:00
Tatsuo Ishii
4f3ae012fd Fix bug in MIC -> EUC_JP conversion. Per Atsushi Ogawa. 2005-06-11 02:50:07 +00:00
Tom Lane
fe88b2043a Repair error in description of nonblocking usage of PQgetCopyData().
Per Volkan Yazici.
2005-06-09 19:08:47 +00:00