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

Function par_end_for

src/gpre/par.cpp:1800–1844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1798//
1799
1800static act* par_end_for()
1801{
1802 if (!cur_for)
1803 PAR_error("unmatched END_FOR");
1804
1805 act* begin_action = (act*) MSC_pop(&cur_for);
1806 if (!begin_action)
1807 return NULL;
1808
1809 PAR_end();
1810 gpre_req* request = begin_action->act_request;
1811
1812 // If the action is a blob for, make up a blob end.
1813
1814 if (begin_action->act_type == ACT_blob_for)
1815 {
1816 blb* blob = (blb*) begin_action->act_object;
1817 act* action = MSC_action(request, ACT_endblob);
1818 action->act_object = (ref*) blob;
1819 begin_action->act_pair = action;
1820 action->act_pair = begin_action;
1821 HSH_remove(blob->blb_symbol);
1822 blob->blb_flags |= BLB_symbol_released;
1823 return action;
1824 }
1825
1826 // If there isn't a database assigned, the FOR statement itself
1827 // failed. Since an error has been given, just return quietly.
1828
1829 if (!request->req_database)
1830 return NULL;
1831
1832 act* action = MSC_action(request, ACT_endfor);
1833 begin_action->act_pair = action;
1834 action->act_pair = begin_action;
1835 EXP_rse_cleanup(request->req_rse);
1836
1837 for (blb* blob = request->req_blobs; blob; blob = blob->blb_next)
1838 {
1839 if (!(blob->blb_flags & BLB_symbol_released))
1840 HSH_remove(blob->blb_symbol);
1841 }
1842
1843 return action;
1844}
1845
1846
1847//____________________________________________________________

Callers 1

PAR_actionFunction · 0.85

Calls 6

MSC_popFunction · 0.85
PAR_endFunction · 0.85
MSC_actionFunction · 0.85
HSH_removeFunction · 0.85
EXP_rse_cleanupFunction · 0.85
PAR_errorFunction · 0.70

Tested by

no test coverage detected