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

Method fillFromCache

src/common/StatementMetadata.cpp:427–453  ·  view source on GitHub ↗

Fill an output buffer from the cached data. Return true if succeeded.

Source from the content-addressed store, hash-verified

425
426// Fill an output buffer from the cached data. Return true if succeeded.
427bool StatementMetadata::fillFromCache(unsigned itemsLength, const UCHAR* items,
428 unsigned bufferLength, UCHAR* buffer)
429{
430 //// TODO: Respond more things locally. isc_dsql_prepare_m will need.
431
432 if (((itemsLength == 1 && items[0] == isc_info_sql_stmt_type) ||
433 (itemsLength == 2 && items[0] == isc_info_sql_stmt_type &&
434 (items[1] == isc_info_end || items[1] == 0))) &&
435 type.specified)
436 {
437 if (bufferLength >= 8)
438 {
439 *buffer++ = isc_info_sql_stmt_type;
440 put_vax_short(buffer, 4);
441 buffer += 2;
442 put_vax_long(buffer, type.value);
443 buffer += 4;
444 *buffer = isc_info_end;
445 }
446 else
447 *buffer = isc_info_truncated;
448
449 return true;
450 }
451
452 return false;
453}
454
455// Fetch input or output parameter list.
456void StatementMetadata::fetchParameters(UCHAR code, Parameters* parameters)

Callers 1

getInfoMethod · 0.80

Calls 2

put_vax_shortFunction · 0.85
put_vax_longFunction · 0.85

Tested by

no test coverage detected