1. 03 6月, 2016 3 次提交
    • H
      Remove unused 'rewindPlanIDs' fields. · efc1052c
      Heikki Linnakangas 提交于
      The copy/out/read functions for it were wrong: a Bitmapset is not a Node,
      so one should use e.g. COPY_BITMAPSET_FIELD() instead of COPY_NODE_FIELD()
      for them. But since the fields are currently unused, let's just remove them.
      
      These fields will be resurrected soon, by the PostgreSQL 8.3 merge, as they
      were introduced in PostgreSQL 8.3. Then they will actually be used, too.
      efc1052c
    • H
      Move transient information out of PlannedStmt, to a new struct. · 41478b89
      Heikki Linnakangas 提交于
      That includes the slice table, transientRecordTypes, and IntoClause's
      oidInfo. These are transient information, created in ExecutorStart, not
      something that should be cached along with the plan. transientRecordTypes
      and oidInfo in particular were stored in PlannedStmt only so that they can
      be conveniently dispatched to QEs along with the plan. That's not a problem
      at the moment, but with the upcoming PostgreSQL 8.3 merge, we'll start
      keeping the PlannedStmt struct around for many executions, so let's create
      a new struct to hold that kind of information, which is transmitted from
      QD to QEs along with the plan (that new struct is called QueryDispatchDesc).
      41478b89
    • H
      Make InitPlan Param mechanism cope with InitPlans that are never executed. · a5747dbc
      Heikki Linnakangas 提交于
      If there are two InitPlan nodes inside each other, and the outer InitPlan
      never executes the inner InitPlan (because the value of the outer InitPlan
      was determined without it), don't get confused when some of the params
      are not set (= won't even have a valid type OID)
      
      bfv_subquery regression tests exercised this. It failed with
      --enable-cassert. Fixes github issue #500.
      a5747dbc
  2. 02 6月, 2016 1 次提交
  3. 19 5月, 2016 1 次提交
  4. 22 1月, 2016 1 次提交
  5. 28 10月, 2015 1 次提交
  6. 06 2月, 2007 1 次提交
  7. 02 2月, 2007 1 次提交
    • T
      Repair failure to check that a table is still compatible with a previously · 5413eef8
      Tom Lane 提交于
      made query plan.  Use of ALTER COLUMN TYPE creates a hazard for cached
      query plans: they could contain Vars that claim a column has a different
      type than it now has.  Fix this by checking during plan startup that Vars
      at relation scan level match the current relation tuple descriptor.  Since
      at that point we already have at least AccessShareLock, we can be sure the
      column type will not change underneath us later in the query.  However,
      since a backend's locks do not conflict against itself, there is still a
      hole for an attacker to exploit: he could try to execute ALTER COLUMN TYPE
      while a query is in progress in the current backend.  Seal that hole by
      rejecting ALTER TABLE whenever the target relation is already open in
      the current backend.
      
      This is a significant security hole: not only can one trivially crash the
      backend, but with appropriate misuse of pass-by-reference datatypes it is
      possible to read out arbitrary locations in the server process's memory,
      which could allow retrieving database content the user should not be able
      to see.  Our thanks to Jeff Trout for the initial report.
      
      Security: CVE-2007-0556
      5413eef8
  8. 30 1月, 2007 1 次提交
  9. 06 1月, 2007 1 次提交
  10. 27 12月, 2006 1 次提交
    • T
      Fix failure due to accessing an already-freed tuple descriptor in a plan · 0cbc5b1e
      Tom Lane 提交于
      involving HashAggregate over SubqueryScan (this is the known case, there
      may well be more).  The bug is only latent in releases before 8.2 since they
      didn't try to access tupletable slots' descriptors during ExecDropTupleTable.
      The least bogus fix seems to be to make subqueries share the parent query's
      memory context, so that tupdescs they create will have the same lifespan as
      those of the parent query.  There are comments in the code envisioning going
      even further by not having a separate child EState at all, but that will
      require rethinking executor access to range tables, which I don't want to
      tackle right now.  Per bug report from Jean-Pierre Pelletier.
      0cbc5b1e
  11. 04 10月, 2006 1 次提交
  12. 14 7月, 2006 3 次提交
  13. 29 6月, 2006 1 次提交
  14. 17 6月, 2006 1 次提交
    • T
      Fix problems with cached tuple descriptors disappearing while still in use · 06e10abc
      Tom Lane 提交于
      by creating a reference-count mechanism, similar to what we did a long time
      ago for catcache entries.  The back branches have an ugly solution involving
      lots of extra copies, but this way is more efficient.  Reference counting is
      only applied to tupdescs that are actually in caches --- there seems no need
      to use it for tupdescs that are generated in the executor, since they'll go
      away during plan shutdown by virtue of being in the per-query memory context.
      Neil Conway and Tom Lane
      06e10abc
  15. 05 3月, 2006 1 次提交
  16. 28 2月, 2006 1 次提交
    • T
      Extend the ExecInitNode API so that plan nodes receive a set of flag · 2c0ef977
      Tom Lane 提交于
      bits indicating which optional capabilities can actually be exercised
      at runtime.  This will allow Sort and Material nodes, and perhaps later
      other nodes, to avoid unnecessary overhead in common cases.
      This commit just adds the infrastructure and arranges to pass the correct
      flag values down to plan nodes; none of the actual optimizations are here
      yet.  I'm committing this separately in case anyone wants to measure the
      added overhead.  (It should be negligible.)
      
      Simon Riggs and Tom Lane
      2c0ef977
  17. 28 12月, 2005 1 次提交
    • T
      Implement SQL-compliant treatment of row comparisons for < <= > >= cases · 6e077097
      Tom Lane 提交于
      (previously we only did = and <> correctly).  Also, allow row comparisons
      with any operators that are in btree opclasses, not only those with these
      specific names.  This gets rid of a whole lot of indefensible assumptions
      about the behavior of particular operators based on their names ... though
      it's still true that IN and NOT IN expand to "= ANY".  The patch adds a
      RowCompareExpr expression node type, and makes some changes in the
      representation of ANY/ALL/ROWCOMPARE SubLinks so that they can share code
      with RowCompareExpr.
      
      I have not yet done anything about making RowCompareExpr an indexable
      operator, but will look at that soon.
      
      initdb forced due to changes in stored rules.
      6e077097
  18. 23 11月, 2005 1 次提交
  19. 15 10月, 2005 1 次提交
  20. 07 5月, 2005 1 次提交
  21. 07 4月, 2005 1 次提交
    • T
      Merge Resdom nodes into TargetEntry nodes to simplify code and save a · ad161bcc
      Tom Lane 提交于
      few palloc's.  I also chose to eliminate the restype and restypmod fields
      entirely, since they are redundant with information stored in the node's
      contained expression; re-examining the expression at need seems simpler
      and more reliable than trying to keep restype/restypmod up to date.
      
      initdb forced due to change in contents of stored rules.
      ad161bcc
  22. 17 3月, 2005 1 次提交
    • T
      Revise TupleTableSlot code to avoid unnecessary construction and disassembly · f97aebd1
      Tom Lane 提交于
      of tuples when passing data up through multiple plan nodes.  A slot can now
      hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
      of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
      arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
      calls to extract the data again.  This work extends Atsushi Ogawa's earlier
      patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
      (I believe however that something like this was foreseen way back in Berkeley
      days --- see the old comment on ExecProject.)  A test case involving many
      levels of join of fairly wide tables (about 80 columns altogether) showed
      about 3x overall speedup, though simple queries will probably not be
      helped very much.
      
      I have also duplicated some code in heaptuple.c in order to provide versions
      of heap_formtuple and friends that use "bool" arrays to indicate null
      attributes, instead of the old convention of "char" arrays containing either
      'n' or ' '.  This provides a better match to the convention used by
      ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
      of the old routines, I think they should be deprecated and eventually removed.
      f97aebd1
  23. 01 1月, 2005 1 次提交
    • P
      · 2ff50159
      PostgreSQL Daemon 提交于
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  24. 29 8月, 2004 2 次提交
  25. 31 5月, 2004 1 次提交
  26. 26 5月, 2004 1 次提交
    • N
      Reimplement the linked list data structure used throughout the backend. · d0b4399d
      Neil Conway 提交于
      In the past, we used a 'Lispy' linked list implementation: a "list" was
      merely a pointer to the head node of the list. The problem with that
      design is that it makes lappend() and length() linear time. This patch
      fixes that problem (and others) by maintaining a count of the list
      length and a pointer to the tail node along with each head node pointer.
      A "list" is now a pointer to a structure containing some meta-data
      about the list; the head and tail pointers in that structure refer
      to ListCell structures that maintain the actual linked list of nodes.
      
      The function names of the list API have also been changed to, I hope,
      be more logically consistent. By default, the old function names are
      still available; they will be disabled-by-default once the rest of
      the tree has been updated to use the new API names.
      d0b4399d
  27. 17 3月, 2004 1 次提交
    • T
      Replace the switching function ExecEvalExpr() with a macro that jumps · c1352052
      Tom Lane 提交于
      directly to the appropriate per-node execution function, using a function
      pointer stored by ExecInitExpr.  This speeds things up by eliminating one
      level of function call.  The function-pointer technique also enables further
      small improvements such as only making one-time tests once (and then
      changing the function pointer).  Overall this seems to gain about 10%
      on evaluation of simple expressions, which isn't earthshaking but seems
      a worthwhile gain for a relatively small hack.  Per recent discussion
      on pghackers.
      c1352052
  28. 15 1月, 2004 1 次提交
    • T
      Fix permission-checking bug reported by Tim Burgess 10-Feb-03 (this time · cfd7fb7e
      Tom Lane 提交于
      for sure...).  Rather than relying on the query context of a rangetable
      entry to identify what permissions it wants checked, store a full AclMode
      mask in each RTE, and check exactly those bits.  This allows an RTE
      specifying, say, INSERT privilege on a view to be copied into a derived
      UPDATE query without changing meaning.  Per recent discussion thread.
      initdb forced due to change of stored rule representation.
      cfd7fb7e
  29. 30 11月, 2003 1 次提交
    • P
      · 969685ad
      PostgreSQL Daemon 提交于
      $Header: -> $PostgreSQL Changes ...
      969685ad
  30. 02 10月, 2003 1 次提交
    • T
      Repair RI trigger visibility problems (this time for sure ;-)) per recent · 55d85f42
      Tom Lane 提交于
      discussion on pgsql-hackers: in READ COMMITTED mode we just have to force
      a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have
      to run the scan under a current snapshot and then complain if any rows
      would be updated/deleted that are not visible in the transaction snapshot.
      55d85f42
  31. 26 9月, 2003 1 次提交
  32. 25 9月, 2003 1 次提交
  33. 19 8月, 2003 1 次提交
    • T
      Improve dynahash.c's API so that caller can specify the comparison function · 80860c32
      Tom Lane 提交于
      as well as the hash function (formerly the comparison function was hardwired
      as memcmp()).  This makes it possible to eliminate the special-purpose
      hashtable management code in execGrouping.c in favor of using dynahash to
      manage tuple hashtables; which is a win because dynahash knows how to expand
      a hashtable when the original size estimate was too small, whereas the
      special-purpose code was too stupid to do that.  (See recent gripe from
      Stephan Szabo about poor performance when hash table size estimate is way
      off.)  Free side benefit: when using string_hash, the default comparison
      function is now strncmp() instead of memcmp().  This should eliminate some
      part of the overhead associated with larger NAMEDATALEN values.
      80860c32
  34. 09 8月, 2003 1 次提交
  35. 04 8月, 2003 1 次提交