summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2006-01-17Repair problems with the result of lookup_rowtype_tupdesc() possibly beingTom Lane
discarded by cache flush while still in use. This is a minimal patch that just copies the tupdesc anywhere it could be needed across a flush. Applied to back branches only; Neil Conway is working on a better long-term solution for HEAD.
2006-01-15When using GCC on AMD64 and PPC, ECPGget_variable() takes a va_list *, notNeil Conway
a va_list. Christof Petig's previous patch made this change, but neglected to update ecpglib/descriptor.c, resulting in a compiler warning (and a likely runtime crash) on AMD64 and PPC.
2006-01-14Fix pg_ctl crash on "unregister" when a data directory is not specified.Peter Eisentraut
by Magnus Hagander
2006-01-12We neglected to apply domain constraints on UNKNOWN parameters toNeil Conway
prepared statements, per report from David Wheeler.
2006-01-12Repair "Halloween problem" in EvalPlanQual: a tuple that's been inserted byTom Lane
our own command (or more generally, xmin = our xact and cmin >= current command ID) should not be seen as good. Else we may try to update rows we already updated. This error was inserted last August while fixing the even bigger problem that the old coding wouldn't see *any* tuples inserted by our own transaction as good. Per report from Euler Taveira de Oliveira.
2006-01-10Fix pg_tzset() to ensure that 'lclmem' (the static variable holdingTom Lane
the localtime timezone data) is not overwritten until we know the data is good. tzload() is capable of failing after having begun modifying the struct it's pointed at, and in such cases the static data was left in a corrupt state. Bug does not exist pre-8.0 (since we didn't have this code then) nor post-8.0 (since we already changed the code to tzload into local variables initially). Per report from Nick Martens.
2006-01-10In PLy_function_build_args(), the code loops repeatedly, constructingNeil Conway
one argument at a time and then inserting the argument into a Python list via PyList_SetItem(). This "steals" the reference to the argument: that is, the reference to the new list member is now held by the Python list itself. This works fine, except if an elog occurs. This causes the function's PG_CATCH() block to be invoked, which decrements the reference counts on both the current argument and the list of arguments. If the elog happens to occur during the second or subsequent iteration of the loop, the reference count on the current argument will be decremented twice. The fix is simple: set the local pointer to the current argument to NULL immediately after adding it to the argument list. This ensures that the Py_XDECREF() in the PG_CATCH() block doesn't double-decrement.
2006-01-09Fix pg_dump to add the required OPERATOR() decoration to schema-qualifiedTom Lane
operator names. This is needed when dumping operator definitions that have COMMUTATOR (or similar) links to operators in other schemas. Apparently Daniel Whitter is the first person ever to try this :-(
2006-01-08Stop perl from hijacking stdio and other stuff on Windows.Andrew Dunstan
2006-01-07Add RelationOpenSmgr() calls to ensure rd_smgr is valid when we try toTom Lane
use it. While it normally has been opened earlier during btree index build, testing shows that it's possible for the link to be closed again if an sinval reset occurs while the index is being built.
2006-01-06Fix failure to apply domain constraints to a NULL constant that's added toTom Lane
an INSERT target list during rule rewriting. Per report from John Supplee.
2006-01-06Fix Windows-only postmaster code to reject a connection request and continue,Tom Lane
rather than elog(FATAL), when there is no more room in ShmemBackendArray. This is a security issue since too many connection requests arriving close together could cause the postmaster to shut down, resulting in denial of service. Reported by Yoshiyuki Asaba, fixed by Magnus Hagander.
2006-01-06Convert Assert checking for empty page into a regular test and elog.Tom Lane
The consequences of overwriting a non-empty page are bad enough that we should not omit this test in production builds.
2006-01-06Fix ReadBuffer() to correctly handle the case where it's trying to extendTom Lane
the relation but it finds a pre-existing valid buffer. The buffer does not correspond to any page known to the kernel, so we *must* do smgrextend to ensure that the space becomes allocated. The 7.x branches all do this correctly, but the corner case got lost somewhere during 8.0 bufmgr rewrites. (My fault no doubt :-( ... I think I assumed that such a buffer must be not-BM_VALID, which is not so.)
2006-01-05Stamp relesae 8.0.6.Bruce Momjian
2006-01-05Arrange to set the LC_XXX environment variables to match our locale setup.Tom Lane
Back-patch of previous fix in HEAD for plperl-vs-locale issue.
2006-01-03Fix incorrect treatment of RL_PROMPT_START_IGNORE/RL_PROMPT_END_IGNORE,Tom Lane
per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343616 via Martin Pitt.
2006-01-03Add checks to verify that a plpgsql function returning a rowtype is actuallyTom Lane
returning the rowtype it's supposed to return. Per reports from David Niblett and Michael Fuhr.
2006-01-01Remove DOS line endings ("\r\n") from several .po files. DOS line endingsNeil Conway
are inconsistent with the rest of the .po files, and apparently cause problems for Sun's cc. Per report on IRC from "bitvector2".
2005-12-29Index: src/pl/plpython/plpython.cNeil Conway
=================================================================== RCS file: /Users/neilc/postgres/cvs_root/pgsql/src/pl/plpython/plpython.c,v retrieving revision 1.67 diff -c -r1.67 plpython.c *** src/pl/plpython/plpython.c 26 Dec 2005 04:28:48 -0000 1.67 --- src/pl/plpython/plpython.c 29 Dec 2005 16:54:57 -0000 *************** *** 2,8 **** * plpython.c - python as a procedural language for PostgreSQL * * This software is copyright by Andrew Bosma ! * but is really shameless cribbed from pltcl.c by Jan Weick, and * plperl.c by Mark Hollomon. * * The author hereby grants permission to use, copy, modify, --- 2,8 ---- * plpython.c - python as a procedural language for PostgreSQL * * This software is copyright by Andrew Bosma ! * but is really shamelessly cribbed from pltcl.c by Jan Wieck, and * plperl.c by Mark Hollomon. * * The author hereby grants permission to use, copy, modify, *************** *** 1996,2002 **** int i, rv; PLyPlanObject *plan; - char *nulls; MemoryContext oldcontext; if (list != NULL) --- 1996,2001 ---- *************** *** 2018,2024 **** if (nargs != plan->nargs) { char *sv; - PyObject *so = PyObject_Str(list); if (!so) --- 2017,2022 ---- *************** *** 2036,2048 **** oldcontext = CurrentMemoryContext; PG_TRY(); { ! nulls = palloc(nargs * sizeof(char)); for (i = 0; i < nargs; i++) { PyObject *elem, *so; - char *sv; elem = PySequence_GetItem(list, i); if (elem != Py_None) --- 2034,2045 ---- oldcontext = CurrentMemoryContext; PG_TRY(); { ! char *nulls = palloc(nargs * sizeof(char)); for (i = 0; i < nargs; i++) { PyObject *elem, *so; elem = PySequence_GetItem(list, i); if (elem != Py_None) *************** *** 2051,2070 **** if (!so) PLy_elog(ERROR, "function \"%s\" could not execute plan", PLy_procedure_name(PLy_curr_procedure)); ! sv = PyString_AsString(so); ! /* ! * FIXME -- if this elogs, we have Python reference leak ! */ ! plan->values[i] = ! FunctionCall3(&(plan->args[i].out.d.typfunc), ! CStringGetDatum(sv), ! ObjectIdGetDatum(plan->args[i].out.d.typioparam), ! Int32GetDatum(-1)); ! Py_DECREF(so); ! Py_DECREF(elem); nulls[i] = ' '; } else --- 2048,2073 ---- if (!so) PLy_elog(ERROR, "function \"%s\" could not execute plan", PLy_procedure_name(PLy_curr_procedure)); ! Py_DECREF(elem); ! PG_TRY(); ! { ! char *sv = PyString_AsString(so); ! plan->values[i] = ! FunctionCall3(&(plan->args[i].out.d.typfunc), ! CStringGetDatum(sv), ! ObjectIdGetDatum(plan->args[i].out.d.typioparam), ! Int32GetDatum(-1)); ! } ! PG_CATCH(); ! { ! Py_DECREF(so); ! PG_RE_THROW(); ! } ! PG_END_TRY(); + Py_DECREF(so); nulls[i] = ' '; } else
2005-12-24Fix long standing Asian multibyte charsets bug.Tatsuo Ishii
See: Subject: [HACKERS] bugs with certain Asian multibyte charsets From: Tatsuo Ishii <ishii@sraoss.co.jp> To: pgsql-hackers@postgresql.org Date: Sat, 24 Dec 2005 18:25:33 +0900 (JST) for more details.
2005-12-23Fix make_relative_path() to support cases where target_path and bin_pathTom Lane
differ by more than the last directory component. Instead of insisting that they match up to the last component, accept whatever common prefix they have, and try to replace the non-matching part of bin_path with the non-matching part of target_path in the actual executable's path. In one way this is tighter than the old code, because it insists on a match to the part of bin_path we want to substitute for, rather than blindly stripping one directory component from the executable's path. Per gripe from Martin Pitt and subsequent discussion.
2005-12-22Adjust string comparison so that only bitwise-equal strings are consideredTom Lane
equal: if strcoll claims two strings are equal, check it with strcmp, and sort according to strcmp if not identical. This fixes inconsistent behavior under glibc's hu_HU locale, and probably under some other locales as well. Also, take advantage of the now-well-defined behavior to speed up texteq, textne, bpchareq, bpcharne: they may as well just do a bitwise comparison and not bother with strcoll at all. NOTE: affected databases may need to REINDEX indexes on text columns to be sure they are self-consistent.
2005-12-14Defend against crash while processing Describe Statement or Describe PortalTom Lane
messages, when client attempts to execute these outside a transaction (start one) or in a failed transaction (reject message, except for COMMIT/ROLLBACK statements which we can handle). Per report from Francisco Figueiredo Jr.
2005-12-14Fix a *different* problem with whole-row Vars afflicting 8.0 branch.Tom Lane
This is a back-port of a fix made to markTargetListOrigin() on 2005-04-25.
2005-12-09Translation updatesREL8_0_5Peter Eisentraut
2005-12-09Stamp 8.0.5.Tom Lane
2005-12-08Fix bgwriter's failure to release buffer pins and open files after anTom Lane
error. This probably explains bug #2099 and could also account for mysterious VACUUM hangups.
2005-12-06In a nestloop inner indexscan, it's OK to use pushed-down baserestrictinfoTom Lane
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-05Add regression test to see if the min/max values of int8 convert correctly.Tom Lane
2005-12-03Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.Tom Lane
Per example from Dirk Pirschel.
2005-12-01Retry in FileRead and FileWrite if Windows returns ERROR_NO_SYSTEM_RESOURCES.Tom Lane
Also add a retry for Unixen returning EINTR, which hasn't been reported as an issue but at least theoretically could be. Patch by Qingqing Zhou, some minor adjustments by me.
2005-12-01Check for overflow in strtol() while parsing datetime inputs.Tom Lane
Michael Fuhr.
2005-11-30Rearrange code in pg_atoi() to avoid assuming that isspace() cannotTom Lane
change errno. No reported bugs here, but why take a chance?
2005-11-30- Made several variables "const char *" instead of "char *" as proposed by ↵Michael Meskes
Qingqing Zhou <zhouqq@cs.toronto.edu>. - Replaced all strdup() calls by ECPGstrdup().
2005-11-18Fix performance issue in exprTypmod(): for a COALESCE expression, itTom Lane
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-16Update error message and documentation for fsync test.Bruce Momjian
2005-11-16Update test_fsync to honor -f.Bruce Momjian
Backpatch to 8.0.X.
2005-11-13Force the second argument of SUBSTRING(foo FOR bar) to be int4, to avoidTom Lane
surprising results when it's some other numeric type. This doesn't solve the generic problem of surprising implicit casts to text, but it's a low-impact way of making sure this particular case behaves sanely. Per gripe from Harald Fuchs and subsequent discussion.
2005-11-10When in transaction-aborted state, reject Bind message for portals containingTom Lane
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-09Fix misspelling of 'listen_addresses', per Devrim.Tom Lane
2005-11-05Repair an error introduced by log_line_prefix patch: it is not acceptableTom Lane
to assume that the string pointer passed to set_ps_display is good forever. There's no need to anyway since ps_status.c itself saves the string, and we already had an API (get_ps_display) to return it. I believe this explains Jim Nasby's report of intermittent crashes in elog.c when %i format code is in use in log_line_prefix. While at it, repair a previously unnoticed problem: on some platforms such as Darwin, the string returned by get_ps_display was blank-padded to the maximum length, meaning that lock.c's attempt to append " waiting" to it never worked.
2005-11-04Ensure that we only create one ConsoleCtrlHandler per psql process,Tom Lane
so as to avoid performance issues and possible ultimate crash on long psql scripts. Per Merlin Moncure.
2005-11-03Fix longstanding race condition in transaction log management: there was aTom Lane
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-01Provide a --no-locale option for pg_regress and a corresponding NOLOCALE=1Andrew Dunstan
setting for the regression makefile, allowing Windows users to force locale settings since Windows does not get its locale from the environment. Per Petr Jelinek.
2005-10-26Properly update the 'group' flatfile when modifying the user, in caseBruce Momjian
they were added to a group. Also fix visibility of our own changes when creating the group file. This fixes: test=> CREATE GROUP g1; CREATE GROUP test=> CREATE USER u1 IN GROUP g1; CREATE USER test=> \! cat /u/pg/data/global/pg_group "g1" "u1" test=> CREATE USER u2 IN GROUP g1; CREATE USER test=> \! cat /u/pg/data/global/pg_group "g1" "u1" "u2" test=> ALTER USER u2 RENAME TO u3; ALTER USER test=> \! cat /u/pg/data/global/pg_group "g1" "u1" "u3" [ this code does not exist in CVS head.] Per report from Dennis Vshivkov
2005-10-25Fix longstanding bug that would sometimes let the planner generate a bad planTom Lane
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-20Postpone pg_timezone_initialize() until after creation of postmaster.pid,Tom Lane
since it can take a fair amount of time and this can confuse boot scripts that expect postmaster.pid to appear quickly. Move initialization of SSL library and preloaded libraries to after that point, too, just for luck. Per reports from Tony Caduto and others.
2005-10-19Back-patch fix for proper labeling of whole-row Datums generated fromTom Lane
subquery results.
2005-10-14Pass a strdup'd ident string to openlog(), to ensure that reallocationTom Lane
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.