1. 01 12月, 2015 11 次提交
    • G
      Rework SSE42 implementation and runtime logic to be more similar to PostgreSQL 9.5 · 6c025b52
      Garrett Thornburg 提交于
      This patch merges the PostgreSQL 9.5 implementation of SSE4.2 into GPDB.
      The SSE4.2 implementation was lifted right out of PostgreSQL without
      change to make merging later PostgreSQL releases easier.
      
      Update win32 configuration to support SSE4.2 runtime checks
      
      This change was pulled from "src/include/pg_config.h.win32" from the
      commits below.
      
      configure.in changes, determining if cpu instruction for perfomring runtime
      checks are availible, and moving some of the code to port SSE4.2 came from the
      following PostgreSQL commits:
      
      commit 3dc2d62d
      Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
      Date:   Tue Apr 14 17:05:03 2015 +0300
      
          Use Intel SSE 4.2 CRC instructions where available.
      
          Modern x86 and x86-64 processors with SSE 4.2 support have special
          instructions, crc32b and crc32q, for calculating CRC-32C. They greatly
          speed up CRC calculation.
      
          Whether the instructions can be used or not depends on the compiler and the
          target architecture. If generation of SSE 4.2 instructions is allowed for
          the target (-msse4.2 flag on gcc and clang), use them. If they are not
          allowed by default, but the compiler supports the -msse4.2 flag to enable
          them, compile just the CRC-32C function with -msse4.2 flag, and check at
          runtime whether the processor we're running on supports it. If it doesn't,
          fall back to the slicing-by-8 algorithm. (With the common defaults on
          current operating systems, the runtime-check variant is what you get in
          practice.)
      
          Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
      
      commit b4eb2d16
      Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
      Date:   Tue Apr 14 19:56:00 2015 +0300
      	On gcc and clang, the _mm_crc32_u8 and _mm_crc32_u64 intrinsics are not
      	defined at all, when not building with -msse4.2. But on icc, they are.
      	So we cannot assume that if those intrinsics are defined, we can always use
      	them safely, we might still need the runtime check.
      
      	To fix, check if the __SSE_4_2__ preprocessor symbol is defined. That's
      	supposed to be defined only when the compiler is targeting a processor that
      	has SSE 4.2 support.
      
      	Per buildfarm members fulmar and okapi.
      6c025b52
    • H
      Remove remnants of support for reading WAL files from old gpdb versions. · 2c8bce0f
      Heikki Linnakangas 提交于
      I already removed support from the backend and from tools in src/bin
      earlier, but missed these tools in contrib.
      2c8bce0f
    • H
      Remove gpmodcontrol.c · c36564fa
      Heikki Linnakangas 提交于
      I removed everything else from gpupgrade earlier, but missed this file
      for reason.
      c36564fa
    • H
      Make 'union' test case match the upstream version. · 6d594e28
      Heikki Linnakangas 提交于
      1. Remove unnecessary ORDER BYs (one of them still needed, as gpdiff.pl got
      confused by the ORDER BY within subquery, thinking that the order of the
      overall query was well-ordered).
      
      2. Move GPDB-added test queries to separate test file, union_gp.sql.
      6d594e28
    • H
      Move 'partition' bugbuster test to the main suite. · 16b1260e
      Heikki Linnakangas 提交于
      This is part of long-standing effort ot eliminate the separate bugbuster
      suite.
      16b1260e
    • H
      Move remaining 'ggg' tests from bugbuster partition test. · cf6b2ce3
      Heikki Linnakangas 提交于
      There are similar tests in the partition1 test already, so keep them
      together.
      cf6b2ce3
    • H
      Remove redundant tests. · 94a658bc
      Heikki Linnakangas 提交于
      These exactly same queries from bugbuster 'partition' test were already in
      the main suite's 'partition' test (and even had some comments there).
      94a658bc
    • H
      Split 'partition' test into two. · 33297250
      Heikki Linnakangas 提交于
      This test takes a very long time, so by splitting it and running other tests
      in parallel, we can hopefully utilize multiple CPUs better during regression
      tests, and finish the tests earlier.
      
      There's no big principle on where exactly I split this, but I did take care
      that the new 'partition1' test case doesn't need different expected output
      files for the ORCA and non-ORCA case. That always makes maintenance easier.
      33297250
    • H
      Move some tests from 'partition' to separate test file. · e61a363d
      Heikki Linnakangas 提交于
      These tests query pg_locks and fail if there are concurrent transactions
      holding locks. Isolate them to separate file, so that we can safely run
      other tests in parallel.
      e61a363d
    • J
      Improve gpssh-exkeys gethostbyaddr error message. · aac2f599
      Jason Champion 提交于
      When gethostbyaddr fails in gpssh-exkeys, print the name
      of the host that failed lookup for easier troubleshooting.
      aac2f599
    • K
      Fix row estimation of some catalog tables in planner. · 7ff79c6d
      Kenan Yao 提交于
      When the cluster has multiple segments, planner now mistakenly calculates the
      row number of catalog tables. One example is: SELECT COUNT(*) FROM pg_class may
      say the table has 200 rows of records, while EXPLAIN SELECT * FROM pg_class
      would say there are 200 * N rows of records, even if you have already issued ANALYZE
      upon pg_class and restarted the session(to reload the relation cache), where N
      is the number of primary segments.
      
      Another bug is for query like SELECT * FROM gp_dist_random('pg_class'), in this
      case, planner should assume the size of pg_class to be 200 * N, instead of the
      current 200.
      7ff79c6d
  2. 28 11月, 2015 2 次提交
    • H
      Merge commit '3a32ba2f' · 3f1c2890
      Heikki Linnakangas 提交于
      Only minor formatting and comment changes, everything else in this merge
      commit we had already backported earlier.
      
      Conflicts:
      	configure
      	configure.in
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	doc/src/sgml/Makefile
      	doc/src/sgml/installation.sgml
      	doc/src/sgml/ref/initdb.sgml
      	doc/src/sgml/release.sgml
      	src/Makefile.shlib
      	src/backend/executor/execQual.c
      	src/backend/optimizer/path/costsize.c
      	src/backend/optimizer/plan/initsplan.c
      	src/backend/parser/parse_expr.c
      	src/backend/parser/parser.c
      	src/backend/port/Makefile
      	src/backend/utils/adt/float.c
      	src/backend/utils/adt/xml.c
      	src/bin/initdb/initdb.c
      	src/include/utils/xml.h
      	src/interfaces/ecpg/test/expected/compat_informix-charfuncs.c
      	src/interfaces/ecpg/test/expected/compat_informix-dec_test.c
      	src/interfaces/ecpg/test/expected/compat_informix-rfmtdate.c
      	src/interfaces/ecpg/test/expected/compat_informix-rfmtlong.c
      	src/interfaces/ecpg/test/expected/compat_informix-rnull.c
      	src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
      	src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c
      	src/interfaces/ecpg/test/expected/connect-test1.c
      	src/interfaces/ecpg/test/expected/connect-test2.c
      	src/interfaces/ecpg/test/expected/connect-test3.c
      	src/interfaces/ecpg/test/expected/connect-test4.c
      	src/interfaces/ecpg/test/expected/connect-test5.c
      	src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c
      	src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
      	src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c
      	src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c
      	src/interfaces/ecpg/test/expected/preproc-comment.c
      	src/interfaces/ecpg/test/expected/preproc-define.c
      	src/interfaces/ecpg/test/expected/preproc-init.c
      	src/interfaces/ecpg/test/expected/preproc-type.c
      	src/interfaces/ecpg/test/expected/preproc-variable.c
      	src/interfaces/ecpg/test/expected/preproc-whenever.c
      	src/interfaces/ecpg/test/expected/sql-array.c
      	src/interfaces/ecpg/test/expected/sql-binary.c
      	src/interfaces/ecpg/test/expected/sql-code100.c
      	src/interfaces/ecpg/test/expected/sql-copystdout.c
      	src/interfaces/ecpg/test/expected/sql-define.c
      	src/interfaces/ecpg/test/expected/sql-desc.c
      	src/interfaces/ecpg/test/expected/sql-dynalloc.c
      	src/interfaces/ecpg/test/expected/sql-dynalloc2.c
      	src/interfaces/ecpg/test/expected/sql-dyntest.c
      	src/interfaces/ecpg/test/expected/sql-execute.c
      	src/interfaces/ecpg/test/expected/sql-fetch.c
      	src/interfaces/ecpg/test/expected/sql-func.c
      	src/interfaces/ecpg/test/expected/sql-indicators.c
      	src/interfaces/ecpg/test/expected/sql-quote.c
      	src/interfaces/ecpg/test/expected/sql-show.c
      	src/interfaces/ecpg/test/expected/thread-thread.c
      	src/interfaces/ecpg/test/expected/thread-thread_implicit.c
      	src/interfaces/libpq/Makefile
      	src/test/regress/expected/xml.out
      	src/test/regress/expected/xml_1.out
      	src/test/regress/sql/xml.sql
      3f1c2890
    • H
      Merge commit '29dccf5f' into master · 0b90b058
      Heikki Linnakangas 提交于
      Just the bump in copyright year in this, nothing interesting. And almost
      every file already carried a higher year already anyway, so I didn't
      touch those. I did update the PostgreSQL CVS tags where applicable, though,
      just to reduce the number of merge conflicts in future.
      0b90b058
  3. 27 11月, 2015 1 次提交
    • H
      Merge commit '5a2a527b' · c9a0fa4d
      Heikki Linnakangas 提交于
      Noth much interesting here, but I wanted to stop before the next upstream
      commit, which is a mechanical Copyright year bump.
      
      Conflicts:
      	contrib/btree_gist/btree_gist.sql.in
      	doc/FAQ
      	doc/FAQ_DEV
      	doc/FAQ_japanese
      	doc/bug.template
      	doc/src/FAQ/FAQ.html
      	doc/src/FAQ/FAQ_DEV.html
      	doc/src/FAQ/FAQ_japanese.html
      	doc/src/sgml/ref/pg_ctl-ref.sgml
      	doc/src/sgml/ref/postgres-ref.sgml
      	doc/src/sgml/ref/reindex.sgml
      	doc/src/sgml/release.sgml
      	src/backend/access/gin/ginvacuum.c
      	src/backend/access/heap/tuptoaster.c
      	src/backend/main/main.c
      	src/backend/postmaster/postmaster.c
      	src/backend/tcop/postgres.c
      	src/backend/utils/adt/float.c
      	src/backend/utils/adt/regexp.c
      	src/bin/pg_ctl/pg_ctl.c
      	src/bin/pg_dump/dumputils.c
      	src/include/catalog/pg_type.h
      	src/include/pg_config.h.win32
      	src/include/utils/builtins.h
      	src/interfaces/ecpg/compatlib/Makefile
      	src/interfaces/ecpg/ecpglib/Makefile
      	src/interfaces/ecpg/pgtypeslib/Makefile
      	src/interfaces/ecpg/preproc/Makefile
      	src/interfaces/libpq/Makefile
      	src/interfaces/libpq/libpq.rc.in
      	src/port/win32ver.rc
      	src/test/regress/pg_regress.c
      	src/tools/RELEASE_CHANGES
      	src/tools/copyright
      	src/tools/msvc/Project.pm
      c9a0fa4d
  4. 26 11月, 2015 6 次提交
    • H
      Merge commit 'ef072219' from PostgreSQL · 11c64252
      Heikki Linnakangas 提交于
      This batch includes:
      
      * A series of tweaks to handling float corner case. Our code is now roughly
        the same as upstream tip of 8.3 stable branch. As part of this merge,
        I reverted some unnecessary changes to the float regression test, so that
        it now closely matches upstream too.
      
      * Widen money datatype to 64 bits. Not that exciting, but noteworthy because
        that changes the on-disk format, and would need to be dealt with if we
        tried to implement in-place upgrade crossing this commit. (There are more
        such changes upcoming from PostgreSQL 8.3, but this is the first)
      
      * Changes to the API of smgr.c and md.c. The big change is that mdread() on
        a block beoynd EOF no longer extends the file with zeros, but throws an
        error. A couple of places had to be tweaked for that. Also, I started
        getting errors from that from a TID scan test case in portals_updatable
        test case. If a table was partitioned, and the current TID was pointing e.g.
        to block 10, we would try to fetch block 10 on all partitions, not only the
        partition the current row came from. That now lead to an ERROR in mdread().
        I suspect this has been wrong all along, but no-one's noticed.
      
      Conflicts:
      	configure
      	src/backend/access/hash/hashpage.c
      	src/backend/access/nbtree/nbtsort.c
      	src/backend/commands/tablecmds.c
      	src/backend/storage/smgr/md.c
      	src/backend/storage/smgr/smgr.c
      	src/backend/utils/adt/float.c
      	src/backend/utils/adt/int.c
      	src/backend/utils/adt/network.c
      	src/include/catalog/catversion.h
      	src/include/catalog/pg_type.h
      	src/include/port/win32.h
      	src/include/storage/smgr.h
      	src/test/regress/expected/float4.out
      	src/test/regress/expected/float8.out
      	src/test/regress/expected/rules.out
      11c64252
    • H
      Minor cosmetic cleanup. · e2cf5231
      Heikki Linnakangas 提交于
      Move a comment outside local block, so that the indentation matches
      upstream. Remove some unnecessary #includes.
      e2cf5231
    • H
      Merge commit '0b56be83' from PostgreSQL. · 9b88bed2
      Heikki Linnakangas 提交于
      This batch includes a bunch of misc fixes, but the most notable change is
      the support for type modifiers of user-defined types. There were also a
      bunch of XML-type related fixes, but most of those were not applicable
      (i.e. had them already), as I backported the 9.1 XML implementation in toto
      already.
      
      Conflicts:
      	contrib/pgbench/pgbench.c
      	contrib/tsearch2/dict_thesaurus.c
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	doc/src/sgml/catalogs.sgml
      	doc/src/sgml/ddl.sgml
      	doc/src/sgml/errcodes.sgml
      	doc/src/sgml/installation.sgml
      	doc/src/sgml/keywords.sgml
      	doc/src/sgml/maintenance.sgml
      	doc/src/sgml/plpgsql.sgml
      	doc/src/sgml/ref/create_type.sgml
      	doc/src/sgml/ref/vacuum.sgml
      	doc/src/sgml/rules.sgml
      	src/backend/access/common/tupdesc.c
      	src/backend/access/nbtree/README
      	src/backend/access/nbtree/nbtutils.c
      	src/backend/commands/tablecmds.c
      	src/backend/commands/typecmds.c
      	src/backend/executor/execMain.c
      	src/backend/executor/execQual.c
      	src/backend/executor/execUtils.c
      	src/backend/executor/nodeBitmapHeapscan.c
      	src/backend/executor/nodeFunctionscan.c
      	src/backend/executor/nodeIndexscan.c
      	src/backend/executor/nodeResult.c
      	src/backend/executor/nodeSeqscan.c
      	src/backend/executor/nodeSubplan.c
      	src/backend/executor/nodeSubqueryscan.c
      	src/backend/executor/nodeTidscan.c
      	src/backend/executor/nodeValuesscan.c
      	src/backend/executor/spi.c
      	src/backend/nodes/copyfuncs.c
      	src/backend/nodes/equalfuncs.c
      	src/backend/nodes/makefuncs.c
      	src/backend/nodes/outfuncs.c
      	src/backend/nodes/readfuncs.c
      	src/backend/optimizer/util/clauses.c
      	src/backend/parser/gram.y
      	src/backend/parser/keywords.c
      	src/backend/parser/parse_coerce.c
      	src/backend/parser/parse_expr.c
      	src/backend/parser/parse_relation.c
      	src/backend/parser/parse_target.c
      	src/backend/parser/parse_type.c
      	src/backend/storage/buffer/localbuf.c
      	src/backend/utils/adt/arrayutils.c
      	src/backend/utils/adt/date.c
      	src/backend/utils/adt/float.c
      	src/backend/utils/adt/format_type.c
      	src/backend/utils/adt/ruleutils.c
      	src/backend/utils/adt/timestamp.c
      	src/backend/utils/adt/varbit.c
      	src/backend/utils/adt/varchar.c
      	src/backend/utils/adt/xml.c
      	src/backend/utils/cache/lsyscache.c
      	src/backend/utils/cache/relcache.c
      	src/backend/utils/mb/mbutils.c
      	src/backend/utils/misc/guc.c
      	src/backend/utils/mmgr/aset.c
      	src/bin/pg_dump/pg_dump.c
      	src/bin/psql/command.c
      	src/bin/psql/input.c
      	src/bin/psql/mbprint.c
      	src/include/catalog/catversion.h
      	src/include/catalog/pg_class.h
      	src/include/catalog/pg_proc.h
      	src/include/catalog/pg_type.h
      	src/include/mb/pg_wchar.h
      	src/include/nodes/nodes.h
      	src/include/nodes/parsenodes.h
      	src/include/nodes/primnodes.h
      	src/include/parser/parse_coerce.h
      	src/include/parser/parse_type.h
      	src/include/utils/array.h
      	src/include/utils/builtins.h
      	src/include/utils/timestamp.h
      	src/include/utils/varbit.h
      	src/include/utils/xml.h
      	src/interfaces/libpq/Makefile
      	src/pl/plpgsql/src/pl_exec.c
      	src/test/regress/expected/create_type.out
      	src/test/regress/expected/horology.out
      	src/test/regress/expected/opr_sanity.out
      	src/test/regress/expected/xml.out
      	src/test/regress/expected/xml_1.out
      	src/test/regress/sql/create_type.sql
      	src/test/regress/sql/opr_sanity.sql
      	src/tools/findoidjoins/README
      	src/tools/msvc/Solution.pm
      	src/tools/pgindent/pgindent
      9b88bed2
    • N
      Merge pull request #121 from armenatzoglou/nikos-wrong_immutable_funcs · 5d870156
      Nikos Armenatzoglou 提交于
      Fix: Immutable function mregr_coef returns different results
      5d870156
    • N
      Fix: Immutable function mregr_coef returns different results · 0fe93961
      Nikos Armenatzoglou 提交于
      The immutable function was returning different values, because it was allocating memory and using a table whose entries may have a garbage initial value.
      The fix initiates the entries of the table to zero.
      0fe93961
    • J
      Refactor gpmgmt1 test in bugbuster. · b6468738
      Jimmy Yih 提交于
      In the gpmgmt1 bugbuster test, the gpstate -f line makes a
      connection to the template1 database which can cause the
      other tests in gpmgmt1's parallel test group to fail.  An
      example of this is when metadata_track tries to create
      databases and fails as template1 is being accessed.
      
      gpstate -f in gpmgmt1 bugbuster test has been removed.
      b6468738
  5. 25 11月, 2015 5 次提交
    • C
    • J
      Change gpdbrestore -G flag to allow globals-only restore. · d5f6a81e
      Jamie McAtamney 提交于
      The gpdbrestore -G flag has been modified from a boolean flag
      to one that accepts an optional argument.  Passing it the
      argument "include" will carry out the old -G functionality,
      restoring global objects in addition to performing a normal
      restore; passing it no argument will do the same, to retain
      backwards compatibility.  Passing it the argument "only" will
      restore global objects but will not restore anything else.
      
      Authors: James McAtamney and Jimmy Yih
      d5f6a81e
    • C
      Add --change-schema flag to allow restoring tables to a different schema · 6afeda82
      Chumki Roy 提交于
      Currently gpdbrestore does not allow tables to be restored from one schema to another.
      Eg:
      testschema.testtable => anotherschema.testtable
      6afeda82
    • H
      Merge commit 'a78fcfb5' into master · cebb37fb
      Heikki Linnakangas 提交于
      This merges operator families from upstream.
      
      Conflicts:
      	contrib/intarray/_int.sql.in
      	contrib/intarray/uninstall__int.sql
      	doc/src/sgml/catalogs.sgml
      	doc/src/sgml/indexam.sgml
      	doc/src/sgml/indices.sgml
      	doc/src/sgml/xoper.sgml
      	src/backend/access/hash/hashfunc.c
      	src/backend/access/index/indexam.c
      	src/backend/access/nbtree/nbtsearch.c
      	src/backend/catalog/Makefile
      	src/backend/catalog/dependency.c
      	src/backend/catalog/namespace.c
      	src/backend/commands/indexcmds.c
      	src/backend/commands/opclasscmds.c
      	src/backend/commands/operatorcmds.c
      	src/backend/commands/tablecmds.c
      	src/backend/executor/nodeIndexscan.c
      	src/backend/executor/nodeMergejoin.c
      	src/backend/nodes/copyfuncs.c
      	src/backend/nodes/outfuncs.c
      	src/backend/nodes/readfuncs.c
      	src/backend/optimizer/path/indxpath.c
      	src/backend/optimizer/path/joinpath.c
      	src/backend/optimizer/plan/createplan.c
      	src/backend/optimizer/plan/planagg.c
      	src/backend/optimizer/plan/subselect.c
      	src/backend/optimizer/util/clauses.c
      	src/backend/optimizer/util/pathnode.c
      	src/backend/optimizer/util/predtest.c
      	src/backend/optimizer/util/restrictinfo.c
      	src/backend/utils/adt/ruleutils.c
      	src/backend/utils/adt/selfuncs.c
      	src/backend/utils/cache/catcache.c
      	src/backend/utils/cache/lsyscache.c
      	src/backend/utils/cache/relcache.c
      	src/backend/utils/cache/syscache.c
      	src/backend/utils/sort/tuplesort.c
      	src/bin/initdb/initdb.c
      	src/bin/pg_dump/pg_dump.c
      	src/include/catalog/catversion.h
      	src/include/catalog/indexing.h
      	src/include/catalog/pg_amop.h
      	src/include/catalog/pg_amproc.h
      	src/include/catalog/pg_opclass.h
      	src/include/catalog/pg_operator.h
      	src/include/nodes/plannodes.h
      	src/include/nodes/relation.h
      	src/include/optimizer/pathnode.h
      	src/include/utils/lsyscache.h
      	src/include/utils/selfuncs.h
      	src/include/utils/syscache.h
      	src/test/regress/expected/opr_sanity.out
      	src/test/regress/expected/sanity_check.out
      	src/tools/findoidjoins/README
      cebb37fb
    • A
      Wrong number of parameters in string formatting · a280b8b2
      Alexey Grishchenko 提交于
      We should be more careful with string substitutions. The old code generates
      stack trace without giving out the information which host has the problem
      due to the bug in code Zendesk ticket
      https://discuss.zendesk.com/agent/tickets/17783
      a280b8b2
  6. 24 11月, 2015 2 次提交
  7. 23 11月, 2015 7 次提交
  8. 21 11月, 2015 3 次提交
    • A
      Avoid SEGV during backend initialization due to elog(ERROR). · a0eda0cb
      Asim Praveen 提交于
      This is fixed in PostgreSQL and I found parts of those fixes pulled in already.
      This commit pulls in the remnants.  The SEGV was found at a customer site
      where default_tablespace was configured for a role.  While new connections were
      made by the role, GRANT/REVOKE on the same tablespace was running concurrently.
      The assign hook for default_tablespace invoked elog(ERROR) but target for
      siglongjmp was not initialized, causing a segv and PANIC.
      
      Some unit tests had to be changed to accommodate the fix.
      
      Original commits from PostgreSQL:
      88f1fd29
      79ca7ffe
      a0eda0cb
    • C
      Add final table row count validation for gptransfer · f3f9b1ee
      Chumki Roy 提交于
      Currently GPtransfer has count validation which runs after every table transfer. It does not do any checking at the end of the transfer to the destination. Therefore it does not validate that the tables haven't changed in the meantime.
      
      To resolve the issue, an additional table row count validation has been added with all the existing validation options. This count validation does a final pass after the transfer is completely done to make sure the tables haven't changed in the meantime. Therefore, the default is to compare the row count of tables copied to the destination databases with the tables in the source database.
      
      Also an option '--no-final-count’ has beed introduced for users who do not want to run the final count validation by default. The option '--no-final-count’ will disable table row count validation that is performed after GPtransfer completes copying database objects to the target database.
      f3f9b1ee
    • X
      Bump optimizer version from 1.607 to 1.608. · aa53124b
      Xin Zhang 提交于
      aa53124b
  9. 20 11月, 2015 3 次提交