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

Method getFbVersion

src/yvalve/utl.cpp:427–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void UtilInterface::getFbVersion(CheckStatusWrapper* status, IAttachment* att,
428 IVersionCallback* callback)
429{
430/**************************************
431 *
432 * g d s _ $ v e r s i o n
433 *
434 **************************************
435 *
436 * Functional description
437 * Obtain and print information about a database.
438 *
439 **************************************/
440 try
441 {
442 if (!att)
443 Arg::Gds(isc_bad_db_handle).raise();
444
445 UCharBuffer buffer;
446 USHORT buf_len = 256;
447 UCHAR* buf = buffer.getBuffer(buf_len);
448
449 const TEXT* versions = 0;
450 const TEXT* implementations = 0;
451 const UCHAR* dbis = NULL;
452 bool redo;
453
454 do
455 {
456 att->getInfo(status, sizeof(info), info, buf_len, buf);
457 if (status->getState() & Firebird::IStatus::STATE_ERRORS)
458 return;
459
460 ClumpletReader p(ClumpletReader::InfoResponse, buf, buf_len);
461
462 for (redo = false; !(redo || p.isEof()); p.moveNext())
463 {
464 switch (p.getClumpTag())
465 {
466 case isc_info_firebird_version:
467 versions = (TEXT*) p.getBytes();
468 break;
469
470 case isc_info_implementation:
471 implementations = (TEXT*) p.getBytes();
472 break;
473
474 case fb_info_implementation:
475 dbis = p.getBytes();
476 if (dbis[0] * 6u + 1u > p.getClumpLength())
477 {
478 // fb_info_implementation value appears incorrect
479 dbis = NULL;
480 }
481 break;
482
483 case isc_info_error:
484 // old server does not understand fb_info_implementation

Callers 2

open_filesFunction · 0.45
API_ROUTINE isc_versionFunction · 0.45

Calls 15

GdsClass · 0.85
UTL_get_ods_versionFunction · 0.85
getClumpTagMethod · 0.80
getClumpLengthMethod · 0.80
raiseMethod · 0.45
getBufferMethod · 0.45
getInfoMethod · 0.45
getStateMethod · 0.45
isEofMethod · 0.45
moveNextMethod · 0.45
getBytesMethod · 0.45
implementationMethod · 0.45

Tested by

no test coverage detected