1. 26 1月, 2016 2 次提交
    • K
      DEFAULT paramters of UDF ported from PostgreSQL 8.4 · 5b2af3cf
      Kuien Liu 提交于
      Functions can be declared with parameters with default values or
      expressions.  The default expressions are used as parameter value
      if the parameter is not explicitly specified in a function call.
      All parameters after a parameter with default value have to be
      parameters with default values as well.
      
      It allows user to invoke a UDF without setting all the parameters.
      Two examples to demo its usage:
      
          CREATE FUNCTION dfunc1(text DEFAULT 'Hello', text DEFAULT 'World')
              RETURNS text AS $$
              SELECT $1 || ', ' || $2;
              $$ LANGUAGE SQL;
          SELECT dfunc1();  -- 'Hello, World'
          SELECT dfunc1('Hi');  -- 'Hi, World'
          SELECT dfunc1('Hi', 'Beijing');  -- 'Hi, Beijing'
      
          CREATE FUNCTION dfunc2(id int4, t timestamp DEFAULT now())
              RETURNS text AS $$
              SELECT 'Time for id:' || $1 || ' is ' || $2;
              $$ LANGUAGE SQL;
          SELECT dfunc2(24);  -- 'Time for id:24 is 2016-01-07 14:38'
      
      NOTE: The default change set is ported from from PostgreSQL 8.4,
          original commits:
          '517ae403'
          '455dffbb'
      5b2af3cf
    • H
      Update "clients" submodule reference, for removal fo cdbdistributedxidmap.h. · cfba9714
      Heikki Linnakangas 提交于
      The file was being included in the Windows installers, which caused the
      Windows build to fail once the file was removed.
      cfba9714
  2. 25 1月, 2016 13 次提交
    • H
      Fix coverity on 16905 Explicit null dereferenced · 98bc2483
      Haisheng Yuan 提交于
      Closes #303
      98bc2483
    • D
      Merge upto 'a8e0b660' from PostgreSQL 8.3 · 89dcc9c0
      Daniel Gustafsson 提交于
      This patch merges the fix for plpgsql simple expression evaluation mechanism
      to ensure it behaves safely in the presence of subtransactions.
      
       Conflicts:
      	src/pl/plpgsql/src/pl_exec.c
      	src/pl/plpgsql/src/pl_handler.c
      	src/pl/plpgsql/src/plpgsql.h
      89dcc9c0
    • H
      Update alternative join_gp expected output, for when ORCA is enabled. · 80599797
      Heikki Linnakangas 提交于
      Forgot to update this in previous commit, when I added a test query to the
      test.
      80599797
    • H
      Fix "variable not found in subplan target list" error. · db3320e5
      Heikki Linnakangas 提交于
      Some test queries in the TINC/cdbfast test suite were failing with that
      error, after merging the equivalence classes path. The problem was that
      the Motion node's hash key an incorrect equivalence class member, one that
      wasn't in the target list, instead of one that was.
      
      To fix, make cdbpullup_findPathKeyExprInTargetList() return the actual Expr
      that it finds, not just the EquivalenceClass containing it. The logic in
      cdbpathlocus_get_partkey_exprs() that tried to find the right member was
      not correct: it's not enough to check that the relids overlap.
      
      This brings the code in question closer to the way it was before the
      equivalence classes merge.
      db3320e5
    • H
      Remove dead code. · f86b9b35
      Heikki Linnakangas 提交于
      The cdbdistributedxidmap.c file was not in Makefile and was not compiled
      (and would throw errors if you tried).
      f86b9b35
    • D
      Merge uptop '76c7d2af' from PostgreSQL 8.3 · 9114f298
      Daniel Gustafsson 提交于
      All the commits in this set were either doc commits or had already been cherry
      picked into GPDB so barring a small pg_sleep() diff in the tests, another merge
      without side effects.
      
       Conflicts:
      	configure
      	doc/src/sgml/Makefile
      	doc/src/sgml/docguide.sgml
      	src/backend/access/nbtree/nbtinsert.c
      	src/backend/postmaster/postmaster.c
      	src/backend/utils/adt/selfuncs.c
      	src/port/exec.c
      9114f298
    • H
      Remove comment referring to non-existent function. · ff547ba2
      Heikki Linnakangas 提交于
      I removed pathnode_copy_node() in an earlier commit, but missed this
      comment. If someone needs to copy a Path in the future, they'll have to
      come up with a way to do it at that point, but there hasn't been any need
      for that so far. (copyObject() should work, but it makes a deep copy, while
      the old pathnode_copy_node() function made a shallow copy.
      ff547ba2
    • H
      Remove spurious #includes in the middle of .c file. · a4ea28eb
      Heikki Linnakangas 提交于
      These really don't belong here.
      a4ea28eb
    • H
      Silence compiler warning about uninitialized use of variable. · 6d2232a0
      Heikki Linnakangas 提交于
      The compiler was wrong, the variable is only used if 'ismeta', and it is
      always initialized in that case. Silence the warning by initializing it
      anyway.
      6d2232a0
    • H
      Silence compiler warnings about unused functions. · c81435b9
      Heikki Linnakangas 提交于
      _outEquivalenceClass and _outEquivalenceMember were unused, when included
      into outfast.c. We have no need to serialize them when shipping a finished
      Plan to segments, so just ifdef them out to silence the compiler. (The
      regular textual "out" functions, for debugging purposes, work normally.)
      c81435b9
    • H
      Remove unused PORTAL_STATUSMAX enum value · 7746e331
      Heikki Linnakangas 提交于
      7746e331
    • H
      Fix reconstruct_pathkeys() function, broken by equivalence classes merge. · 2abb80fe
      Heikki Linnakangas 提交于
      It was quite clearly broken, as it didn't do anything with the new_tle
      that it chased up, and the end result was just the same as calling
      canonicalize_pathkeys() on the input.
      2abb80fe
    • D
      Silence compiler warning in gpfdist.c · e8f1d62a
      Dan Danese 提交于
      When compiling gpfdist on Ubuntu, the compile fails because of the compiler
      flag to treat all warnings as errors. You get a warning when calling
      freopen and not checking the result of the call.
      
      Added a check for NULL of the redirect of stdout and stderr on init. If it
      fails, it will print a message and return out of init with a -1.
      e8f1d62a
  3. 24 1月, 2016 1 次提交
    • D
      Merge upto 'ee57938c' from PostgreSQL 8.3 · 3863e617
      Daniel Gustafsson 提交于
      This set of patches were all already cherry-picked into PGDB or was rejected
      due to being Doc patches.
      
       Conflicts:
      	contrib/intarray/_int.h
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	doc/src/sgml/Makefile
      	doc/src/sgml/docguide.sgml
      	doc/src/sgml/installation.sgml
      	src/backend/libpq/be-secure.c
      	src/backend/port/win32/socket.c
      	src/backend/postmaster/pgstat.c
      	src/backend/utils/adt/xml.c
      	src/include/port/win32.h
      	src/interfaces/ecpg/ChangeLog
      	src/interfaces/ecpg/ecpglib/extern.h
      	src/interfaces/ecpg/ecpglib/typename.c
      	src/interfaces/libpq/fe-secure.c
      	src/interfaces/libpq/libpq-int.h
      	src/pl/plperl/expected/plperl.out
      	src/pl/plperl/plperl.c
      	src/pl/plperl/sql/plperl.sql
      	src/timezone/ialloc.c
      	src/timezone/zic.c
      	src/tools/msvc/Project.pm
      	src/tools/msvc/build.bat
      	src/tools/msvc/mkvcbuild.pl
      3863e617
  4. 22 1月, 2016 6 次提交
    • D
      Merge upto '167fa70a' from PostgreSQL · 8e7886dd
      Daniel Gustafsson 提交于
      This merge only brings a small doc update and a bugfix in detaosting
      access to bytea field in pg_trigger.tgargs. The main changes in this
      set of patches were XML related which we already have (from 9.1) and
      the introduction of tablespaces for temporary objects which GPDB
      already have with filespaces for temporary objects.
      
       Conflicts:
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	doc/src/sgml/config.sgml
      	doc/src/sgml/datatype.sgml
      	src/backend/commands/indexcmds.c
      	src/backend/commands/tablecmds.c
      	src/backend/commands/tablespace.c
      	src/backend/commands/trigger.c
      	src/backend/executor/execMain.c
      	src/backend/executor/execQual.c
      	src/backend/parser/gram.y
      	src/backend/parser/keywords.c
      	src/backend/parser/parse_expr.c
      	src/backend/storage/file/fd.c
      	src/backend/utils/adt/xml.c
      	src/backend/utils/misc/postgresql.conf.sample
      	src/include/utils/guc.h
      	src/include/utils/xml.h
      	src/pl/plpython/plpython.c
      	src/test/regress/expected/xml.out
      	src/test/regress/expected/xml_1.out
      	src/test/regress/sql/xml.sql
      8e7886dd
    • H
      Fix confusion over opfamily used for a join clause in a window agg. · 5f519a89
      Heikki Linnakangas 提交于
      I'm not 100% the code is doing the right thing even with this: If the
      pathkey's operator family doesn't match the join clause's operator family,
      the output isn't truly ordered the same way. This is not an issue for the
      case that I included in the regression test, where the join happens on a
      constant, but I can't figure out whether this might be an issue with some
      other query.
      5f519a89
    • H
      Fix bug in checking whether a cached function is still valid. · 74a71329
      Heikki Linnakangas 提交于
      When the combocids patch was backported from PostgreSQL 8.3 (c3983003), the
      changes to change the cache key of compiled functions were left out for
      some reason. Those changes are necessary: calling HeapTupleHeaderGetCMin()
      on the pg_proc tuple will trip an assertion, if the tuple has been moved by
      VACUUM FULL, and therefore HEAP_MOVED flags on the tuple are set. To fix,
      backport the missing parts of the upstream combocid patch.
      74a71329
    • H
      Remove unused field. · a653bd6a
      Heikki Linnakangas 提交于
      a653bd6a
    • H
      Fix assertion failure if the producer of a share scan is in subplan. · 7d9ca5db
      Heikki Linnakangas 提交于
      The comment in apply_shareinput_xslice() said that we process top-plan
      first, to ensure that we find the producer of a shared scan before its
      consumers, when the top plan contains a producer for subplans. But the
      situation can just as well be the other way 'round.
      
      No new test case added, because running the existing with_clause test
      with gp_cte_sharing=on trips the assertion.
      
      Fixes github issue #287.
      7d9ca5db
    • N
      Handle unfinished sort due to QueryFinishPending · e6acd16b
      Nikos Armenatzoglou 提交于
      My previous commit (3d0a4806), which was solving the issue described in pull request #276, was braking some ICG tests in some operating systems and we reverted it. This is a complete fix for the same issue.
      e6acd16b
  5. 21 1月, 2016 6 次提交
    • S
      Update gpcheckcat summary report · 4339a3bc
      Stephen Carter 提交于
      Currently to check previous runtimes it takes multiple grep commands
      to summarize the log file. This change adds all the information to a
      single line making it far easier to check historical runtimes. The
      historical runtimes can be used to estimate the required maintenance
      window for future runs.
      4339a3bc
    • D
      Merge upto '6441288e' from PostgreSQL 8.3 · e779bf66
      Daniel Gustafsson 提交于
      This merge adds --tablespaces-only and --roles-only to pg_dumpall. Since
      both GPDB and upstream have used -r in pg_dumpall, this commits disables
      -r and instead issues an error to avoid confusion.
      
       Conflicts:
      	doc/TODO
      	doc/src/FAQ/TODO.html
      	doc/src/sgml/ref/pg_dumpall.sgml
      	src/bin/pg_dump/pg_backup_archiver.h
      	src/bin/pg_dump/pg_dumpall.c
      	src/include/c.h
      e779bf66
    • D
      Merge upto 'ef65f6f7' from PostgreSQL 8.3 · ca5e1901
      Daniel Gustafsson 提交于
      This patch prevents WAL logging when COPY is done in the same transaction
      that created it. fba8113c is also cherry
      picked into this merge since it has fixups to this patch as well as
      related WAL skipping changes to CLUSTER.
      
       Conflicts:
      	doc/src/sgml/perform.sgml
      	src/backend/access/heap/heapam.c
      	src/backend/access/heap/tuptoaster.c
      	src/backend/catalog/index.c
      	src/backend/commands/copy.c
      	src/backend/executor/execMain.c
      	src/backend/utils/cache/relcache.c
      	src/include/access/tuptoaster.h
      ca5e1901
    • X
      Merge partition_full_outer_join back to partition1. · 7f8d0c20
      Xin Zhang 提交于
      Closes 275
      7f8d0c20
    • J
      Modify segment dump to exclude certain metadata. · 421d8268
      Jimmy Yih 提交于
      The dump process was checking the segments for several kinds of
      metadata, such as indexes and triggers, even though they were not
      being included in the dump.  The statements that were performing
      these useless checks have been modified to only run on the master.
      
      Authors: James McAtamney and Jimmy Yih
      421d8268
    • X
      Revert "Handling unfinished sort due to QueryFinishPending" · 630bb7f4
      Xin Zhang 提交于
      This reverts commit 3d0a4806.
      
      Closes #288
      630bb7f4
  6. 20 1月, 2016 4 次提交
    • N
      Handling unfinished sort due to QueryFinishPending · 3d0a4806
      Nikos Armenatzoglou 提交于
      This fix prevents gpdb from a segmentation fault in case that: i) a SharedInputScan has a Sort child node, ii) sort spills, and iii) somebody requests to finish the execution during the last stage of the sort (i.e., QueryFinishPending = true). Currently, in the above scenario, SharedInputScan continues the execution and tries to access sort's result_tape, which is NULL, due to QueryFinishPending.
      
      This commit makes a sort node to pretend that there are no results when QueryFinishPending flag is set to true. The commit also  creates a new Fault injector type and includes an ICG test.
      3d0a4806
    • D
      Merge upto '693c85d9' from PostgreSQL 8.3 · 8357ed1d
      Daniel Gustafsson 提交于
      This adds the capability to dump operator families. XML and MSVC build
      fixes were already merged and kept at master.
      
       Conflicts:
      	doc/src/sgml/xindex.sgml
      	src/backend/executor/execScan.c
      	src/backend/utils/adt/xml.c
      	src/backend/utils/mb/wchar.c
      	src/bin/pg_dump/common.c
      	src/bin/pg_dump/pg_backup_archiver.c
      	src/bin/pg_dump/pg_dump.c
      	src/bin/pg_dump/pg_dump.h
      	src/include/port/win32.h
      	src/test/regress/expected/xml.out
      	src/tools/msvc/Project.pm
      	src/tools/msvc/Solution.pm
      	src/tools/msvc/mkvcbuild.pl
      8357ed1d
    • P
      Backup and restore to report errors found from segments' status file · ce4586a7
      Pengcheng Tang 提交于
      Gpcrondump and gpdbrestore redirect stderr into status file for segments,
      errors should be reflected into the master's report file.
      Warnings will be given if process completed but errors were generated in
      the report file.
      
      Also made some refactor of the code.
      
      This commit also reverts 08f4ada7.
      
      Authors: Pengcheng Tang, Nikhil Kak
      ce4586a7
    • S
      Merge pull request #268 from skahler-pivotal/cent7_gpadmin_systemaccount · 339ff865
      Scott Kahler 提交于
      systemd IPC cleanup takes effect if gpadmin is not system user
      339ff865
  7. 19 1月, 2016 8 次提交
    • H
      Forbid DISTRIBUTED BY on an int2vector or aclitem column. · 56e7c16b
      Heikki Linnakangas 提交于
      int2vector and aclitem don't have B-tree operators, making them not
      mergejoinable. In the merge of the equivalence classes patch, I made
      cdb_make_pathkeys_for_expr() more strict on that, and it now throws
      an error if it's passed a datatype that doesn't have a mergejoinable
      = operator. It used to return a path key with InvalidOid as the sort
      operator, but that seems like a recipe for bugs elsehere.
      
      To fix, mandate that all gpdb-hashable datatypes must be mergejoinable.
      int2vector and aclitem are not, so forbid using them in DISTRIBUTED BY.
      
      This is a backwards-incompatible change, but hopefully no-one is using
      int2vector or aclitem in user-tables, at least not as a distribution key.
      56e7c16b
    • H
      Money is 64-bits wide nowadays. Fix comment. · 677772ee
      Heikki Linnakangas 提交于
      677772ee
    • D
      Update comment to match reality · 190cdd14
      Daniel Gustafsson 提交于
      Ensure that the comment match what can happen, YAML files with .yml
      suffix can also be created from mapred.
      190cdd14
    • V
    • H
      Merge upto 'a33cf104' from PostgreSQL 8.3 · 25d68c7a
      Heikki Linnakangas 提交于
      This adds CREATE/ALTER/DROP OPERATOR FAMILY commands.
      
      Conflicts:
      	doc/src/sgml/ref/allfiles.sgml
      	doc/src/sgml/ref/comment.sgml
      	doc/src/sgml/ref/drop_opclass.sgml
      	doc/src/sgml/reference.sgml
      	src/backend/catalog/aclchk.c
      	src/backend/commands/opclasscmds.c
      	src/backend/parser/gram.y
      	src/backend/parser/keywords.c
      	src/backend/tcop/utility.c
      	src/include/nodes/parsenodes.h
      25d68c7a
    • H
      Merge upto '8502b685' from PostgreSQL 8.3 · 6cc2eec5
      Heikki Linnakangas 提交于
      Conflicts:
      	contrib/pgbench/pgbench.c
      	doc/FAQ_MINGW
      	doc/src/sgml/manage-ag.sgml
      	src/backend/optimizer/path/costsize.c
      	src/backend/postmaster/postmaster.c
      	src/include/port/win32.h
      	src/port/exec.c
      6cc2eec5
    • H
      Relax the gp_toolkit tests for relation sizes. · 0ba94507
      Heikki Linnakangas 提交于
      There were failures from these in the Pivotal buildfarm. Some tables were
      larger than expected. I'm not sure why - perhaps there was some concurrent
      activity that bloats append-only tables - but there have been no functional
      changes so these really should be passing.
      0ba94507
    • 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