[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:
Relates
relates to MCOL-530 autoincrement not updating in catalog... Closed
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';
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.

MariaDB [asdb]> alter table tablename COMMENT 'autoincrement=id,5492786873';
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.

Thanks
Suresh Rajagopal



 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:

MariaDB [test]> CREATE TABLE `t1` (
  `i` int(11) NOT NULL,
  `c` char(3) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1 COMMENT='autoincrement=i' ;
 
MariaDB [test]> alter table t1 comment 'autoincrement=id,5';
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.

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:

create table t2 (i int not null comment 'autoincrement=1', c char(3)) engine=columnstore;
alter table t2 change i i int not null comment 'autoincrement=5';
select * from t2 where c = 'JKL';
+---+------+
| i | c    |
+---+------+
| 3 | JKL  |
+---+------+
1 row in set (0.01 sec)

Comment by Andrew Hutchings (Inactive) [ 2017-01-05 ]

The patch allows autoincrement value to be changed using:

ALTER TABLE table_name COMMENT 'autoincrement=value'

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
commit 83b0e5c54a644bc31461752cf73f0e1140586d39
Merge: b975814 93c1c7e
Author: david hill <david.hill@mariadb.com>
Date: Thu Jan 12 09:27:28 2017 -0600

Merge pull request #26 from mariadb-corporation/MCOL-500

Update README.md

[root@localhost mariadb-columnstore-engine]# git show
commit c6799df6408c0e86ccba9ee63929a6b9ad4294bf
Merge: fa0fde9 2f3937a
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Fri Jan 13 21:03:35 2017 -0600

Merge pull request #96 from mariadb-corporation/MCOL-505

MCOL-505 Performance improvements to ExeMgr

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;
ERROR 1815 (HY000): Internal error: An unexpected condition within the query caused an internal processing error within InfiniDB. Please check the log files for more details. Additional Information: error in BatchPrimitiveProces

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 MCOL-530 to track this.

Comment by David Thompson (Inactive) [ 2017-01-23 ]

I am ok with the restriction that the value reset only works with the table comment.

Generated at Thu Feb 08 02:21:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.