@rex0220/kintone-sql-tools 3.84.0 → 3.85.0

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/dist-cli/ksql.js CHANGED
@@ -23465,6 +23465,11 @@ function walkDependency(node, context) {
23465
23465
  if (context.clause !== "SELECT" && ref.tableAlias === null) {
23466
23466
  const alias = resolveProjectedName(ref.field, context.aliases.keys());
23467
23467
  const targets = alias === void 0 ? [] : context.aliases.get(alias) ?? [];
23468
+ if (context.clause === "HAVING" && alias !== void 0 && targets.some((target) => target.type === "WINDOW_COL")) {
23469
+ throw new Error(
23470
+ `ArgumentError: HAVING \u304B\u3089\u306F\u540C\u3058 SELECT \u306E\u30A6\u30A3\u30F3\u30C9\u30A6\u95A2\u6570\u306E\u7D50\u679C\uFF08\u5225\u540D ${alias}\uFF09\u3092\u53C2\u7167\u3067\u304D\u307E\u305B\u3093\u3002HAVING \u306F\u30A6\u30A3\u30F3\u30C9\u30A6\u3088\u308A\u5148\u306B\u8A55\u4FA1\u3055\u308C\u307E\u3059\u3002WITH \u3067\u6BB5\u3092\u5206\u3051\u3001\u6B21\u306E\u6BB5\u306E WHERE \u3067\u7D5E\u3063\u3066\u304F\u3060\u3055\u3044 (reason=HAVING_WINDOW_ALIAS)`
23471
+ );
23472
+ }
23468
23473
  if (targets.length === 1 && alias !== void 0 && !context.resolvingAliases.has(alias)) {
23469
23474
  const resolvingAliases = new Set(context.resolvingAliases);
23470
23475
  resolvingAliases.add(alias);