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

Function dsqlGenReturningLocalTableCursor

src/dsql/StmtNodes.cpp:9923–9961  ·  view source on GitHub ↗

Generate BLR for returning's local table cursor.

Source from the content-addressed store, hash-verified

9921
9922// Generate BLR for returning's local table cursor.
9923static void dsqlGenReturningLocalTableCursor(DsqlCompilerScratch* dsqlScratch, ReturningClause* returning,
9924 USHORT localTableNumber)
9925{
9926 dsqlGenEofAssignment(dsqlScratch, 1);
9927
9928 const USHORT localForContext = dsqlScratch->contextNumber++;
9929
9930 dsqlScratch->appendUChar(blr_for);
9931 dsqlScratch->putBlrMarkers(StmtNode::MARK_AVOID_COUNTERS);
9932 dsqlScratch->appendUChar(blr_rse);
9933 dsqlScratch->appendUChar(1);
9934 dsqlScratch->appendUChar(blr_local_table_id);
9935 dsqlScratch->appendUShort(localTableNumber);
9936 dsqlScratch->appendMetaString(""); // alias
9937 GEN_stuff_context_number(dsqlScratch, localForContext);
9938 dsqlScratch->appendUChar(blr_end);
9939
9940 dsqlScratch->appendUChar(blr_send);
9941 dsqlScratch->appendUChar(dsqlScratch->getDsqlStatement()->getReceiveMsg()->msg_number);
9942
9943 dsqlScratch->appendUChar(blr_begin);
9944
9945 USHORT fieldNum = 0;
9946
9947 for (auto& retTarget : returning->second->items)
9948 {
9949 dsqlScratch->appendUChar(blr_assignment);
9950 dsqlScratch->appendUChar(blr_fid);
9951 GEN_stuff_context_number(dsqlScratch, localForContext);
9952 dsqlScratch->appendUShort(fieldNum++);
9953 retTarget->genBlr(dsqlScratch);
9954 }
9955
9956 dsqlScratch->appendUChar(blr_end);
9957
9958 dsqlScratch->appendUChar(blr_send);
9959 dsqlScratch->appendUChar(dsqlScratch->getDsqlStatement()->getReceiveMsg()->msg_number);
9960 dsqlGenEofAssignment(dsqlScratch, 0);
9961}
9962
9963// Generate BLR for returning's local table declaration.
9964static void dsqlGenReturningLocalTableDecl(DsqlCompilerScratch* dsqlScratch, USHORT tableNumber)

Callers 1

genBlrMethod · 0.85

Calls 9

dsqlGenEofAssignmentFunction · 0.85
GEN_stuff_context_numberFunction · 0.85
appendUCharMethod · 0.80
putBlrMarkersMethod · 0.80
appendUShortMethod · 0.80
appendMetaStringMethod · 0.80
getReceiveMsgMethod · 0.80
getDsqlStatementMethod · 0.45
genBlrMethod · 0.45

Tested by

no test coverage detected