mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
Fix CLUSTER on expression indexes.
Since the introduction of different slot types, in1a0586de36, we create a virtual slot in tuplesort_begin_cluster(). While that looks right, it unfortunately doesn't actually work, as ExecStoreHeapTuple() is used to store tuples in the slot. Unfortunately no regression tests for CLUSTER on expression indexes existed so far. Fix the slot type, and add bare bones tests for CLUSTER on expression indexes. Reported-By: Justin Pryzby Author: Andres Freund Discussion: https://postgr.es/m/20191011210320.GS10470@telsasoft.com Backpatch: 12, like1a0586de36
This commit is contained in:
@@ -933,7 +933,7 @@ tuplesort_begin_cluster(TupleDesc tupDesc,
|
||||
* scantuple has to point to that slot, too.
|
||||
*/
|
||||
state->estate = CreateExecutorState();
|
||||
slot = MakeSingleTupleTableSlot(tupDesc, &TTSOpsVirtual);
|
||||
slot = MakeSingleTupleTableSlot(tupDesc, &TTSOpsHeapTuple);
|
||||
econtext = GetPerTupleExprContext(state->estate);
|
||||
econtext->ecxt_scantuple = slot;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user