From ca9627e70852f6b2e835660df870fe3ab405882d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 1 Sep 2019 00:00:32 +0200 Subject: Initial import --- dev-db/freetds/files/SQLGetData_cvs.patch | 67 +++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 dev-db/freetds/files/SQLGetData_cvs.patch (limited to 'dev-db/freetds/files/SQLGetData_cvs.patch') diff --git a/dev-db/freetds/files/SQLGetData_cvs.patch b/dev-db/freetds/files/SQLGetData_cvs.patch new file mode 100644 index 0000000..5631c22 --- /dev/null +++ b/dev-db/freetds/files/SQLGetData_cvs.patch @@ -0,0 +1,67 @@ +diff -dPNur freetds-0.82-ds1/src/odbc/odbc.c freetds-0.82-ds2/src/odbc/odbc.c +--- freetds-0.82-ds1/src/odbc/odbc.c 2008-07-01 19:19:14.000000000 +0200 ++++ freetds-0.82-ds2/src/odbc/odbc.c 2008-07-01 19:19:25.000000000 +0200 +@@ -4564,6 +4564,7 @@ + SQLLEN dummy_cb; + int nSybType; + ++ TDS_INT converted_column_cur_size; + int extra_bytes = 0; + + INIT_HSTMT; +@@ -4599,6 +4600,7 @@ + ODBC_RETURN(stmt, SQL_ERROR); + } + colinfo = resinfo->columns[icol - 1]; ++ converted_column_cur_size = colinfo->column_cur_size; + + if (colinfo->column_cur_size < 0) { + *pcbValue = SQL_NULL_DATA; +@@ -4624,7 +4626,7 @@ + if (is_blob_type(colinfo->column_type)) + src = ((TDSBLOB *) src)->textvalue; + +- if (fCType == SQL_C_CHAR && colinfo->column_text_sqlgetdatapos) { ++ if (fCType == SQL_C_CHAR) { + TDS_CHAR buf[3]; + SQLLEN len; + +@@ -4667,12 +4669,15 @@ + } + } else { + nread = colinfo->column_text_sqlgetdatapos / 2; +- if (nread >= colinfo->column_cur_size) ++ ++ if (colinfo->column_text_sqlgetdatapos > 0 ++ && nread >= colinfo->column_cur_size) + ODBC_RETURN(stmt, SQL_NO_DATA); + } + + src += nread; + srclen = colinfo->column_cur_size - nread; ++ converted_column_cur_size *= 2; + break; + default: + if (colinfo->column_text_sqlgetdatapos >= colinfo->column_cur_size) +@@ -4701,6 +4706,12 @@ + + src += nread; + srclen = colinfo->column_cur_size - nread; ++ ++ if (converted_column_cur_size%2) ++ converted_column_cur_size = (converted_column_cur_size + 1) / 2; ++ else ++ converted_column_cur_size /= 2; ++ + break; + default: + if (colinfo->column_text_sqlgetdatapos > 0 +@@ -4751,7 +4762,7 @@ + if (colinfo->column_text_sqlgetdatapos == 0 && cbValueMax > 0) + ++colinfo->column_text_sqlgetdatapos; + /* not all readed ?? */ +- if (colinfo->column_text_sqlgetdatapos < colinfo->column_cur_size) { ++ if (colinfo->column_text_sqlgetdatapos < converted_column_cur_size) { + odbc_errs_add(&stmt->errs, "01004", "String data, right truncated"); + ODBC_RETURN(stmt, SQL_SUCCESS_WITH_INFO); + } -- cgit v1.2.3