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

autoid: only initialize rowid allocator if necessary #18326

Merged
merged 4 commits into from
Jul 13, 2020

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Jul 2, 2020

What problem does this PR solve?

Issue Number: close #18254

Problem Summary:

What is changed and how it works?

What's Changed:

  • check the table if it has row id or auto_increment id.
  • rename the const "XXAllocatorType" to "AllocatorTypeXX" for friendly typing suggestions.
  • modify a show next row id test.

How it Works:

When there is no row id or auto_increment attribute, RowIDAllocType is not needed.

Related changes

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Breaking backward compatibility

Release note

  • No release note

@tangenta tangenta requested a review from a team as a code owner July 2, 2020 05:42
@tangenta tangenta requested review from qw4990 and removed request for a team July 2, 2020 05:42
@tangenta tangenta force-pushed the autorand-rm-rowid-alloc branch 2 times, most recently from a02e609 to b4ebb48 Compare July 2, 2020 05:47
@codecov
Copy link

codecov bot commented Jul 2, 2020

Codecov Report

Merging #18326 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #18326   +/-   ##
===========================================
  Coverage   79.5075%   79.5075%           
===========================================
  Files           540        540           
  Lines        145029     145029           
===========================================
  Hits         115309     115309           
  Misses        20454      20454           
  Partials       9266       9266           

@AilinKid
Copy link
Contributor

AilinKid commented Jul 2, 2020

/run-check_dev

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 2, 2020
@ti-srebot
Copy link
Contributor

@AilinKid,Thanks for you review.

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 2, 2020
Copy link
Contributor

@ti-srebot ti-srebot left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot
Copy link
Contributor

@zimulala,Thanks for your review.

@tangenta
Copy link
Contributor Author

tangenta commented Jul 2, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 2, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@tangenta merge failed.

@qw4990 qw4990 removed their request for review July 10, 2020 08:10
@tangenta
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@tangenta merge failed.

@tangenta
Copy link
Contributor Author

/run-unit-test

FAIL: db_test.go:3188: testDBSuite1.TestCharacterSetInColumns

db_test.go:3195:
     tk.MustQuery("select count(*) from information_schema.columns where table_schema = 'varchar_test' and character_set_name = 'utf8mb4'").Check(testkit.Rows("2"))
/home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:62:
    res.c.Assert(resBuff.String(), check.Equals, needBuff.String(), res.comment)
... obtained string = "[4]\n"
... expected string = "[2]\n"
... sql:select count(*) from information_schema.columns where table_schema = 'varchar_test' and character_set_name = 'utf8mb4',

@tangenta
Copy link
Contributor Author

/run-all-tests

@tangenta tangenta merged commit 8b856cc into pingcap:master Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show table t next_row_id shows row id on auto_random table
4 participants