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

show table t next_row_id shows row id on auto_random table #18254

Closed
cyliu0 opened this issue Jun 29, 2020 · 2 comments · Fixed by #18326
Closed

show table t next_row_id shows row id on auto_random table #18254

cyliu0 opened this issue Jun 29, 2020 · 2 comments · Fixed by #18326
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@cyliu0
Copy link
Contributor

cyliu0 commented Jun 29, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t;
create table t (a bigint primary key auto_random, b varchar(100), c varchar(100));
show table t next_row_id;

2. What did you expect to see? (Required)

+---------+------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE        |
+---------+------------+-------------+--------------------+----------------+
| test    | t          | a           | 1                  | AUTO_RANDOM    |
+---------+------------+-------------+--------------------+----------------+

3. What did you see instead (Required)

+---------+------------+-------------+--------------------+----------------+
| DB_NAME | TABLE_NAME | COLUMN_NAME | NEXT_GLOBAL_ROW_ID | ID_TYPE        |
+---------+------------+-------------+--------------------+----------------+
| test    | t          | _tidb_rowid | 1                  | AUTO_INCREMENT |
| test    | t          | a           | 1                  | AUTO_RANDOM    |
+---------+------------+-------------+--------------------+----------------+

4. Affected version (Required)

mysql root@127.0.0.1:test> select tidb_version()
+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-691-ge0be394f0                     |
| Edition: Community                                                |
| Git Commit Hash: e0be394f0bfba8c0a1006998948d3c4c9a4ae392         |
| Git Branch: master                                                |
| UTC Build Time: 2020-06-29 02:58:38                               |
| GoVersion: go1.14.2                                               |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+
1 row in set
Time: 0.012s

5. Root Cause Analysis

@cyliu0 cyliu0 added the type/bug The issue is confirmed as a bug. label Jun 29, 2020
@cyliu0
Copy link
Contributor Author

cyliu0 commented Jun 29, 2020

@tangenta Check this out

@tangenta tangenta added the sig/sql-infra SIG: SQL Infra label Jun 29, 2020
@zimulala zimulala added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jun 30, 2020
@tangenta tangenta changed the title show table t next_row_id shows dropped table show table t next_row_id shows row id on auto_random table Jul 2, 2020
@tangenta tangenta self-assigned this Jul 9, 2020
@tangenta
Copy link
Contributor

The fixing PR #18326 is not cherry-picked to release-4.0 because of the compatibility issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants