Skip to content

Commit e40c2af

Browse files
revert dataFormatSupport change
1 parent 29dbf5b commit e40c2af

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

hana/lib/drivers/hdb.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ const { text } = require('stream/consumers')
44

55
const hdb = require('hdb')
66
const iconv = require('iconv-lite')
7+
const cds = require('@sap/cds')
78

89
const { driver, prom, handleLevel } = require('./base')
910
const { resultSetStream } = require('./stream')
1011
const { wrap_client } = require('./dynatrace')
1112

13+
if (cds.env.features.sql_simple_queries === 3) {
14+
// Make hdb return true / false
15+
const Reader = require('hdb/lib/protocol/Reader.js')
16+
Reader.prototype._readTinyInt = Reader.prototype.readTinyInt
17+
Reader.prototype.readTinyInt = function () {
18+
const ret = this._readTinyInt()
19+
return ret == null ? ret : !!ret
20+
}
21+
}
22+
1223
const credentialMappings = [
1324
{ old: 'certificate', new: 'ca' },
1425
{ old: 'encrypt', new: 'useTLS' },
@@ -24,7 +35,6 @@ class HDBDriver extends driver {
2435
constructor(creds) {
2536
creds = {
2637
fetchSize: 1 << 16, // V8 default memory page size
27-
dataFormatSupport: 7, // with 7 hana supports booleans
2838
...creds,
2939
}
3040

0 commit comments

Comments
 (0)