[MCOL-479] insert omitting not null autoincrement column results in warning Created: 2016-12-21  Updated: 2021-12-27  Resolved: 2019-11-21

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.0.6, 1.2.1, 1.2.3
Fix Version/s: Icebox

Type: Bug Priority: Minor
Reporter: David Thompson (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: None

Issue Links:
Duplicate
duplicates MCOL-780 auto increment needs to use MariaDB's... Closed
is duplicated by MCOL-3620 Auto Increment expects the column to ... Closed
Epic Link: ColumnStore Compatibility Improvements

 Description   

If you have defined an autoincrement column and that column also has a not null constraint then a warning is issued if you omit the autoincr column in the insert statement:

MariaDB [test]> create table t1(i int not null, c char(3)) engine=columnstore comment 'autoincrement=i';
Query OK, 0 rows affected (0.57 sec)
 
MariaDB [test]> insert into t1 (c) values ('ABC');
Query OK, 1 row affected, 1 warning (0.33 sec)
 
MariaDB [test]> show warnings;
+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1364 | Field 'i' doesn't have a default value |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> insert into t1 (i,c) values (0, 'ABC');
Query OK, 1 row affected (0.27 sec)



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2016-12-21 ]

From sql_table.cc:

Set NO_DEFAULT_VALUE_FLAG if this field doesn't have a default value and
it is NOT NULL, not an AUTO_INCREMENT field, not a TIMESTAMP and not
updated trough a NOW() function.

ColumnStore doesn't use a autoincrement that mysqld is aware of so the warning is triggered. To remove this warning correctly we would need a way to may mysqld aware of the autoincrement, or use mysqld's autoincrement flags (there is another MCOL for the latter).

Comment by Andrew Hutchings (Inactive) [ 2019-11-21 ]

Closing as duplicate of MCOL-780 to consolidate all of these issue.

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