@sap/cds-compiler 5.9.12 → 5.9.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/language/genericAntlrParser.js +2 -2
- package/lib/render/toSql.js +0 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@
|
|
|
7
7
|
Note: `beta` fixes, changes and features are usually not listed in this ChangeLog but [here](doc/CHANGELOG_BETA.md).
|
|
8
8
|
The compiler behavior concerning `beta` features can change at any time without notice.
|
|
9
9
|
|
|
10
|
+
## Verion 5.9.16 - 2026-01-12
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- parser: Fix error with parentheses around sub expressions; they were sometimes closed
|
|
15
|
+
too late, dependending on the operators used inside and after the sub expression.
|
|
16
|
+
|
|
17
|
+
## Verion 5.9.14 - 2025-12-03
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- to.sql|hdi: Don't add superfluous and sometimes wrong (SQLite) parentheses around `UNION`s
|
|
22
|
+
|
|
10
23
|
## Version 5.9.12 - 2025-09-19
|
|
11
24
|
|
|
12
25
|
### Fixed
|
|
@@ -650,8 +650,8 @@ function surroundByParens( expr, open, close, asQuery = false ) {
|
|
|
650
650
|
expr.$parens.push( location );
|
|
651
651
|
else
|
|
652
652
|
expr.$parens = [ location ];
|
|
653
|
-
if (expr
|
|
654
|
-
expr.$opPrecedence = null;
|
|
653
|
+
if (expr.args?.$opPrecedence)
|
|
654
|
+
expr.args.$opPrecedence = null;
|
|
655
655
|
return (asQuery) ? { query: expr, location } : expr;
|
|
656
656
|
}
|
|
657
657
|
|
package/lib/render/toSql.js
CHANGED
|
@@ -1307,11 +1307,7 @@ function toSqlDdl( csn, options, messageFunctions ) {
|
|
|
1307
1307
|
|
|
1308
1308
|
// Set operation may also have an ORDER BY and LIMIT/OFFSET (in contrast to the ones belonging to
|
|
1309
1309
|
// each SELECT)
|
|
1310
|
-
// If the whole SET has an ORDER BY/LIMIT, wrap the part before that in parentheses
|
|
1311
|
-
// (otherwise some SQL implementations (e.g. sqlite) would interpret the ORDER BY/LIMIT as belonging
|
|
1312
|
-
// to the last SET argument, not to the whole SET)
|
|
1313
1310
|
if (query.SET.orderBy || query.SET.limit) {
|
|
1314
|
-
result = `(${result})`;
|
|
1315
1311
|
if (query.SET.orderBy) {
|
|
1316
1312
|
const orderBy = query.SET.orderBy.map(entry => renderOrderByEntry(entry, env.withSubPath([ 'orderBy' ]))).join(', ');
|
|
1317
1313
|
result += `\n${env.indent}ORDER BY ${orderBy}`;
|