1. 13 Apr, 2021 5 commits
  2. 12 Apr, 2021 9 commits
  3. 11 Apr, 2021 5 commits
    • Tom Lane's avatar
      Silence some Coverity warnings and improve code consistency. · 6277435a
      Tom Lane authored
      Coverity complained about possible overflow in expressions like
      	intresult = tm->tm_sec * 1000000 + fsec;
      on the grounds that the multiplication would happen in 32-bit
      arithmetic before widening to the int64 result.  I think these
      are all false positives because of the limited possible range of
      tm_sec; but nonetheless it seems silly to spell it like that when
      nearby lines have the identical computation written with a 64-bit
      constant.
      
      ... or more accurately, with an LL constant, which is not project
      style.  Make all of these use INT64CONST(), as we do elsewhere.
      
      This is all new code from a2da77cd, so no need for back-patch.
      6277435a
    • Tom Lane's avatar
      Add macro PGWARNING, and make PGERROR available on all platforms. · d7cff12c
      Tom Lane authored
      We'd previously noted the need for coping with Windows headers
      that provide some other definition of macro "ERROR" than elog.h
      does.  It turns out that R also wants to define ERROR, and
      WARNING too.  PL/R has been working around this in a hacky way
      that broke when we recently changed the numeric value of ERROR.
      To let them have a more future-proof solution, provide an
      alternate macro PGWARNING for WARNING, and make PGERROR visible
      always, not only when #ifdef WIN32.
      
      Discussion: https://postgr.es/m/CADK3HHK6iMChd1yoOqssxBn5Z14Zar8Ztr3G-N_fuG7F8YTP3w@mail.gmail.com
      d7cff12c
    • Tom Lane's avatar
      Fix uninitialized variable from commit a4d75c86. · 9cb92334
      Tom Lane authored
      The path for *exprs != NIL would misbehave, and likely crash,
      since pull_varattnos expects its last argument to be valid
      at call.
      
      Found by Coverity --- we have no coverage of this path in
      the regression tests.
      9cb92334
    • Fujii Masao's avatar
      Avoid unnecessary table open/close in TRUNCATE command. · 81a23dd8
      Fujii Masao authored
      ExecuteTruncate() filters out the duplicate tables specified
      in the TRUNCATE command, for example in the case where "TRUNCATE foo, foo"
      is executed. Such duplicate tables obviously don't need to be opened
      and closed because they are skipped. But previously it always opened
      the tables before checking whether they were duplicated ones or not,
      and then closed them if they were. That is, the duplicated tables were
      opened and closed unnecessarily.
      
      This commit changes ExecuteTruncate() so that it opens the table
      after it confirms that table is not duplicated one, which leads to
      avoid unnecessary table open/close.
      
      Do not back-patch because such unnecessary table open/close is not
      a bug though it exists in older versions.
      
      Author: Bharath Rupireddy
      Reviewed-by: Amul Sul, Fujii Masao
      Discussion: https://postgr.es/m/CALj2ACUdBO_sXJTa08OZ0YT0qk7F_gAmRa9hT4dxRcgPS4nsZA@mail.gmail.com
      81a23dd8
    • Fujii Masao's avatar
      Remove COMMIT_TS_SETTS record. · 08aa89b3
      Fujii Masao authored
      Commit 438fc4a3 prevented the WAL replay from writing
      COMMIT_TS_SETTS record. By this change there is no code that
      generates COMMIT_TS_SETTS record in PostgreSQL core.
      Also we can think that there are no extensions using the record
      because we've not received so far any complaints about the issue
      that commit 438fc4a3 fixed. Therefore this commit removes
      COMMIT_TS_SETTS record and its related code. Even without
      this record, the timestamp required for commit timestamp feature
      can be acquired from the COMMIT record.
      
      Bump WAL page magic.
      Reported-by: default avatarlx zou <zoulx1982@163.com>
      Author: Fujii Masao
      Reviewed-by: Alvaro Herrera
      Discussion: https://postgr.es/m/16931-620d0f2fdc6108f1@postgresql.org
      08aa89b3
  4. 10 Apr, 2021 5 commits
  5. 09 Apr, 2021 9 commits
  6. 08 Apr, 2021 7 commits