Provide a way to export the (non-cached) SEQUENCE state via SQL for backup and restore #20165
Labels
feature/accepted
This feature request is accepted by product managers
type/feature-request
Categorizes issue or PR as related to a new feature.
Feature Request
Is your feature request related to a problem? Please describe:
In TiDB a sequence's (non-cached) state is determined by the sequence value (
SID
) and cycle count (SequenceCycle
). While the SID can be retrieved using theSHOW TABLE NEXT_ROW_ID
query:the SequenceCycle can only be retrieved via internal API (the
meta
package), which is not possible via the SQL protocol.See pingcap/br#242 (comment) for why the cycle count is important.
Describe the feature you'd like:
Provide a way to expose the cycle count. (Please make a decision.) Either simply extend
SHOW TABLE NEXT_ROW_ID
:or copy MariaDB's behavior to support SELECT-ing a sequence:
(Treating SEQUENCE as TABLE is MariaDB-specific behavior and does not work on PostgreSQL nor MS SQL Server.)
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
The text was updated successfully, but these errors were encountered: