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

Function dfw_should_know

src/jrd/vio.cpp:5043–5079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5041
5042
5043static bool dfw_should_know(thread_db* tdbb,
5044 record_param* org_rpb,
5045 record_param* new_rpb,
5046 USHORT irrelevant_field,
5047 bool void_update_is_relevant)
5048{
5049/**************************************
5050 *
5051 * d f w _ s h o u l d _ k n o w
5052 *
5053 **************************************
5054 *
5055 * Functional description
5056 * Not all operations on system tables are relevant to inform DFW.
5057 * In particular, changing comments on objects is irrelevant.
5058 * Engine often performs empty update to force some tasks (e.g. to
5059 * recreate index after field type change). So we must return true
5060 * if relevant field changed or if no fields changed. Or we must
5061 * return false if only irrelevant field changed.
5062 *
5063 **************************************/
5064 dsc desc2, desc3;
5065 bool irrelevant_changed = false;
5066 for (USHORT iter = 0; iter < org_rpb->rpb_record->getFormat()->fmt_count; ++iter)
5067 {
5068 const bool flag_org = EVL_field(0, org_rpb->rpb_record, iter, &desc2);
5069 const bool flag_new = EVL_field(0, new_rpb->rpb_record, iter, &desc3);
5070 if (flag_org != flag_new || (flag_new && MOV_compare(tdbb, &desc2, &desc3)))
5071 {
5072 if (iter != irrelevant_field)
5073 return true;
5074
5075 irrelevant_changed = true;
5076 }
5077 }
5078 return void_update_is_relevant ? !irrelevant_changed : false;
5079}
5080
5081
5082static void expunge(thread_db* tdbb, record_param* rpb, const jrd_tra* transaction, ULONG prior_page)

Callers 1

VIO_modifyFunction · 0.85

Calls 3

EVL_fieldFunction · 0.85
MOV_compareFunction · 0.85
getFormatMethod · 0.45

Tested by

no test coverage detected