1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00
Commit Graph

6241 Commits

Author SHA1 Message Date
Tom Lane
da736b79e7 Suppress compile warnings on machines where the INT64CONST() decoration
is actually needed.  Backport of Oliver Elphick's recent patch.
2004-06-13 17:17:49 +00:00
Peter Eisentraut
b43b461396 Translation updates 2004-06-10 22:43:28 +00:00
Peter Eisentraut
bf61bdc124 Translation updates 2004-06-10 17:23:12 +00:00
Peter Eisentraut
90ecc9ffda Translation update 2004-06-10 17:19:47 +00:00
Tom Lane
112403ba71 Add missing check for too-few-inputs when replacing a zero-dimensional
array.
2004-06-08 20:28:29 +00:00
Tom Lane
a757fd70e5 I think I've finally identified the cause of the off-by-one-second
issue in timestamp conversion that we hacked around for so long by
ignoring the seconds field from localtime().  It's simple: you have
to watch out for platform-specific roundoff error when reducing a
possibly-fractional timestamp to integral time_t form.  In particular
we should subtract off the already-determined fractional fsec field.
This should be enough to get an exact answer with int64 timestamps;
with float timestamps, throw in a rint() call just to be sure.
2004-05-31 18:32:23 +00:00
Peter Eisentraut
54427e9a1b Translation update 2004-05-29 06:22:33 +00:00
Tom Lane
360dcb1341 Fix erroneous error message printout when a configuration file contains
an overlength token.  Printout was always garbage and could dump core
entirely :-(.  Per report from Martin Pitt.
2004-05-25 19:11:26 +00:00
Tom Lane
05ce2d738f Reduce pg_listener lock taken by NOTIFY et al from AccessExclusiveLock
to ExclusiveLock.  This still serializes the operations of this module,
but doesn't conflict with concurrent ANALYZE operations.  Per trouble
report from Philip Warner a few weeks ago.
2004-05-22 21:58:41 +00:00
Tom Lane
65924e6cc6 Tighten up overflow check in path_recv, pursuant to code review inspired
by Ken Ashcraft's report.  I think there is no actual bug here since if
the int32 value does wrap a little bit, palloc will still reject it.
Still it's better that the code be obviously correct.
2004-05-12 22:39:00 +00:00
Tom Lane
5e027b19cd Add tests to enlargeStringInfo() to avoid possible buffer-overrun or
infinite-loop problems if a bogus data length is passed.
2004-05-11 20:07:38 +00:00
Tom Lane
b8de9b216f Fix oversights in processing of LIMIT expressions during planning. 2004-05-11 13:15:23 +00:00
Tom Lane
40ac7eddd9 Repair recalculation failure for nested sub-SELECTs, per bug report from
Didier Moens.  Bug is new in 7.4, and was caused by not updating everyplace
I should've when replacing locParam markers by allParam.
2004-05-11 02:21:55 +00:00
Tom Lane
8d86b89ec0 NATURAL CROSS JOIN is a contradiction in terms, not to mention disallowed
by the SQL spec and by our parser.  Thanks to Jonathan Scott for finding
this longstanding error.
2004-05-07 03:20:01 +00:00
Tom Lane
69f5e41be3 Don't assume that struct timeval's tv_sec field is the same datatype as
time_t; on some platforms they are not the same width.  Per Manfred Koizar.
2004-05-05 17:28:57 +00:00
Tom Lane
14684ca28f Ensure getaddrinfo_all returns null result on failure. 2004-04-24 20:10:47 +00:00
Tom Lane
9086c46f22 Tweak findTargetlistEntry so that bare names occurring in GROUP BY clauses
are sought first as local FROM columns, then as local SELECT-list aliases,
and finally as outer FROM columns; the former behavior made outer FROM
columns take precedence over aliases.  This does not change spec
conformance because SQL99 allows only the first case anyway, and it seems
more useful and self-consistent.  Per gripe from Dennis Bjorklund 2004-04-05.
2004-04-18 18:13:31 +00:00
Tom Lane
d9bbf47aaa Still another place to make the world safe for zero-column tables.
Per example from Jiang Wei.
2004-04-07 18:46:20 +00:00
Tom Lane
2fde466135 Support FULL JOIN with no join clauses, such as X FULL JOIN Y ON TRUE.
That particular corner case is not exactly compelling, but given 7.4's
ability to discard redundant join clauses, it is possible for the situation
to arise from queries that are not so obviously silly.  Per bug report
of 6-Apr-04.
2004-04-06 18:46:25 +00:00
Tom Lane
79d48449d7 ALTER SEQUENCE RESTART did the wrong thing if sequence last_value was
equal to the desired restart value (must clear is_called, did not).
Per bug report #1127 from Piotr Konieczny.
2004-04-06 16:39:40 +00:00
Tom Lane
695c241e5a Repair memory leakage introduced into the non-hashed aggregate case by
7.4 rewrite for hashed aggregate support.  If the transition data type
is pass-by-reference, the transValue must be pfreed when starting a new
group boundary, else we have a one-value-per-group leakage.  Thanks to
Rae Steining for providing a reproducible test case.
2004-03-13 00:54:35 +00:00
Bruce Momjian
4a6bf72c65 Fix log_executor_stats for non-multi queries. Backpatch to 7.4.X. 2004-03-05 00:21:51 +00:00
Tom Lane
819bfac66a Junkfilter logic to force a projection step during SELECT INTO was too
simplistic; it recognized SELECT * FROM but not SELECT * FROM LIMIT.
Per bug report from Jeff Bohmer.
2004-03-02 18:56:28 +00:00
Tom Lane
f91bde3fb6 make_sort_from_pathkeys()'s method for choosing which of several
equivalent sort expressions to use was broken: you can't just look
at the relation membership, you have to actually grovel over the
individual Vars in each expression.  I think this did work when it
was written, but it was broken by subsequent optimizations that made
join relations not propagate every single input variable upward.
Must find the Var that got propagated, not choose one at random.
Per bug report from Daniel O'Neill.
2004-02-29 17:36:48 +00:00
Tom Lane
5cfb44a82e genericcostestimate() neglected to include qual startup cost in
indexTotalCost.  I think this may not make any real difference in 7.4,
but it definitely is a problem with CVS tip's new equation.
2004-02-27 21:44:44 +00:00
Tom Lane
36be19e3ed process_implied_equality must copy the substructure of the clauses it
is generating, to avoid problems when subselects are involved.  Per
report from Damon Hart.
2004-02-27 21:42:10 +00:00
Tom Lane
6b534f3c33 Replace opendir/closedir calls throughout the backend with AllocateDir
and FreeDir routines modeled on the existing AllocateFile/FreeFile.
Like the latter, these routines will avoid failing on EMFILE/ENFILE
conditions whenever possible, and will prevent leakage of directory
descriptors if an elog() occurs while one is open.
Also, reduce PANIC to ERROR in MoveOfflineLogs() --- this is not
critical code and there is no reason to force a DB restart on failure.
All per recent trouble report from Olivier Hubaut.
2004-02-23 23:03:43 +00:00
Tom Lane
95a6dbf12b Do a direct probe during postmaster startup to determine the maximum
number of openable files and the number already opened.  This eliminates
depending on sysconf(_SC_OPEN_MAX), and allows much saner behavior on
platforms where open-file slots are used up by semaphores.
2004-02-23 20:46:16 +00:00
Tom Lane
8c99671a3b Implement a solution to the 'Turkish locale downcases I incorrectly'
problem, per previous discussion.  Make some additional changes to
centralize the knowledge of just how identifier downcasing is done,
in hopes of simplifying any future tweaking in this area.
2004-02-21 00:35:13 +00:00
Tom Lane
0d4c8f26ae Repair optimization bug I introduced in a moment of brain fade back in
Nov 2002: when constant-expression simplification removes all the
aggregate function calls from a query, that doesn't mean we can act as
though there never were any aggregates.  Per bug report from Gabor Szucs.
2004-02-13 22:26:43 +00:00
Peter Eisentraut
f8cdde14da Translation updates 2004-02-12 19:17:41 +00:00
Tom Lane
2194ed88de Ensure that memcmp() does not run off the end of memory, per Kurt Roeckx.
(Same patch committed to HEAD but I fat-fingered the commit message...)
2004-02-03 17:56:04 +00:00
Tom Lane
a8fcb748e3 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:14 +00:00
Tom Lane
871e56709d Fix text_position to not scan past end of source string in multibyte
case, per report from Korea PostgreSQL Users' Group.
2004-01-31 00:45:34 +00:00
Tom Lane
fd950e878c 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.
2004-01-28 07:47:07 +00:00
Tom Lane
9f017115f5 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.
2004-01-28 00:05:25 +00:00
Tom Lane
a51d4b8dc0 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:23 +00:00
Tom Lane
67a1bf1bb1 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.
2004-01-24 00:37:42 +00:00
Tom Lane
94db74f370 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.
2004-01-22 02:23:35 +00:00
Tom Lane
ab65429adf Back-patch repairs for --disable-shared support. 2004-01-21 19:25:11 +00:00
Peter Eisentraut
0054f82c62 Fix typo. 2004-01-19 14:28:06 +00:00
Tom Lane
ab189aaad9 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.
2004-01-18 02:15:57 +00:00
Tom Lane
9933ba3f67 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.
2004-01-18 00:31:53 +00:00
Tom Lane
f07c69ae57 The no-updates-to-system-catalogs-unless-usecatupd restriction should
not apply to system views.  It never mattered before 7.4, but it does now.
2004-01-14 03:45:02 +00:00
Tom Lane
c2d9ae899d 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:29 +00:00
Peter Eisentraut
00e734116c Fix format string error. 2004-01-13 22:43:25 +00:00
Tom Lane
6119c7740a 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.
2004-01-10 00:30:39 +00:00
Peter Eisentraut
6a78eecf6f Translation updates 2004-01-07 17:44:07 +00:00
Tom Lane
71caa53674 Fix discrepancy in prototypes for HPUX pg_dlerror. 2004-01-04 04:06:45 +00:00
Tom Lane
7302130179 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.
2003-12-30 20:05:15 +00:00