| 270 | |
| 271 | |
| 272 | void 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; |
no test coverage detected