fix(oracle): match index_owner in index metadata joins to avoid cross-schema index collisions - #2286
Conversation
…-schema index collisions (code review follow-up)
|
Blocking: the owner predicate fix is incomplete. The |
openai0229
left a comment
There was a problem hiding this comment.
The Oracle index metadata joins now match index owner and column position, preventing cross-schema collisions and Cartesian expansion of expressions for composite function-based indexes. The result-level JDBC proxy test verifies expression ordering by position, and the full Oracle reactor passed locally. Approved.
Problem
OracleMetaDataConstants.SELECT_TABLE_INDEXjoinsALL_IND_COLUMNStoALL_INDEXES(andALL_IND_EXPRESSIONS) on table owner/name and index name, but never matches the index owner. In Oracle an index can be owned by a different schema than its table, and index names are only unique per owner — so when two schemas own same-named indexes on the same table, the join multiplies rows and mixes columns/expressions from the other schema's index into the index metadata.Fix
Add the missing owner predicates to both joins:
aic.index_owner = ai.owneron theALL_INDEXESjoinaic.index_owner = ex.index_owneron theALL_IND_EXPRESSIONSjoinTests
New
OracleMetaDataConstantsTestasserts both joins constrain index owner.mvn teston chat2db-community-oracle: 17/17 pass.Verified on fork HandSonic#15 (meaningful CI checks green; dependency-review/project-sync jobs are fork-permission noise). Regression tests pass; adversarial review cleared.