diff --git a/hana/lib/HANAService.js b/hana/lib/HANAService.js index 2bb743cb6..cb10f7986 100644 --- a/hana/lib/HANAService.js +++ b/hana/lib/HANAService.js @@ -154,8 +154,8 @@ class HANAService extends SQLService { // REVISIT: add prepare options when param:true is used let sqlScript = isLockQuery || isSimple ? sql : this.wrapTemporary(temporary, withclause, blobs) - const { hints } = query.SELECT - if (hints) sqlScript += ` WITH HINT (${hints.join(',')})` + const { hints = HANAVERSION <= 2 || this.options.limit_hint !== true ? null : ['prelimit_rule_with_sql_parameters'] } = query.SELECT + if (hints?.length) sqlScript += ` WITH HINT (${hints.join(',')})` let rows if (values?.length || blobs.length > 0 || isStream) { const ps = await this.prepare(sqlScript, blobs.length) @@ -931,11 +931,6 @@ SELECT ${mixing} FROM JSON_TABLE(SRC.JSON, '$' COLUMNS(${extraction}) ERROR ON E }) } - limit({ rows, offset }) { - rows = { param: false, __proto__: rows } - return super.limit({ rows, offset }) - } - where(xpr) { xpr = { xpr, top: true } const suffix = this.is_comparator(xpr)