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

Method pass2

src/dsql/StmtNodes.cpp:363–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363AssignmentNode* AssignmentNode::pass2(thread_db* tdbb, CompilerScratch* csb)
364{
365 bool pushedRse = false;
366
367 // Deal with invariants of assignment targets of FOR, SELECT and UPDATE - CORE-5871.
368 //
369 // blr_for
370 // ...
371 // blr_begin
372 // blr_assignment
373 // blr_assignment
374 // blr_begin
375 //
376 // blr_for
377 // ...
378 // blr_send
379 // blr_begin
380 // blr_assignment
381 // blr_assignment
382 //
383 // blr_for
384 // ...
385 // blr_modify
386 // blr_begin
387 // blr_assignment
388 // blr_assignment
389 if (csb->csb_current_for_nodes.hasData() && nodeIs<CompoundStmtNode>(parentStmt))
390 {
391 ForNode* forNode = csb->csb_current_for_nodes.back();
392
393 if (parentStmt->parentStmt == forNode ||
394 (nodeIs<SuspendNode>(parentStmt->parentStmt) && parentStmt->parentStmt->parentStmt == forNode) ||
395 (nodeIs<ModifyNode>(parentStmt->parentStmt) && parentStmt->parentStmt->parentStmt == forNode))
396 {
397 pushedRse = true;
398 csb->csb_current_nodes.push(forNode->rse.getObject());
399 }
400 }
401
402 { // scope
403 dsc desc;
404 asgnTo->getDesc(tdbb, csb, &desc);
405 AutoSetRestore<dsc*> dataType(&csb->csb_preferredDesc, &desc);
406 ExprNode::doPass2(tdbb, csb, asgnFrom.getAddress());
407 }
408 ExprNode::doPass2(tdbb, csb, asgnTo.getAddress());
409 ExprNode::doPass2(tdbb, csb, missing.getAddress());
410 ExprNode::doPass2(tdbb, csb, missing2.getAddress());
411
412 if (pushedRse)
413 csb->csb_current_nodes.pop();
414
415 validateTarget(csb, asgnTo);
416
417 return this;
418}
419
420const StmtNode* AssignmentNode::execute(thread_db* tdbb, Request* request, ExeState* /*exeState*/) const

Callers

nothing calls this directly

Calls 15

CMP_post_rseFunction · 0.85
pass2FindForNodeFunction · 0.85
CMP_pass2_validationFunction · 0.85
FB_ALIGNFunction · 0.85
CMP_formatFunction · 0.85
getAddressMethod · 0.80
getRootRecordSourceMethod · 0.80
hasWriteLockMethod · 0.80
CursorClass · 0.70
ItemClass · 0.70
hasDataMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected