Returns true if var is the document column of the relation this scan path is for. */
| 1523 | |
| 1524 | /* Returns true if var is the document column of the relation this scan path is for. */ |
| 1525 | static bool |
| 1526 | IsCurrentScanDocumentVar(Var *var, PlannerInfo *root, Index scanRti) |
| 1527 | { |
| 1528 | /* Requires a local BSON Var from the same query source as the scan path, |
| 1529 | * then confirm that source is a real relation (not a CTE or subquery). |
| 1530 | */ |
| 1531 | if (var->varlevelsup != 0 || |
| 1532 | var->varno != (int) scanRti || |
| 1533 | var->varattno != DOCUMENT_DATA_TABLE_DOCUMENT_VAR_ATTR_NUMBER || |
| 1534 | (var->vartype != BsonTypeId() && var->vartype != DocumentDBCoreBsonTypeId())) |
| 1535 | { |
| 1536 | return false; |
| 1537 | } |
| 1538 | |
| 1539 | return planner_rt_fetch(var->varno, root)->rtekind == RTE_RELATION; |
| 1540 | } |
| 1541 | |
| 1542 | |
| 1543 | static bool |
no test coverage detected