Repository navigation
fix(mongodb): reject SET external table columns - #27271
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed exact head e1c31f5. SET remains distinguishable from ordinary BIGINT UNSIGNED at this boundary through T_uint64 plus nonempty member metadata; rejecting it before ColumnMapping drops Enumvalues prevents the MongoDB converter from silently treating SET as a supported integer. Regressions cover nullable and NOT NULL columns under strict and try_null conversion modes and verify failed DDL produces no plan. No blocking findings.
|
Queued — the merge queue status continues in this comment ↓. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head e1c31f5894151a1fe70b13960c2348965b06953f: APPROVED.
The rejection is placed at the last boundary where SET remains distinguishable from ordinary BIGINT UNSIGNED: both use T_uint64, but only SET carries nonempty member metadata. Rejecting before ColumnMapping flattens the plan type prevents the MongoDB converter from silently accepting SET as an unsigned integer without affecting ordinary unsigned columns.
Coverage exercises nullable and NOT NULL SET columns under strict and try-null conversion modes, asserts that failed CREATE retains no DDL plan, and includes the direct mapping contract. Both focused controlled-CGo regressions pass on this exact head. I found no blocking issue in the complete three-file diff.
Merge Queue Status
This pull request spent 1 hour 11 minutes in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #27271 has been dequeued Queue conditions are not satisfied:
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
aptend
left a comment
There was a problem hiding this comment.
[P1] Reject SET with a single empty member
Location: pkg/sql/mongodb/mapping.go:115.
Enumvalues != "" is not a complete SET discriminator. MatrixOne accepts empty SET members, and SET("") is normalized to []string{""}; strings.Join therefore stores an empty Enumvalues string on the planned T_uint64. This condition is false, so NewConverter receives a bare uint64 mapping and the unsupported SET DDL succeeds.
A planner-level reproducer on this exact head is:
CREATE EXTERNAL TABLE tpch.mongo_set_empty (
v SET("") MONGODB_PATH "device_id"
) ENGINE=MONGODB WITH (
"connection"="source", "database"="telemetry", "collection"="samples",
"schema_mode"="explicit", "conversion_mode"="strict", "max_parallelism"="1"
);A temporary regression using runOneStmt expected MongoDB mapping target type SET, but got nil error and a plan. This leaves a valid SET spelling able to bypass the fix and be silently treated as BIGINT UNSIGNED. Please identify SET from the parsed column type (which still carries the MYSQL_TYPE_SET OID/family) or otherwise preserve an unambiguous discriminator, and add the single-empty-member case to the strict/try-null coverage.
|
@aptend Fresh independent verification on exact head |
|
@aptend Rechecked the current exact head |
|
@aptend 本次按当前 exact head |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 679c4c7.
The new parsed-type discriminator closes the previous SET single-empty-member gap: SET('') is rejected while the AST still carries MYSQL_TYPE_SET, before both SET and ordinary BIGINT UNSIGNED flatten to T_uint64 and before empty Enumvalues loses provenance. The ordinary unsigned control remains accepted, and failed SET DDL retains no plan.
Validation on the exact clean worktree:
- focused ParseTableMappingSpec regression under -race -count=10
- focused planner SET/unsigned regressions under -count=3
- full ./pkg/sql/mongodb package
- git diff --check
No blocking findings.
What type of PR is this?
Which issue(s) this PR fixes:
issue #27259
What this PR does / why we need it:
fix(mongodb): reject SET external table columns