isql.epp (Firebird-3.0.2.32703-0.tar.bz2) | : | isql.epp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 576 | skipping to change at line 576 | |||
} | } | |||
static bool D_Transaction() | static bool D_Transaction() | |||
{ | { | |||
return startTransaction(&D__trans, sizeof(default_tpb), default_tpb); | return startTransaction(&D__trans, sizeof(default_tpb), default_tpb); | |||
} | } | |||
// Transaction for all frontend commands | // Transaction for all frontend commands | |||
static bool frontendTransaction() | static bool frontendTransaction() | |||
{ | { | |||
return startTransaction(&fbTrans, sizeof(default_tpb), default_tpb); | return startTransaction(&fbTrans); | |||
} | } | |||
static void atexit_fb_shutdown() | static void atexit_fb_shutdown() | |||
{ | { | |||
fb_shutdown(0, fb_shutrsn_app_stopped); | fb_shutdown(0, fb_shutrsn_app_stopped); | |||
} | } | |||
int CLIB_ROUTINE main(int argc, char* argv[]) | int CLIB_ROUTINE main(int argc, char* argv[]) | |||
{ | { | |||
/************************************** | /************************************** | |||
skipping to change at line 6827 | skipping to change at line 6827 | |||
* | * | |||
* Functional description | * Functional description | |||
* Special case - Nan and Infinity. | * Special case - Nan and Infinity. | |||
* Some libraries (SFIO) work wrong with them. | * Some libraries (SFIO) work wrong with them. | |||
* | * | |||
**************************************/ | **************************************/ | |||
const TEXT* t = NULL; | const TEXT* t = NULL; | |||
if (isnan(value)) | if (isnan(value)) | |||
t = "NaN"; | t = "NaN"; | |||
else if (isinf(value)) | else if (isinf(value)) | |||
t = "Infinity"; | t = Firebird::isNegativeInf(value) ? "-Infinity" : "Infinity"; | |||
else | else | |||
return false; | return false; | |||
if (setValues.List) { | if (setValues.List) { | |||
isqlGlob.printf("%s%s", t, NEWLINE); | isqlGlob.printf("%s%s", t, NEWLINE); | |||
} | } | |||
sprintf(p, "%*.*s ", length, length, t); | sprintf(p, "%*.*s ", length, length, t); | |||
return true; | return true; | |||
} | } | |||
skipping to change at line 7688 | skipping to change at line 7688 | |||
for (const UCHAR* ptr = planPtr; ptr < planPtr + planSize;) | for (const UCHAR* ptr = planPtr; ptr < planPtr + planSize;) | |||
{ | { | |||
const UCHAR tag = *ptr++; | const UCHAR tag = *ptr++; | |||
switch (tag) | switch (tag) | |||
{ | { | |||
case isc_info_sql_get_plan: | case isc_info_sql_get_plan: | |||
case isc_info_sql_explain_plan: | case isc_info_sql_explain_plan: | |||
{ | { | |||
const ULONG len = gds__vax_integer(ptr, s izeof(USHORT)); | const USHORT len = (USHORT) gds__vax_inte ger(ptr, sizeof(USHORT)); | |||
ptr += sizeof(USHORT); | ptr += sizeof(USHORT); | |||
planString.assign((const char*) ptr, len) ; | planString.assign((const char*) ptr, len) ; | |||
ptr += len; | ptr += len; | |||
} | } | |||
break; | break; | |||
case isc_info_truncated: | case isc_info_truncated: | |||
truncated = true; | truncated = true; | |||
break; | break; | |||
case isc_info_end: | case isc_info_end: | |||
break; | break; | |||
skipping to change at line 7845 | skipping to change at line 7845 | |||
unsigned namelength = IcuUtil::charLength(isqlGlob.att_charset, | unsigned namelength = IcuUtil::charLength(isqlGlob.att_charset, | |||
static_cast<unsigned>(strlen(var.alias)), var.alias); | static_cast<unsigned>(strlen(var.alias)), var.alias); | |||
// Minimum display length should not be less than that needed | // Minimum display length should not be less than that needed | |||
// for displaying null | // for displaying null | |||
if (namelength < NULL_DISP_LEN) | if (namelength < NULL_DISP_LEN) | |||
namelength = NULL_DISP_LEN; | namelength = NULL_DISP_LEN; | |||
const unsigned type = var.type; | const unsigned type = var.type; | |||
const SSHORT charSet = TTYPE_TO_CHARSET(var.charSet); | ||||
switch (type) | switch (type) | |||
{ | { | |||
case SQL_BLOB: | case SQL_BLOB: | |||
case SQL_ARRAY: | case SQL_ARRAY: | |||
// enough room for the blob id to print | // enough room for the blob id to print | |||
disp_length = 17; | disp_length = 17; | |||
break; | break; | |||
case SQL_TIMESTAMP: | case SQL_TIMESTAMP: | |||
skipping to change at line 7876 | skipping to change at line 7877 | |||
case SQL_FLOAT: | case SQL_FLOAT: | |||
disp_length = FLOAT_LEN; | disp_length = FLOAT_LEN; | |||
break; | break; | |||
case SQL_DOUBLE: | case SQL_DOUBLE: | |||
disp_length = DOUBLE_LEN; | disp_length = DOUBLE_LEN; | |||
break; | break; | |||
case SQL_TEXT: | case SQL_TEXT: | |||
alignment = 1; | alignment = 1; | |||
data_length++; | data_length++; | |||
// OCTETS data is displayed in hex | // OCTETS data is displayed in hex | |||
if (var.charSet == CS_BINARY) | if (charSet == CS_BINARY) | |||
disp_length = 2 * var.length; | disp_length = 2 * var.length; | |||
else if (var.charSet == CS_UNICODE_FSS) | else if (charSet == CS_UNICODE_FSS) | |||
disp_length /= 3; | disp_length /= 3; | |||
else if (var.charSet == CS_UTF8) | else if (charSet == CS_UTF8) | |||
disp_length /= 4; | disp_length /= 4; | |||
break; | break; | |||
case SQL_VARYING: | case SQL_VARYING: | |||
data_length += sizeof(USHORT) + 1; | data_length += sizeof(USHORT) + 1; | |||
alignment = sizeof(USHORT); | alignment = sizeof(USHORT); | |||
// OCTETS data is displayed in hex | // OCTETS data is displayed in hex | |||
if (var.charSet == CS_BINARY) | if (charSet == CS_BINARY) | |||
disp_length = 2 * var.length; | disp_length = 2 * var.length; | |||
else if (var.charSet == CS_UNICODE_FSS) | else if (charSet == CS_UNICODE_FSS) | |||
disp_length /= 3; | disp_length /= 3; | |||
else if (var.charSet == CS_UTF8) | else if (charSet == CS_UTF8) | |||
disp_length /= 4; | disp_length /= 4; | |||
break; | break; | |||
case SQL_SHORT: | case SQL_SHORT: | |||
disp_length = SHORT_LEN; | disp_length = SHORT_LEN; | |||
break; | break; | |||
case SQL_LONG: | case SQL_LONG: | |||
disp_length = LONG_LEN; | disp_length = LONG_LEN; | |||
break; | break; | |||
case SQL_INT64: | case SQL_INT64: | |||
disp_length = INT64_LEN; | disp_length = INT64_LEN; | |||
skipping to change at line 7933 | skipping to change at line 7934 | |||
pad[i] = disp_length; | pad[i] = disp_length; | |||
// Is there a collist entry, then use that width, but only for te xt | // Is there a collist entry, then use that width, but only for te xt | |||
if (type == SQL_TEXT || type == SQL_VARYING) | if (type == SQL_TEXT || type == SQL_VARYING) | |||
{ | { | |||
if (!setValues.global_Cols.find(var.alias, &pad[i]) && se tValues.global_Col_default) | if (!setValues.global_Cols.find(var.alias, &pad[i]) && se tValues.global_Col_default) | |||
pad[i] = setValues.global_Col_default; | pad[i] = setValues.global_Col_default; | |||
disp_length = pad[i]; | disp_length = pad[i]; | |||
if (var.charSet == 4) | if (charSet == 4) | |||
disp_length *= 4; | disp_length *= 4; | |||
} | } | |||
// The total line length | // The total line length | |||
linelength += disp_length + 1; | linelength += disp_length + 1; | |||
} | } | |||
return linelength; | return linelength; | |||
} | } | |||
skipping to change at line 8438 | skipping to change at line 8439 | |||
// we do not want to proceed with shutdown except when exit() was called | // we do not want to proceed with shutdown except when exit() was called | |||
return FB_FAILURE; | return FB_FAILURE; | |||
#endif | #endif | |||
} | } | |||
// Detect if stdin is redirected, IE we aren't reading from the console. | // Detect if stdin is redirected, IE we aren't reading from the console. | |||
static bool stdin_redirected() | static bool stdin_redirected() | |||
{ | { | |||
#ifdef WIN_NT | #ifdef WIN_NT | |||
HANDLE in = GetStdHandle(STD_INPUT_HANDLE); | HANDLE in = GetStdHandle(STD_INPUT_HANDLE); | |||
if (GetFileType(in) == FILE_TYPE_CHAR) //FILE_TYPE_DISK) | const DWORD file_type = GetFileType(in); | |||
if (file_type == FILE_TYPE_CHAR || file_type == FILE_TYPE_PIPE) | ||||
return false; | return false; | |||
#else | #else | |||
if (isatty(fileno(stdin))) | if (isatty(fileno(stdin))) | |||
return false; | return false; | |||
#endif | #endif | |||
return true; | return true; | |||
} | } | |||
// CVC: There's something either wrong or on purpose in this routine: | // CVC: There's something either wrong or on purpose in this routine: | |||
// it doesn't unescape the embedded quotes that may exist. | // it doesn't unescape the embedded quotes that may exist. | |||
End of changes. 12 change blocks. | ||||
11 lines changed or deleted | 13 lines changed or added |