|
2 | 2 | #include"optimizer/paths.h" |
3 | 3 | #include"optimizer/pathnode.h" |
4 | 4 | #include"optimizer/restrictinfo.h" |
| 5 | +#include"optimizer/tlist.h" |
5 | 6 | #include"utils/tqual.h" |
6 | 7 | #include"utils/builtins.h" |
7 | 8 | #include"utils/elog.h" |
@@ -449,7 +450,7 @@ create_crossmatch_plan(PlannerInfo *root, |
449 | 450 | cscan->scan.plan.targetlist=tlist; |
450 | 451 | cscan->scan.plan.qual=joinclauses; |
451 | 452 | cscan->scan.scanrelid=0; |
452 | | -cscan->custom_scan_tlist=tlist;/* tlist of the 'virtual' join rel |
| 453 | +cscan->custom_scan_tlist=make_tlist_from_pathtarget(&rel->reltarget);/* tlist of the 'virtual' join rel |
453 | 454 | we'll have to build and scan */ |
454 | 455 |
|
455 | 456 | cscan->flags=best_path->flags; |
@@ -512,8 +513,8 @@ crossmatch_begin(CustomScanState *node, EState *estate, int eflags) |
512 | 513 | scan_state->outer=heap_open(scan_state->outer_rel,AccessShareLock); |
513 | 514 | scan_state->inner=heap_open(scan_state->inner_rel,AccessShareLock); |
514 | 515 |
|
515 | | -scan_state->values=palloc(sizeof(Datum)*nlist); |
516 | | -scan_state->nulls=palloc(sizeof(bool)*nlist); |
| 516 | +scan_state->values=palloc0(sizeof(Datum)*nlist); |
| 517 | +scan_state->nulls=palloc0(sizeof(bool)*nlist); |
517 | 518 |
|
518 | 519 | /* Store blank tuple in case scan tlist is empty */ |
519 | 520 | if (scan_state->scan_tlist==NIL) |
@@ -575,6 +576,7 @@ crossmatch_exec(CustomScanState *node) |
575 | 576 | if (!htup_outer_ready) |
576 | 577 | { |
577 | 578 | htup_outer_ready= true; |
| 579 | +/* TODO: check result */ |
578 | 580 | heap_fetch(scan_state->outer,SnapshotSelf, |
579 | 581 | &htup_outer,&buf1, false,NULL); |
580 | 582 | } |
@@ -665,6 +667,7 @@ static void |
665 | 667 | crossmatch_rescan(CustomScanState*node) |
666 | 668 | { |
667 | 669 | /* NOTE: nothing to do here? */ |
| 670 | +node->ss.ps.ps_TupFromTlist= false; |
668 | 671 | } |
669 | 672 |
|
670 | 673 | staticvoid |
|