Skip to content

Commit a92f352

Browse files
TreeHunter9Artyom Ivanov
authored andcommitted
Fix incorrect maximum size when reading dbb parameter values in SHOW DATABASE (#8413)
* Fix incorrect maximum size when reading dbb parameter values Incorrect maximum size occur for isc_info_oldest_transaction, isc_info_oldest_active, isc_info_oldest_snapshot, isc_info_next_transaction. Also change maximum size for all parameter values, so we don't get the same error in future. * Cast transaction number to correct type --------- Co-authored-by: Artyom Ivanov <[email protected]>
1 parent fd31e52 commit a92f352

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/isql/show.epp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,12 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
444444
break;
445445

446446
case isc_info_page_size:
447-
value_out = p.getInt();
447+
value_out = p.getBigInt();
448448
sprintf(info, "PAGE_SIZE %" SQUADFORMAT"%s", value_out, separator);
449449
break;
450450

451451
case isc_info_db_size_in_pages:
452-
value_out = p.getInt();
452+
value_out = p.getBigInt();
453453
if (translate)
454454
{
455455
IUTILS_msg_get(NUMBER_PAGES, msg, SafeArg() << value_out);
@@ -460,7 +460,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
460460
break;
461461

462462
case fb_info_pages_used:
463-
value_out = p.getInt();
463+
value_out = p.getBigInt();
464464
if (translate)
465465
{
466466
IUTILS_msg_get(NUMBER_USED_PAGES, msg, SafeArg() << value_out);
@@ -471,7 +471,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
471471
break;
472472

473473
case fb_info_pages_free:
474-
value_out = p.getInt();
474+
value_out = p.getBigInt();
475475
if (translate)
476476
{
477477
IUTILS_msg_get(NUMBER_FREE_PAGES, msg, SafeArg() << value_out);
@@ -482,7 +482,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
482482
break;
483483

484484
case fb_info_crypt_state:
485-
value_out = p.getInt();
485+
value_out = p.getBigInt();
486486
if (translate)
487487
{
488488
Firebird::string s;
@@ -512,7 +512,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
512512
break;
513513

514514
case isc_info_sweep_interval:
515-
value_out = p.getInt();
515+
value_out = p.getBigInt();
516516
if (translate)
517517
{
518518
IUTILS_msg_get(SWEEP_INTERV, msg, SafeArg() << value_out);
@@ -523,32 +523,32 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
523523
break;
524524

525525
case isc_info_forced_writes:
526-
value_out = p.getInt();
526+
value_out = p.getBigInt();
527527
sprintf (info, "Forced Writes are %s%s", (value_out == 1 ? "ON" : "OFF"), separator);
528528
break;
529529

530530
case isc_info_oldest_transaction :
531-
value_out = p.getInt();
531+
value_out = p.getBigInt();
532532
sprintf(info, "Transaction - oldest = %" SQUADFORMAT"%s", value_out, separator);
533533
break;
534534

535535
case isc_info_oldest_active :
536-
value_out = p.getInt();
536+
value_out = p.getBigInt();
537537
sprintf(info, "Transaction - oldest active = %" SQUADFORMAT"%s", value_out, separator);
538538
break;
539539

540540
case isc_info_oldest_snapshot :
541-
value_out = p.getInt();
541+
value_out = p.getBigInt();
542542
sprintf(info, "Transaction - oldest snapshot = %" SQUADFORMAT"%s", value_out, separator);
543543
break;
544544

545545
case isc_info_next_transaction :
546-
value_out = p.getInt();
546+
value_out = p.getBigInt();
547547
sprintf (info, "Transaction - Next = %" SQUADFORMAT"%s", value_out, separator);
548548
break;
549549

550550
case isc_info_base_level:
551-
value_out = p.getInt();
551+
value_out = p.getBigInt();
552552
if (translate)
553553
{
554554
IUTILS_msg_get(BASE_LEVEL, msg, SafeArg() << value_out);
@@ -559,7 +559,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
559559
break;
560560

561561
case isc_info_limbo:
562-
value_out = p.getInt();
562+
value_out = p.getBigInt();
563563
if (translate)
564564
{
565565
IUTILS_msg_get(LIMBO, msg, SafeArg() << value_out);
@@ -573,7 +573,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
573573
isqlGlob.major_ods = p.getInt();
574574
break;
575575
case isc_info_ods_minor_version:
576-
value_out = p.getInt();
576+
value_out = p.getBigInt();
577577
sprintf(info, "ODS = %" SLONGFORMAT".%" SQUADFORMAT"%s",
578578
(SLONG) isqlGlob.major_ods, value_out, separator);
579579
break;
@@ -584,7 +584,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
584584
break;
585585

586586
case fb_info_protocol_version:
587-
value_out = p.getInt();
587+
value_out = p.getBigInt();
588588
if (value_out)
589589
sprintf(info, "Protocol version = %" SQUADFORMAT"%s", value_out, separator);
590590
else
@@ -662,7 +662,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
662662

663663
case fb_info_replica_mode:
664664
{
665-
value_out = p.getInt();
665+
value_out = p.getBigInt();
666666
const char* mode =
667667
(value_out == fb_info_replica_none) ? "NONE" :
668668
(value_out == fb_info_replica_read_only) ? "READ_ONLY" :
@@ -6767,4 +6767,4 @@ static processing_state show_wireStats()
67676767
return ps_ERR;
67686768

67696769
return SKIP;
6770-
}
6770+
}

0 commit comments

Comments
 (0)