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

Function INF_database_info

src/jrd/inf.cpp:272–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271
272void INF_database_info(thread_db* tdbb,
273 const ULONG item_length,
274 const UCHAR* items,
275 const ULONG output_length,
276 UCHAR* info)
277{
278/**************************************
279 *
280 * I N F _ d a t a b a s e _ i n f o ( J R D )
281 *
282 **************************************
283 *
284 * Functional description
285 * Process requests for database info.
286 *
287 **************************************/
288 CHECK_INPUT("INF_database_info");
289
290 CountsBuffer counts_buffer;
291 UCHAR* buffer = counts_buffer.getBuffer(BUFFER_SMALL, false);
292 ULONG length, err_val;
293 bool header_refreshed = false;
294
295 Database* const dbb = tdbb->getDatabase();
296 CHECK_DBB(dbb);
297
298 AutoTransaction transaction(tdbb);
299
300 const UCHAR* const end_items = items + item_length;
301 const UCHAR* const end = info + output_length;
302
303 const Jrd::Attachment* const att = tdbb->getAttachment();
304
305 while (items < end_items && *items != isc_info_end && info < end)
306 {
307 UCHAR* p = buffer;
308 UCHAR item = *items++;
309
310 switch (item)
311 {
312 case isc_info_end:
313 break;
314
315 case isc_info_reads:
316 length = INF_convert(dbb->dbb_stats.getValue(RuntimeStatistics::PAGE_READS), buffer);
317 break;
318
319 case isc_info_writes:
320 length = INF_convert(dbb->dbb_stats.getValue(RuntimeStatistics::PAGE_WRITES), buffer);
321 break;
322
323 case isc_info_fetches:
324 length = INF_convert(dbb->dbb_stats.getValue(RuntimeStatistics::PAGE_FETCHES), buffer);
325 break;
326
327 case isc_info_marks:
328 length = INF_convert(dbb->dbb_stats.getValue(RuntimeStatistics::PAGE_MARKS), buffer);
329 break;

Callers 1

getInfoMethod · 0.85

Calls 15

CHECK_DBBFunction · 0.85
INF_convertFunction · 0.85
PAG_attachment_idFunction · 0.85
CCH_flushFunction · 0.85
getCountsFunction · 0.85
ISC_get_hostFunction · 0.85
PAG_headerFunction · 0.85
TRA_snapshot_stateFunction · 0.85
TRA_waitFunction · 0.85
INF_put_itemFunction · 0.85
CCH_FETCHFunction · 0.85
CCH_RELEASE_TAILFunction · 0.85

Tested by

no test coverage detected