diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d36c40..a9bc569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## [2.3.4] - 2020-08-09 +### Fixed +- Fixed bug when UNICODE is defined where statement in result object and column name properties wouldn't encode correctly +- Update package-lock.json with vulnerability fixes + ## [2.3.3] - 2020-07-31 ### Fixed - Fixed bug when UNICODE is defined where error message, error state, and column names wouldn't encode correctly diff --git a/package-lock.json b/package-lock.json index 170503f..99d121a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "odbc", - "version": "2.3.3", + "version": "2.3.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1001,9 +1001,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "mimic-fn": { diff --git a/package.json b/package.json index 682a9e6..89a61f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "odbc", "description": "unixodbc bindings for node", - "version": "2.3.3", + "version": "2.3.4", "homepage": "http://github.com/markdirish/node-odbc/", "main": "lib/odbc.js", "types": "lib/odbc.d.ts", diff --git a/src/odbc_connection.cpp b/src/odbc_connection.cpp index 42a9bc7..8ce9c7d 100644 --- a/src/odbc_connection.cpp +++ b/src/odbc_connection.cpp @@ -294,7 +294,11 @@ Napi::Array ODBCConnection::ProcessDataForNapi(Napi::Env env, QueryData *data, N if (data->sql == NULL) { rows.Set(Napi::String::New(env, STATEMENT), env.Null()); } else { + #ifdef UNICODE + rows.Set(Napi::String::New(env, STATEMENT), Napi::String::New(env, (const char16_t*)data->sql)); + #else rows.Set(Napi::String::New(env, STATEMENT), Napi::String::New(env, (const char*)data->sql)); + #endif } // set the 'parameters' property @@ -434,7 +438,11 @@ Napi::Array ODBCConnection::ProcessDataForNapi(Napi::Env env, QueryData *data, N if (this->connectionOptions.fetchArray == true) { row.Set(j, value); } else { + #ifdef UNICODE + row.Set(Napi::String::New(env, (const char16_t*)columns[j]->ColumnName), value); + #else row.Set(Napi::String::New(env, (const char*)columns[j]->ColumnName), value); + #endif } } rows.Set(i, row);