1. 13 9月, 2016 7 次提交
    • R
      Catch fatal flex errors in the GUC file lexer. · 932b1e58
      Robert Haas 提交于
      This prevents the postmaster from unexpectedly croaking if postgresql.conf
      contains something like:
      
      include 'invalid_directory_name'
      
      Noah Misch. Reviewed by Tom Lane and myself.
      
      Conflicts with GPDB code:
      	src/backend/utils/misc/guc-file.l
      932b1e58
    • T
      Improve handling of ereport(ERROR) and elog(ERROR). · 00067d50
      Tom Lane 提交于
      In commit 71450d7f, we added code to inform
      suitably-intelligent compilers that ereport() doesn't return if the elevel
      is ERROR or higher.  This patch extends that to elog(), and also fixes a
      double-evaluation hazard that the previous commit created in ereport(),
      as well as reducing the emitted code size.
      
      The elog() improvement requires the compiler to support __VA_ARGS__, which
      should be available in just about anything nowadays since it's required by
      C99.  But our minimum language baseline is still C89, so add a configure
      test for that.
      
      The previous commit assumed that ereport's elevel could be evaluated twice,
      which isn't terribly safe --- there are already counterexamples in xlog.c.
      On compilers that have __builtin_constant_p, we can use that to protect the
      second test, since there's no possible optimization gain if the compiler
      doesn't know the value of elevel.  Otherwise, use a local variable inside
      the macros to prevent double evaluation.  The local-variable solution is
      inferior because (a) it leads to useless code being emitted when elevel
      isn't constant, and (b) it increases the optimization level needed for the
      compiler to recognize that subsequent code is unreachable.  But it seems
      better than not teaching non-gcc compilers about unreachability at all.
      
      Lastly, if the compiler has __builtin_unreachable(), we can use that
      instead of abort(), resulting in a noticeable code savings since no
      function call is actually emitted.  However, it seems wise to do this only
      in non-assert builds.  In an assert build, continue to use abort(), so that
      the behavior will be predictable and debuggable if the "impossible"
      happens.
      
      These changes involve making the ereport and elog macros emit do-while
      statement blocks not just expressions, which forces small changes in
      a few call sites.
      
      Andres Freund, Tom Lane, Heikki Linnakangas
      
      Conflicts with GPDB codebase:
      	config/c-compiler.m4
      	configure
      	configure.in
      	contrib/cube/cubescan.l
      	contrib/seg/segscan.l
      	src/include/pg_config.h.in
      	src/include/pg_config.h.win32
      00067d50
    • P
      Teach compiler that ereport(>=ERROR) does not return · c73dec0f
      Peter Eisentraut 提交于
      When elevel >= ERROR, we add an abort() call to the ereport() macro to
      give the compiler a hint that the ereport() expansion will not return,
      but the abort() isn't actually reached because the longjmp happens in
      errfinish().
      
      Because the effect of ereport() varies with the elevel, we cannot use
      standard compiler attributes such as noreturn for this.
      c73dec0f
    • P
      Remove duplicate checks that already exist within PQsendGpQuery_shared() · d6a5c7a8
      Pengzhou Tang 提交于
      Before dispatching a command, we assume the connection is newly created or is reused. For newly created connection, it must be idle, for reused connection, it should have been cleaned up, meanwhile within the internal dispatching, PQsendGpQuery_shared() also do the busy checking and bad connection checking, so pre-checking looks like unnecessary
      d6a5c7a8
    • P
      add test cases for dispatch gang creation. · db41b9b9
      Pengzhou Tang 提交于
      To test corner cases, we use faultinjector utility to simulate
      segment recovery, segment FATAL&ERROR level errors when gangs are creating.
      db41b9b9
    • P
      Speed up QE cancel when one or more QEs got errors · 39ed6031
      Pengzhou Tang 提交于
      QD need to cancel QEs when
      1) QD get a error
      2) one or more QEs got error and cancelOnError was set to true.
      
      We want to cancel QEs as soon as possible once above conditions are reached, but considering
      the cost of cancelling QEs is high, we want to process as many pending finish QEs as possible
      before actually cancel. The original interval before cancelling is 2 seconds which is too
      long that users will see an obvious delay before errors are reported, this commit lower
      this interval to 100 ms to speed up the cancelling process.
      39ed6031
    • N
      Fixing codegen related bugs in InitializeSupportedFunction · 0eeec886
      Nikos Armenatzoglou 提交于
      There are a few bugs in InitializeSupportedFunction.
      In particular:
      * int4le returns int32 but it should return bool.
      * date_le_timestamp returns int32 but it should return bool
      * in int4_sum, PGGenericFuncGenerator should take arguments < int64_t, int64_t, int32_t >
      * in int8pl, PGGenericFuncGenerator should take arguments < int64_t, int64_t, int64_t >
      
      [#130130821]
      0eeec886
  2. 10 9月, 2016 1 次提交
    • H
      Added a new GUC gp_enable_relsize_collection to enable stats collection. (#1110) · 0ea740cf
      Haisheng Yuan 提交于
      Currently, when the stats are not existing for a relation, planner
      relies on default values instead of running pg_relation_size to save
      time. However, this causes planner to produce bad plans. Earlier, the
      code had the feature to collect stats for planner if the table did not
      had any stats, but it was removed.
      
      This fix re-introduces the feature with the GUC to control whether to use
      default values or run pg_relation_size to get actual stats if stats are
      not present. By default, the GUC is turned off.
      
      [#129570829]
      0ea740cf
  3. 09 9月, 2016 2 次提交
  4. 08 9月, 2016 2 次提交
  5. 06 9月, 2016 1 次提交
  6. 05 9月, 2016 5 次提交
  7. 04 9月, 2016 1 次提交
    • H
      Remove unused file load.sql · 1033c536
      Haisheng Yuan 提交于
      Through the file content we know it uses personal absolute path, which
      can't be used by others. DisableXform/EnableXform are already built-in
      functions if GPDB is built with Orca. So we can safely delete this file.
      1033c536
  8. 03 9月, 2016 9 次提交
    • A
      Fix an oversight in removing CaQL introduced in 8df78e · 281ee123
      Asim R P 提交于
      This was causing gpinitstandby failure.  Thank you @zeromax007 and @volkovandr
      for the report.  Fixes #1079.
      281ee123
    • S
      Rewrite PGGenericFuncGenerator to support variable number of types · 41055352
      Shreedhar Hardikar 提交于
      Currently PGFuncBaseGenerator and PGGenericFuncGenerator classes have
      only one template that takes two argument only, i.e., two datums. These
      templates can support only (built-in) functions that take two arguments
      as input only (e.g., int4pl). However, there are built-in functions that
      take either more or less than two arguments.
      This will benefit count and average aggregate function.
      41055352
    • M
      Enhance foreign key check detection for gpcheckcat (#1061) · 92cc0187
      Marbin Tan 提交于
      * Enhance foreign key check detection for gpcheckcat
      
      We will now do a bidirectional check for the following
      catalogs with foreign key check with pg_class:
          pg_attribute, pg_index, and pg_appendonly
      
      This is accomplished by doing a full join based on the foreign keys and
      primary keys between pg_class and a catalog mentioned above. Once
      detected, we will now output missing catalog infront of our stderr.
      
      * Add unit test for foreign_key check in gpcheckcat
      
      * update the behave test to account for gpcheckcat creating a repair for foreign_key.
      
      * Add new module for foreign key check in gpcheckcat
      * get unittest in a working state
      * refactor unit test to be "smaller"
      
      Update behave and unit test for gpcheckcat foreign_key_check:
      
      * We are keeping gp_distribution_policy to be checked as part of the
        left join instead of skipping it all together just because it's a
        master only catalog table.
      * Add behave test that deletes from segments instead of master for
        foreign key check
      * Fix unit test to be able to mock out the full and left join queries
        for forign key check
      
      Add unit test for gpcheck -C option
      
      * Remove pg_constraint check
      
      Due to pg_class limitations where some flags (relhaspkey) are maintained
      lazily (updates to some pg_class columns are not enforced).
      There is no good way to create a one to one mapping between pg_class
      and pg_constraint. So, removing/commenting it out for now
      
      Authors: Nikhil Kak, Chris Hajas, Chumki Roy, and Marbin Tan
      92cc0187
    • J
      6537a159
    • J
      Remove the vestige of 9c98a4f8 · 0068bfdd
      Jesse Zhang and Omer Arap 提交于
      This partially reverts f518ce9e because 2a121900 missed it.
      0068bfdd
    • A
      Initialize latestCompletedXid after pass3 during recovery · 402aea23
      Ashwin Agrawal 提交于
      latestCompletedXid in ShmemVariableCache is used during visibility checking to
      exit early from TransactionIdIsInProgress, if transaction being checked is
      higher than latestCompletedXid. During merge to 8.3 this value was set
      incorrectly after pass1 of recovery, hence it reflected value what checkpoint
      provides for nextXid. In GPDB pass3 is where xlog records are replayed which
      would bump-up the nextXID to correctly reflect in-flight transactions. So,
      latestCompletedXid needs to be set after pass3 has completed to record correct
      value. Without the fix latestCompletedXid was pointing to stale transaction id
      yeilding incorrect visibility of tuples post recovery.
      
      Repro:
      create table foo(id int);
      -- manually kill -9 a segment QE process to simulate SIGSEGV, and force postmaster reset on that segment
      select * from foo; -- fails currently, ideally shouldn't fail as well
      select * from foo; -- expected to succeed but it fails with error message like "ERROR: relation with OID xxxxxx does not exist"
      
      Thank You @eurekaka for reporting.
      Fixes: #1094
      402aea23
    • S
    • N
      Add AdvanceAggregatesCodegenEnroll mock function · e5318b6b
      Nikos Armenatzoglou 提交于
      This function is used in codegen unittests.
      In this commit, we also address a minor cpplint error in GenerateSlotGetAttr.
      e5318b6b
    • J
      Move the test case for case-statement in filter for planner · 2a121900
      Jesse Zhang and Omer Arap 提交于
      This commit
      - backs out the test addition in 9c98a4f8
      - adds the test to a more appropriate place: `bfv_subquery`
      2a121900
  9. 02 9月, 2016 6 次提交
  10. 01 9月, 2016 6 次提交