Repository navigation
Commit 1a98683
fix(view-entity): catch derived-string CE6770 pre-build, revive OQL type checker
A view entity with a DERIVED string column — cast(x as string), a
string-returning CASE, or a string expression — fails MxBuild CE6770
"View Entity is out of sync with the OQL Query" whenever the declared
attribute length is anything other than 200. The OQL runs fine, so it
looks like an mxcli serialization gap, but it is a Mendix platform rule:
Mendix normalizes a derived string column to the default length
String(200), while a plain pass-through column inherits its source
length. Confirmed on mxbuild 11.6.6: string(30) -> CE6770,
string(200) -> 0 errors.
mxcli now catches this pre-build as MDL031 with an actionable fix
("change to 'X: String(200)'") instead of letting it fall through to a
cryptic build-time CE6770.
Two parts:
- Infer cast(expr AS string) and string-returning CASE as String(200);
normalize any inferred string column to 200 in ValidateOQLTypes;
typesStrictlyCompatible now compares string length (not just kind).
- Revive the OQL type checker, which was dead: inferTypeStatic /
inferTypeFromExpression / inferCaseType uppercased the expression then
compared against LOWERCASE literals ("cast(", "count(", "case",
"true"...), so every prefix check failed and only DATEPART matched.
Sibling of Bug 9b's extractSelectClause case bug. Fixed all prefixes
to uppercase.
False-positive guard: SUM() over an un-inferable inner (a bare attribute
ref -> Unknown) now returns Unknown instead of guessing Decimal, so
sum(s.Units) declared integer no longer false-fires (caught on
34-chart-widget-examples.mdl).
Tests: TestValidateOQLTypesDerivedString (CAST/CASE length rule),
TestValidateOQLTypesNoFalsePositive (still green). Bug-test:
mdl-examples/bug-tests/view-entity-derived-string-length.mdl.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 64bc653 commit 1a98683
5 files changed
Lines changed: 249 additions & 20 deletions
File tree
- .claude/skills
- mendix
- mdl-examples/bug-tests
- mdl/executor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
226 | 244 | | |
227 | 245 | | |
228 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
0 commit comments