From 2b3a30ecb0536eaceb75d7aa605e12b544215050 Mon Sep 17 00:00:00 2001 From: Alex Kasko Date: Fri, 17 May 2024 14:08:27 +0100 Subject: [PATCH] Fractional seconds impl for Time, Datetime2 and Datetimeoffset cleanup Signed-off-by: Alex Kasko --- .../src/backend/tds/tdstypeio.c | 165 ++++------ test/JDBC/expected/jtds-TestTime.out | 300 ++++++++++++++++++ test/JDBC/input/jtds/jtds-TestTime.txt | 104 ++++++ test/JDBC/jdbc_schedule | 1 + test/JDBC/jtds_jdbc_schedule | 18 +- 5 files changed, 474 insertions(+), 114 deletions(-) create mode 100644 test/JDBC/expected/jtds-TestTime.out create mode 100644 test/JDBC/input/jtds/jtds-TestTime.txt diff --git a/contrib/babelfishpg_tds/src/backend/tds/tdstypeio.c b/contrib/babelfishpg_tds/src/backend/tds/tdstypeio.c index 0899542d0fa..21bd4d615cd 100644 --- a/contrib/babelfishpg_tds/src/backend/tds/tdstypeio.c +++ b/contrib/babelfishpg_tds/src/backend/tds/tdstypeio.c @@ -3339,78 +3339,61 @@ TdsSendTypeUniqueIdentifier(FmgrInfo *finfo, Datum value, void *vMetaData) } static char* -append_fsec1(char *cp, fsec_t fsec, int scale) +AppendFractionalSeconds(char *cp, fsec_t fsec, int scale) { int value, oldval, remainder, - idx, - sidx; - char *res, - *orig; - char buf[MAX_TIMESTAMP_PRECISION + 1]; - - res = cp; - orig = cp; - (void) orig; + idx; + char buf[MAX_TIMESTAMP_PRECISION]; if (scale > 0) { *cp++ = '.'; - res++; value = abs(fsec); - for (idx = 0; idx < sizeof(buf) && value > 0; idx++) - { - oldval = value; - value /= 10; - remainder = oldval - value * 10; - buf[idx] = '0' + remainder; - } - - // todo: fix leading zeros - - for (sidx = 0; sidx < scale && sidx < idx; sidx++) + for (idx = sizeof(buf) - 1; idx >= 0; idx--) { - cp[sidx] = buf[idx - sidx - 1]; - res++; - } - -/* - tmpval = value; - shift = scale; - while (tmpval > 0 && shift > 0) - { - tmpval /= 10; - shift--; + if (value > 0) + { + oldval = value; + value /= 10; + remainder = oldval - value * 10; + buf[idx] = '0' + remainder; + } + else + buf[idx] = '0'; } - while (scale-- && value > 0) + for (idx = 0; idx < scale; idx++) { - oldval = value; - value /= 10; - remainder = oldval - value * 10; - cp[scale - shift] = '0' + remainder; - res++; + if (idx < sizeof(buf)) + *cp++ = buf[idx]; + else + *cp++ = '0'; } -*/ - - while(scale-- > idx) - *res++ = '0'; } - return res; + return cp; } -static char* -time_out1(TimeADT time, int scale) +static int +TdsSendTimeAsNVarcharHelper(FmgrInfo *finfo, Datum value, void *vMetaData) { struct pg_tm tt, *tm = &tt; fsec_t fsec; - char *out, + int rc, + scale; + char *out, *cp; + TdsColumnMetaData *col; + StringInfoData buf; + TimeADT time; + col = (TdsColumnMetaData *) vMetaData; + time = (TimeADT) value; + scale = (int) col->atttypmod; if (scale < 0) scale = MAX_TIMESTAMP_PRECISION; @@ -3424,22 +3407,7 @@ time_out1(TimeADT time, int scale) cp = pg_ultostr_zeropad(cp, tm->tm_min, 2); *cp++ = ':'; cp = pg_ultostr_zeropad(cp, tm->tm_sec, 2); - cp = append_fsec1(cp, fsec, scale); - - return out; -} - -static int -TdsSendTimeAsNVarcharHelper(FmgrInfo *finfo, Datum value, void *vMetaData) -{ - int rc, - scale; - char *out; - TdsColumnMetaData *col = (TdsColumnMetaData *) vMetaData; - StringInfoData buf; - - scale = (int) col->atttypmod; - out = time_out1((TimeADT) value, scale); + cp = AppendFractionalSeconds(cp, fsec, scale); initStringInfo(&buf); TdsUTF8toUTF16StringInfo(&buf, out, strlen(out)); @@ -3498,15 +3466,24 @@ TdsSendTypeTime(FmgrInfo *finfo, Datum value, void *vMetaData) return rc; } -static char* -timestamp_out1(Timestamp timestamp, int scale) +static int +TdsSendDatetime2AsNVarcharHelper(FmgrInfo *finfo, Datum value, void *vMetaData) { struct pg_tm tt, *tm = &tt; fsec_t fsec; - char *out, + int rc, + scale; + char *out, *cp; - + TdsColumnMetaData *col; + StringInfoData buf; + Timestamp timestamp; + + col = (TdsColumnMetaData *) vMetaData; + timestamp = (Timestamp) value; + scale = (int) col->atttypmod; + out = palloc0(27 + 1); cp = out; @@ -3526,28 +3503,13 @@ timestamp_out1(Timestamp timestamp, int scale) cp = pg_ultostr_zeropad(cp, tm->tm_min, 2); *cp++ = ':'; cp = pg_ultostr_zeropad(cp, tm->tm_sec, 2); - cp = append_fsec1(cp, fsec, scale); + cp = AppendFractionalSeconds(cp, fsec, scale); } else ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), errmsg("timestamp out of range"))); - return out; -} - -static int -TdsSendDatetime2AsNVarcharHelper(FmgrInfo *finfo, Datum value, void *vMetaData) -{ - int rc, - scale; - char *out; - TdsColumnMetaData *col = (TdsColumnMetaData *) vMetaData; - StringInfoData buf; - - scale = (int) col->atttypmod; - out = timestamp_out1((Timestamp) value, scale); - initStringInfo(&buf); TdsUTF8toUTF16StringInfo(&buf, out, strlen(out)); pfree(out); @@ -4385,24 +4347,30 @@ EncodeTimezone(char *str, int tz, int style) return str; } -static char* -datetimeoffset_out1(tsql_datetimeoffset *df, int scale) +static int +TdsSendDatetimeoffsetAsNVarcharHelper(FmgrInfo *finfo, Datum value, void *vMetaData) { struct pg_tm tt, *tm = &tt; fsec_t fsec; - Timestamp timestamp; - char *out, + int rc, + scale; + char *out, *cp; - + TdsColumnMetaData *col; + StringInfoData buf; + tsql_datetimeoffset *df; + + col = (TdsColumnMetaData *) vMetaData; + df = (tsql_datetimeoffset *) value; + scale = (int) col->atttypmod; if (scale < 0) scale = MAX_TIMESTAMP_PRECISION + 1; out = palloc0(34 + 1); cp = out; - timestamp = df->tsql_ts; - if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) == 0) + if (timestamp2tm(df->tsql_ts, NULL, tm, &fsec, NULL, NULL) == 0) { cp = pg_ultostr_zeropad(cp, (tm->tm_year > 0) ? tm->tm_year : -(tm->tm_year - 1), 4); @@ -4416,7 +4384,7 @@ datetimeoffset_out1(tsql_datetimeoffset *df, int scale) cp = pg_ultostr_zeropad(cp, tm->tm_min, 2); *cp++ = ':'; cp = pg_ultostr_zeropad(cp, tm->tm_sec, 2); - cp = append_fsec1(cp, fsec, scale); + cp = AppendFractionalSeconds(cp, fsec, scale); *cp++ = ' '; cp = EncodeTimezone(cp, df->tsql_tz, DateStyle); } @@ -4425,21 +4393,6 @@ datetimeoffset_out1(tsql_datetimeoffset *df, int scale) (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), errmsg("datetimeoffset out of range"))); - return out; -} - -static int -TdsSendDatetimeoffsetAsNVarcharHelper(FmgrInfo *finfo, Datum value, void *vMetaData) -{ - int rc, - scale; - char *out; - TdsColumnMetaData *col = (TdsColumnMetaData *) vMetaData; - StringInfoData buf; - - scale = (int) col->atttypmod; - out = datetimeoffset_out1((tsql_datetimeoffset *) value, scale); - initStringInfo(&buf); TdsUTF8toUTF16StringInfo(&buf, out, strlen(out)); pfree(out); diff --git a/test/JDBC/expected/jtds-TestTime.out b/test/JDBC/expected/jtds-TestTime.out new file mode 100644 index 00000000000..40bec7f2744 --- /dev/null +++ b/test/JDBC/expected/jtds-TestTime.out @@ -0,0 +1,300 @@ +Create table TestTime(a time(6)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37.000000 +12:45:37.000000 +12:45:37.000000 +12:45:37.000000 +12:45:37.000000 +12:45:37.000000 +12:45:37.000000 + +~~END~~ + + +Drop table TestTime + +Create table TestTime(a time(5)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37.00000 +12:45:37.00000 +12:45:37.00000 +12:45:37.00000 +12:45:37.00000 +12:45:37.00000 +12:45:37.00000 + +~~END~~ + + +Drop table TestTime + +Create table TestTime(a time(4)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37.0000 +12:45:37.0000 +12:45:37.0000 +12:45:37.0000 +12:45:37.0000 +12:45:37.0000 +12:45:37.0000 + +~~END~~ + + +Drop table TestTime + +Create table TestTime(a time(3)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37.000 +12:45:37.000 +12:45:37.000 +12:45:37.000 +12:45:37.000 +12:45:37.000 +12:45:37.000 + +~~END~~ + + +Drop table TestTime + +Create table TestTime(a time(2)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37.00 +12:45:37.00 +12:45:37.00 +12:45:37.00 +12:45:37.00 +12:45:37.00 +12:45:37.00 + +~~END~~ + + +Drop table TestTime + +Create table TestTime(a time(1)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37.0 +12:45:37.0 +12:45:37.0 +12:45:37.0 +12:45:37.0 +12:45:37.0 +12:45:37.0 + +~~END~~ + + +Drop table TestTime + +Create table TestTime(a time(0)) + +prepst#!# Insert into TestTime Values(?) #!#Time|-|a|-|12:45:37.123|-|0 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +~~ROW COUNT: 1~~ + +prepst#!#exec#!#Time|-|a|-| +~~ROW COUNT: 1~~ + + +select * from TestTime +~~START~~ +nvarchar +12:45:37 +12:45:37 +12:45:37 +12:45:37 +12:45:37 +12:45:37 +12:45:37 + +~~END~~ + + +Drop table TestTime diff --git a/test/JDBC/input/jtds/jtds-TestTime.txt b/test/JDBC/input/jtds/jtds-TestTime.txt new file mode 100644 index 00000000000..fcb6805a487 --- /dev/null +++ b/test/JDBC/input/jtds/jtds-TestTime.txt @@ -0,0 +1,104 @@ +Create table TestTime(a time(6)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime + +Create table TestTime(a time(5)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime + +Create table TestTime(a time(4)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime + +Create table TestTime(a time(3)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime + +Create table TestTime(a time(2)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime + +Create table TestTime(a time(1)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime + +Create table TestTime(a time(0)) + +prepst#!# Insert into TestTime Values(@a) #!#Time|-|a|-|12:45:37.123|-|0 +prepst#!#exec#!#Time|-|a|-|12:45:37.123|-|3 +prepst#!#exec#!#Time|-|a|-|12:45:37.12|-|2 +prepst#!#exec#!#Time|-|a|-|12:45:37.1|-|1 +prepst#!#exec#!#Time|-|a|-|12:45:37.1234|-|4 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|6 +prepst#!#exec#!#Time|-|a|-|12:45:37.123456|-|5 +prepst#!#exec#!#Time|-|a|-| + +select * from TestTime + +Drop table TestTime \ No newline at end of file diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 6bd4b8d856c..600bd594656 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -295,6 +295,7 @@ ignore#!#jtds-TestDatetime ignore#!#jtds-TestBinary ignore#!#jtds-TestSimpleErrors ignore#!#jtds-TestErrorsWithTryCatch +ignore#!#jtds-TestTime ignore#!#jtds-TestSQLQueries ignore#!#jtds-TestStoredProcedures ignore#!#jtds-TestTransactionSupportForProcedure diff --git a/test/JDBC/jtds_jdbc_schedule b/test/JDBC/jtds_jdbc_schedule index 88cc9d56cab..e03211f4155 100644 --- a/test/JDBC/jtds_jdbc_schedule +++ b/test/JDBC/jtds_jdbc_schedule @@ -39,20 +39,22 @@ TestReal jtds-TestDatetime # jTDS date handling differs with mssql-jdbc, behavior on MSSQL and Babelfish is the same jtds-TestDate -# Failure: jTDS behaviour differs from mssql-jdbc on both MSSQL and Babelfish in different way +# Failure: when '2016-10-23 12:45:37.12' is inserted into datetime2(6) column, Babelfish inserts +# '2016-10-23 12:45:37.119' instead, root cause is currently unclear. # TestDatetime2 TestSmallDatetime -# Failure: jTDS behaviour differs from mssql-jdbc on both MSSQL and Babelfish in different way -# TestTime -# Failure: FATAL: UTF16 output of varchar/bpchar exceeds max length +# Nvarchar column type is returned for time columns on both MSSQL and Babelfish +jtds-TestTime +# Failure: besides nvarchar column type, value output differs when datetimeoffet is being cast +# to datetime2 or time # TestDatetimeoffset-vu-prepare # TestDatetimeoffset-vu-verify # TestDatetimeoffset-vu-cleanup -# java.lang.StringIndexOutOfBoundsException: offset 0, count -17238, length 255 +# Failure: ERROR: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol +# stream is incorrect. Parameter 2 (""): Data type 0x63 has an invalid data length or metadata length. # TestVarChar -# Failure: -# ERROR: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. -# Parameter 3 (""): Data type 0x63 has an invalid data length or metadata length. +# Failure: ERROR: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol +# stream is incorrect. Parameter 3 (""): Data type 0x63 has an invalid data length or metadata length. # TestText TestChar # Image column type is returned for varbinary(max) on both MSSQL and Babelfish