JNSimba opened a new pull request, #64740:
URL: https://github.com/apache/doris/pull/64740

   ## Proposed changes
   
   `JdbcClient` / `JdbcMySQLClient.getPrimaryKeys` returned primary-key columns 
in whatever order the JDBC driver yielded them. 
`DatabaseMetaData.getPrimaryKeys` orders its rows by `COLUMN_NAME`, not 
`KEY_SEQ`, so for a composite primary key whose definition order differs from 
alphabetical order (e.g. `PRIMARY KEY (tenant_id, order_id)`), the columns came 
back reordered. This affected the resulting Doris key columns and the bucket 
hash distribution.
   
   This reorders the columns by their 1-based `KEY_SEQ`. Single-column keys are 
unaffected; PostgreSQL is unaffected (its driver already returns KEY_SEQ 
order); only MySQL (whose driver sorts by column name) is corrected.
   
   ## Tests
   
   Updated the composite-PK regression to assert the real definition order; 
`fe-core` compiles.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to