Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apache/incubator-seata#6678 #718

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jay-li-csck
Copy link

What this PR does:
Convert table names to uppercase in cache, preventing different tables from being found
Which issue(s) this PR fixes:

Fixes #711

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@@ -92,8 +93,9 @@ func (c *BaseTableMetaCache) refresh(ctx context.Context) {

for i := range v {
tm := v[i]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题不大,补一个单测

Copy link
Contributor

@Code-Fight Code-Fight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只改一处,可能会到缓存失效,改一下GetTableMeta 确保一致

@@ -92,8 +93,9 @@ func (c *BaseTableMetaCache) refresh(ctx context.Context) {

for i := range v {
tm := v[i]
if _, ok := c.cache[tm.TableName]; !ok {
c.cache[tm.TableName] = &entry{
var upperTableName = strings.ToUpper(tm.TableName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个ToUpper仅在refresh的加不行,需要在GetTableMeta的时,保证都是一致的

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
26.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[seata-java] 表名大小写问题导致的相同记录生成不同RowKey的问题
3 participants