Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-19", "refs": ["ako/mxcli#1258"], "ce": ["CE0282"], "symptom": "An import mapping's custom object handler `find … by M.MF ( P: member )` that fed a JSON member to a microflow parameter of an incompatible type (a String member into an Integer parameter) passed `check` and `exec` and was written; `mx check` reported CE0282 \"The microflow parameter 'P' is of type 'Integer'. It does not match the specified type 'String'\".", "file": "mdl/executor/validate_mapping_handler_types.go ValidateMappingHandlerTypes (MDL107), called from validate_program.go with the lazy project opener. Tests: validate_mapping_handler_types_test.go; fixtures mdl-examples/bug-tests/mapping-handler-param-type-mismatch.fail.mdl and the clean control mapping-handler-types.mdl", "cause": "buildCustomHandler binds each parameter to its member and never compares the member's JSON type with the parameter's declared type.", "insight": "**The compatibility matrix is small enough to measure whole, which made a name-based lookup safe where a path-following one was not.** 25 pairings of {String, Integer, Long, Decimal, Boolean, DateTime} x {string, integer, decimal, boolean, date-time} members, one project each on MxBuild 11.16.1: a String parameter takes everything, Decimal also takes Integer, Long takes Integer, the rest only their own type. The rule finds the member by its NAME in the whole structure and judges only when every occurrence is one known value type, so it never has to follow the handler's element path through arrays and two-level items (the duplication that made a CE0281 mirror a drift risk); a name that is absent or typed differently in two places is left to the build. The cost is silence on that ambiguous case, which is the right direction to be wrong in."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/catalog", "date": "2026-11-19", "symptom": "On a run where lint BUILDS the catalog, one iterator failed while others succeeded on the same handle: `lint could not read the catalog for AttributesFor: SQL logic error: no such table: attributes` with ctx.Entities() returning rows in the same run, and the next identical run (cached catalog) correct. Reproduced on testdata/testapp-views and not on testdata/pedapp. Also: a fresh catalog's snapshot ObjectCount was counted as 0.", "cause": "catalog.New() opened `sql.Open(\"sqlite\", \":memory:\")`. Every CONNECTION to \":memory:\" is its own separate, empty database, and sql.Open returns a POOL — so createTables' schema landed on one connection and whatever query the pool later served on another saw nothing. Which iterator broke was pool timing, hence the per-project difference. Fixed with a uniquely named shared-cache DSN (`file:mxcli-catalog-<pid>-<n>?mode=memory&cache=shared&_pragma=foreign_keys(1)`) plus one pinned connection so the shared cache is not freed. Two rejected fixes mattered: db.SetMaxOpenConns(1) gives one database but DEADLOCKS, because the readers nest (ctx.Entities() yields from an open cursor while the body calls ctx.AttributesFor()) and because Builder.updateSnapshotCount queried the POOL while the build transaction held a connection; shared cache alone still hung on that same builder read until it was routed through b.txQuery.", "file": "`mdl/catalog/catalogdb_sqlite.go` (NewSqliteCatalogDB, Close, NewSqliteCatalogDBFromFile); `mdl/catalog/builder.go` (updateSnapshotCount); tests `mdl/catalog/catalogdb_memory_pool_2417_test.go`", "insight": "\":memory:\" plus database/sql is never one database — it is one per connection, so any pooled access is a coin flip, and the failure presents as a MISSING TABLE on a schema that provably exists (sqlite_master listed all 88 views in the failing run). That signature — one table unreadable while its neighbours read fine, same handle, same run — means separate databases, not a broken view; stop comparing view DDL and look at the DSN. The per-project reproduction (one project yes, one no) is the tell that it is pool timing rather than data. Pinning the pool is the obvious fix and is wrong here: a goroutine dump taken with kill -QUIT named the exact blocker (Builder.updateSnapshotCount -> QueryRow -> database/sql.(*DB).conn), and it only showed up because the hang was investigated instead of the pin reverted. Reading a count on the pool while the build transaction is open was also returning 0, because a pool query cannot see the transaction's uncommitted rows: the deadlock and the wrong count were one bug. Finally, a claim about CI behaviour needs the exit code, not the printed text: lint already prints \"Results are INCOMPLETE\" and exits 1 on any recorded query error (cmd_lint.go), so the \"CI sees a pass\" worry in the issue was unfounded."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area":"sql","date":"2026-11-19","symptom":"`SQL <alias> GENERATE CONNECTOR INTO <Module>` silently omitted every object whose own NAME contains a dot. On a DuckGraphLake lake the raw topic tables are named after the Kafka topic (`main.\"local__cdc.CdcPublish.Customer.1.local\"`), so 4 of the 9 listed objects were missing from the output, with no warning and no error -- the only warnings printed were about unmappable columns (ako/mxcli#2422).","cause":"the address was flattened to one string by qualifiedTableName and split again by splitTableName, which took the last two dot-separated parts: schema `1`, name `local`. DescribeTable then found nothing and readListed's `continue` discarded the error. Two more faults sat behind that one, each of which would have turned the silent drop into silently invalid output: TableSchema.QualifiedName joined the parts unquoted, so the emitted SQL would have been `FROM main.local__cdc.CdcPublish.Customer.1.local` (`syntax error at or near \".1.\"`), and toPascalCase treated only `_ - space` as separators, so TableToEntityName gave `LocalCdc.cdcpublish.customer.1.local` -- dots and all -- which is not a Mendix entity name.","file":"sql/meta.go (splitQualifiedIdent, quoteIdent/needsQuoting, splitTableName); sql/schema.go (QualifiedName, qualifiedTableName, readListed returns what it skipped); sql/naming.go (toPascalCase: `.` is a separator, in both the early return and the loop); sql/generate.go (GenerateResult.SkippedObjects); mdl/executor/cmd_sql.go (reports them); test sql/generate_dotted_names_2422_test.go","insight":"Fixing the addressing ALONE would have been worse than the bug: the object would have been generated with an entity name containing dots and a FROM clause that is a syntax error, where before it was merely absent. Check what the name becomes, not just whether the object is found -- `TableToEntityName` had a second, easily missed trap, an early return for names without `_` or `-` that only capitalises the first letter, so `my.table` became `My.table` and never reached the separator loop. Quote only what needs it (anything outside [A-Za-z0-9_], or a leading digit): quoting every identifier would change every query the tool has ever generated, and a bare reserved word needs no quoting once it is schema-qualified, which ako/mxcli#2414 measured. Three one-line probes settle the whole diagnosis on any such database: `select count(*) from information_schema.columns where table_schema='main' and table_name='<dotted>'` (7 -- the metadata side is fine), the same select quoted (5 rows), and unquoted (syntax error). Four controls, each failing a different test: split on every dot -> SplitTableName_QuotedNameKeepsItsDots; quoteIdent never quotes -> QualifiedName_QuotesANameThatNeedsIt; `.` not a separator -> TableToEntityName_DotsAreWordSeparators; skipped list dropped -> UnreadableObjectIsReported. Live result: 5 of 9 objects generated before, 9 of 9 after, all 9 queries running.","refs":["ako/mxcli#2422","ako/mxcli#2414","ako/mxcli#2415"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area":"sql","date":"2026-11-19","symptom":"`SQL <alias> GENERATE CONNECTOR INTO <Module> VIEWS (customer)` generated every table as well and then the named view on top, so one connector held two entities and two queries called LakeSql.Customer / GetAllCustomers -- not a model Mendix can load. Measured on a DuckGraphLake lake (all objects are views): `views (customer)` gave 6 queries with one duplicate, `views (customer, order)` 7 with two, `tables (customer) views (customer)` 2 with one. `tables (customer)` alone was correct, which is what made it look like a views-only quirk (ako/mxcli#2415).","cause":"two things compounded in sql/generate.go: `cfg.Tables == nil` meant \"every table\" with nothing suppressing it when Views was set (there was no views-only mode), and the table reader ignored information_schema's table_type -- the third column ShowTables already returns -- so a view was in the tables set before the view pass added it again. A third made the dedupe impossible: ReadTableSchema recorded no schema for a name the user wrote bare, so `TABLES (customer)` and `VIEWS (cdcpublish.customer)` had different addresses and could not be recognised as one object. That last one is also why the ako/mxcli#2414 fix did not reach the explicit clauses: it qualified the discovery path only.","file":"sql/generate.go (clause scoping, dedupeByAddress); sql/schema.go (discoveredObjects, readListed, ReadAllSchemas, ReadAllTableSchemas now excludes views, ReadTableSchema resolves a bare name); sql/meta.go (schemasHolding, factored out of refuseAmbiguousTable); test sql/generate_clause_scope_2415_test.go","insight":"Do not filter views out of the table reader without giving the no-clause path somewhere else to get them: on a CDC lake every object is a view, so filtering alone turns `generate connector` into `no tables or views found`. Enumerating views from the driver's view listing is the wrong somewhere -- pg_views on the lake returns 23 rows, 14 of them internal temp views (sqlite_master, pragma_database_list), where information_schema.tables returns the 9 real ones. So read the one listing and partition it on table_type. Resolving a bare name needs no new query shape: refuseAmbiguousTable already asked which schemas hold a name, for all three drivers, and discards the answer when there is exactly one -- that answer is the schema the generated query needs. Four controls, each failing a different test: clause scoping reverted -> ViewsClauseDoesNotPullInEveryTable; dedupe removed -> ObjectInBothClausesEmittedOnce; table_type ignored -> NoClauseGeneratesEverythingOnce + both reader tests; bare-name resolution removed -> BareClauseNameIsQualified + ObjectInBothClausesEmittedOnce. Adjacent and NOT fixed here: splitTableName takes the last two dot-separated parts, so an object whose own name contains dots (`main.\"local__cdc.App.Entity.1.local\"`, which is what a Kafka topic table is called) resolves to schema `1`, name `local`, fails describe, and is dropped by the reader's `continue` with no warning -- four of the lake's nine objects vanish from the no-clause output, before and after this fix.","refs":["ako/mxcli#2415","ako/mxcli#2414"]}
Loading
Loading