1. 13 Dec, 2008 1 commit
    • Tom Lane's avatar
      Fix failure to ensure that a snapshot is available to datatype input functions · c98a9237
      Tom Lane authored
      when they are invoked by the parser.  We had been setting up a snapshot at
      plan time but really it needs to be done earlier, before parse analysis.
      Per report from Dmitry Koterov.
      
      Also fix two related problems discovered while poking at this one:
      exec_bind_message called datatype input functions without establishing a
      snapshot, and SET CONSTRAINTS IMMEDIATE could call trigger functions without
      establishing a snapshot.
      
      Backpatch to 8.2.  The underlying problem goes much further back, but it is
      masked in 8.1 and before because we didn't attempt to invoke domain check
      constraints within datatype input.  It would only be exposed if a C-language
      datatype input function used the snapshot; which evidently none do, or we'd
      have heard complaints sooner.  Since this code has changed a lot over time,
      a back-patch is hardly risk-free, and so I'm disinclined to patch further
      than absolutely necessary.
      c98a9237
  2. 12 Dec, 2008 2 commits
  3. 11 Dec, 2008 4 commits
  4. 10 Dec, 2008 2 commits
  5. 09 Dec, 2008 3 commits
  6. 08 Dec, 2008 4 commits
  7. 07 Dec, 2008 2 commits
  8. 06 Dec, 2008 3 commits
  9. 05 Dec, 2008 1 commit
  10. 04 Dec, 2008 7 commits
  11. 03 Dec, 2008 6 commits
  12. 02 Dec, 2008 4 commits
  13. 01 Dec, 2008 1 commit
    • Tom Lane's avatar
      Fix an oversight in the code that makes transitive-equality deductions from · a1feb90e
      Tom Lane authored
      outer join clauses.  Given, say,
      	... from a left join b on a.a1 = b.b1 where a.a1 = 42;
      we'll deduce a clause b.b1 = 42 and then mark the original join clause
      redundant (we can't remove it completely for reasons I don't feel like
      squeezing into this log entry).  However the original implementation of
      that wasn't bulletproof, because clause_selectivity() wouldn't honor
      this_selec if given nonzero varRelid --- which in practice meant that
      it worked as desired *except* when considering index scan quals.  Which
      resulted in bogus underestimation of the size of the indexscan result for
      an inner indexscan in an outer join, and consequently a possibly bad
      choice of indexscan vs. bitmap scan.  Fix by introducing an explicit test
      into clause_selectivity().  Also, to make sure we don't trigger that test
      in corner cases, change the convention to be that this_selec > 1, not
      this_selec = 1, means it's been marked redundant.  Per trouble report from
      Scara Maccai.
      
      Back-patch to 8.2, where the problem was introduced.
      a1feb90e