Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
23.10.0
-
None
-
None
Description
MariaDB [test]> CREATE TABLE person ( |
-> name VARCHAR(100) NOT NULL, |
-> surname VARCHAR(100) NOT NULL |
-> ) ENGINE ColumnStore;
|
Query OK, 0 rows affected (0.222 sec) |
|
|
MariaDB [test]> INSERT INTO person (name, surname) VALUES ('Miles', 'Davis'); |
Query OK, 1 row affected (0.160 sec)
|
|
|
MariaDB [test]> ALTER TABLE person ADD COLUMN middle_name VARCHAR(100) NOT NULL DEFAULT ''; |
ERROR 1815 (HY000): Internal error: New column has to have a default value if NOT NULL required. |
This only happens when the default value is an empty string. But the empty string is a valid value, and it works with other storage engines:
MariaDB [test]> ALTER TABLE person ENGINE InnoDB; |
Query OK, 1 row affected (0.303 sec)
|
Records: 1 Duplicates: 0 Warnings: 0
|
|
|
MariaDB [test]> ALTER TABLE person ADD COLUMN middle_name VARCHAR(100) NOT NULL DEFAULT ''; |
Query OK, 0 rows affected (0.038 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|