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

Method Statement

src/jrd/Statement.cpp:63–230  ·  view source on GitHub ↗

Start to turn a parsed scratch into a statement. This is completed by makeStatement.

Source from the content-addressed store, hash-verified

61
62// Start to turn a parsed scratch into a statement. This is completed by makeStatement.
63Statement::Statement(thread_db* tdbb, MemoryPool* p, CompilerScratch* csb)
64 : pool(p),
65 rpbsSetup(*p),
66 requests(*p),
67 externalList(*p),
68 accessList(*p),
69 resources(*p),
70 triggerName(*p),
71 triggerInvoker(NULL),
72 parentStatement(NULL),
73 subStatements(*p),
74 fors(*p),
75 localTables(*p),
76 invariants(*p),
77 blr(*p),
78 mapFieldInfo(*p)
79{
80 try
81 {
82 makeSubRoutines(tdbb, this, csb, csb->subProcedures);
83 makeSubRoutines(tdbb, this, csb, csb->subFunctions);
84
85 topNode = (csb->csb_node && csb->csb_node->getKind() == DmlNode::KIND_STATEMENT) ?
86 static_cast<StmtNode*>(csb->csb_node) : NULL;
87
88 accessList = csb->csb_access;
89 csb->csb_access.clear();
90
91 externalList = csb->csb_external;
92 csb->csb_external.clear();
93
94 mapFieldInfo.takeOwnership(csb->csb_map_field_info);
95
96 resources = csb->csb_resources; // Assign array contents
97 csb->csb_resources.clear();
98
99 impureSize = csb->csb_impure;
100
101 //if (csb->csb_g_flags & csb_blr_version4)
102 // flags |= FLAG_VERSION4;
103 blrVersion = csb->blrVersion;
104
105 // Take out existence locks on resources used in statement. This is
106 // a little complicated since relation locks MUST be taken before
107 // index locks.
108
109 for (Resource* resource = resources.begin(); resource != resources.end(); ++resource)
110 {
111 switch (resource->rsc_type)
112 {
113 case Resource::rsc_relation:
114 {
115 jrd_rel* relation = resource->rsc_rel;
116 MET_post_existence(tdbb, relation);
117 break;
118 }
119
120 case Resource::rsc_index:

Callers

nothing calls this directly

Calls 15

makeSubRoutinesFunction · 0.85
CMP_get_index_lockFunction · 0.85
LCK_lockFunction · 0.85
JRD_print_procedure_infoFunction · 0.85
incUseCountMethod · 0.80
getKindMethod · 0.45
clearMethod · 0.45
takeOwnershipMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
addRefMethod · 0.45
printfMethod · 0.45

Tested by

no test coverage detected