Skip to content

[Enhancement] sort result by tablename when show tables like 'show data' #11636

@nextdreamblue

Description

@nextdreamblue

Search before asking

  • I had searched in the issues and found no similar issues.

Description

when show tables from xxx,i get table names unsort,for example:
MySQL [abc]> show tables;
+---------------+
| Tables_in_abc |
+---------------+
| ctable_hash |
| atable_hash |
| table_hash |
| btable_hash |
| ztable_hash |
+---------------+
5 rows in set (0.00 sec)

but when show data, i can get table names which be sorted, for example:
MySQL [abc]> show data;

show data

+-------------+-------------+--------------+
| TableName | Size | ReplicaCount |
+-------------+-------------+--------------+
| atable_hash | 0.000 | 96 |
| btable_hash | 0.000 | 96 |
| ctable_hash | 0.000 | 96 |
| table_hash | 790.000 B | 96 |
| ztable_hash | 0.000 | 96 |
| Total | 790.000 B | 480 |
| Quota | 1024.000 TB | 1073741824 |
| Left | 1024.000 TB | 1073741344 |
+-------------+-------------+--------------+

i want to get result sorted by tablename when show tables like show data.

Solution

when show tables, sort result by tablenames.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions