7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.15 1998/02/2604:31:26 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.16 1998/02/2612:13:11 vadim Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -267,11 +267,11 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
267
267
n_keys = numScanKeys [indexPtr ];
268
268
run_keys = (int * )runtimeKeyInfo [indexPtr ];
269
269
scan_keys = (ScanKey )scanKeys [indexPtr ];
270
-
270
+
271
271
/* it's possible in subselects */
272
272
if (exprCtxt == NULL )
273
273
exprCtxt = node -> scan .scanstate -> cstate .cs_ExprContext ;
274
-
274
+
275
275
for (j = 0 ;j < n_keys ;j ++ )
276
276
{
277
277
@@ -410,12 +410,10 @@ ExecIndexMarkPos(IndexScan *node)
410
410
indexScanDescs = indexstate -> iss_ScanDescs ;
411
411
scanDesc = indexScanDescs [indexPtr ];
412
412
413
- /* ----------------
414
- *XXX access methods don't return marked positions so
415
- * ----------------
416
- */
413
+ #if 0
417
414
IndexScanMarkPosition (scanDesc );
418
- return ;
415
+ #endif
416
+ index_markpos (scanDesc );
419
417
}
420
418
421
419
/* ----------------------------------------------------------------
@@ -441,7 +439,10 @@ ExecIndexRestrPos(IndexScan *node)
441
439
indexScanDescs = indexstate -> iss_ScanDescs ;
442
440
scanDesc = indexScanDescs [indexPtr ];
443
441
442
+ #if 0
444
443
IndexScanRestorePosition (scanDesc );
444
+ #endif
445
+ index_restrpos (scanDesc );
445
446
}
446
447
447
448
/* ----------------------------------------------------------------
@@ -488,7 +489,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
488
489
HeapScanDesc currentScanDesc ;
489
490
ScanDirection direction ;
490
491
int baseid ;
491
-
492
+
492
493
List * execParam = NULL ;
493
494
494
495
/* ----------------
@@ -711,22 +712,22 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
711
712
*it identifies the value to place in our scan key.
712
713
* ----------------
713
714
*/
714
-
715
+
715
716
/* Life was so easy before ... subselects */
716
- if (((Param * )leftop )-> paramkind == PARAM_EXEC )
717
+ if ( ((Param * )leftop )-> paramkind == PARAM_EXEC )
717
718
{
718
719
have_runtime_keys = true;
719
720
run_keys [j ]= LEFT_OP ;
720
- execParam = lappendi (execParam , ((Param * )leftop )-> paramid );
721
+ execParam = lappendi (execParam , ((Param * )leftop )-> paramid );
721
722
}
722
723
else
723
724
{
724
725
scanvalue = ExecEvalParam ((Param * )leftop ,
725
- scanstate -> cstate .cs_ExprContext ,
726
+ scanstate -> cstate .cs_ExprContext ,
726
727
& isnull );
727
728
if (isnull )
728
729
flags |=SK_ISNULL ;
729
-
730
+
730
731
run_keys [j ]= NO_OP ;
731
732
}
732
733
}
@@ -804,22 +805,22 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
804
805
*it identifies the value to place in our scan key.
805
806
* ----------------
806
807
*/
807
-
808
+
808
809
/* Life was so easy before ... subselects */
809
- if (((Param * )rightop )-> paramkind == PARAM_EXEC )
810
+ if ( ((Param * )rightop )-> paramkind == PARAM_EXEC )
810
811
{
811
812
have_runtime_keys = true;
812
813
run_keys [j ]= RIGHT_OP ;
813
- execParam = lappendi (execParam , ((Param * )rightop )-> paramid );
814
+ execParam = lappendi (execParam , ((Param * )rightop )-> paramid );
814
815
}
815
816
else
816
817
{
817
818
scanvalue = ExecEvalParam ((Param * )rightop ,
818
- scanstate -> cstate .cs_ExprContext ,
819
+ scanstate -> cstate .cs_ExprContext ,
819
820
& isnull );
820
821
if (isnull )
821
822
flags |=SK_ISNULL ;
822
-
823
+
823
824
run_keys [j ]= NO_OP ;
824
825
}
825
826
}
@@ -989,13 +990,13 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
989
990
indexstate -> iss_ScanDescs = scanDescs ;
990
991
991
992
indexstate -> cstate .cs_TupFromTlist = false;
992
-
993
- /*
994
- * if there are some PARAM_EXEC in skankeys then force index rescan on
995
- * first scan.
993
+
994
+ /*
995
+ * if there are some PARAM_EXEC in skankeys then
996
+ *force index rescan on first scan.
996
997
*/
997
- ((Plan * )node )-> chgParam = execParam ;
998
-
998
+ ((Plan * )node )-> chgParam = execParam ;
999
+
999
1000
/* ----------------
1000
1001
*all done.
1001
1002
* ----------------