Skip to content

Commit dece699

Browse files
committed
Merge branch 'release/2.5.1'
2 parents 5c0643e + 01d8295 commit dece699

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ matrix:
5252
env: DB=mariadb:10.5 SKIP_LEAK=1 ADDITIONAL_CONF=--version=10.5.199
5353
- node_js: "14"
5454
env: DB=mariadb:10.5 SKIP_LEAK=1
55+
- node_js: "15"
56+
env: DB=mariadb:10.5 SKIP_LEAK=1
5557
- node_js: "12"
5658
env: DB=mariadb:10.5 SKIP_LEAK=1 TEST_COLLATION=cp1251_general_ci
5759
- node_js: "12"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [2.5.1](https://github.com/mariadb-corporation/mariadb-connector-nodejs/tree/2.5.1) (23 Oct 2020)
4+
[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-nodejs/compare/2.5.0...2.5.1)
5+
6+
* CONJS-149 - [CONJS-149] correcting possible TypeError [ERR_UNKNOWN_ENCODING], Node v15 compatibility
7+
8+
39
## [2.5.0](https://github.com/mariadb-corporation/mariadb-connector-nodejs/tree/2.5.0) (15 Oct 2020)
410
[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-nodejs/compare/2.4.2...2.5.0)
511

documentation/connection-options.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ Integers in JavaScript use IEEE-754 representation. This means that Node.js can
6161

6262
This means that when the value set on a column is not in the [safe](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger) range, the default implementation receives an inexact representation of the number.
6363

64-
The Connector provides two options to address this issue.
64+
The Connector provides 3 options to address this issue.
6565

6666
|option|description|type|default|
6767
|---:|---|:---:|:---:|
6868
| **bigNumberStrings** | When an integer is not in the safe range, the Connector interprets the value as a string. |*boolean* |false|
6969
| **supportBigNumbers** | When an integer is not in the safe range, the Connector interprets the value as a [Long](https://www.npmjs.com/package/long) object. |*boolean* |false|
70+
| **supportBigInt** | Whether resultset should return javascript ES2020 [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) for [BIGINT](https://mariadb.com/kb/en/bigint/) data type. This ensures having expected value even for value > 2^53 (see [safe](#big-integer-support) range). |*boolean* | false |
7071

7172

73+
Native `supportBigInt` implementation is recommended over `supportBigNumbers` (remains for compability with older version). `supportBigInt` is not enabled by default for compatibilty to avoid major regression.
74+
It will be in a future 3.x version.
75+
7276
## SSL
7377

7478
The Connector can encrypt data during transfer using the Transport Layer Security (TLS) protocol. TLS/SSL allows for transfer encryption, and can optionally use identity validation for the server and client.
@@ -361,7 +365,7 @@ mariadb.createConnection({
361365
| **rsaPublicKey** | Indicate path/content to MySQL server RSA public key. use requires Node.js v11.6+ |*string* | |
362366
| **cachingRsaPublicKey** | Indicate path/content to MySQL server caching RSA public key. use requires Node.js v11.6+ |*string* | |
363367
| **allowPublicKeyRetrieval** | Indicate that if `rsaPublicKey` or `cachingRsaPublicKey` public key are not provided, if client can ask server to send public key. |*boolean* | false |
364-
| **supportBigInt** | Whether resultset should return javascript ES2020 [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) for [BIGINT](https://mariadb.com/kb/en/bigint/) data type. This ensures having expected value even for value > 2^53 (see [safe](documentation/connection-options.md#support-for-big-integer) range). |*boolean* | false |
368+
| **supportBigInt** | Whether resultset should return javascript ES2020 [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) for [BIGINT](https://mariadb.com/kb/en/bigint/) data type. This ensures having expected value even for value > 2^53 (see [safe](#big-integer-support) range). |*boolean* | false |
365369

366370

367371
## F.A.Q.

documentation/promise-api.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ To use the Connector, you need to import the package into your application code.
5050
const mariadb = require('mariadb');
5151
```
5252

53-
## Timezone consideration
53+
## Recommendation
54+
55+
### Timezone consideration
5456

5557
It's not recommended, but in some cases, Node.js and database are configured with different timezone.
5658

@@ -63,7 +65,7 @@ If client and server timezone differ, `timezone` option has to be set to server
6365
Connector will then convert date to server timezone, rather than the current Node.js timezone.
6466

6567

66-
## Security consideration
68+
### Security consideration
6769

6870
Connection details such as URL, username, and password are better hidden into environment variables.
6971
using code like :
@@ -104,6 +106,12 @@ DB_PWD=secretPasswrd
104106
```
105107
.env files must NOT be pushed into repository, using .gitignore
106108

109+
### Default options consideration
110+
111+
For new project, enabling option `supportBigInt` is recommended (It will be in a future 3.x version).
112+
113+
This option permits to avoid exact value for big integer (value > 2^53) (see [javascript ES2020
114+
BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) )
107115

108116
# Promise API
109117

@@ -596,7 +604,8 @@ Whether you want the Connector to retrieve date values as strings, rather than `
596604

597605
*boolean, default: false*
598606

599-
Whether the query should return integers as [`Long`](https://www.npmjs.com/package/long) objects when they are not in the [safe](documentation/connection-options.md#support-for-big-integer) range.
607+
Whether the query should return integers as [`Long`](https://www.npmjs.com/package/long) objects when they are not in
608+
the [safe](/documentation/connection-options.md#big-integer-support) range.
600609

601610

602611
#### `supportBigInt`
@@ -605,7 +614,7 @@ Whether the query should return integers as [`Long`](https://www.npmjs.com/packa
605614

606615
Whether the query should return javascript ES2020 [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
607616
for [BIGINT](https://mariadb.com/kb/en/bigint/) data type.
608-
This ensures having expected value even for value > 2^53 (> 9007199254740991) (see [safe](documentation/connection-options.md#support-for-big-integer) range).
617+
This ensures having expected value even for value > 2^53 (see [safe](/documentation/connection-options.md#big-integer-support) range).
609618
This option can be set to query level, supplanting connection option `supportBigInt` value.
610619

611620
```javascript
@@ -622,7 +631,7 @@ const res2 = await shareConn.query({sql: 'select * from bigIntTable', supportBig
622631

623632
*boolean, default: false*
624633

625-
Whether the query should return integers as strings when they are not in the [safe](documentation/connection-options.md#support-for-big-integer) range.
634+
Whether the query should return integers as strings when they are not in the [safe](documentation/connection-options.md#big-integer-support) range.
626635

627636

628637
#### `typeCast`

lib/connection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ function Connection(options) {
946946
}.bind(this)
947947
);
948948

949-
_socket.writeBuf = _socket.write;
949+
_socket.writeBuf = (buf) => _socket.write(buf);
950950
_socket.flush = () => {};
951951
_out.setStream(_socket);
952952
};
@@ -1037,7 +1037,7 @@ function Connection(options) {
10371037
secureSocket.on('data', _in.onData.bind(_in));
10381038
secureSocket.on('error', _socketError);
10391039
secureSocket.on('end', _socketError);
1040-
secureSocket.writeBuf = secureSocket.write;
1040+
secureSocket.writeBuf = (buf) => secureSocket.write(buf);
10411041
secureSocket.flush = () => {};
10421042

10431043
_socket.removeAllListeners('data');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mariadb",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"description": "fast mariadb/mysql connector.",
55
"main": "promise.js",
66
"types": "types/index.d.ts",

0 commit comments

Comments
 (0)