Skip to content

Conversation

CbcWestwolf
Copy link
Member

@CbcWestwolf CbcWestwolf commented Jun 5, 2025

What problem does this PR solve?

Issue Number: close #61265

Problem Summary:

If a duplicate name index is found with IF NOT EXISTS, tidb report a warning

tidb/pkg/ddl/executor.go

Lines 4715 to 4718 in 0d8e2bb

if ifNotExists {
ctx.AppendNote(err)
return ast.CIStr{}, nil, nil
}

but do not skip the following execution

tidb/pkg/ddl/executor.go

Lines 4915 to 4920 in 0d8e2bb

indexName, hiddenCols, err := checkIndexNameAndColumns(metaBuildCtx, t, indexName, indexPartSpecifications, model.ColumnarIndexTypeNA, ifNotExists)
if err != nil {
return errors.Trace(err)
}
tblInfo := t.Meta()

What changed and how does it work?

If a duplicate name index is found, skip the following execution.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 5, 2025
@CbcWestwolf CbcWestwolf changed the title ddl: fix a bug that Index with empty name can be created unexpectedly ddl: fix a bug that index with empty name can be created unexpectedly Jun 5, 2025
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.9789%. Comparing base (d216b7b) to head (5b2cbd8).
Report is 7 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #61531        +/-   ##
================================================
+ Coverage   73.0963%   74.9789%   +1.8825%     
================================================
  Files          1729       1751        +22     
  Lines        480686     489395      +8709     
================================================
+ Hits         351364     366943     +15579     
+ Misses       107793      99477      -8316     
- Partials      21529      22975      +1446     
Flag Coverage Δ
integration 48.8747% <100.0000%> (?)
unit 72.3764% <100.0000%> (+0.0302%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 62.9013% <ø> (+15.9320%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CbcWestwolf
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 6, 2025
@CbcWestwolf
Copy link
Member Author

/retest

Copy link

ti-chi-bot bot commented Jun 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fzzf678, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 6, 2025
Copy link

ti-chi-bot bot commented Jun 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-06-06 05:52:25.344140947 +0000 UTC m=+593831.546486212: ☑️ agreed by tangenta.
  • 2025-06-06 05:57:07.241235584 +0000 UTC m=+594113.443580847: ☑️ agreed by fzzf678.

@ti-chi-bot ti-chi-bot bot merged commit af43e24 into pingcap:master Jun 6, 2025
25 of 27 checks passed
@CbcWestwolf CbcWestwolf deleted the fix61265 branch June 6, 2025 08:13
@CbcWestwolf
Copy link
Member Author

/cherry-pick release-8.5

@ti-chi-bot
Copy link
Member

@CbcWestwolf: new pull request created to branch release-8.5: #61552.

In response to this:

/cherry-pick release-8.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index with empty name is created unexpectedly
4 participants