| 869 | |
| 870 | |
| 871 | void PAR_dependency(thread_db* tdbb, CompilerScratch* csb, StreamType stream, SSHORT id, |
| 872 | const MetaName& field_name) |
| 873 | { |
| 874 | /************************************** |
| 875 | * |
| 876 | * P A R _ d e p e n d e n c y |
| 877 | * |
| 878 | ************************************** |
| 879 | * |
| 880 | * Functional description |
| 881 | * Register a field, relation, procedure or exception reference |
| 882 | * as a dependency. |
| 883 | * |
| 884 | **************************************/ |
| 885 | SET_TDBB(tdbb); |
| 886 | |
| 887 | if (!csb->collectingDependencies()) |
| 888 | return; |
| 889 | |
| 890 | CompilerScratch::Dependency dependency(0); |
| 891 | |
| 892 | if (csb->csb_rpt[stream].csb_relation) |
| 893 | { |
| 894 | dependency.relation = csb->csb_rpt[stream].csb_relation; |
| 895 | // How do I determine reliably this is a view? |
| 896 | // At this time, rel_view_rse is still null. |
| 897 | //if (is_view) |
| 898 | // dependency.objType = obj_view; |
| 899 | //else |
| 900 | dependency.objType = obj_relation; |
| 901 | } |
| 902 | else if (csb->csb_rpt[stream].csb_procedure) |
| 903 | { |
| 904 | if (csb->csb_rpt[stream].csb_procedure->isSubRoutine()) |
| 905 | return; |
| 906 | |
| 907 | dependency.procedure = csb->csb_rpt[stream].csb_procedure; |
| 908 | dependency.objType = obj_procedure; |
| 909 | } |
| 910 | |
| 911 | if (field_name.length() > 0) |
| 912 | dependency.subName = FB_NEW_POOL(*tdbb->getDefaultPool()) MetaName(*tdbb->getDefaultPool(), field_name); |
| 913 | else if (id >= 0) |
| 914 | dependency.subNumber = id; |
| 915 | |
| 916 | csb->addDependency(dependency); |
| 917 | } |
| 918 | |
| 919 | |
| 920 | static PlanNode* par_plan(thread_db* tdbb, CompilerScratch* csb) |
no test coverage detected