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

Function par_end_modify

src/gpre/par.cpp:1853–1927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1851//
1852
1853static act* par_end_modify()
1854{
1855 if (!cur_modify)
1856 PAR_error("unmatched END_MODIFY");
1857
1858 PAR_end();
1859 upd* modify = (upd*) MSC_pop(&cur_modify);
1860
1861 if (gpreGlob.errors_global)
1862 return NULL;
1863
1864 gpre_req* request = modify->upd_request;
1865
1866 // used at the end of this function
1867 act* begin_action = request->req_actions;
1868 while ((upd*) begin_action->act_object != modify)
1869 begin_action = begin_action->act_next;
1870
1871 // Build assignments for all fields and null flags referenced
1872
1873 gpre_lls* stack = NULL;
1874 int count = 0;
1875
1876 for (ref* reference = request->req_references; reference; reference = reference->ref_next)
1877 {
1878 if (reference->ref_context == modify->upd_source &&
1879 reference->ref_level >= modify->upd_level &&
1880 !reference->ref_master)
1881 {
1882 ref* change = MSC_reference(&modify->upd_references);
1883 change->ref_context = modify->upd_update;
1884 change->ref_field = reference->ref_field;
1885 change->ref_source = reference;
1886 change->ref_flags = reference->ref_flags;
1887
1888 gpre_nod* item = MSC_node(nod_assignment, 2);
1889 item->nod_arg[0] = MSC_unary(nod_value, (gpre_nod*) change);
1890 item->nod_arg[1] = MSC_unary(nod_field, (gpre_nod*) change);
1891 MSC_push((gpre_nod*) item, &stack);
1892 count++;
1893
1894 if (reference->ref_null)
1895 {
1896 ref* flag = MSC_reference(&modify->upd_references);
1897 flag->ref_context = change->ref_context;
1898 flag->ref_field = flag_field;
1899 flag->ref_master = change;
1900 flag->ref_source = reference->ref_null;
1901 change->ref_null = flag;
1902
1903 item = MSC_node(nod_assignment, 2);
1904 item->nod_arg[0] = MSC_unary(nod_value, (gpre_nod*) flag);
1905 item->nod_arg[1] = MSC_unary(nod_field, (gpre_nod*) flag);
1906 MSC_push((gpre_nod*) item, &stack);
1907 count++;
1908 }
1909 }
1910 }

Callers 1

PAR_actionFunction · 0.85

Calls 8

PAR_endFunction · 0.85
MSC_popFunction · 0.85
MSC_referenceFunction · 0.85
MSC_nodeFunction · 0.85
MSC_unaryFunction · 0.85
MSC_pushFunction · 0.85
MSC_actionFunction · 0.85
PAR_errorFunction · 0.70

Tested by

no test coverage detected