Repository navigation
Infer each Form field independently - #132172
Conversation
readRowAndGetNamesAndDataTypesForFormRow declared its value buffers outside the field loop, and readStringUntilAmpersand appends to its argument, so every field carried the previous fields into it and its inferred type depended on the fields before it.
|
Workflow [PR], commit [7fc8ab9] Summary: ✅
AI ReviewSummaryReviewed #132172 at Findings💡 Nits
Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Fields that are now correctly inferred as numbers trigger the Vertical large-number tip, which the reference did not yet reflect. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 10 s compile time in total, 7 of them have a recent master baseline. |
…ort_nested_json` The test relied on `Form` schema inference appending each field to the previous ones, which made `x=1.5` inferred as a string. #132172 fixed that on master, so `1.5` is now inferred as a number and is a value-level error, not a structure mismatch. Use `x=abc`, which is inferred as a string, to keep testing the intent. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes: #132102
Why
readRowAndGetNamesAndDataTypesForFormRowdeclared itsvalueanddecoded_valuebuffers outside the field loop, andreadStringUntilAmpersandappends to its argument rather than assigning to it. So every field carried all the previous fields' text into it, and a field's inferred type depended on the fields before it: informat(Form, 'n=1&a=x&m=2'),nwas inferred asUInt8butmasString, because by then the buffer held1a=x2.What changed
FormRowInputFormat.cpp: the two buffers are declared inside the loop, so each field is decoded and inferred from its own text only.Scope
Formformat. Nothing is used after the loop, so the narrower scope changes no other behaviour.+handling is unchanged:Poco::URI::decodeonly maps+to a space after a?, so a body field keeps a literal+.Verification
05580_form_schema_inference_independent_fields.sqlfails on master (26.11.1.2276) on three of its seven lines: the fields after the first came back quoted, i.e. inferred asString, instead of as their own type.02984_form_formatis updated in two places, because removing the contamination letscol3=%5B1%2C%202%2C%203%5Dinfer asArray(Nullable(Int64))— the type master already infers for that field on its own — and so renders as[1,2,3]. Every other field in that test's large body was checked one by one and renders identically before and after.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes schema inference for the
Formformat, where the type inferred for a field depended on the fields before it. For example, informat(Form, 'n=1&a=x&m=2')the fieldmwas inferred asStringinstead of a number.Workflow [PR]
Sync PR [sync-upstream/pr/132172]
Version info
26.11.1.2687-master(included in26.11and later)