Repository navigation
Conversation
…mental-discovery # Conflicts: # pkg/sql/plan/function/func_binary.go # pkg/sql/plan/function/list_builtIn.go # pkg/sql/plan/query_builder.go # test/distributed/cases/function/func_datetime_maketime.result # test/distributed/cases/function/func_datetime_maketime.test
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Blocking security issue: table_changes bypasses the source table's SELECT privilege. The planner resolves the source only to derive the result schema, then emits a Node_FUNCTION_SCAN without a privilege-bearing TABLE_SCAN/source object reference. extractPrivilegeTipsFromPlan therefore sees no table, len(arr) == 0, and authentication allows the statement. The executor opens the relation directly.
I reproduced this on exact head b9b34016c79b with an authenticated embedded cluster:
- Create
secret(id primary key, payload)and insertclassified. - Create a user whose role has only
CONNECT, no SELECT on the database/table. select payload from db.secretis correctly rejected withdo not have privilege.- The same user successfully executes
select payload from table_changes('db', 'secret', after, until)and receivesclassified.
Please make table_changes contribute the same source-table SELECT privilege requirement as a normal scan (including the existing cluster/catalog access rules), and add deny/allow black-box privilege tests. Tenant filtering is not a substitute for authorization within a tenant.
LeftHandCold
left a comment
There was a problem hiding this comment.
Reviewed repository matrixorigin/matrixone, PR #26616 at exact head 0d694dca45b09bff252639b10a2644dcb78bd233 against base/merge-base 94528dcb63d55921b936cda611ea61eb1862ea79.
Requesting changes for one remaining merge blocker:
[P1] Initialize logical seqnums on the real table_changes path before normalizing in-memory rows
The new argument at pkg/vm/engine/disttae/change_handle.go:401 is normally still nil. txnTable.seqnums is populated only by ensureSeqnumsAndTypesExpectRowid, whose production callers are the object-compaction and merge paths (txn.go:2356 and txn_table.go:3311). The normal tableChangesState path does CopyTableDef and then CollectChanges (table_changes.go:162,202), neither of which initializes that cache. The constructor therefore copies nil at logtailreplay/change_handle.go:3008, and fillInInsertBatch takes its legacy fallback at lines 3984-3990, preserving physical rather than logical order.
For CREATE TABLE t(id PK, payload); ALTER TABLE t ADD COLUMN added FIRST, the intended logical seqnums are [2,0,1], but a targeted regression matching the pre-CollectChanges table_changes sequence gets tbl.seqnums == nil. The new helper test passes only because it supplies [2,0,1] directly, so it does not exercise this broken connection. In production the prior failure remains: an in-memory physical batch [id,payload,added] is exposed as if logical and the logical primaryIdx can select payload, preventing same-PK insert/delete cancellation and mislabeling output columns.
Please derive/capture the current logical seqnums from the table definition before building the deferred range handler (or otherwise guarantee synchronized initialization), and add a handler/public-path no-flush regression for ADD FIRST/AFTER and a dropped-column hole, including same-PK insert-delete and spill. The previous update-delete test-construction blocker is fixed; both newly modified focused tests pass locally.
LeftHandCold
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 51b9b1f. The previous P1 is fixed: CollectChanges now initializes the current logical-to-physical seqnum mapping before constructing the range handle, and the visible-state snapshot transition initializes and captures the snapshot relation's own mapping together with its primary indexes. This closes the production handoff that the earlier helper-only test missed. The mapping is copied into the deferred handle, and the existing focused tests cover reordered physical columns and logical-PK net effects. I found no remaining code blocker in this delta. Approving; the remaining CI jobs can complete independently.
…ery' into agent/catalog-incremental-discovery
…ery' into agent/catalog-incremental-discovery
…mental-discovery # Conflicts: # pkg/defines/const.go
…mental-discovery # Conflicts: # pkg/defines/const.go
Merge Queue Status
This pull request spent 30 minutes 33 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26616 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
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
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #26615
What this PR does / why we need it:
Agent/catalog incremental discovery