1. 17 8月, 2009 1 次提交
    • T
      Fix incorrect encoding-aware name truncation in makeArrayTypeName(). · 51bc461d
      Tom Lane 提交于
      truncate_identifier won't do anything if the passed-in strlen is already
      less than NAMEDATALEN, which it always would be given the strlcpy usage.
      This has been broken since the arrays-of-composite-types code went in.
      
      Arguably truncate_identifier is suffering from excessive optimization
      and should always process the string, but for the moment I'll take the
      more localized patch.
      
      Per bug #4987.
      51bc461d
  2. 16 8月, 2009 1 次提交
  3. 13 8月, 2009 1 次提交
    • T
      Fix old bug in log_autovacuum_min_duration code: it was relying on being able · 355e7ef4
      Tom Lane 提交于
      to access a Relation entry it had just closed.  I happened to be testing with
      CLOBBER_CACHE_ALWAYS, which made this a guaranteed core dump (at least on
      machines where sprintf %s isn't forgiving of a NULL pointer).  It's probably
      quite unlikely that it would fail in the field, but a bug is a bug.  Fix by
      moving the relation_close call down past the logging action.
      355e7ef4
  4. 11 8月, 2009 1 次提交
  5. 10 8月, 2009 2 次提交
  6. 08 8月, 2009 1 次提交
    • T
      Try to defend against the possibility that libpq is still in COPY_IN state · d9a00ebb
      Tom Lane 提交于
      when we reach the post-COPY "pump it dry" error recovery code that was added
      2006-11-24.  Per a report from Neil Best, there is at least one code path
      in which this occurs, leading to an infinite loop in code that's supposed
      to be making it more robust not less so.  A reasonable response seems to be
      to call PQputCopyEnd() again, so let's try that.
      
      Back-patch to all versions that contain the cleanup loop.
      d9a00ebb
  7. 07 8月, 2009 1 次提交
  8. 30 7月, 2009 1 次提交
  9. 29 7月, 2009 1 次提交
  10. 28 7月, 2009 1 次提交
  11. 25 7月, 2009 1 次提交
  12. 21 7月, 2009 1 次提交
  13. 18 7月, 2009 1 次提交
    • T
      Repair bug #4926 "too few pathkeys for mergeclauses". This example shows · d7bc5e30
      Tom Lane 提交于
      that the sanity checking I added to create_mergejoin_plan() in 8.3 was a
      few bricks shy of a load: the mergeclauses could reference pathkeys in a
      noncanonical order such as x,y,x, not only cases like x,x,y which is all
      that the code had allowed for.  The odd cases only turn up when using
      redundant clauses in an outer join condition, which is why no one had
      noticed before.
      d7bc5e30
  14. 14 7月, 2009 1 次提交
    • T
      Do a conditional SPI_push/SPI_pop when replanning a query in · b5f32d8d
      Tom Lane 提交于
      RevalidateCachedPlan.  This is to avoid a "SPI_ERROR_CONNECT" failure when
      the planner calls a SPI-using function and we are already inside one.
      The alternative fix is to expect callers of RevalidateCachedPlan to do this,
      which seems likely to result in additional hard-to-detect bugs of omission.
      Per reports from Frank van Vugt and Marek Lewczuk.
      
      Back-patch to 8.3. It's much harder to trigger the bug in 8.3, due to a
      smaller set of cases in which plans can be invalidated, but it could happen.
      (I think perhaps only a SI reset event could make 8.3 fail here, but that's
      certainly within the realm of possibility.)
      b5f32d8d
  15. 10 7月, 2009 1 次提交
    • T
      Fix xslt_process() to ensure that it inserts a NULL terminator after the · 12010081
      Tom Lane 提交于
      last pair of parameter name/value strings, even when there are MAXPARAMS
      of them.  Aboriginal bug in contrib/xml2, noted while studying bug #4912
      (though I'm not sure whether there's something else involved in that
      report).
      
      This might be thought a security issue, since it's a potential backend
      crash; but considering that untrustworthy users shouldn't be allowed
      to get their hands on xslt_process() anyway, it's probably not worth
      getting excited about.
      12010081
  16. 07 7月, 2009 1 次提交
  17. 25 6月, 2009 1 次提交
  18. 24 6月, 2009 1 次提交
    • T
      Fix an ancient error in dist_ps (distance from point to line segment), which · 462c280f
      Tom Lane 提交于
      a number of other geometric operators also depend on.  It miscalculated the
      slope of the perpendicular to the given line segment anytime that slope was
      other than 0, infinite, or +/-1.  In some cases the error would be masked
      because the true closest point on the line segment was one of its endpoints
      rather than the intersection point, but in other cases it could give an
      arbitrarily bad answer.  Per bug #4872 from Nick Roosevelt.
      
      Bug goes clear back to Berkeley days, so patch all supported branches.
      Make a couple of cosmetic adjustments while at it.
      462c280f
  19. 18 6月, 2009 1 次提交
  20. 14 6月, 2009 1 次提交
    • T
      Change test tables in copy2 regression test to be temporary tables. · 5b2e5fed
      Tom Lane 提交于
      This prevents autovacuum from reclaiming free space in them and causing
      the test's output row order to change, which is causing intermittent
      bogus failure reports in the buildfarm.
      
      Backpatch to 8.3.  The issue exists further back, but since autovacuum was
      not on by default before 8.3, it's not a problem for buildfarm testing.
      5b2e5fed
  21. 12 6月, 2009 1 次提交
  22. 11 6月, 2009 3 次提交
  23. 10 6月, 2009 3 次提交
  24. 09 6月, 2009 1 次提交
  25. 06 6月, 2009 3 次提交
  26. 05 6月, 2009 1 次提交
  27. 02 6月, 2009 1 次提交
  28. 25 5月, 2009 1 次提交
    • T
      Fix LIKE's special-case code for % followed by _. I'm not entirely sure that · 6b4a3a77
      Tom Lane 提交于
      this case is worth a special code path, but a special code path that gets
      the boundary condition wrong is definitely no good.  Per bug #4821 from
      Andrew Gierth.
      
      In passing, clean up some minor code formatting issues (excess parentheses
      and blank lines in odd places).
      
      Back-patch to 8.3, where the bug was introduced.
      6b4a3a77
  29. 19 5月, 2009 1 次提交
  30. 13 5月, 2009 1 次提交
    • T
      Fix intratransaction memory leaks in xml_recv, xmlconcat, xmlroot, and · 9497c7a7
      Tom Lane 提交于
      xml_parse, all arising from the same sloppy usage of parse_xml_decl.
      The original coding had that function returning its output string
      parameters in the libxml context, which is long-lived, and all but one
      of its callers neglected to free the strings afterwards.  The easiest
      and most bulletproof fix is to return the strings in the local palloc
      context instead, since that's short-lived.  This was only costing a
      dozen or two bytes per function call, but that adds up fast if the
      function is called repeatedly ...
      
      Noted while poking at the more general problem of what to do with our
      libxml memory allocation hooks.  Back-patch to 8.3, which has the
      identical coding.
      9497c7a7
  31. 12 5月, 2009 1 次提交
    • T
      Partially revert my patch of 2008-11-12 that installed a limit on the number · dd60bca4
      Tom Lane 提交于
      of AND/OR clause branches that predtest.c would attempt to deal with.  As
      noted in bug #4721, that change disabled proof attempts for sizes of problems
      that people are actually expecting it to work for.  The original complaint
      it was trying to solve was O(N^2) behavior for long IN-lists, so let's try
      applying the limit to just ScalarArrayOpExprs rather than everything.
      Another case of "foolish consistency" I fear.
      
      Back-patch to 8.2, same as the previous patch was.
      dd60bca4
  32. 07 5月, 2009 1 次提交
    • H
      Request XLOG switch before writing checkpoint in pg_start_backup(). Otherwise · b6ecee27
      Heikki Linnakangas 提交于
      you can end up with an unrecoverable backup if you start a new base backup
      right after finishing archive recovery. In that scenario, the redo pointer of
      the checkpoint that pg_start_backup() writes points to the XLOG segment where
      the timeline-changing end-of-archive-recovery checkpoint is. The beginning
      of that segment contains pages with the old timeline ID, and we don't accept
      that in recovery unless we find a history file covering the old timeline ID.
      If you omit pg_xlog from the base backup and clear the archive directory
      before starting the backup, there will be no such history file available.
      
      The bug is present in all versions since PITR was introduced in 8.0, but I'm
      back-patching only back to 8.2. Earlier versions didn't have XLOG switch
      records, making this fix unfeasible. Given the lack of reports until now,
      it doesn't seem worthwhile to spend more effort to fix 8.0 and 8.1.
      
      Per report and suggestion by Mikael Krantz
      b6ecee27
  33. 05 5月, 2009 1 次提交