From 6b452499a3f337c31db2f928292790e2841de666 Mon Sep 17 00:00:00 2001 From: mengxumx Date: Mon, 3 Dec 2018 22:56:16 -0600 Subject: [PATCH] dbstmt: made buffer bigger for some unicode characters doc: added CHANGELOG.md --- CHANGELOG.md | 76 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- src/db2ia/dbstmt.cc | 6 ++-- 3 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f22db49 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,76 @@ +# idb-connector changelog + +## 1.1.5 + +- Refined docs and trace for scrollable cursor +- Added a new API stmt.getStmtDiag() as alias of stmt.stmtError() +- Added CHANGLOG.md + +## 1.1.4 + +- Added test cases for the callback in dbconn.conn() +- Updated examples with ES6 syntax +- Required dep "node-pre-gyp" 0.11.0 and above + +## 1.1.3 + +- Fixed the NAPI callback error in DbConn::Conn() +- Ported and refined the API manual from "developerWorks" + +## 1.1.2 + +- Removed "node-gyp" from dependency list +- Exposed data types symbols for params binding + +## 1.1.1 + +- Supported fetching result set from stored procedures + +## 1.1.0 + +- Swithed to N-API +- Added Blob/Binary support and corresponding docs +- Refined test cases and trace + +## 1.0.13 + +- Supported pre-compiled binary downloading +- Fixed a memory leak issue + +## 1.0.12 + +- Fixed the truncate issue for big numbers + +## 1.0.11 + +- Supported Node.js v10.x + +## 1.0.10 + +- Refined the code for fetching results and binding params +- Fixed a string param binding issue + +## 1.0.9 + +- Fixed a statement executing issue +- Fixed a output param buffer size issue + +## 1.0.8 + +- Added a new API stmt.reset() +- Fixed a param binding issue + +## 1.0.7 + +- Added support for BINARY SQL data +- Fixed the 'in/out' param missing issue + +## 1.0.6 + +- Used accurate column width to save memory usage +- Supported dynamic column width + +## 1.0.5 + +- Provided pre-compiled binary for npm +- Renamed to idb-connector \ No newline at end of file diff --git a/package.json b/package.json index 7b8f49b..189f232 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "idb-connector", - "version": "1.1.4", + "version": "1.1.5", "description": "A Node.js DB2 driver for IBM i", "main": "lib/db2a.js", "directories": { diff --git a/src/db2ia/dbstmt.cc b/src/db2ia/dbstmt.cc index 2c9f271..32b75d7 100644 --- a/src/db2ia/dbstmt.cc +++ b/src/db2ia/dbstmt.cc @@ -1924,14 +1924,14 @@ int DbStmt::populateColumnDescriptions(Napi::Env env) { case SQL_WCHAR : case SQL_WVARCHAR : { - maxColLen = dbColumn[i].colPrecise << 2; + maxColLen = dbColumn[i].colPrecise * 4 + 1; rowData[i] = (SQLCHAR*)calloc(maxColLen, sizeof(SQLCHAR)); sqlReturnCode = SQLBindCol(stmth, i + 1, SQL_C_CHAR, (SQLPOINTER)rowData[i], maxColLen, &dbColumn[i].rlength); } break; - default : + default : // SQL_CHAR / SQL_VARCHAR { - maxColLen = dbColumn[i].colPrecise + 1; + maxColLen = dbColumn[i].colPrecise * 4 + 1; rowData[i] = (SQLCHAR*)calloc(maxColLen, sizeof(SQLCHAR)); sqlReturnCode = SQLBindCol(stmth, i + 1, SQL_C_CHAR, (SQLPOINTER)rowData[i], maxColLen, &dbColumn[i].rlength); }