Generate BLR for returning's local table cursor.
| 9921 | |
| 9922 | // Generate BLR for returning's local table cursor. |
| 9923 | static 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. |
| 9964 | static void dsqlGenReturningLocalTableDecl(DsqlCompilerScratch* dsqlScratch, USHORT tableNumber) |
no test coverage detected