Skip to content

Commit 1175b6e

Browse files
authored
fix(forUpdate): forUpdate optional (#1079)
Error introduced in #1074
1 parent e6285cb commit 1175b6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hana/lib/HANAService.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ class HANAService extends SQLService {
158158
resultQuery.SELECT.forUpdate = undefined
159159
resultQuery.SELECT.forShareLock = undefined
160160
const keys = Object.keys(req.target.keys || {})
161-
if (keys.length && query.SELECT.forUpdate.ignoreLocked) {
161+
if (keys.length && query.SELECT.forUpdate?.ignoreLocked) {
162162
// REVISIT: No support for count
163163
// where [keys] in [values]
164164
const left = { list: keys.map(k => ({ ref: [k] })) }
165165
const right = { list: rows.map(r => ({ list: keys.map(k => ({ val: r[k.toUpperCase()] })) })) }
166+
resultQuery.SELECT.limit = undefined
166167
resultQuery.SELECT.where = [left, 'in', right]
167168
}
168169
return this.onSELECT({ query: resultQuery, __proto__: req })

0 commit comments

Comments
 (0)