| 3275 | // |
| 3276 | |
| 3277 | string Optimizer::getStreamName(StreamType stream) |
| 3278 | { |
| 3279 | const auto tail = &csb->csb_rpt[stream]; |
| 3280 | const auto relation = tail->csb_relation; |
| 3281 | const auto procedure = tail->csb_procedure; |
| 3282 | const auto alias = tail->csb_alias; |
| 3283 | |
| 3284 | string name; |
| 3285 | |
| 3286 | if (relation) |
| 3287 | name = relation->rel_name.c_str(); |
| 3288 | else if (procedure) |
| 3289 | name = procedure->getName().toString(); |
| 3290 | |
| 3291 | if (alias && alias->hasData()) |
| 3292 | { |
| 3293 | if (name.hasData()) |
| 3294 | name += " as "; |
| 3295 | name += *alias; |
| 3296 | } |
| 3297 | |
| 3298 | return name; |
| 3299 | } |
| 3300 | |
| 3301 | |
| 3302 | // |
no test coverage detected