* QueryListGetPrimaryStmt * Get the "primary" stmt within a list, ie, the one marked canSetTag. * * Returns NULL if no such stmt. If multiple queries within the list are * marked canSetTag, returns the first one. Neither of these cases should * occur in present usages of this function. */
| 1830 | * occur in present usages of this function. |
| 1831 | */ |
| 1832 | static Query * |
| 1833 | QueryListGetPrimaryStmt(List *stmts) |
| 1834 | { |
| 1835 | ListCell *lc; |
| 1836 | |
| 1837 | foreach(lc, stmts) |
| 1838 | { |
| 1839 | Query *stmt = lfirst_node(Query, lc); |
| 1840 | |
| 1841 | if (stmt->canSetTag) |
| 1842 | return stmt; |
| 1843 | } |
| 1844 | return NULL; |
| 1845 | } |
| 1846 | |
| 1847 | /* |
| 1848 | * AcquireExecutorLocks: acquire locks needed for execution of a cached plan; |
no test coverage detected