github-actions[bot] commented on code in PR #63402:
URL: https://github.com/apache/doris/pull/63402#discussion_r3303144953
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcPostgreSQLClient.java:
##########
@@ -63,6 +63,11 @@ public List<JdbcFieldSchema> getJdbcColumnsInfo(String
remoteDbName, String remo
String catalogName = getCatalogName(conn);
rs = getRemoteColumns(databaseMetaData, catalogName, remoteDbName,
remoteTableName);
while (rs.next()) {
+ // getColumns treats schema/table as LIKE patterns; drop rows
pulled in via `_`/`%`.
Review Comment:
This fixes the legacy FE PostgreSQL client, but the same metadata path
exists in the parallel connector implementation and is still vulnerable.
`fe/fe-connector/fe-connector-jdbc/src/main/java/org/apache/doris/connector/jdbc/client/JdbcPostgreSQLConnectorClient.java`
is adapted from this class; its `getJdbcColumnsInfo()` calls
`getRemoteColumns(meta, cat, remoteDbName, remoteTableName)` and then
unconditionally adds every returned `JdbcFieldInfo`. Since PostgreSQL JDBC
treats both schema and table as LIKE patterns, a connector catalog over schema
`cdc_test` can still mix columns from `cdcXtest.<same_table>` or from
`userXinfo_pg_normal1`. Please mirror the exact `TABLE_SCHEM`/`TABLE_NAME`
filtering there as well, and add connector coverage or otherwise justify why
that path cannot be used for PostgreSQL catalogs.
--
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]