autoincrement

119 views
Skip to first unread message

Suresh Rajagopal

unread,
Dec 19, 2016, 3:30:37 PM12/19/16
to MariaDB ColumnStore
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

David Thompson

unread,
Dec 20, 2016, 4:14:27 PM12/20/16
to Suresh Rajagopal, MariaDB ColumnStore

Hi Suresh,

I have filed a bug for this that has more details:

https://jira.mariadb.org/browse/MCOL-475

 

If you specify the value 0 or null for the autoincrement column then cpimport or direct insert will populate from the autoinc sequence rather than the file. IF you can reload the file that may be an option while we investigate this case further.

 

David.

--
You received this message because you are subscribed to the Google Groups "MariaDB ColumnStore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mariadb-columns...@googlegroups.com.
To post to this group, send email to mariadb-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mariadb-columnstore/1731553039.1817636.1482179426553%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.

Suresh Rajagopal

unread,
Dec 20, 2016, 6:26:13 PM12/20/16
to David Thompson, MariaDB ColumnStore
Hi David,

Thanks for filling the bug. I have reloaded the data with auto increment set at create table.

I see another issue with auto increment. We don't pass any value for auto increment column and system generates a default value. But in column store i get a warning. InnoDB its working fine.


MariaDB [asdb]> create table srs (`id` bigint(20) NOT NULL, `fileDate` datetime NOT NULL) ENGINE=Columnstore DEFAULT CHARSET=utf8 COMMENT='autoincrement=id';
Query OK, 0 rows affected (0.76 sec)

MariaDB [asdb]> insert into srs(fileDate) values ('2014-04-07 00:13:24');
Query OK, 1 row affected, 1 warning (0.46 sec)

MariaDB [asdb]> show warnings;
+---------+------+-----------------------------------------+
| Level   | Code | Message                                 |
+---------+------+-----------------------------------------+
| Warning | 1364 | Field 'id' doesn't have a default value |
+---------+------+-----------------------------------------+
1 row in set (0.00 sec)


MariaDB [asdb]>  create table srsinnodb (`id` bigint(20) NOT NULL AUTO_INCREMENT,`fileDate` datetime NOT NULL,PRIMARY KEY (`id`))  ENGINE = InnoDB;
Query OK, 0 rows affected (0.12 sec)

MariaDB [asdb]> insert into srsinnodb(fileDate) values ('2014-04-07 00:13:24');
Query OK, 1 row affected (0.00 sec)

MariaDB [asdb]> show warnings;
Empty set (0.00 sec)



From: David Thompson <dtho...@mariadb.com>
To: Suresh Rajagopal <sure...@gmail.com>; MariaDB ColumnStore <mariadb-c...@googlegroups.com>
Sent: Tuesday, December 20, 2016 1:14 PM
Subject: RE: autoincrement

David Thompson

unread,
Dec 20, 2016, 7:27:57 PM12/20/16
to Suresh Rajagopal, MariaDB ColumnStore

Thanks good catch on that one, it’s only if you also define a not null constraint on the autoincrement column.  The warning also does not occur if you explicitly specify the column as null or 0 in your insert statement.

 

I’ve filed https://jira.mariadb.org/browse/MCOL-479 for this.

 

Thanks,

 

David.

Reply all
Reply to author
Forward
0 new messages