"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/isql/show.epp" between
Firebird-3.0.2.32703-0.tar.bz2 and Firebird-3.0.4.33054-0.tar.bz2

About: Firebird is a relational database offering many ANSI SQL standard features.

show.epp  (Firebird-3.0.2.32703-0.tar.bz2):show.epp  (Firebird-3.0.4.33054-0.tar.bz2)
skipping to change at line 134 skipping to change at line 134
public: public:
// IVersionCallback implementation // IVersionCallback implementation
void callback(Firebird::CheckStatusWrapper*, const char* text) void callback(Firebird::CheckStatusWrapper*, const char* text)
{ {
isqlGlob.printf("%s%s", text, NEWLINE); isqlGlob.printf("%s%s", text, NEWLINE);
} }
}; };
} // anonymous namespace } // 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);
} }
// Initialize types // Initialize types
// Keep this array in sync with obj.h in jrd. // Keep this array in sync with obj.h in jrd.
static const SCHAR* Object_types[] = static const SCHAR* Object_types[] =
{ {
"Table", "Table",
"View", "View",
"Trigger", "Trigger",
skipping to change at line 382 skipping to change at line 382
* *
* Arguments: * Arguments:
* db_handle -- database handle * db_handle -- database handle
* info_buf -- info_bufput file pointer * info_buf -- info_bufput file pointer
* db_itemsL -- list of db_info items to process * db_itemsL -- list of db_info items to process
* *
**************************************/ **************************************/
UCHAR buffer[BUFFER_LENGTH400]; UCHAR buffer[BUFFER_LENGTH400];
TEXT msg[MSG_LENGTH]; TEXT msg[MSG_LENGTH];
Firebird::AutoPtr<Firebird::IStatus, Firebird::SimpleDispose<Firebird::IS Firebird::AutoPtr<Firebird::IStatus, Firebird::SimpleDispose> status_vect
tatus> > or(fbMaster->getStatus());
status_vector(fbMaster->getStatus());
Firebird::CheckStatusWrapper statusWrapper(status_vector); Firebird::CheckStatusWrapper statusWrapper(status_vector);
db_handle->getInfo(&statusWrapper, item_length, db_itemsL, sizeof(buffer) , buffer); db_handle->getInfo(&statusWrapper, item_length, db_itemsL, sizeof(buffer) , buffer);
if (ISQL_errmsg(status_vector)) if (ISQL_errmsg(status_vector))
return false; return false;
*info_buf = '\0'; *info_buf = '\0';
SCHAR* info = info_buf; SCHAR* info = info_buf;
for (const UCHAR* d = buffer; *d != isc_info_end;) for (const UCHAR* d = buffer; *d != isc_info_end;)
{ {
SLONG value_out = 0; SINT64 value_out = 0;
const UCHAR item = *d++; const UCHAR item = *d++;
const int length = ISQL_vax_integer(d, 2); const int length = ISQL_vax_integer(d, 2);
d += 2; d += 2;
/* /*
* This is not the best solution but it fixes the lack of <LF> ch aracters * This is not the best solution but it fixes the lack of <LF> ch aracters
* in Windows ISQL. This will need to remain until we modify the messages * in Windows ISQL. This will need to remain until we modify the messages
* to remove the '\n' (on the PC its '\n\r'). * to remove the '\n' (on the PC its '\n\r').
* CVC: WISQL is dead. I've restored the missing newlines for isq l. * CVC: WISQL is dead. I've restored the missing newlines for isq l.
*/ */
switch (item) switch (item)
{ {
case isc_info_end: case isc_info_end:
break; break;
case isc_info_page_size: case isc_info_page_size:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
sprintf(info, "PAGE_SIZE %" SLONGFORMAT"%s", value_out, s eparator); sprintf(info, "PAGE_SIZE %" SQUADFORMAT"%s", value_out, s eparator);
break; break;
case isc_info_db_size_in_pages: case isc_info_db_size_in_pages:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
IUTILS_msg_get(NUMBER_PAGES, msg, SafeArg() << va lue_out); IUTILS_msg_get(NUMBER_PAGES, msg, SafeArg() << va lue_out);
sprintf(info, "%s%s", msg, separator); sprintf(info, "%s%s", msg, separator);
} }
else 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; break;
case fb_info_pages_used: case fb_info_pages_used:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
IUTILS_msg_get(NUMBER_USED_PAGES, msg, SafeArg() << value_out); IUTILS_msg_get(NUMBER_USED_PAGES, msg, SafeArg() << value_out);
sprintf(info, "%s%s", msg, separator); sprintf(info, "%s%s", msg, separator);
} }
else else
sprintf(info, "Number of DB pages used = %" SLONG FORMAT"%s", value_out, separator); sprintf(info, "Number of DB pages used = %" SQUAD FORMAT"%s", value_out, separator);
break; break;
case fb_info_pages_free: case fb_info_pages_free:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
IUTILS_msg_get(NUMBER_FREE_PAGES, msg, SafeArg() << value_out); IUTILS_msg_get(NUMBER_FREE_PAGES, msg, SafeArg() << value_out);
sprintf(info, "%s%s", msg, separator); sprintf(info, "%s%s", msg, separator);
} }
else else
sprintf(info, "Number of DB pages free = %" SLONG FORMAT"%s", value_out, separator); sprintf(info, "Number of DB pages free = %" SQUAD FORMAT"%s", value_out, separator);
break; break;
case fb_info_crypt_state: case fb_info_crypt_state:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
Firebird::string s; Firebird::string s;
if (value_out & fb_info_crypt_encrypted) if (value_out & fb_info_crypt_encrypted)
IUTILS_msg_get(DATABASE_CRYPTED, msg); IUTILS_msg_get(DATABASE_CRYPTED, msg);
skipping to change at line 485 skipping to change at line 484
break; break;
case isc_info_sweep_interval: case isc_info_sweep_interval:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
IUTILS_msg_get(SWEEP_INTERV, msg, SafeArg() << va lue_out); IUTILS_msg_get(SWEEP_INTERV, msg, SafeArg() << va lue_out);
sprintf(info, "%s%s", msg, separator); sprintf(info, "%s%s", msg, separator);
} }
else else
sprintf(info, "Sweep interval = %" SLONGFORMAT"%s ", value_out, separator); sprintf(info, "Sweep interval = %" SQUADFORMAT"%s ", value_out, separator);
break; break;
case isc_info_forced_writes: case isc_info_forced_writes:
value_out = ISQL_vax_integer (d, length); value_out = ISQL_vax_integer (d, length);
sprintf (info, "Forced Writes are %s%s", (value_out == 1 ? "ON" : "OFF"), separator); sprintf (info, "Forced Writes are %s%s", (value_out == 1 ? "ON" : "OFF"), separator);
break; break;
case isc_info_oldest_transaction : case isc_info_oldest_transaction :
value_out = ISQL_vax_integer (d, length); 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; break;
case isc_info_oldest_active : case isc_info_oldest_active :
value_out = ISQL_vax_integer (d, length); value_out = ISQL_vax_integer (d, length);
sprintf(info, "Transaction - oldest active = %" SLONGFORM AT"%s", value_out, separator); sprintf(info, "Transaction - oldest active = %" SQUADFORM AT"%s", value_out, separator);
break; break;
case isc_info_oldest_snapshot : case isc_info_oldest_snapshot :
value_out = ISQL_vax_integer (d, length); value_out = ISQL_vax_integer (d, length);
sprintf(info, "Transaction - oldest snapshot = %" SLONGFO RMAT"%s", value_out, separator); sprintf(info, "Transaction - oldest snapshot = %" SQUADFO RMAT"%s", value_out, separator);
break; break;
case isc_info_next_transaction : case isc_info_next_transaction :
value_out = ISQL_vax_integer (d, length); 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; break;
case isc_info_base_level: case isc_info_base_level:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
IUTILS_msg_get(BASE_LEVEL, msg, SafeArg() << valu e_out); IUTILS_msg_get(BASE_LEVEL, msg, SafeArg() << valu e_out);
sprintf(info, "%s%s", msg, separator); sprintf(info, "%s%s", msg, separator);
} }
else else
sprintf(info, "Base level = %" SLONGFORMAT"%s", v alue_out, separator); sprintf(info, "Base level = %" SQUADFORMAT"%s", v alue_out, separator);
break; break;
case isc_info_limbo: case isc_info_limbo:
value_out = ISQL_vax_integer(d, length); value_out = ISQL_vax_integer(d, length);
if (translate) if (translate)
{ {
IUTILS_msg_get(LIMBO, msg, SafeArg() << value_out ); IUTILS_msg_get(LIMBO, msg, SafeArg() << value_out );
sprintf(info, "%s%s", msg, separator); sprintf(info, "%s%s", msg, separator);
} }
else else
sprintf(info, "Transaction in limbo = %" SLONGFOR MAT"%s", value_out, separator); sprintf(info, "Transaction in limbo = %" SQUADFOR MAT"%s", value_out, separator);
break; break;
case isc_info_ods_version: case isc_info_ods_version:
isqlGlob.major_ods = ISQL_vax_integer(d, length); isqlGlob.major_ods = ISQL_vax_integer(d, length);
break; break;
case isc_info_ods_minor_version: case isc_info_ods_minor_version:
value_out = ISQL_vax_integer(d, length); 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, se parator); (SLONG) isqlGlob.major_ods, value_out, se parator);
break; break;
#ifdef DEV_BUILD #ifdef DEV_BUILD
case isc_info_db_id: case isc_info_db_id:
{ {
// Will print with garbage for now. // Will print with garbage for now.
//It's sprintf(info, "DB/Host = %.*s", length, d) ; //It's sprintf(info, "DB/Host = %.*s", length, d) ;
const UCHAR* s = d; const UCHAR* s = d;
const UCHAR* end = s + length; const UCHAR* end = s + length;
 End of changes. 16 change blocks. 
18 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)