You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix#594: preserve omitted scalar fields on create or modify external entity
`execCreateExternalEntity` unconditionally wrote `existingEntity.X = s.X`
for every property in the modify branch. When the MDL statement omitted
`RemoteName`, `s.RemoteName` was the empty string and the pre-existing
value was wiped — the resulting `Rest$ODataRemoteEntitySource` BSON had
`RemoteName: ""`, which Studio Pro's Integration Pane visualiser then
dereferences in `ODataRemoteEntitySource.get_RemoteId()` and NREs with
`ArgumentNullException("EntityTypeName")` (Studio Pro aliases the BSON
`RemoteName` field as the C# property `EntityTypeName`).
Convert the scalar fields on `CreateExternalEntityStmt` to pointers so
the executor can distinguish "omitted by the user" (nil → preserve
existing value on `or modify`) from "explicitly set to zero"
(`Countable: false`). This matches the existing tri-state convention
already used for `AlterProjectSecurityStmt.DemoUsersEnabled *bool`.
Wire the visitor to allocate pointers only when a property is present
in the statement, and update the executor to gate each assignment on
non-nil. Initial create still requires `EntitySet` (no prior value to
preserve) and rejects the statement with a validation error if it's
omitted.
Add a focused mock-backend test that constructs a pre-existing entity
with non-default values for every clobberable field, runs `or modify`
with only `EntitySet` and `AllowCreateChangeLocally` set, and asserts
all other fields retain their pre-existing values. The test fails on
the old executor logic (verified by temporarily reverting the
RemoteName branch — it reports `RemoteEntityName = "", want "Account"`).
Add `mdl-examples/bug-tests/594-or-modify-external-entity-preserve-omitted.mdl`
as the end-to-end regression fixture for Studio Pro validation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments