hvlad: each member of recursive CTE can refer to CTE itself (only once) via CTE name or via alias. We need to substitute this aliases when processing CTE member to resolve field names. Therefore we store all aliases in order of occurrence and later use it in backward order (since our parser is right-to-left). Also we put CTE name after all such aliases to distinguish aliases for different CTE's. W
| 224 | // We also need to repeat this process if main select expression contains union with |
| 225 | // recursive CTE |
| 226 | void addCTEAlias(const Firebird::string& alias) |
| 227 | { |
| 228 | thread_db* tdbb = JRD_get_thread_data(); |
| 229 | fb_assert(currCteAlias == NULL); |
| 230 | cteAliases.add(FB_NEW_POOL(*tdbb->getDefaultPool()) Firebird::string(*tdbb->getDefaultPool(), alias)); |
| 231 | } |
| 232 | |
| 233 | const Firebird::string* getNextCTEAlias() |
| 234 | { |
nothing calls this directly
no test coverage detected