1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-26 23:43:30 +03:00
Commit Graph

5494 Commits

Author SHA1 Message Date
Tom Lane
76f13fe78d interval_out failed to mention 'ago' for negative intervals in SQL and
GERMAN datestyles.  Ancient bug reported by Terry Lee Tucker.
2005-01-11 18:34:29 +00:00
Tom Lane
e333705b84 array_map failed to insert correct result type in an empty array.
Per example from Florian Pflug.
2004-12-17 20:58:47 +00:00
Tom Lane
bd677bb443 Back-patch fix for ALTER DATABASE failing to flush pg_database changes
to disk right away.  This is just a one-liner change rather than trying
to use FlushRelationBuffers().
2004-11-18 01:19:57 +00:00
Tom Lane
eac07f1fd7 Fix off-by-one memory allocation, as reported by Rod Taylor. Also
avoid repalloc'ing twice when once is sufficient.
2004-11-17 19:54:53 +00:00
Tom Lane
78c0692b15 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.
2004-10-13 22:22:22 +00:00
Tom Lane
8a9b331c32 Fix breakage in hashjoin from recent backpatch of left-join bug fix.
(That's what I get for not testing the back branches *before* committing.)
2004-10-13 21:56:06 +00:00
Tom Lane
c57bcb7b2c 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.
2004-09-17 18:29:24 +00:00
Tom Lane
25ad99245a 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.
2004-08-11 04:08:40 +00:00
Peter Eisentraut
6122f38b0a Translation updates 2004-04-05 09:02:37 +00:00
Tom Lane
a60442a446 Avoid generating invalid character encoding sequences in make_greater_string.
Not sure how this mistake evaded detection for so long.
2004-02-02 03:07:25 +00:00
Joe Conway
b59917f02e Fix text_position to not scan past end of source string in multibyte
case, per report from Korea PostgreSQL Users' Group. Copied from Tom
Lane's 7.4 branch patch.
2004-02-01 04:05:13 +00:00
Tom Lane
1b25db6a3c 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.
2004-01-26 19:16:40 +00:00
Tom Lane
15ae5d26a0 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.
2004-01-14 03:39:36 +00:00
Joe Conway
c9eb119353 Repair indexed bytea like operations, and related selectivity
functionality. Per bug report by Alvar Freude:
http://archives.postgresql.org/pgsql-bugs/2003-12/msg00022.php
2003-12-07 04:11:26 +00:00
Tom Lane
8d802d4edf Force zero_damaged_pages to be effectively ON during recovery from WAL,
since there is no need to worry about damaged pages when we are going to
overwrite them anyway from the WAL.  Per recent discussion.
2003-12-01 16:53:42 +00:00
Tom Lane
6144601f42 Back-patch fix to check vartypmod when matching PlannerParamVar entries.
This should prevent some obscure cases of 'variable not in subplan target
lists', although actual failures have only been reported against 7.4 in
which the bug is much easier to trigger.
2003-11-30 22:24:16 +00:00
Tom Lane
a0547f6ea2 Back-patch fix to cause stats processes to detach from shared memory,
so that they do not prevent the postmaster from deleting the shmem segment
during crash recovery.
2003-11-30 21:56:36 +00:00
Joe Conway
8582f21afd Make PQescapeBytea and byteaout consistent with each other, and
octal escape all octets outside the range 0x20 to 0x7e. This fixes
the problem pointed out by Sergey Yatskevich here:
http://archives.postgresql.org/pgsql-bugs/2003-11/msg00140.php
2003-11-30 20:52:37 +00:00
Jan Wieck
d1c496e9d5 Fix for possible referential integrity violation when a qualified ON INSERT
rule split the query into one INSERT and one UPDATE where the UPDATE
then hit's the just created row without modifying the key fields again.
In this special case, the new key slipped in totally unchecked.

Jan
2003-10-31 03:57:42 +00:00
Tom Lane
98c7f157f2 It is possible for ResolveNew to be used to insert a sublink into a
subquery that didn't previously have one.  We have traditionally made
the caller of ResolveNew responsible for updating the hasSubLinks flag
of the outermost query, but this fails to account for hasSubLinks in
subqueries.  Fix ResolveNew to handle this.  We might later want to
change the calling convention of ResolveNew so that it can fix the
outer query too, simplifying callers.  But I went with the localized
fix for now.  Per bug report from J Smith, 20-Oct-03.
2003-10-20 20:02:30 +00:00
Tom Lane
f8ee74faeb When dumping CREATE INDEX, must show opclass name if the opclass isn't
in the schema search path.  Otherwise pg_dump doesn't correctly dump
scenarios where a custom opclass is created in 'public' and then used
by indexes in other schemas.
2003-10-02 22:25:08 +00:00
Tom Lane
57040f5069 _SPI_cursor_operation forgot to check for failure return from
_SPI_begin_call.  Per gripe from Tomasz Myrta.
2003-09-23 15:11:41 +00:00
Tom Lane
64b9dfa56f Back-patch the other part of Karel's formatting bug fix. 2003-09-03 19:01:35 +00:00
Tom Lane
e6d6713ceb Repair problems with to_char() overrunning its input string.
From Karel Zak.
2003-09-03 15:00:07 +00:00
Tatsuo Ishii
0fc3b22125 Fix GB18030 to UTF-8 mapping table 2003-08-24 05:13:40 +00:00
Tatsuo Ishii
1de44349f4 Fix bug in GB18030 conversion script 2003-08-24 05:00:45 +00:00
Tom Lane
efbc85c209 Conversion functions must be STRICT to prevent them from getting null inputs. 2003-08-08 15:49:10 +00:00
Tom Lane
1b637d7cbe Fix several places where fractional-second inputs were misprocessed
in HAVE_INT64_TIMESTAMP cases, including two potential stack smashes
when more than six fractional digits were supplied.  Per bug report
from Philipp Reisner.
2003-08-05 17:39:36 +00:00
Tom Lane
d1f35b73ac SSL_read/SSL_write do not approximate the return conventions of recv()
and send() very well at all; and in any case we can't use retval==0
for EOF due to race conditions.  Make the same fixes in the backend as
are required in libpq.
2003-08-04 17:58:25 +00:00
Tom Lane
a4ffca6bdf Fix longstanding error in _bt_search(): should moveright at top of loop not
bottom.  Otherwise we fail to moveright when the root page was split while
we were "in flight" to it.  This is not a significant problem when the root
is above the leaf level, but if the root was also a leaf (ie, a single-page
index just got split) we may return the wrong leaf page to the caller,
resulting in failure to find a key that is in fact present.  Bug has existed
at least since 7.1, probably forever.
2003-07-29 22:18:48 +00:00
Tom Lane
091b9c211c Fix timestamp_date for HAVE_INT64_TIMESTAMP case. 2003-07-24 04:38:27 +00:00
Tom Lane
fa67e2ce4f Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000. 2003-07-24 00:21:31 +00:00
Tom Lane
3abd1390ba wups, took out one memset too many ... 2003-07-22 19:13:25 +00:00
Tom Lane
3196738793 Back-patch fix for bugs in pgstat_initstats. 2003-07-22 19:00:36 +00:00
Tom Lane
004d2be5d9 Oh, for crying in a bucket ... relax Assert so that glibc's strxfrm
does not dump core.
2003-07-17 22:20:22 +00:00
Tom Lane
df32af15b6 Work around buggy strxfrm() present in some Solaris releases. 2003-07-17 20:52:42 +00:00
Tom Lane
19de9d2fee For COMMENT ON DATABASE where database name is unknown or not the current
database, emit a WARNING and do nothing, rather than raising ERROR.
Per recent discussion in which we concluded this is the best way to deal
with database dumps that are reloaded into a database of a new name.
2003-07-17 20:14:09 +00:00
Tom Lane
0a49e774b1 Repair boundary-case bug introduced by patch of two months ago that
fixed incorrect initial setting of StartUpID.  The logic in XLogWrite()
expects that Write->curridx is advanced to the next page as soon as
LogwrtResult points to the end of the current page, but StartupXLOG()
failed to make that happen when the old WAL ended exactly on a page
boundary.  Per trouble report from Hannu Krosing.
2003-07-17 16:45:25 +00:00
Tom Lane
537c1c1983 Fix a *second* buffer overrun bug in to_ascii(). Grumble. 2003-07-14 16:41:46 +00:00
Tom Lane
263b42f289 Don't generate 'zero' typeids in the output from gen_cross_product.
This is no longer necessary or appropriate since we don't use zero typeid
as a wildcard anymore, and it fixes a nasty performance problem with
functions with many parameters.  Per recent example from Reuven Lerner.
2003-06-25 20:07:54 +00:00
Tom Lane
5fbc1d4a45 Fix bugs in interval-to-time conversion: HAVE_INT64_TIMESTAMP case did not
work at all, and neither case behaved sanely for negative intervals.
2003-06-16 18:56:53 +00:00
Tom Lane
1e2d20910b Fix SQL function executor for case where last command of a function is
not a SELECT.  We didn't use to allow that, but we do now.
2003-06-12 17:29:37 +00:00
Tom Lane
f9e42d2522 Add defense in assign_session_authorization() against trying to do
catalog lookups when not in a transaction.  This prevents bizarre
failures if someone tries to set a value for session_authorization in
postgresql.conf.  Per report from Fernando Nasser.
2003-06-06 16:25:52 +00:00
Tom Lane
bab030b288 Repair sometimes-incorrect computation of StartUpID after a crash, per
example from Rao Kumar.  This is a very corner corner-case, requiring
a minimum of three closely-spaced database crashes and an unlucky
positioning of the second recovery's checkpoint record before you'd notice
any problem.  But the consequences are dire enough that it's a must-fix.
2003-05-22 14:39:49 +00:00
Tom Lane
3284e342a2 Back-patch Jan's fix to avoid primary key lookup (and lock) if foreign key
does not change on UPDATE.
2003-05-21 18:14:46 +00:00
Tom Lane
529ec66d53 Back-patch change to avoid O(N^2) behavior with lots of deferred triggers,
by making deferredTriggerInvokeEvents only scan events added since it last ran.
2003-05-19 17:23:54 +00:00
Tom Lane
3ffaf20461 Apply fixes for problems with dropped columns whose types have also been
dropped.  Add regression test, too.
2003-05-12 00:17:34 +00:00
Tom Lane
016e059fcf Adjust CreateCheckpoint so that buffer dumping activities and cleanup of
dead xlog segments are not considered part of a critical section.  It is
not necessary to force a database-wide panic if we get a failure in these
operations.  Per recent trouble reports.
2003-05-10 18:01:49 +00:00
Tom Lane
c04e80cf87 Allow 60 in seconds fields of timestamp, time, interval input values.
Per recent discussion on pgsql-general, this is appropriate for spec
compliance, and has the nice side-effect of easing porting from old
pg_dump files that exhibit the 59.999=>60.000 roundoff problem.
2003-05-04 04:30:35 +00:00
Tom Lane
f1b3af29c1 When a TIMESTAMP, TIME, or INTERVAL precision is specified larger than our
implementation limits, do not issue an ERROR; instead issue a NOTICE and use
the max supported value.  Per pgsql-general discussion of 28-Apr, this is
needed to allow easy porting from pre-7.3 releases where the limits were
higher.

Unrelated change in same area: accept GLOBAL TEMP/TEMPORARY as a synonym
for TEMPORARY, as per pgsql-hackers discussion of 15-Apr.  We previously
rejected it, but that was based on a misreading of the spec --- SQL92's
GLOBAL temp tables are really closer to what we have than their LOCAL ones.
2003-05-04 00:04:10 +00:00