[MCOL-477] can't reset autoincrement values Created: 2016-12-20 Updated: 2017-01-23 Resolved: 2017-01-23 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | DDLProc |
| Affects Version/s: | 1.0.6 |
| Fix Version/s: | 1.0.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Thompson (Inactive) | Assignee: | David Thompson (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | community | ||
| Issue Links: |
|
||||||||
| Sprint: | 2016-25, 2017-01, 2017-2 | ||||||||
| Description |
|
Hi, How to adjust autoincrement to max value+1 after data load from csv ? MariaDB [asdb]> alter table tablename COMMENT 'autoincrement=id;autoincrement=5492786873'; MariaDB [asdb]> alter table tablename COMMENT 'autoincrement=id,5492786873'; Thanks |
| Comments |
| Comment by David Thompson (Inactive) [ 2016-12-21 ] | |||||||||
|
it looks like if you have specified this as a tablename comment it fails which is a bug:
| |||||||||
| Comment by David Thompson (Inactive) [ 2016-12-21 ] | |||||||||
|
The column form of changing a comment does parse and update the comment. However it does not seem to have the effect of resetting the autoinc counter whether autoinc is specified initially as a table or column content in the create table:
| |||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-01-05 ] | |||||||||
|
The patch allows autoincrement value to be changed using:
Where "value" is the new integer. You do not specify the column name in the comment. | |||||||||
| Comment by Daniel Lee (Inactive) [ 2017-01-18 ] | |||||||||
|
Build verified: Github source build [root@localhost mariadb-columnstore-server]# git show Merge pull request #26 from mariadb-corporation/ Update README.md [root@localhost mariadb-columnstore-engine]# git show Merge pull request #96 from mariadb-corporation/ Performance testing on the new syntax, as well as normal auto increment value tests. It worked. Negative test did not go so well.If I set the autoincrement value to -1, the alter table statement never returned. I ctrl-c out of the command and selecting from the table would hang. I stopped the system and there was a locked (but I forgot to check what the lock was). After starting the system, I still could not query any table. Basically, the database is not functional anymore. I tried to select from the calpontsys.syscolumn and got this error: MariaDB [calpontsys]> select * from syscolumn; The autoincrement value is being kept in the syscolumn table and I have a feeling that syscolumn is in a bad state. | |||||||||
| Comment by Daniel Lee (Inactive) [ 2017-01-18 ] | |||||||||
|
Reopened per my last comment | |||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-01-18 ] | |||||||||
|
New pull requests for develop and develop-1.0 to validate the autoincrement value. | |||||||||
| Comment by David Hall (Inactive) [ 2017-01-18 ] | |||||||||
|
This fix makes the ALTER TABLE table_name COMMENT 'autoincrement=value' work, but it does not fix the column comment problem: alter table t2 change i i int not null comment 'autoincrement=5'; does not work, nor does a column comment in the create statement. In create, such a column comment turns on auto increment, but does not set the start value as expected. If both types of alter statements are executed, a show create table will show both comments, possibly with different values, but the value in the column comment is immaterial and not used. Most likely we will be scrapping the comment syntax for the standardized mariadb syntax, so further work on this issue is a very low priority. | |||||||||
| Comment by David Thompson (Inactive) [ 2017-01-23 ] | |||||||||
|
the autoincrement column in catalog tables does not appear to be being updated either initially or after a value reset. Filed | |||||||||
| Comment by David Thompson (Inactive) [ 2017-01-23 ] | |||||||||
|
I am ok with the restriction that the value reset only works with the table comment. |