1. 15 11月, 2017 3 次提交
    • T
      Prevent int128 from requiring more than MAXALIGN alignment. · 75180499
      Tom Lane 提交于
      Our initial work with int128 neglected alignment considerations, an
      oversight that came back to bite us in bug #14897 from Vincent Lachenal.
      It is unsurprising that int128 might have a 16-byte alignment requirement;
      what's slightly more surprising is that even notoriously lax Intel chips
      sometimes enforce that.
      
      Raising MAXALIGN seems out of the question: the costs in wasted disk and
      memory space would be significant, and there would also be an on-disk
      compatibility break.  Nor does it seem very practical to try to allow some
      data structures to have more-than-MAXALIGN alignment requirement, as we'd
      have to push knowledge of that throughout various code that copies data
      structures around.
      
      The only way out of the box is to make type int128 conform to the system's
      alignment assumptions.  Fortunately, gcc supports that via its
      __attribute__(aligned()) pragma; and since we don't currently support
      int128 on non-gcc-workalike compilers, we shouldn't be losing any platform
      support this way.
      
      Although we could have just done pg_attribute_aligned(MAXIMUM_ALIGNOF) and
      called it a day, I did a little bit of extra work to make the code more
      portable than that: it will also support int128 on compilers without
      __attribute__(aligned()), if the native alignment of their 128-bit-int
      type is no more than that of int64.
      
      Add a regression test case that exercises the one known instance of the
      problem, in parallel aggregation over a bigint column.
      
      This will need to be back-patched, along with the preparatory commit
      91aec93e.  But let's see what the buildfarm makes of it first.
      
      Discussion: https://postgr.es/m/20171110185747.31519.28038@wrigleys.postgresql.org
      75180499
    • T
      Rearrange c.h to create a "compiler characteristics" section. · 91aec93e
      Tom Lane 提交于
      Generalize section 1 to handle stuff that is principally about the
      compiler (not libraries), such as attributes, and collect stuff there
      that had been dropped into various other parts of c.h.  Also, push
      all the gettext macros into section 8, so that section 0 is really
      just inclusions rather than inclusions and random other stuff.
      
      The primary goal here is to get pg_attribute_aligned() defined before
      section 3, so that we can use it with int128.  But this seems like good
      cleanup anyway.
      
      This patch just moves macro definitions around, and shouldn't result
      in any changes in generated code.  But I'll push it out separately
      to see if the buildfarm agrees.
      
      Discussion: https://postgr.es/m/20171110185747.31519.28038@wrigleys.postgresql.org
      91aec93e
    • T
      Document changes in large-object privilege checking. · 6d776522
      Tom Lane 提交于
      Commit 5ecc0d73 removed the hard-wired superuser checks in lo_import
      and lo_export in favor of protecting them with SQL permissions, but
      failed to adjust the documentation to match.  Fix that, and add a
      <caution> paragraph pointing out the nontrivial security hazards
      involved with actually granting such permissions.  (It's still better
      than ALLOW_DANGEROUS_LO_FUNCTIONS, though.)
      
      Also, commit ae20b23a caused large object read/write privilege to
      be checked during lo_open() rather than in the actual read or write
      calls.  Document that.
      
      Discussion: https://postgr.es/m/CAB7nPqRHmNOYbETnc_2EjsuzSM00Z+BWKv9sy6tnvSd5gWT_JA@mail.gmail.com
      6d776522
  2. 14 11月, 2017 5 次提交
  3. 13 11月, 2017 4 次提交
  4. 12 11月, 2017 4 次提交
  5. 11 11月, 2017 4 次提交
  6. 10 11月, 2017 9 次提交
  7. 09 11月, 2017 4 次提交
    • T
      Allow --with-bonjour to work with non-macOS implementations of Bonjour. · 9b9cb3c4
      Tom Lane 提交于
      On macOS the relevant functions require no special library, but elsewhere
      we need to pull in libdns_sd.
      
      Back-patch to supported branches.  No docs change since the docs do not
      suggest that this is a Mac-only feature.
      
      Luke Lonergan
      
      Discussion: https://postgr.es/m/2D8331C5-D64F-44C1-8717-63EDC6EAF7EB@brightforge.com
      9b9cb3c4
    • T
      Doc: fix erroneous example. · bd65e0c6
      Tom Lane 提交于
      The grammar requires these options to appear the other way 'round.
      
      jotpe@posteo.de
      
      Discussion: https://postgr.es/m/78933bd0-45ce-690e-b832-a328dd1a5567@posteo.de
      bd65e0c6
    • T
      Fix two violations of the ResourceOwnerEnlarge/Remember protocol. · c5269472
      Tom Lane 提交于
      The point of having separate ResourceOwnerEnlargeFoo and
      ResourceOwnerRememberFoo functions is so that resource allocation
      can happen in between.  Doing it in some other order is just wrong.
      
      OpenTemporaryFile() did open(), enlarge, remember, which would leak the
      open file if the enlarge step ran out of memory.  Because fd.c has its own
      layer of resource-remembering, the consequences look like they'd be limited
      to an intratransaction FD leak, but it's still not good.
      
      IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow
      up if the incr-refcount step ever failed.  It was safe enough when written,
      but since the introduction of PrivateRefCountHash, I think the assumption
      that no error could happen there is pretty shaky.
      
      The odds of real problems from either bug are probably small, but still,
      back-patch to supported branches.
      
      Thomas Munro and Tom Lane, per a comment from Andres Freund
      c5269472
    • P
      Change TRUE/FALSE to true/false · 2eb4a831
      Peter Eisentraut 提交于
      The lower case spellings are C and C++ standard and are used in most
      parts of the PostgreSQL sources.  The upper case spellings are only used
      in some files/modules.  So standardize on the standard spellings.
      
      The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so
      those are left as is when using those APIs.
      
      In code comments, we use the lower-case spelling for the C concepts and
      keep the upper-case spelling for the SQL concepts.
      Reviewed-by: NMichael Paquier <michael.paquier@gmail.com>
      2eb4a831
  8. 08 11月, 2017 7 次提交