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

17160 Commits

Author SHA1 Message Date
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
Tom Lane
39c9398956 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:55 +00:00
Tom Lane
b38bcb2fa0 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:04:08 +00:00
Michael Meskes
e0632407aa Fixed memory leak in ecpglib by adding some missing free() commands. 2005-06-02 12:50:30 +00:00
Teodor Sigaev
1891938e9c Prevent to divide by zero and range out of 0..1 2005-06-01 11:46:09 +00:00
Tom Lane
5205024b5a Add test to WAL replay to verify that xl_prev points back to the previous
WAL record; this is necessary to be sure we recognize stale WAL records
when a WAL page was only partially written during a system crash.
2005-05-31 19:10:57 +00:00
Tom Lane
3c6bba3072 expandRTE and get_rte_attribute_type mistakenly always imputed typmod -1
to columns of an RTE that was a function returning RECORD with a column
definition list.  Apparently no one has tried to use non-default typmod
with a function returning RECORD before.
2005-05-29 17:10:52 +00:00
Neil Conway
ab82f60119 Adjust datetime parsing to be more robust. We now pass the length of the
working buffer into ParseDateTime() and reject too-long input there,
rather than checking the length of the input string before calling
ParseDateTime(). The old method was bogus because ParseDateTime() can use
a variable amount of working space, depending on the content of the
input string (e.g. how many fields need to be NUL terminated). This fixes
a minor stack overrun -- I don't _think_ it's exploitable, although I
won't claim to be an expert.

Along the way, fix a bug reported by Mark Dilger: the working buffer
allocated by interval_in() was too short, which resulted in rejecting
some perfectly valid interval input values. I added a regression test for
this fix.
2005-05-26 02:14:32 +00:00
Peter Eisentraut
d1d5c0fe2e Translation updates 2005-05-25 08:32:14 +00:00
Tatsuo Ishii
05a07afd51 Fix previous patch to exprTypmod. 2005-05-25 02:13:48 +00:00
Tatsuo Ishii
de212f4910 Inserting 5 characters into char(10) does not produce 5 padding spaces
if they are two-byte multibyte characters. Same thing can be happen
if octet_length(multibyte_chars) == n where n is char(n).
Long standing bug since 7.3 days. Per report and fix from Yoshiyuki Asaba.
2005-05-24 23:15:05 +00:00
Tom Lane
0a7b3a3649 Previous fix for "x FULL JOIN y ON true" failed to handle the case
where there was also a WHERE-clause restriction that applied to the
join.  The check on restrictlist == NIL is really unnecessary anyway,
because select_mergejoin_clauses already checked for and complained
about any unmergejoinable join clauses.  So just take it out.
2005-05-24 18:03:24 +00:00
Tom Lane
88c59aeed8 Guard against duplicate IDs in input file in SortTocFromFile().
Per report from Brian Hackett.
2005-05-17 17:30:53 +00:00
Tom Lane
103376e075 Update release notes for upcoming re-releases. REL7_4_8 2005-05-09 00:10:22 +00:00
Tom Lane
775fec12c6 Update release checklist to reflect that HISTORY and INSTALL don't
need to be created by hand anymore.
2005-05-08 23:34:32 +00:00
Kris Jurka
43418e8702 In Blob.getBytes(long position, int length) position is an offset
starting at 1, not zero as the driver was previously doing.

Thanks to Emmanuel Bernard for the report.
2005-05-08 23:16:58 +00:00
Tom Lane
0053e290d9 Repair very-low-probability race condition between relation extension
and VACUUM: in the interval between adding a new page to the relation
and formatting it, it was possible for VACUUM to come along and decide
it should format the page too.  Though not harmful in itself, this would
cause data loss if a third transaction were able to insert tuples into
the vacuumed page before the original extender got control back.
2005-05-07 21:33:21 +00:00
Tom Lane
501ec7b64c Adjust time qual checking code so that we always check TransactionIdIsInProgress
before we check commit/abort status.  Formerly this was done in some paths
but not all, with the result that a transaction might be considered
committed for some purposes before it became committed for others.
Per example found by Jan Wieck.
2005-05-07 21:23:02 +00:00
Tom Lane
26f64e4c7a Stamp release 7.4.8. 2005-05-05 20:08:35 +00:00
Tom Lane
d9088d3071 Make standalone backends ignore pg_database.datallowconn, so that there
is a way to recover from disabling connections to all databases at once.
2005-05-05 19:53:49 +00:00