summaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAgeFilesLines
* 1. Fix for elog(ERROR, "EvalPlanQual: t_xmin is uncommitted ?!")Vadim B. Mikheev1999-06-106-29/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and possibly for other cases too: DO NOT cache status of transaction in unknown state (i.e. non-committed and non-aborted ones) Example: T1 reads row updated/inserted by running T2 and cache T2 status. T2 commits. Now T1 reads a row updated by T2 and with HEAP_XMAX_COMMITTED in t_infomask (so cached T2 status is not changed). Now T1 EvalPlanQual gets updated row version without HEAP_XMIN_COMMITTED -> TransactionIdDidCommit(t_xmin) and TransactionIdDidAbort(t_xmin) return FALSE and T2 decides that t_xmin is not committed and gets ERROR above. It's too late to find more smart way to handle such cases and so I just changed xact status caching and got rid TransactionIdFlushCache() from code. Changed: transam.c, xact.c, lmgr.c and transam.h - last three just because of TransactionIdFlushCache() is removed. 2. heapam.c: T1 marked a row for update. T2 waits for T1 commit/abort. T1 commits. T3 updates the row before T2 locks row page. Now T2 sees that new row t_xmax is different from xact id (T1) T2 was waiting for. Old code did Assert here. New one goes to HeapTupleSatisfiesUpdate. Obvious changes too. 3. Added Assert to vacuum.c 4. bufmgr.c: break Assert(buf->r_locks == 0 && !buf->ri_lock) into two Asserts.
* Fix errors in SELECT ... GROUP BY ... UNION SELECT ...Tom Lane1999-06-101-1/+8
| | | | | ye proverbial one-line patch (not counting five lines of comment so's maybe it won't happen again)
* Reset evaluation plan tuple table next free slot counter to 0Vadim B. Mikheev1999-06-091-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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) ?
* Concurrency... Highest one...Vadim B. Mikheev1999-06-071-5/+8
| | | | | | DO NOT EVEN TRY TO DO PageGetMaxOffsetNumber BEFORE LockBuffer! -:)
* Repair recently-introduced error in makeIndexable for LIKE:Tom Lane1999-06-072-14/+29
| | | | | | 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.
* Have to release meta page before reading root one!Vadim B. Mikheev1999-06-071-4/+4
| | | | < 6.5 versions were just not affected by this bug due to locking.
* 1. xact.c: update comments about changing MyProc->xid and MyProc->xmin.Vadim B. Mikheev1999-06-065-26/+44
| | | | | | | | | | | 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).
* equal() needs a case for Aggref nodes, as shown by:Tom Lane1999-06-061-1/+25
| | | | | 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
* Fix problems with grouping/aggregation in queries that useTom Lane1999-06-063-125/+79
| | | | inheritance ... basically it was completely busted :-(
* I used bad style of comments and ... commented out some code inVadim B. Mikheev1999-06-061-11/+9
| | | | | EvalPlanQualNext() when implemented it... -:) Uncommented...
* Instead of failing when the constructed name for a sequence,Tom Lane1999-06-051-85/+92
| | | | index, etc is too long, truncate until it fits.
* trace.patch (compilation error)Marc G. Fournier1999-06-051-7/+7
| | | | | | | | 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>
* Add startup-time check that -B is not unreasonably small forTom Lane1999-06-041-2/+19
| | | | given number of backends (-N), per recent discussion in pghackers list.
* Add configurable option controlling security checks in LO functions.Tom Lane1999-06-041-1/+5
|
* Turns out OIDNAMELEN wasn't really being used at all!Tom Lane1999-06-041-6/+4
| | | | Get rid of it to make customization of NAMEDATALEN easier.
* Fix for failure to clean SysCache entry when a relation is deletedTom Lane1999-06-043-51/+53
| | | | in the same transaction that created it.
* 1. Additional fix against ERROR: Child itemid marked as unusedVadim B. Mikheev1999-06-032-25/+49
| | | | | in CommitTransaction(). 2. Changes in GetSnapshotData().
* Unuseful tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED inVadim B. Mikheev1999-06-031-3/+2
| | | | vc_scanheap().
* 1. MyProc->xid assignment is moved to GetNewTransactionId so newerVadim B. Mikheev1999-06-032-18/+18
| | | | | | | | | | | | | | 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).
* Ensure consistent results when FormSortKeys fails to findTom Lane1999-06-031-2/+4
| | | | all the expected keys (it was returning uninitialized memory).
* Ooops ... dllist.c can't use Assert() when it is compiled intoTom Lane1999-06-031-2/+11
| | | | libpq ...
* Changed "current." into "old." in rule string backparsingJan Wieck1999-06-021-2/+2
| | | | Jan
* The INET and CIDR types mistakenly compared 198.68.123.0/24 andBruce Momjian1999-06-021-2/+10
| | | | | | 198.68.123.0/27 the same when indexing them. D'Arcy
* Fix some latent bugs in dllist.c (carelessness about settingTom Lane1999-05-312-39/+71
| | | | | all fields that should be set). Add a MoveToFront primitive to speed up one of the hotspots in SearchSysCache.
* Clean up memory leaks in LO operations by freeing LO's privateTom Lane1999-05-312-26/+81
| | | | memory context at transaction commit or abort.
* Generate a more specific error message when an operator usedTom Lane1999-05-311-5/+61
| | | | in an index doesn't have a restriction selectivity estimator.
* Round up shmem size estimate to 1Kb boundary.Tom Lane1999-05-311-1/+3
|
* Correct serious bug in hashtable expansion routine: under theTom Lane1999-05-311-38/+44
| | | | | right circumstances it would leave old and new bucket headers pointing to the same list of records.
* Release XactLockTable share lock immediately after this lock is acquiredVadim B. Mikheev1999-05-311-1/+2
| | | | | (no sense to hold it) or we'll be out of lock entries. Great thanks to Hiroshi Inoue.
* 1. Run all pg_dump queries in single serializable transaction.Vadim B. Mikheev1999-05-293-24/+19
| | | | | | 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.
* Fix xid table sizing.Vadim B. Mikheev1999-05-291-2/+2
|
* Missing semicolons in non-HAS_TEST_AND_SET code paths :-(Tom Lane1999-05-291-5/+5
|
* Avoid redundant SysCache searches in coerce_type, for anotherTom Lane1999-05-293-34/+21
| | | | few percent speedup in INSERT...
* new_relation_targetlist used to cause about 8 separate (andTom Lane1999-05-291-58/+74
| | | | | | 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.
* Clean up inefficient and just plain bad code in some hot-spotTom Lane1999-05-292-187/+239
| | | | cache access routines.
* Repair performance problem in SI segment manipulations: iteratingTom Lane1999-05-283-61/+44
| | | | | | | | 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.
* Fix for crypt memory leak, from James ThompsonBruce Momjian1999-05-271-4/+4
|
* Patch from Andreas: when CREATE TABLE is followed by CREATE INDEXTom Lane1999-05-262-31/+47
| | | | | before any tuples are loaded, preserve the default '1000 tuples' table size estimate.
* Add fix for 0x7fU constants to pgindentBruce Momjian1999-05-262-7/+7
|
* Make functions static or NOT_USED as appropriate.Bruce Momjian1999-05-2617-92/+87
|
* Another pgindent run. Sorry folks.Bruce Momjian1999-05-2553-403/+404
|
* Make 0x007f -> (unsigned)0x7f to make pgindent happy.Bruce Momjian1999-05-2512-73/+78
|
* Get rid of page-level locking in btree-s.Vadim B. Mikheev1999-05-257-132/+73
| | | | | | LockBuffer is used to acquire read/write access to index pages. Pages are released before leaving index internals.
* pgindent run over code.Bruce Momjian1999-05-25240-7775/+8389
|
* Bugfix - Range table entries that are unused after rewriting shouldJan Wieck1999-05-251-2/+140
| | | | | | | | | | | 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
* Fixed bug in rules event qualification output.Jan Wieck1999-05-251-2/+2
| | | | Jan
* FIx for 0.0.0.0/0 output as 00/0.Bruce Momjian1999-05-251-2/+2
|
* Do not assign output columns to junk attributes created fromTom Lane1999-05-231-10/+11
| | | | GROUP BY or ORDER BY expressions in INSERT ... SELECT.
* Detect case of invalid use of GROUP BY when there are noTom Lane1999-05-232-14/+19
| | | | | | | 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.
* Fix tuple chain moving bug found by "Hiroshi Inoue" <Inoue@tpf.co.jp>.Vadim B. Mikheev1999-05-231-17/+105
|