pingcap / pingcap/tidb

Can't alter the COMMENT on a SEQUENCE

Open
#51,433 0 comments 0 reactions 0 assignees View on GitHub
component/ddl type/feature-request
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Feature Request

Would be great to be able to change the comment on a sequence.

```
sql> CREATE SEQUENCE s1 COMMENT "seq 1";
Query OK, 0 rows affected (0.0261 sec)

sql> CREATE SEQUENCE s2;
Query OK, 0 rows affected (0.0125 sec)

sql> ALTER SEQUENCE s2 COMMENT "seq 2";
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 25 near "COMMENT "seq 2""

sql> TABLE INFORMATION_SCHEMA.SEQUENCES;
+---------------+-----------------+---------------+-------+-------------+-------+-----------+---------------------+-----------+-------+---------+
| TABLE_CATALOG | SEQUENCE_SCHEMA | SEQUENCE_NAME | CACHE | CACHE_VALUE | CYCLE | INCREMENT | MAX_VALUE | MIN_VALUE | START | COMMENT |
+---------------+-----------------+---------------+-------+-------------+-------+-----------+---------------------+-----------+-------+---------+
| def | test | s1 | 1 | 1000 | 0 | 1 | 9223372036854775806 | 1 | 1 | seq 1 |
| def | test | s2 | 1 | 1000 | 0 | 1 | 9223372036854775806 | 1 | 1 | |
+---------------+-----------------+---------------+-------+-------------+-------+-----------+---------------------+-----------+-------+---------+
2 rows in set (0.0005 sec)

sql> SHOW CREATE SEQUENCE s1\G
*************************** 1. row ***************************
Sequence: s1
Create Sequence: CREATE SEQUENCE `s1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB COMMENT='seq 1'
1 row in set (0.0011 sec)

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.