Commit Graph

2348 Commits

Author SHA1 Message Date
Tom Lane c37ecaf8d5 Fix errors in SELECT ... GROUP BY ... UNION SELECT ...
ye proverbial one-line patch (not counting five lines of comment so's
maybe it won't happen again)
1999-06-10 06:55:40 +00:00
Vadim B. Mikheev 51298bcfda Reset evaluation plan tuple table next free slot counter to 0
after ExecEndNode. It must be done! Or we'll be out of free
tuple slots very soon, though slots are freed by ExecEndNode
and ready for reusing.

We didn't see this problem before because of

int         nSlots = ExecCountSlotsNode(plan);
TupleTable  tupleTable = ExecCreateTupleTable(nSlots + 10);
    /* why add ten? - jolly */

code in InitPlan - i.e. extra 10 slots. Simple select uses
3 slots and so it was possible to re-use evaluation plan
3 additional times and didn't get

elog(NOTICE, "Plan requires more slots than are available");
elog(ERROR, "send mail to your local executor guru to fix this");

Changes are obvious and shouldn't be problems with them.
Though, I added Assert(epqstate->es_tupleTable->next == 0)
before EvalPlanQual():ExecInitNode and we'll notice if
something is still wrong. Is it better to change Assert
to elog(ERROR) ?
1999-06-09 12:23:42 +00:00
Vadim B. Mikheev 4c45832c39 Concurrency... Highest one...
DO NOT EVEN TRY TO DO PageGetMaxOffsetNumber BEFORE
LockBuffer!
-:)
1999-06-07 15:14:54 +00:00
Tom Lane bad3b3068d Repair recently-introduced error in makeIndexable for LIKE:
a non-leading % would be put into the >=/<= patterns.  Also, repair
longstanding confusion about whether %% means a literal %%.  The SQL92
doesn't say any such thing, and textlike() knows that, but gram.y didn't.
1999-06-07 14:28:26 +00:00
Vadim B. Mikheev 43c135e351 Have to release meta page before reading root one!
< 6.5 versions were just not affected by this bug due to locking.
1999-06-07 14:28:22 +00:00
Vadim B. Mikheev 1b812d9358 1. xact.c: update comments about changing MyProc->xid and MyProc->xmin.
2. varsup.c:ReadNewTransactionId(): don't read nextXid from disk -
   this func doesn't allocate next xid, so ShmemVariableCache->nextXid
   may be used (but GetNewTransactionId() must be called first).
3. vacuum.c: change elog(ERROR, "Child item....") to elog(NOTICE) -
   this is not ERROR, proper handling is just not implemented, yet.
4. s_lock.c: increase S_MAX_BUSY by 2 times.
5. shmem.c:GetSnapshotData(): have to call ReadNewTransactionId()
   _after_ SpinAcquire(ShmemIndexLock).
1999-06-06 20:19:35 +00:00
Tom Lane 48c1887964 equal() needs a case for Aggref nodes, as shown by:
regression=> select sum(q1) from int8_tbl group by q2 order by sum(q1);
NOTICE:  equal: don't know whether nodes of type 107 are equal
1999-06-06 17:46:40 +00:00
Tom Lane b4210ae0f0 Fix problems with grouping/aggregation in queries that use
inheritance ... basically it was completely busted :-(
1999-06-06 17:38:11 +00:00
Vadim B. Mikheev 08abe0acb6 I used bad style of comments and ... commented out some code in
EvalPlanQualNext() when implemented it... -:)
Uncommented...
1999-06-06 15:14:40 +00:00
Tom Lane ca234c3f38 Instead of failing when the constructed name for a sequence,
index, etc is too long, truncate until it fits.
1999-06-05 20:22:30 +00:00
Marc G. Fournier 93b57eb533 trace.patch (compilation error)
the gettimeofday doesn't compile under Linux with glibc2 because
        the DST_NONE constant is no more defined. It seems that this code
        (written by me) has always be wrong but for some reason working.

From: Massimo Dal Zotto <dz@cs.unitn.it>
1999-06-05 04:18:09 +00:00
Tom Lane 8f19603d6c Add startup-time check that -B is not unreasonably small for
given number of backends (-N), per recent discussion in pghackers list.
1999-06-04 21:14:46 +00:00
Tom Lane 4cd4a54c80 Add configurable option controlling security checks in LO functions. 1999-06-04 21:13:38 +00:00
Tom Lane 1c3c080534 Turns out OIDNAMELEN wasn't really being used at all!
Get rid of it to make customization of NAMEDATALEN easier.
1999-06-04 21:12:07 +00:00
Tom Lane 74e7b58b61 Fix for failure to clean SysCache entry when a relation is deleted
in the same transaction that created it.
1999-06-04 02:19:47 +00:00
Vadim B. Mikheev 5541abee0d 1. Additional fix against ERROR: Child itemid marked as unused
in CommitTransaction().
2. Changes in GetSnapshotData().
1999-06-03 13:33:13 +00:00
Vadim B. Mikheev f103501286 Unuseful tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED in
vc_scanheap().
1999-06-03 13:25:54 +00:00
Vadim B. Mikheev 9680a71205 1. MyProc->xid assignment is moved to GetNewTransactionId so newer
transactions will not assume that MyProc transaction was committed
   before snapshot calculations. With old MyProc->xid assignment
   (in xact.c:StartTransaction()) there was ability to see the same
   row twice (I used gdb for this)!...
2. Assignments of InvalidTransactionId to MyProc->xid and MyProc->xmin
   are moved from xact.c:CommitTransaction() to
   xact.c:RecordTransactionCommit() - this invalidation must be done
   before releasing transaction locks or bad (too high) XmaxRecent value
   might be used by vacuum ("ERROR:  Child itemid marked as unused"
   reported by "Hiroshi Inoue" <Inoue@tpf.co.jp>; once again, gdb
   allowed me reproduce this error).
1999-06-03 04:41:41 +00:00
Tom Lane f463c44fc0 Ensure consistent results when FormSortKeys fails to find
all the expected keys (it was returning uninitialized memory).
1999-06-03 03:17:37 +00:00
Tom Lane 9b3e2dda16 Ooops ... dllist.c can't use Assert() when it is compiled into
libpq ...
1999-06-03 01:28:24 +00:00
Jan Wieck 98981a9f1c Changed "current." into "old." in rule string backparsing
Jan
1999-06-02 11:52:29 +00:00
Bruce Momjian e47b93d333 The INET and CIDR types mistakenly compared 198.68.123.0/24 and
198.68.123.0/27 the same when indexing them.

D'Arcy
1999-06-02 03:37:15 +00:00
Tom Lane 185b427284 Fix some latent bugs in dllist.c (carelessness about setting
all fields that should be set).  Add a MoveToFront primitive to speed up
one of the hotspots in SearchSysCache.
1999-05-31 23:48:04 +00:00
Tom Lane 2a44383a2d Clean up memory leaks in LO operations by freeing LO's private
memory context at transaction commit or abort.
1999-05-31 22:53:59 +00:00
Tom Lane 81ced1e037 Generate a more specific error message when an operator used
in an index doesn't have a restriction selectivity estimator.
1999-05-31 19:32:47 +00:00
Tom Lane cc384fa240 Round up shmem size estimate to 1Kb boundary. 1999-05-31 18:28:52 +00:00
Tom Lane 86482e17bd Correct serious bug in hashtable expansion routine: under the
right circumstances it would leave old and new bucket headers pointing to
the same list of records.
1999-05-31 17:01:52 +00:00
Vadim B. Mikheev 219bb76d61 Release XactLockTable share lock immediately after this lock is acquired
(no sense to hold it) or we'll be out of lock entries.
Great thanks to Hiroshi Inoue.
1999-05-31 01:48:13 +00:00
Vadim B. Mikheev df9e539ea2 1. Run all pg_dump queries in single serializable transaction.
2. Get rid of locking when updating statistics in vacuum.
3. Use QuerySnapshot in COPY TO and call SetQuerySnashot
   in main tcop loop before FETCH and COPY TO.
1999-05-29 10:25:33 +00:00
Vadim B. Mikheev bbbc211ed1 Fix xid table sizing. 1999-05-29 06:14:43 +00:00
Tom Lane dfefad7db0 Missing semicolons in non-HAS_TEST_AND_SET code paths :-( 1999-05-29 03:58:43 +00:00
Tom Lane 1bdd7c68c0 Avoid redundant SysCache searches in coerce_type, for another
few percent speedup in INSERT...
1999-05-29 03:17:20 +00:00
Tom Lane b325dab67a new_relation_targetlist used to cause about 8 separate (and
redundant) SearchSysCache searches per table column in an INSERT, which
accounted for a good percentage of the CPU time for INSERT ... VALUES().
Now it only does two searches in the typical case.
1999-05-29 01:48:06 +00:00
Tom Lane ce2586dbc9 Clean up inefficient and just plain bad code in some hot-spot
cache access routines.
1999-05-29 01:45:21 +00:00
Tom Lane dc6d404959 Repair performance problem in SI segment manipulations: iterating
through MAXBACKENDS array entries used to be fine when MAXBACKENDS = 64.
It's not so cool with MAXBACKENDS = 1024 (or more!), especially not in a
frequently-used routine like SIDelExpiredDataEntries.  Repair by making
procState array size be the soft MaxBackends limit rather than the hard
limit, and by converting SIGetProcStateLimit() to a macro.
1999-05-28 17:03:31 +00:00
Bruce Momjian 0d5f7ce11c Fix for crypt memory leak, from James Thompson 1999-05-27 04:09:45 +00:00
Tom Lane 7c8beefd5e Patch from Andreas: when CREATE TABLE is followed by CREATE INDEX
before any tuples are loaded, preserve the default '1000 tuples' table
size estimate.
1999-05-26 22:57:39 +00:00
Bruce Momjian 9c56b408c4 Add fix for 0x7fU constants to pgindent 1999-05-26 15:20:04 +00:00
Bruce Momjian 278bbf4572 Make functions static or NOT_USED as appropriate. 1999-05-26 12:57:23 +00:00
Bruce Momjian fcff1cdf4e Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00
Bruce Momjian 4eadfe8754 Make 0x007f -> (unsigned)0x7f to make pgindent happy. 1999-05-25 22:04:56 +00:00
Vadim B. Mikheev 7d443a85af Get rid of page-level locking in btree-s.
LockBuffer is used to acquire read/write access
to index pages. Pages are released before leaving
index internals.
1999-05-25 18:20:31 +00:00
Bruce Momjian 07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Jan Wieck b122e16a1c Bugfix - Range table entries that are unused after rewriting should
not be marked inFromCl any longer. Otherwise the planner gets confused
and joins over them where in fact it does not have to.

Adjust hasSubLinks now with a recursive lookup - could be wrong in
multi action rules because parse state isn't reset correctly and all
actions in the rule are marked hasSubLinks if one of them has.

Jan
1999-05-25 13:16:10 +00:00
Jan Wieck f4fadbe4db Fixed bug in rules event qualification output.
Jan
1999-05-25 08:49:33 +00:00
Bruce Momjian 6bf0db7e07 FIx for 0.0.0.0/0 output as 00/0. 1999-05-25 05:29:38 +00:00
Tom Lane 9432b6dd64 Do not assign output columns to junk attributes created from
GROUP BY or ORDER BY expressions in INSERT ... SELECT.
1999-05-23 21:42:09 +00:00
Tom Lane 505b5185fc Detect case of invalid use of GROUP BY when there are no
aggregate functions, as in
	select a, b from foo group by a;
The ungrouped reference to b is not kosher, but formerly we neglected to
check this unless there was an aggregate function somewhere in the query.
1999-05-23 21:41:14 +00:00
Vadim B. Mikheev 7e14593d2e Fix tuple chain moving bug found by "Hiroshi Inoue" <Inoue@tpf.co.jp>. 1999-05-23 09:10:24 +00:00
Tom Lane 795f6ca66a Update commentary in sample GEQO config file. 1999-05-22 23:59:59 +00:00