MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / makeAlias

Method makeAlias

src/jrd/optimizer/Optimizer.cpp:3307–3347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3305//
3306
3307string Optimizer::makeAlias(StreamType stream)
3308{
3309 string alias;
3310
3311 const CompilerScratch::csb_repeat* csb_tail = &csb->csb_rpt[stream];
3312
3313 if (csb_tail->csb_view || csb_tail->csb_alias)
3314 {
3315 ObjectsArray<string> alias_list;
3316
3317 while (csb_tail)
3318 {
3319 if (csb_tail->csb_alias)
3320 alias_list.push(*csb_tail->csb_alias);
3321 else if (csb_tail->csb_relation)
3322 alias_list.push(csb_tail->csb_relation->rel_name.c_str());
3323
3324 if (!csb_tail->csb_view)
3325 break;
3326
3327 csb_tail = &csb->csb_rpt[csb_tail->csb_view_stream];
3328 }
3329
3330 while (alias_list.hasData())
3331 {
3332 alias += alias_list.pop();
3333
3334 if (alias_list.hasData())
3335 alias += ' ';
3336 }
3337 }
3338 else if (csb_tail->csb_relation)
3339 alias = csb_tail->csb_relation->rel_name.c_str();
3340 else if (csb_tail->csb_procedure)
3341 alias = csb_tail->csb_procedure->getName().toString();
3342 //// TODO: LocalTableSourceNode
3343 else
3344 fb_assert(false);
3345
3346 return alias;
3347}
3348
3349
3350//

Callers 2

compileMethod · 0.80
Retrieval.cppFile · 0.80

Calls 6

pushMethod · 0.45
c_strMethod · 0.45
hasDataMethod · 0.45
popMethod · 0.45
toStringMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected