summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2005-06-11Fix bug in MIC -> EUC_JP conversion. Per Atsushi Ogawa.Tatsuo Ishii
2005-06-01patternsel() was improperly stripping RelabelType from the derivedTom Lane
expressions it constructed, causing scalarineqsel to become confused if the underlying variable was of a domain type. Per report from Kevin Grittner.
2005-05-26Adjust datetime parsing to be more robust. We now pass the length of theNeil Conway
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-07Adjust time qual checking code so that we always check TransactionIdIsInProgressTom Lane
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-05Make standalone backends ignore pg_database.datallowconn, so that thereTom Lane
is a way to recover from disabling connections to all databases at once.
2005-05-03Alter the signature for encoding conversion functions to declare theTom Lane
output area as INTERNAL not CSTRING. This is to prevent people from calling the functions by hand. This is a permanent solution for the back branches but I hope it is just a stopgap for HEAD.
2005-04-30Make record_out and record_send extract type information from the passedTom Lane
record object itself, rather than relying on a second OID argument to be correct. This patch just changes the function behavior and not the catalogs, so it's OK to back-patch to 8.0. Will remove the now-redundant second argument in pg_proc in a separate patch in HEAD only.
2005-04-30GCC 4.0 includes a new warning option, -Wformat-literal, that emitsNeil Conway
a warning when a variable is used as a format string for printf() and similar functions (if the variable is derived from untrusted data, it could include unexpected formatting sequences). This emits too many warnings to be enabled by default, but it does flag a few dubious constructs in the Postgres tree. This patch fixes up the obvious variants: functions that are passed a variable format string but no additional arguments. Most of these are harmless (e.g. the ruleutils stuff), but there is at least one actual bug here: if you create a trigger named "%sfoo", pg_dump will read uninitialized memory and fail to dump the trigger correctly.
2005-04-23Repair two TIME WITH TIME ZONE bugs found by Dennis Vshivkov. ComparisonTom Lane
of timetz values misbehaved in --enable-integer-datetime cases, and EXTRACT(EPOCH) subtracted the zone instead of adding it in all cases. Backpatch to all supported releases (except --enable-integer-datetime code does not exist in 7.2).
2005-04-20Fix mis-display of negative fractional seconds in interval values forTom Lane
--enable-integer-datetimes case. Per report from Oliver Siegmar.
2005-04-18record_in and record_recv must be careful to return a separatelyTom Lane
pfree'able result, since some callers expect to be able to pfree the result of a pass-by-reference function. Per report from Chris Trawick.
2005-04-11Fix interaction between materializing holdable cursors and firingTom Lane
deferred triggers: either one can create more work for the other, so we have to loop till it's all gone. Per example from andrew@supernews. Add a regression test to help spot trouble in this area in future.
2005-04-01Second try at making examine_variable and friends behave sanely inTom Lane
cases with binary-compatible relabeling. My first try was implicitly assuming that all operators scalarineqsel is used for have binary- compatible datatypes on both sides ... which is very wrong of course. Per report from Michael Fuhr.
2005-04-01Fix wrong week returnded by date_trunc('week') for early dates inBruce Momjian
January --- would return wrong year for 2005-01-01 and 2006-01-01. per report from Robert Creager. Backpatch to 8.0.X.
2005-03-26Fix a pair of related issues with estimation of inequalities that involveTom Lane
binary-compatible relabeling of one or both operands. examine_variable should avoid stripping RelabelType from non-variable expressions, so that they will continue to have the correct type; and convert_to_scalar should just use that type and ignore the other input type. This isn't perfect but it beats failing entirely. Per example from Michael Fuhr.
2005-03-26Prevent to_char(interval) from dumping core on month-related formatsTom Lane
when a zero-month interval is given. Per discussion with Karel. Also, some desultory const-labeling of constant tables. More could be done along that line.
2005-03-25Add missing min/max parameters to DefineCustomIntVariable() andTom Lane
DefineCustomRealVariable(). Thomas Hallgren
2005-03-25Fix to_date to behave reasonably when CC and YY fields are both used.Tom Lane
Karel Zak
2005-03-24array_map can't use the fn_extra field of the provided fcinfo struct asTom Lane
its private storage, because that belongs to the function that it is supposed to call. Per report from Ezequiel Tolnay.
2005-03-24Change Win32 O_SYNC method to O_DSYNC because that is what the methodBruce Momjian
currently does. This is now the default Win32 wal sync method because we perfer o_datasync to fsync. Also, change Win32 fsync to a new wal sync method called fsync_writethrough because that is the behavior of _commit, which is what is used for fsync on Win32. Backpatch to 8.0.X.
2005-03-21Fix quote_ident to use quote_identifier rather than its own, not quiteTom Lane
up-to-speed logic; in particular this will cause it to quote names that match keywords. Remove unnecessary multibyte cruft from quote_literal (all backend-internal encodings are 8-bit-safe).
2005-03-18Need to reset local buffer pin counts, not only shared buffer pins,Tom Lane
before we attempt any file deletions in ShutdownPostgres. Per Tatsuo.
2005-03-18Need to release buffer pins before attempting to drop files duringTom Lane
backend exit. Per report from Bruce.
2005-03-18Treat EPERM as a non-error case when checking to see if old postmasterTom Lane
is still alive. This improves our odds of not getting fooled by an unrelated process when checking a stale lock file. Other checks already in place, plus one newly added in checkDataDir(), ensure that we cannot attempt to usurp the place of a postmaster belonging to a different userid, so there is no need to error out. Add comments indicating the importance of these other checks.
2005-03-16Add missing include for new lc_ctype_is_c() function.Bruce Momjian
Per Neil.
2005-03-16Prevent locale-aware handling of upper, lower, and initcap when theBruce Momjian
locale is C. Backpatch to 8.0.X because some operating systems were throwing errors for such operations, rather than ignoring the locale when it was C.
2005-03-12Fix problem with infinite recursion between write_syslogger_file andTom Lane
elog if the former has trouble writing its file. Code review for Magnus' patch to redirect stderr to syslog on Windows (Bruce's version seems right, but did some minor prettification). Backpatch both changes to 8.0 branch.
2005-02-02Improve performance of fmgr.c calling routines for cases with more thanTom Lane
two arguments. Per suggestions from A. Ogawa.
2005-02-01Adjust estimate_num_groups() to not clamp per-relation group countTom Lane
estimate to less than the number of values estimated for any one grouping Var, as suggested by Manfred. This is intuitively right, and what's more it puts the plan choices in the subselect regression test back the way they were before ...
2005-02-01Sync inet formatting code with recent BIND releases. In particular,Tom Lane
fix bug with inconsistent selection of default mask length for "class D" addresses. Per report from Steve Atkins.
2005-01-28When dealing with multiple grouping columns coming from the same table,Tom Lane
clamp the estimated number of groups to table row count over 10, instead of table row count; this reflects a heuristic that people probably won't group over a near-unique set of columns, and the knowledge that we don't currently have any way to estimate the correlation of the columns better than guessing. This change creates a trivial plan change in one of the regression tests.
2005-01-26Close all cursors created during a failed subtransaction. This is neededTom Lane
to avoid problems when a cursor depends on objects created or changed in the same subtransaction. We'd like to do better someday, but this seems the only workable answer for 8.0.1.
2005-01-13get_names_for_var didn't do recursion for unnamed JOIN vars quite right;Tom Lane
got it wrong when the JOIN was in an outer query level. Per example from Laurie Burrow. Also fix same issue in markTargetListOrigin. I think the latter is only a latent bug since we currently don't apply markTargetListOrigin except at the outer level ... but should do it right anyway.
2005-01-13Remove unportable assumption that it's okay to use the target bufferTom Lane
of an sprintf() as a source string. Demonstrably does not work with recent gcc and/or glibc on some platforms.
2005-01-11interval_out failed to mention 'ago' for negative intervals in SQL andTom Lane
GERMAN datestyles. Ancient bug reported by Terry Lee Tucker.
2005-01-10Separate the functions of relcache entry flush and smgr cache entry flushTom Lane
so that we can get the size of a shared inval message back down to what it was in 7.4 (and simplify the logic too). Phase 2 of fixing the 'SMgrRelation hashtable corrupted' problem.
2005-01-10Phase 1 of fix for 'SMgrRelation hashtable corrupted' problem. ThisTom Lane
is the minimum required fix. I want to look next at taking advantage of it by simplifying the message semantics in the shared inval message queue, but that part can be held over for 8.1 if it turns out too ugly.
2005-01-09Undo an unadvertised change in the API of pg_atoi. In all previousTom Lane
releases, a nonzero 'c' argument meant that the input string could be terminated by either that character or \0. Recent refactoring broke that, causing the thing to scan for 'c' only. This went undetected because no part of the main code actually passes nonzero 'c'. However it broke tsearch2 and possibly other user-written code that assumed the old definition. Per report from Tom Hebbron.
2005-01-01Some more missed copyright notices. Many of these look like theyTom Lane
should have been caught by the src/tools/copyright script ... why weren't they?
2005-01-01Update copyrights that were missed.Bruce Momjian
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-12-26Fix func_ptr declaration for netbsd-mac68k, per Rémi Zara.Tom Lane
2004-12-20Add support for Latin9 encoding in to_ascii(). Jaime CasanovaTom Lane
2004-12-20Mark the TimeZone parameter as GUC_REPORT, so that JDBC can find outTom Lane
when it changes. Per request from Kris Jurka.
2004-12-17Make array_cat more paranoid about checking datatypes in empty arrays.Tom Lane
2004-12-17array_map failed to insert correct result type in an empty array.Tom Lane
Per example from Florian Pflug.
2004-12-13Avoid generating excess (and illegal) parentheses around an aliased JOINTom Lane
in prettyprint mode. Andreas Pflug
2004-12-12Upgrade formrdesc() so that it can correctly initialize the tupledescTom Lane
(rd_att) field of a nailed-in-cache relcache entry. This fixes the bug reported by Alvaro 8-Dec-2004; I believe it probably also explains Grant Finnemore's report of 10-Sep-2004. In an unrelated change in the same file, put back 7.4's response to failure to rename() the relcache init file, ie, unlink the useless temp file. I did not put back the warning message, since there might actually be some reason not to have that.
2004-12-11Instead of supposing (wrongly, in the general case) that the rowtypeTom Lane
of an inheritance child table is binary-compatible with the rowtype of its parent, invent an expression node type that does the conversion correctly. Fixes the new bug exhibited by Kris Shannon as well as a lot of old bugs that would only show up when using multiple inheritance or after altering the parent table.
2004-12-04Back out addition of Win1252 encoding.Bruce Momjian