You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "GoodBoyCoder (via GitHub)" <gi...@apache.org> on 2024/08/15 14:34:41 UTC

[PR] Bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

GoodBoyCoder opened a new pull request, #6759:
URL: https://github.com/apache/incubator-seata/pull/6759

   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [ ] I have registered the PR [changes](../changes).
   
   ### Ⅰ. Describe what this PR did
   Fixed the error that may cause failure to refresh table metadata cache across databases under the same resourceId due to lack of original table name information
   
   ### Ⅱ. Does this pull request fix one issue?
   <!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
   fixes #6685 
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)? 
   
   
   ### Ⅳ. Describe how to verify it
   
   
   ### Ⅴ. Special notes for reviews
   
   


-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "GoodBoyCoder (via GitHub)" <gi...@apache.org>.
GoodBoyCoder commented on code in PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#discussion_r1739742179


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/MysqlTableMetaCache.java:
##########
@@ -48,9 +48,9 @@ public class MysqlTableMetaCache extends AbstractTableMetaCache {
     protected String getCacheKey(Connection connection, String tableName, String resourceId) {
         StringBuilder cacheKey = new StringBuilder(resourceId);
         cacheKey.append(".");
-        //remove single quote and separate it to catalogName and tableName
-        String[] tableNameWithCatalog = tableName.replace("`", "").split("\\.");
-        String defaultTableName = tableNameWithCatalog.length > 1 ? tableNameWithCatalog[1] : tableNameWithCatalog[0];
+        //original: remove single quote and separate it to catalogName and tableName
+        //now: Use the original table name to avoid cache errors of tables with the same name across databases
+        String defaultTableName = tableName.replace("`", "");

Review Comment:
   Done



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#discussion_r1720993876


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/PostgresqlTableMetaCache.java:
##########
@@ -185,8 +184,9 @@ private TableMeta resultSetMetaToSchema(Connection connection, String tableName)
             }
 
             while (rsTable.next()) {
-                String rsTableName = rsTable.getString("TABLE_NAME");
+                String rsTableCat = rsTable.getString("TABLE_CAT");

Review Comment:
   为什么读取TABLE_CAT
   Why read TABLE_CAT



##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/SqlServerTableMetaCache.java:
##########
@@ -189,8 +186,9 @@ private TableMeta resultSetMetaToSchema(Connection connection, String tableName)
             }
 
             while (rsTable.next()) {
-                String rsTableName = rsTable.getString("TABLE_NAME");
+                String rsTableCat = rsTable.getString("TABLE_CAT");

Review Comment:
   Why read TABLE_CAT



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#issuecomment-2292268280

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `74.19355%` with `8 lines` in your changes missing coverage. Please review.
   > Project coverage is 50.54%. Comparing base [(`fb88638`)](https://app.codecov.io/gh/apache/incubator-seata/commit/fb886383988b4f877cd9597b81c9aba7b11b3889?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`283801a`)](https://app.codecov.io/gh/apache/incubator-seata/commit/283801aafbc21c5dee3cdc703f5a4862dea4b1c1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...urce/sql/struct/cache/SqlServerTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FSqlServerTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL1NxbFNlcnZlclRhYmxlTWV0YUNhY2hlLmphdmE=) | 57.14% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...a/org/apache/seata/sqlparser/struct/TableMeta.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=sqlparser%2Fseata-sqlparser-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fsqlparser%2Fstruct%2FTableMeta.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3FscGFyc2VyL3NlYXRhLXNxbHBhcnNlci1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zcWxwYXJzZXIvc3RydWN0L1RhYmxlTWV0YS5qYXZh) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ource/sql/struct/cache/AbstractTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FAbstractTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL0Fic3RyYWN0VGFibGVNZXRhQ2FjaGUuamF2YQ==) | 75.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ource/sql/struct/cache/PolarDBXTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FPolarDBXTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL1BvbGFyREJYVGFibGVNZXRhQ2FjaGUuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/6759/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##                2.x    #6759      +/-   ##
   ============================================
   + Coverage     50.52%   50.54%   +0.02%     
   - Complexity     5927     5929       +2     
   ============================================
     Files          1061     1061              
     Lines         37088    37094       +6     
     Branches       4400     4398       -2     
   ============================================
   + Hits          18738    18749      +11     
   + Misses        16453    16451       -2     
   + Partials       1897     1894       -3     
   ```
   
   | [Files](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [.../datasource/sql/struct/cache/DmTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FDmTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL0RtVGFibGVNZXRhQ2FjaGUuamF2YQ==) | `83.33% <100.00%> (+0.18%)` | :arrow_up: |
   | [...source/sql/struct/cache/MariadbTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FMariadbTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL01hcmlhZGJUYWJsZU1ldGFDYWNoZS5qYXZh) | `77.77% <100.00%> (ø)` | |
   | [...tasource/sql/struct/cache/MysqlTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FMysqlTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL015c3FsVGFibGVNZXRhQ2FjaGUuamF2YQ==) | `86.95% <100.00%> (+2.17%)` | :arrow_up: |
   | [...asource/sql/struct/cache/OracleTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FOracleTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL09yYWNsZVRhYmxlTWV0YUNhY2hlLmphdmE=) | `67.30% <100.00%> (ø)` | |
   | [...rce/sql/struct/cache/PostgresqlTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FPostgresqlTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL1Bvc3RncmVzcWxUYWJsZU1ldGFDYWNoZS5qYXZh) | `78.78% <100.00%> (+4.04%)` | :arrow_up: |
   | [...ource/sql/struct/cache/AbstractTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FAbstractTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL0Fic3RyYWN0VGFibGVNZXRhQ2FjaGUuamF2YQ==) | `83.33% <75.00%> (-1.97%)` | :arrow_down: |
   | [...ource/sql/struct/cache/PolarDBXTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FPolarDBXTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL1BvbGFyREJYVGFibGVNZXRhQ2FjaGUuamF2YQ==) | `11.11% <0.00%> (ø)` | |
   | [...urce/sql/struct/cache/SqlServerTableMetaCache.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2Fcache%2FSqlServerTableMetaCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L2NhY2hlL1NxbFNlcnZlclRhYmxlTWV0YUNhY2hlLmphdmE=) | `78.89% <57.14%> (ø)` | |
   | [...a/org/apache/seata/sqlparser/struct/TableMeta.java](https://app.codecov.io/gh/apache/incubator-seata/pull/6759?src=pr&el=tree&filepath=sqlparser%2Fseata-sqlparser-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fsqlparser%2Fstruct%2FTableMeta.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3FscGFyc2VyL3NlYXRhLXNxbHBhcnNlci1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zcWxwYXJzZXIvc3RydWN0L1RhYmxlTWV0YS5qYXZh) | `69.86% <0.00%> (-3.00%)` | :arrow_down: |
   
   ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/6759/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>


-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "jsbxyyx (via GitHub)" <gi...@apache.org>.
jsbxyyx commented on code in PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#discussion_r1737619514


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/OracleTableMetaCache.java:
##########
@@ -98,6 +99,7 @@ protected TableMeta resultSetMetaToSchema(DatabaseMetaData dbmd, String tableNam
 
         try (ResultSet rsColumns = dbmd.getColumns("", schemaName, tableName, "%");
              ResultSet rsIndex = dbmd.getIndexInfo(null, schemaName, tableName, false, true);
+             ResultSet rsTable = dbmd.getTables("", schemaName, tableName, new String[]{"TABLE"});

Review Comment:
   这行代码是不是没用
   
   Is this line of code useless?



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "GoodBoyCoder (via GitHub)" <gi...@apache.org>.
GoodBoyCoder commented on code in PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#discussion_r1739742396


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/OracleTableMetaCache.java:
##########
@@ -98,6 +99,7 @@ protected TableMeta resultSetMetaToSchema(DatabaseMetaData dbmd, String tableNam
 
         try (ResultSet rsColumns = dbmd.getColumns("", schemaName, tableName, "%");
              ResultSet rsIndex = dbmd.getIndexInfo(null, schemaName, tableName, false, true);
+             ResultSet rsTable = dbmd.getTables("", schemaName, tableName, new String[]{"TABLE"});

Review Comment:
   Done



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "GoodBoyCoder (via GitHub)" <gi...@apache.org>.
GoodBoyCoder commented on code in PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#discussion_r1721997689


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/SqlServerTableMetaCache.java:
##########
@@ -189,8 +186,9 @@ private TableMeta resultSetMetaToSchema(Connection connection, String tableName)
             }
 
             while (rsTable.next()) {
-                String rsTableName = rsTable.getString("TABLE_NAME");
+                String rsTableCat = rsTable.getString("TABLE_CAT");

Review Comment:
   这是废弃方案漏删除的,原本打算存储表名的所有信息,但是后面发现不是很满足要求并且还有点冗余
   
   This is what was omitted in the abandoned solution. I originally planned to store all the information of the table name, but later found that it did not meet the requirements and was a bit redundant.



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "jsbxyyx (via GitHub)" <gi...@apache.org>.
jsbxyyx commented on code in PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759#discussion_r1737618937


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/MysqlTableMetaCache.java:
##########
@@ -48,9 +48,9 @@ public class MysqlTableMetaCache extends AbstractTableMetaCache {
     protected String getCacheKey(Connection connection, String tableName, String resourceId) {
         StringBuilder cacheKey = new StringBuilder(resourceId);
         cacheKey.append(".");
-        //remove single quote and separate it to catalogName and tableName
-        String[] tableNameWithCatalog = tableName.replace("`", "").split("\\.");
-        String defaultTableName = tableNameWithCatalog.length > 1 ? tableNameWithCatalog[1] : tableNameWithCatalog[0];
+        //original: remove single quote and separate it to catalogName and tableName
+        //now: Use the original table name to avoid cache errors of tables with the same name across databases
+        String defaultTableName = tableName.replace("`", "");

Review Comment:
   mysql有多种转义符号,参考ColumnUtils
   
   Mysql has a variety of escape symbols, refer to ColumnUtils



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] bugfix: fix the error of active refresh failure of cross-database table metadata [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #6759:
URL: https://github.com/apache/incubator-seata/pull/6759


-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org