diff --git a/lib/connection/result/column.js b/lib/connection/result/column.js index 9eafd3837..42671cbb8 100644 --- a/lib/connection/result/column.js +++ b/lib/connection/result/column.js @@ -456,10 +456,10 @@ function convertRawTimestampTz(rawColumnValue, column, context) // extract everything but the lowest 14 bits to get the fractional seconds valFracSecsBig = - valFracSecsWithTzBig.dividedBy(16384).floor(); + valFracSecsWithTzBig.dividedBy(16384).integerValue(BigNumber.ROUND_FLOOR); // extract the lowest 14 bits to get the timezone - if (valFracSecsWithTzBig.greaterThanOrEqualTo(0)) + if (valFracSecsWithTzBig.isGreaterThanOrEqualTo(0)) { timezoneBig = valFracSecsWithTzBig.modulo(16384); } @@ -521,7 +521,7 @@ function convertRawTimestampHelper( // split the value into epoch seconds + nanoseconds; for example, // 1365148923.123456789 will be split into 1365148923 (epoch seconds) // and 123456789 (nano seconds) - var valSecBig = epochFracSecsBig.dividedBy(scaleFactor).floor(); + var valSecBig = epochFracSecsBig.dividedBy(scaleFactor).integerValue(BigNumber.ROUND_FLOOR); var fractionsBig = epochFracSecsBig.minus(valSecBig.times(scaleFactor)); var valSecNanoBig = fractionsBig.times(Math.pow(10, 9 - scale)); diff --git a/lib/services/sf.js b/lib/services/sf.js index 554ef643f..bcec47fac 100644 --- a/lib/services/sf.js +++ b/lib/services/sf.js @@ -485,9 +485,10 @@ function SnowflakeService(connectionConfig, httpClient, config) operationQueue.length = 0; }; - this.isConnected = function () - { - return currentState === stateConnected; + this.isConnected = function () { + return currentState === stateConnected || + currentState === stateConnecting || + currentState === stateRenewing; }; this.getServiceName = function () diff --git a/package.json b/package.json index 47bdc107f..4477d752e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "asn1.js-rfc5280": "^3.0.0", "axios": "^1.5.1", "big-integer": "^1.6.43", - "bignumber.js": "^2.4.0", + "bignumber.js": "^9.1.2", "binascii": "0.0.2", "bn.js": "^5.2.1", "browser-request": "^0.3.3",