1. 10 3月, 2010 2 次提交
  2. 09 3月, 2010 2 次提交
  3. 08 3月, 2010 4 次提交
  4. 06 3月, 2010 1 次提交
    • T
      When reading pg_hba.conf and similar files, do not treat @file as an inclusion · 0c814238
      Tom Lane 提交于
      unless (1) the @ isn't quoted and (2) the filename isn't empty.  This guards
      against unexpectedly treating usernames or other strings in "flat files"
      as inclusion requests, as seen in a recent trouble report from Ed L.
      The empty-filename case would be guaranteed to misbehave anyway, because our
      subsequent path-munging behavior results in trying to read the directory
      containing the current input file.
      
      I think this might finally explain the report at
      http://archives.postgresql.org/pgsql-bugs/2004-05/msg00132.php
      of a crash after printing "authentication file token too long, skipping",
      since I was able to duplicate that message (though not a crash) on a
      platform where stdio doesn't refuse to read directories.  We never got
      far in investigating that problem, but now I'm suspicious that the trigger
      condition was an @ in the flat password file.
      
      Back-patch to all active branches since the problem can be demonstrated in all
      branches except HEAD.  The test case, creating a user named "@", doesn't cause
      a problem in HEAD since we got rid of the flat password file.  Nonetheless it
      seems like a good idea to not consider quoted @ as a file inclusion spec,
      so I changed HEAD too.
      0c814238
  5. 04 3月, 2010 3 次提交
    • T
      Fix a couple of places that would loop forever if attempts to read a stdio file · 6fe45c96
      Tom Lane 提交于
      set ferror() but never set feof().  This is known to be the case for recent
      glibc when trying to read a directory as a file, and might be true for other
      platforms/cases too.  Per report from Ed L.  (There is more that we ought to
      do about his report, but this is one easily identifiable issue.)
      6fe45c96
    • T
      Make contrib/xml2 use core xml.c's error handler, when available (that is, · e2524c51
      Tom Lane 提交于
      in versions >= 8.3).  The core code is more robust and efficient than what
      was there before, and this also reduces risks involved in swapping different
      libxml error handler settings.
      
      Before 8.3, there is still some risk of problems if add-on modules such as
      Perl invoke libxml without setting their own error handler.  Given the lack
      of reports I'm not sure there's a risk in practice, so I didn't take the
      step of actually duplicating the core code into older contrib/xml2 branches.
      Instead I just tweaked the existing code to ensure it didn't leave a dangling
      pointer to short-lived memory when throwing an error.
      e2524c51
    • T
      Export xml.c's libxml-error-handling support so that contrib/xml2 can use it · f821c16e
      Tom Lane 提交于
      too, instead of duplicating the functionality (badly).
      
      I renamed xml_init to pg_xml_init, because the former seemed just a bit too
      generic to be safe as a global symbol.  I considered likewise renaming
      xml_ereport to pg_xml_ereport, but felt that the reference to ereport probably
      made it sufficiently PG-centric already.
      f821c16e
  6. 03 3月, 2010 4 次提交
  7. 02 3月, 2010 3 次提交
  8. 01 3月, 2010 3 次提交
    • T
      Remove xmlCleanupParser calls from contrib/xml2. · d71936c9
      Tom Lane 提交于
      These are unnecessary and probably dangerous.  I don't see any immediate
      risk situations in the core XML support or contrib/xml2 itself, but there
      could be issues with external uses of libxml2, and in any case it's an
      accident waiting to happen.
      d71936c9
    • T
      Back-patch today's memory management fixups in contrib/xml2. · 4f146ab3
      Tom Lane 提交于
      Prior to 8.3, these changes are not critical for compatibility with core
      Postgres, since core had no libxml2 calls then.  However there is still
      a risk if contrib/xml2 is used along with libxml2 functionality in Perl
      or other loadable modules.  So back-patch to all versions.
      
      Also back-patch addition of regression tests.  I'm not sure how many of
      the cases are interesting without the interaction with core xml code,
      but a silly regression test is still better than none at all.
      4f146ab3
    • T
      Back-patch changes of 2009-05-13 in xml.c's memory management. · a8cf68f7
      Tom Lane 提交于
      I was afraid to do this when these changes were first made, but now that
      8.4 has seen some field use it should be all right to back-patch.  These
      changes are really quite necessary in order to give xml.c any hope of
      co-existing with loadable modules that also wish to use libxml2.
      a8cf68f7
  9. 26 2月, 2010 1 次提交
    • T
      Allow predicate_refuted_by() to deduce that NOT A refutes A. · bf7edd6b
      Tom Lane 提交于
      We had originally made the stronger assumption that NOT A refutes any B
      if B implies A, but this fails in three-valued logic, because we need to
      prove B is false not just that it's not true.  However the logic does
      go through if B is equal to A.
      
      Recognizing this limited case is enough to handle examples that arise when
      we have simplified "bool_var = true" or "bool_var = false" to just "bool_var"
      or "NOT bool_var".  If we had not done that simplification then the
      btree-operator proof logic would have been able to prove that the expressions
      were contradictory, but only for identical expressions being compared to the
      constants; so handling identical A and B covers all the same cases.
      
      The motivation for doing this is to avoid unexpected asymmetrical behavior
      when a partitioned table uses a boolean partitioning column, as in today's
      gripe from Dominik Sander.
      
      Back-patch to 8.2, which is as far back as predicate_refuted_by attempts to
      do anything at all with NOTs.
      bf7edd6b
  10. 25 2月, 2010 2 次提交
    • M
      Add configuration parameter ssl_renegotiation_limit to control · 0a1ec273
      Magnus Hagander 提交于
      how often we do SSL session key renegotiation. Can be set to
      0 to disable renegotiation completely, which is required if
      a broken SSL library is used (broken patches to CVE-2009-3555
      a known cause) or when using a client library that can't do
      renegotiation.
      0a1ec273
    • T
      Allow zero-dimensional (ie, empty) arrays in contrib/ltree operations. · fbdf9712
      Tom Lane 提交于
      The main motivation for changing this is bug #4921, in which it's pointed out
      that it's no longer safe to apply ltree operations to the result of
      ARRAY(SELECT ...) if the sub-select might return no rows.  Before 8.3,
      the ARRAY() construct would return NULL, which might or might not be helpful
      but at least it wouldn't result in an error.  Now it returns an empty array
      which results in a failure for no good reason, since the ltree operations
      are all perfectly capable of dealing with zero-element arrays.
      
      As far as I can find, these ltree functions are the only places where zero
      array dimensionality is rejected unnecessarily.
      
      Back-patch to 8.3 to prevent behavioral regression of queries that worked
      in older releases.
      fbdf9712
  11. 19 2月, 2010 3 次提交
    • I
      Fix STOP WAL LOCATION in backup history files no to return the next · 28a19436
      Itagaki Takahiro 提交于
      segment of XLOG_BACKUP_END record even if the the record is placed
      at a segment boundary. Furthermore the previous implementation could
      return nonexistent segment file name when the boundary is in segments
      that has "FE" suffix; We never use segments with "FF" suffix.
      
      Backpatch to 8.0, where hot backup was introduced.
      
      Reported by Fujii Masao.
      28a19436
    • T
      Volatile-ize all five places where we expect a PG_TRY block to restore · 08181b42
      Tom Lane 提交于
      old memory context in plpython.  Before only one of them was marked
      volatile, but per report from Zdenek Kotala, some compilers do the
      wrong thing here.
      08181b42
    • T
      Fix ExecEvalArrayRef to pass down the old value of the array element or slice · 1a709257
      Tom Lane 提交于
      being assigned to, in case the expression to be assigned is a FieldStore that
      would need to modify that value.  The need for this was foreseen some time
      ago, but not implemented then because we did not have arrays of composites.
      Now we do, but the point evidently got overlooked in that patch.  Net result
      is that updating a field of an array element doesn't work right, as
      illustrated if you try the new regression test on an unpatched backend.
      Noted while experimenting with EXPLAIN VERBOSE, which has also got some issues
      in this area.
      
      Backpatch to 8.3, where arrays of composites were introduced.
      1a709257
  12. 17 2月, 2010 1 次提交
  13. 16 2月, 2010 1 次提交
  14. 15 2月, 2010 1 次提交
  15. 13 2月, 2010 1 次提交
  16. 12 2月, 2010 1 次提交
  17. 05 2月, 2010 1 次提交
    • H
      Add a note to the documentation of pg_standby that it's important that · a085a6a7
      Heikki Linnakangas 提交于
      the postgres process has permissions to delete the trigger file, per
      suggestion by Mason Hale.
      
      Also fix pg_standby to do a more predictable exit(200) instead of the
      current exit(-1) when the unlink of the trigger file fails anyway.
      
      This only affects 8.3 branch. Older versions didn't have pg_standby,
      and in 8.4 upwards pg_standby is no longer responsible for deleting the
      trigger file; it's supposed to be done by recovery_end_command instead.
      a085a6a7
  18. 04 2月, 2010 1 次提交
  19. 01 2月, 2010 2 次提交
    • T
      Change regexp engine's ccondissect/crevdissect routines to perform DFA · ff18ebfb
      Tom Lane 提交于
      matching before recursing instead of after.  The DFA match eliminates
      unworkable midpoint choices a lot faster than the recursive check, in most
      cases, so doing it first can speed things up; particularly in pathological
      cases such as recently exhibited by Michael Glaesemann.
      
      In addition, apply some cosmetic changes that were applied upstream (in the
      Tcl project) at the same time, in order to sync with upstream version 1.15
      of regexec.c.
      
      Upstream apparently intends to backpatch this, so I will too.  The
      pathological behavior could be unpleasant if encountered in the field,
      which seems to justify any risk of introducing new bugs.
      
      Tom Lane, reviewed by Donal K. Fellows of Tcl project
      ff18ebfb
    • M
      Fix race condition in win32 signal handling. · e00881bd
      Magnus Hagander 提交于
      There was a race condition where the receiving pipe could be closed by the
      child thread if the main thread was pre-empted before it got a chance to
      create a new one, and the dispatch thread ran to completion during that time.
      
      One symptom of this is that rows in pg_listener could be dropped under
      heavy load.
      
      Analysis and original patch by Radu Ilie, with some small
      modifications by Magnus Hagander.
      e00881bd
  20. 31 1月, 2010 1 次提交
    • T
      Avoid performing encoding conversion on command tag strings during EndCommand. · e488941a
      Tom Lane 提交于
      Since all current and foreseeable future command tags will be pure ASCII,
      there is no need to do conversion on them.  This saves a few cycles and also
      avoids polluting otherwise-pristine subtransaction memory contexts, which
      is the cause of the backend memory leak exhibited in bug #5302.  (Someday
      we'll probably want to have a better method of determining whether
      subtransaction contexts need to be kept around, but today is not that day.)
      
      Backpatch to 8.0.  The cycle-shaving aspect of this would work in 7.4
      too, but without subtransactions the memory-leak aspect doesn't apply,
      so it doesn't seem worth touching 7.4.
      e488941a
  21. 25 1月, 2010 2 次提交
    • T
      Apply Tcl_Init() to the "hold" interpreter created by pltcl. · acd294e9
      Tom Lane 提交于
      You might think this is unnecessary since that interpreter is never used
      to run code --- but it turns out that's wrong.  As of Tcl 8.5, the "clock"
      command (alone among builtin Tcl commands) is partially implemented by
      loaded-on-demand Tcl code, which means that it fails if there's not
      unknown-command support, and also that it's impossible to run it directly
      in a safe interpreter.  The way they get around the latter is that
      Tcl_CreateSlave() automatically sets up an alias command that forwards any
      execution of "clock" in a safe slave interpreter to its parent interpreter.
      Thus, when attempting to execute "clock" in trusted pltcl, the command
      actually executes in the "hold" interpreter, where it will fail if
      unknown-command support hasn't been introduced by sourcing the standard
      init.tcl script, which is done by Tcl_Init().  (This is a pretty dubious
      design decision on the Tcl boys' part, if you ask me ... but they didn't.)
      
      Back-patch all the way.  It's not clear that anyone would try to use ancient
      versions of pltcl with a recent Tcl, but it's not clear they wouldn't, either.
      Also add a regression test using "clock", in branches that have regression
      test support for pltcl.
      
      Per recent trouble report from Kyle Bateman.
      acd294e9
    • T
      Fix assorted core dumps and Assert failures that could occur during · 7309f334
      Tom Lane 提交于
      AbortTransaction or AbortSubTransaction, when trying to clean up after an
      error that prevented (sub)transaction start from completing:
      * access to TopTransactionResourceOwner that might not exist
      * assert failure in AtEOXact_GUC, if AtStart_GUC not called yet
      * assert failure or core dump in AfterTriggerEndSubXact, if
        AfterTriggerBeginSubXact not called yet
      
      Per testing by injecting elog(ERROR) at successive steps in StartTransaction
      and StartSubTransaction.  It's not clear whether all of these cases could
      really occur in the field, but at least one of them is easily exposed by
      simple stress testing, as per my accidental discovery yesterday.
      7309f334