Skip to content

Commit

Permalink
Fixed bug CORE-5870 : ISQL's "show database" command works wrong with…
Browse files Browse the repository at this point in the history
… 64-bit numbers
  • Loading branch information
hvlad committed Jul 10, 2018
1 parent 9de2c13 commit ea010ed
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/isql/show.epp
Expand Up @@ -136,9 +136,9 @@ public:
} // anonymous namespace


static int ISQL_vax_integer(const UCHAR* bytes, USHORT length)
static SINT64 ISQL_vax_integer(const UCHAR* bytes, USHORT length)
{
return isc_vax_integer((const char*)bytes, length);
return isc_portable_integer(bytes, length);
}


Expand Down Expand Up @@ -403,7 +403,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
SCHAR* info = info_buf;
for (const UCHAR* d = buffer; *d != isc_info_end;)
{
SLONG value_out = 0;
SINT64 value_out = 0;
const UCHAR item = *d++;
const int length = ISQL_vax_integer(d, 2);
d += 2;
Expand All @@ -420,7 +420,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,

case isc_info_page_size:
value_out = ISQL_vax_integer(d, length);
sprintf(info, "PAGE_SIZE %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "PAGE_SIZE %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_db_size_in_pages:
Expand All @@ -431,7 +431,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
sprintf(info, "%s%s", msg, separator);
}
else
sprintf(info, "Number of DB pages allocated = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Number of DB pages allocated = %" SQUADFORMAT"%s", value_out, separator);
break;

case fb_info_pages_used:
Expand All @@ -442,7 +442,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
sprintf(info, "%s%s", msg, separator);
}
else
sprintf(info, "Number of DB pages used = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Number of DB pages used = %" SQUADFORMAT"%s", value_out, separator);
break;

case fb_info_pages_free:
Expand All @@ -453,7 +453,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
sprintf(info, "%s%s", msg, separator);
}
else
sprintf(info, "Number of DB pages free = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Number of DB pages free = %" SQUADFORMAT"%s", value_out, separator);
break;

case fb_info_crypt_state:
Expand Down Expand Up @@ -495,7 +495,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
sprintf(info, "%s%s", msg, separator);
}
else
sprintf(info, "Sweep interval = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Sweep interval = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_forced_writes:
Expand All @@ -505,22 +505,22 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,

case isc_info_oldest_transaction :
value_out = ISQL_vax_integer (d, length);
sprintf(info, "Transaction - oldest = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Transaction - oldest = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_oldest_active :
value_out = ISQL_vax_integer (d, length);
sprintf(info, "Transaction - oldest active = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Transaction - oldest active = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_oldest_snapshot :
value_out = ISQL_vax_integer (d, length);
sprintf(info, "Transaction - oldest snapshot = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Transaction - oldest snapshot = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_next_transaction :
value_out = ISQL_vax_integer (d, length);
sprintf (info, "Transaction - Next = %" SLONGFORMAT"%s", value_out, separator);
sprintf (info, "Transaction - Next = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_base_level:
Expand All @@ -531,7 +531,7 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
sprintf(info, "%s%s", msg, separator);
}
else
sprintf(info, "Base level = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Base level = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_limbo:
Expand All @@ -542,15 +542,15 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
sprintf(info, "%s%s", msg, separator);
}
else
sprintf(info, "Transaction in limbo = %" SLONGFORMAT"%s", value_out, separator);
sprintf(info, "Transaction in limbo = %" SQUADFORMAT"%s", value_out, separator);
break;

case isc_info_ods_version:
isqlGlob.major_ods = ISQL_vax_integer(d, length);
break;
case isc_info_ods_minor_version:
value_out = ISQL_vax_integer(d, length);
sprintf(info, "ODS = %" SLONGFORMAT".%" SLONGFORMAT"%s",
sprintf(info, "ODS = %" SLONGFORMAT".%" SQUADFORMAT"%s",
(SLONG) isqlGlob.major_ods, value_out, separator);
break;

Expand Down

0 comments on commit ea010ed

Please sign in to comment.