github-actions[bot] commented on code in PR #63402:
URL: https://github.com/apache/doris/pull/63402#discussion_r3302048315


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcPostgreSQLClient.java:
##########
@@ -63,6 +63,10 @@ public List<JdbcFieldSchema> getJdbcColumnsInfo(String 
remoteDbName, String remo
             String catalogName = getCatalogName(conn);
             rs = getRemoteColumns(databaseMetaData, catalogName, remoteDbName, 
remoteTableName);
             while (rs.next()) {
+                // getColumns treats the table name as a LIKE pattern; drop 
rows pulled in via `_`/`%`.
+                if (!remoteTableName.equals(rs.getString("TABLE_NAME"))) {

Review Comment:
   This still allows the same class of leak when the schema name contains JDBC 
LIKE wildcards. `getColumns(catalog, schemaPattern, tableNamePattern, ...)` 
treats both `schemaPattern` and `tableNamePattern` as patterns; this PR filters 
`TABLE_NAME`, but if the configured Postgres schema is `cdc_test` and another 
schema such as `cdcXtest` contains a table with the same name, those rows pass 
this check and their columns are mixed into `tableSchema`. Please also filter 
`TABLE_SCHEM` (or otherwise constrain the schema exactly) and add a regression 
with a decoy schema to cover it.



-- 
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