Repository navigation
fix(check): view-entity OQL checks for CE0174/CE6770, runtime GROUP BY errors and HSQLDB literals (#981) - #984
Merged
Merged
Conversation
formatDecimal(x, '0.00') follows the user's language, so a Dutch user got 12,50 and invalid JSON. Use toString(round(x, 2)), or formatDecimal with a hyphenated locale; explain the silently-ignored underscore tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…json (#982) The run --local hint 'mxcli oql -p …' failed on a non-default --admin-port (cannot connect … localhost:8090), and mxcli log did the same. Both now take the port and password from a live .mxcli/run-local.json for any flag not given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ilt JSON (#982) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…refuses MDL033 comparison as a select column (CE0174), MDL034 aggregate over a grouped column (CE0174), MDL035 plain column not grouped (CE0174), MDL036 non-aggregated expression not in the GROUP BY (passes mxbuild, PostgreSQL 42803 / HSQLDB 42574 at runtime) - errors in ValidateOQLSyntax. MDL037 literal aggregate argument (HSQLDB 42567, warning) and MDL038 bare integer/string literal column (info) in ValidateOQLPortability, which only check and the LSP run. Part of #981. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
String concatenation (r.Name + ' x') is a derived String(200) in mxbuild; string / string(100) declarations are CE6770 and now MDL031. A view attribute declared autonumber over an AutoNumber column (CE6770) is refused under mdl 1 and warns MDL-V1-VIEWAUTONUMBER without the header (ADR-0011); check's reference tier now runs under the script's language version. Part of #981. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
write-oql-queries: a view entity has no ID (count a non-null column), the GROUP BY / comparison / HSQLDB literal table, String(200) concatenation, AutoNumber -> Long. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sum(0.0) and sum(1.5) fail on HSQLDB with 42567 like the integer forms; only a decimal select COLUMN is cast by Mendix (MDL038 still skips it). avg(1) runs on HSQLDB and stays unflagged. Part of #981. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into c26-984 # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #981
View-entity OQL that
checkpassed and mxbuild or the runtime refused. Each rule's failing forms and controls are measured on mxbuild 11.13.0 (the issue's JTSBootLogboek H16/H18 views, plus a new probe set on the same app, below).r.Season = r.CurrentSeason as IsCurrent, also!=)case when … then true else false endcount(r.Season)byr.Season,max(r.RaceDate)bydatepart(YEAR, r.RaceDate),sum(r.Season)byr.Season + 1)sum(1),count(1),max(0),count('x'),count(true),sum(0.0),sum(1.5),max(0.0))avg(1)is not flagged: it runs on HSQLDB (measured), Mendix's avg returning Decimal so its argument reaches the database typedv.One + 1= 11 on HSQLDB, 2 on PostgreSQL (issue measurement); suggestscast(… as Integer/String)autonumberover an AutoNumber columnmdl 1;, warning without the header (ADR-0011,langver.Change)r.Name + ' x'string,string(100),string(102)are CE6770MDL033–036 live in
ValidateOQLSyntax, so exec refuses them too. MDL037/038 are in a newValidateOQLPortabilitythat onlycheckand the LSP call — exec turns everyValidateOQLSyntaxfinding into a refusal, whatever its severity.'TOTAL' as Label(used in the docs) draws only the MDL038 note;make check-mdl/check-skill-mdlstay clean. No doc example aggregated a literal, so none needed the cast form.Fix along the way: check's reference tier (
ValidateProgram[WithWarnings]) ran with language version 0 regardless of the script header; it now enters the program's version, which is what makes the AutoNumber gate work fromcheck -p --references.New measurements (mx check 11.13.0, copy of the issue's app)
r.Namenext togroup by r.Season;r.Namenext togroup by r.ID(no functional-dependency exemption); the same in from-first clause order;r.Season != r.CurrentSeason as X.datepart(YEAR, r.RaceDate) + 1next togroup by datepart(YEAR, r.RaceDate);group by Yr(select alias);'x' as Lnext to a GROUP BY;r.Season, r.Name, count(r.Points)by both;'Season ' + r.Namedeclaredstring(200).Test plan
go test ./mdl/executor/(full package) — pass; new tests inoql_view_select_checks_test.go(one per rule MDL033–038, each with the measured passing forms as controls) andoql_view_column_types_test.go(concatenation, AutoNumber under V1/V0 with Long controls).go test ./cmd/mxcli/ ./mdl/migration/ ./mdl/linter/— pass.make build,make lint,make check-conformance,make check-findings,make check-migration-reference(versions.md regenerated),make sync-skills,make check-mdl,make check-skill-mdl— all pass. (check-mdl first caught a normalisation bug —cast(m.ID as string)read as columnm.idasstring— fixed, with a control test.)mxcli check -p … --referenceson the issue's scratch views (V1cmp, V2aggInGroupExpr, V2bSum, V3count, V3sum1, V4col, V4nonagg, V5autoAN, h13) reports the expected rule; V1case, V3countName, V4alias, V5autoLong, V5cast pass; V5autoAN without the header gives the MDL-V1-VIEWAUTONUMBER warning only.Notes / follow-up
alias.) are not recognised as columns, so they are never flagged.🤖 Generated with Claude Code