1. 19 1月, 2016 2 次提交
    • H
      Remove dead, broken code. · b4abe122
      Heikki Linnakangas 提交于
      This is dead, because SubPlan is an Expr node and therefore cannot appear
      in a Plan tree.
      
      This was broken, because the "subplan = (SubPlan *) subplan" cast didn't
      do anything, and subplan was potentially uninitialized. It meant to say
      "subplan = (SubPlan *) plan".
      
      Spotted by Daniel Gustafsson.
      b4abe122
    • H
      Merge upto '5a7471c3' from PostgreSQL 8.3 · 9b6bd793
      Heikki Linnakangas 提交于
      This merges the COST and ROWS options for functions.
      
      One GPDB-specific question was what the ROWS option means for GPDB
      table functions. I decided to keep the old estimation method, where the
      number of output rows for a table function is estimated to be the same
      as input rows, and ignore the ROWS option.
      
      Also regenerate 4.3.json file, which I forgot to do in the previous commit.
      
      Conflicts:
      	doc/src/sgml/catalogs.sgml
      	doc/src/sgml/ref/create_function.sgml
      	src/backend/bootstrap/bootstrap.c
      	src/backend/catalog/pg_aggregate.c
      	src/backend/catalog/pg_proc.c
      	src/backend/commands/functioncmds.c
      	src/backend/commands/proclang.c
      	src/backend/optimizer/path/costsize.c
      	src/backend/optimizer/plan/createplan.c
      	src/backend/optimizer/plan/setrefs.c
      	src/backend/parser/gram.y
      	src/backend/parser/keywords.c
      	src/backend/utils/Gen_fmgrtab.sh
      	src/backend/utils/cache/lsyscache.c
      	src/bin/pg_dump/pg_dump.c
      	src/include/catalog/catversion.h
      	src/include/catalog/pg_attribute.h
      	src/include/catalog/pg_class.h
      	src/include/catalog/pg_proc.h
      	src/include/optimizer/cost.h
      	src/include/utils/lsyscache.h
      9b6bd793
  2. 18 1月, 2016 9 次提交
    • H
      Merge upto 'a85e9c61' from PostgreSQL 8.3 · 27a72dc6
      Heikki Linnakangas 提交于
      Conflicts:
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	src/interfaces/ecpg/test/Makefile
      	src/interfaces/ecpg/test/pg_regress.sh
      27a72dc6
    • H
      Improve the tests for gp_toolkit. · 0d2672a6
      Heikki Linnakangas 提交于
      This brings in test queries from the "jetpack" test case in cdbfast (a
      legacy Pivotal test suite that has not been open sourced yet), to cover
      the gp_toolkit functionality that was not already covered by the bugbuster
      tests. Move the test case from bugbuster into the main suite - this should
      not be considered optional or auxiliary anymore.
      0d2672a6
    • H
      Fix __gp_user_tables_readable to not error out on inaccessible schemas. · 4b8e880f
      Heikki Linnakangas 提交于
      If there is a schema in the database that the user does not have access to,
      doing "select * from gp_toolkit.__gp_user_tables_readable" throws a
      permission denied error on the schema. Use the relation-OID-variant of
      has_table_privilege() function, to work around that.
      4b8e880f
    • H
      Refactor btree_desc() code to match upstream more closely. · 5fc44b19
      Heikki Linnakangas 提交于
      This isn't otherwise better than the existing code, but this matches the
      upstream more closely, which will make merging slightly easier.
      5fc44b19
    • H
      Move functions related to parsing of PARTITION BY clause to separate file. · 14fc7182
      Heikki Linnakangas 提交于
      parser/analyze.c is bloated, moving larger chunks of GPDB-specific
      functionality like this elsewhere makes it more readable. Make diffing and
      merging of analyze.c with upstream easier, too.
      
      I also ran pgindent on parse_partition.c.
      14fc7182
    • H
      Move createRandomDistribution() function to a more appropriate place. · d7b41c05
      Heikki Linnakangas 提交于
      parser/analyze.c is overcrowded, and since it's an upstream file, extra
      code there can confuse merging (though completely new functions are less
      of a problem).
      d7b41c05
    • H
      Move auto-stats related functions to separate file. · 0f73e33d
      Heikki Linnakangas 提交于
      The GPDB-specific auto-stats system doesn't really have anything to do with
      autovacuum. It's not run by the autovacuum daemon, and there are no calls
      from the autovacuum code to autostats code.
      0f73e33d
    • H
      Merge upto 'fcf4b146' from PostgreSQL 8.3 · 01ce6924
      Heikki Linnakangas 提交于
      Conflicts:
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	doc/src/sgml/catalogs.sgml
      	doc/src/sgml/func.sgml
      	doc/src/sgml/indexam.sgml
      	doc/src/sgml/xindex.sgml
      	src/include/catalog/catversion.h
      	src/include/catalog/pg_am.h
      01ce6924
    • H
      Merge commit 'ebef17c7' from PostgreSQL 8.3 · 087bf2e8
      Heikki Linnakangas 提交于
      The big change in this merge is the "equivalence classes" mechanism. That's
      not too exciting as a feature, but cleans up a lot of the planner stuff that
      tracks which expressions can be treated as equal, and used interchangeably.
      
      This required quite a lot of changes in the GPDB-specific code that tracks
      the distribution keys of tables and intermediate nodes in a plan.
      
      One notable refactoring, that didn't originate from the upstream, was the
      change to CdbPathLocus, to split the "pathkeys" field into two. That reduces
      the confusion on which kind of a List we're dealing with.
      
      This includes fixes from a couple of later upstream commits: 48d9d8e1 and
      11086f2f. Those were needed to fix regression failures in GPDB-added tests.
      
      Merge by Daniel Gustafsson and me.
      
      Conflicts:
      	doc/src/sgml/config.sgml
      	doc/src/sgml/installation.sgml
      	doc/src/sgml/xoper.sgml
      	src/backend/access/gist/gistget.c
      	src/backend/access/gist/gistscan.c
      	src/backend/nodes/copyfuncs.c
      	src/backend/nodes/outfuncs.c
      	src/backend/optimizer/README
      	src/backend/optimizer/path/Makefile
      	src/backend/optimizer/path/costsize.c
      	src/backend/optimizer/path/indxpath.c
      	src/backend/optimizer/path/joinpath.c
      	src/backend/optimizer/path/joinrels.c
      	src/backend/optimizer/path/pathkeys.c
      	src/backend/optimizer/plan/createplan.c
      	src/backend/optimizer/plan/initsplan.c
      	src/backend/optimizer/plan/planmain.c
      	src/backend/optimizer/plan/planner.c
      	src/backend/optimizer/prep/prepunion.c
      	src/backend/optimizer/util/joininfo.c
      	src/backend/optimizer/util/pathnode.c
      	src/backend/optimizer/util/relnode.c
      	src/backend/optimizer/util/restrictinfo.c
      	src/backend/utils/error/elog.c
      	src/backend/utils/misc/postgresql.conf.sample
      	src/bin/psql/describe.c
      	src/include/access/gist_private.h
      	src/include/access/hash.h
      	src/include/nodes/nodes.h
      	src/include/nodes/relation.h
      	src/include/optimizer/pathnode.h
      	src/include/optimizer/paths.h
      	src/include/optimizer/planmain.h
      	src/include/optimizer/restrictinfo.h
      087bf2e8
  3. 16 1月, 2016 3 次提交
  4. 15 1月, 2016 2 次提交
  5. 14 1月, 2016 4 次提交
  6. 13 1月, 2016 3 次提交
  7. 12 1月, 2016 6 次提交
    • H
      Make functions in gp_toolkit to execute on all nodes as intended. · 246f7510
      Heikki Linnakangas 提交于
      Moving the installation of gp_toolkit.sql into initdb, in commit f8910c3c,
      broke all the functions that are supposed to execute on all nodes, like
      gp_toolkit.__gp_localid. After that change, gp_toolkit.sql was executed
      in utility mode, and the gp_distribution_policy entries for those functions
      were not created as a result.
      
      To fix, change the code so that gp_distribution_policy entries are never
      never created, or consulted, for EXECUTE-type external tables. They have
      more fine-grained information in pg_exttable.location field anyway, so rely
      on that instead. With this change, there is no difference in whether an
      EXECUTE-type external table is created in utility mode or not. We would
      still have similar problems if gp_toolkit contained other kinds of
      external tables, but it doesn't.
      
      This removes the isMasterOnly() function and changes all its callers to
      call GpPolicyFetch() directly instead. Some places used GpPolicyFetch()
      directly to check if a table is distributed, so this just makes that the
      canonical way to do it. The check for system schemas that used to be in
      isMasterOnly() are no longer performed, but they should've unnecessary in
      the first place. System tables don't have gp_distribution_policy entries,
      so they'll be treated as master-only even without that check.
      246f7510
    • H
      Fix buffer overflow in parsing boolean-type storage options. · c3720bc2
      Heikki Linnakangas 提交于
      For "checksum=on/off", we used the "on" or "off" value to allocate space
      (i.e. 2 or 3 bytes), but then constructed a string that said "true" or
      "false" (4 or 5 bytes). That lead to overflowing the allocation by a few
      bytes, which produced warnings on assertion-enabled builds.
      
      The integer parsing almost has the same bug. We use the original string's
      length to allocate space, but we use %d to construct the value actually
      stored there. That happens to not be a bug, because the original length is
      always at least as large. This is a near-miss though: the original value
      might be in hexadecimal format, i.e. "0x7fffffff", and its decimal
      representation might be longer than the original. With 32-bit integers,
      however, that happens to not be possible. as the extra "0x" in front of the
      hex string provides enough padding. (i.e. strlen("0x7fffffff") >=
      strlen("2147483647)"))
      
      To fix, don't even try to count the space needed. Use a StringInfo instead.
      
      In the passing, clean up accumAOStorageOpt function in some other ways:
      remove the namelen argument to make it a bit more readable (this is hardly
      performance-critical code), and don't split error message across lines
      (makes it easier to grep for them if you need to find where an error
      is coming from).
      c3720bc2
    • H
      Move union tinc tests to installcheck good · b9055008
      Haisheng Yuan 提交于
      Closes #259.
      b9055008
    • J
      gptransfer should not try to populate gp_toolkit now · 299425bc
      Jimmy Yih 提交于
      299425bc
    • V
      Cleaning up non-deterministic tests · 3283e413
      Venkatesh Raghavan 提交于
      3283e413
    • H
      Add minirepro to let user dump minimal set of DDL and statistics for a given query · bc8726ad
      Haisheng Yuan 提交于
      Usage: minirepro <database> [options]
      
      Options:
        --version             show program's version number and exit
        -?, --help            Show this help message and exit
        -h HOST, --host=HOST  Specify a remote host
        -p PORT, --port=PORT  Specify a port other than 5432
        -U USER, --user=USER  Connect as someone other than current user
        -q QUERY_FILE         file name that contains the query
        -f OUTPUT_FILE        minirepro output file name
      
      Closes #157.
      bc8726ad
  8. 08 1月, 2016 5 次提交
  9. 07 1月, 2016 6 次提交