1. 01 Jun, 2020 2 commits
    • Michael Paquier's avatar
      Fix use-after-release mistake in currtid() and currtid2() for views · ce1c5b9a
      Michael Paquier authored
      This issue has been present since the introduction of this code as of
      a3519a2f from 2002, and has been found by buildfarm member prion that
      uses RELCACHE_FORCE_RELEASE via the tests introduced recently in
      e786be5f.
      
      Discussion: https://postgr.es/m/20200601022055.GB4121@paquier.xyz
      Backpatch-through: 9.5
      ce1c5b9a
    • Michael Paquier's avatar
      Fix crashes with currtid() and currtid2() · e786be5f
      Michael Paquier authored
      A relation that has no storage initializes rd_tableam to NULL, which
      caused those two functions to crash because of a pointer dereference.
      Note that in 11 and older versions, this has always failed with a
      confusing error "could not open file".
      
      These two functions are used by the Postgres ODBC driver, which requires
      them only when connecting to a backend strictly older than 8.1.  When
      connected to 8.2 or a newer version, the driver uses a RETURNING clause
      instead whose support has been added in 8.2, so it should be possible to
      just remove both functions in the future.  This is left as an issue to
      address later.
      
      While on it, add more regression tests for those functions as we never
      really had coverage for them, and for aggregates of TIDs.
      
      Reported-by: Jaime Casanova, via sqlsmith
      Author: Michael Paquier
      Reviewed-by: Álvaro Herrera
      Discussion: https://postgr.es/m/CAJGNTeO93u-5APMga6WH41eTZ3Uee9f3s8dCpA-GSSqNs1b=Ug@mail.gmail.com
      Backpatch-through: 12
      e786be5f
  2. 31 May, 2020 3 commits
  3. 29 May, 2020 1 commit
  4. 28 May, 2020 7 commits
  5. 27 May, 2020 1 commit
  6. 26 May, 2020 5 commits
  7. 25 May, 2020 3 commits
  8. 23 May, 2020 1 commit
  9. 22 May, 2020 7 commits
  10. 21 May, 2020 5 commits
  11. 20 May, 2020 4 commits
  12. 19 May, 2020 1 commit
    • Peter Geoghegan's avatar
      Reconsider nbtree page deletion assertion. · 67b0b2db
      Peter Geoghegan authored
      Commit 624686ab added an assertion that verified that _bt_search
      successfully relocated the leaf page undergoing deletion.  Page deletion
      cannot deal with the case where the descent stack is to the right of the
      page, so this seemed critical (deletion can only handle the case where
      the descent stack is to the left of the leaf/target page).  However, the
      assertion went a bit too far.
      
      Since only a buffer pin is held on the leaf page throughout the call to
      _bt_search, nothing guarantees that it can't have split during this
      small window.  And if does actually split, _bt_search may end up
      "relocating" a page to the right of the original target leaf page.  This
      scenario seems extremely unlikely, but it must still be considered.
      Remove the assertion, and document how we cope in this scenario.
      67b0b2db