[MCOL-4269] ADD COLUMN NOT NULL is expecting the new column has to have a default value. Created: 2020-08-24  Updated: 2021-01-14

Status: Open
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: susil.behera Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Server version: 10.5.6
MCS version: 1.5.4-1



 Description   

ADD COLUMN NOT NULL is expecting the new column has to have a default value.

MariaDB [mcs87_db]> CREATE TABLE t1 (c1 INT, c2 CHAR(1)) ENGINE=Columnstore;
Query OK, 0 rows affected (0.142 sec)

MariaDB [mcs87_db]> INSERT INTO t1 VALUES (1, 'a');
Query OK, 1 row affected (0.221 sec)

MariaDB [mcs87_db]> ALTER TABLE t1 ADD COLUMN c11 INT NOT NULL;
ERROR 1815 (HY000): Internal error: Table is not empty. New column has to have a default value if NOT NULL required.
MariaDB [mcs87_db]> ALTER TABLE t1 ADD COLUMN c22 CHAR NOT NULL;
ERROR 1815 (HY000): Internal error: Table is not empty. New column has to have a default value if NOT NULL required.
MariaDB [mcs87_db]>

InnoDB accepts by adding 0 or empty string into the new column added.


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