--- alter table to add new column with default timestamp values aware of session timezone test ---
CREATE TABLE test1 (i INTEGER, j TIMESTAMP time index, PRIMARY KEY(i));

Affected Rows: 0

ALTER TABLE test1 ADD COLUMN k INTEGER DEFAULT 100;

Affected Rows: 0

ALTER TABLE test1 ADD COLUMN l INTEGER DEFAULT 200;

Affected Rows: 0

ALTER TABLE test1 ADD COLUMN m TIMESTAMP DEFAULT '2024-01-30 00:00:00';

Affected Rows: 0

ALTER TABLE test1 ADD COLUMN n INTEGER DEFAULT 300;

Affected Rows: 0

--- set default value for k, l, n, n ---
ALTER TABLE test1 MODIFY COLUMN k SET DEFAULT 101;

Affected Rows: 0

ALTER TABLE test1 MODIFY COLUMN l SET DEFAULT 201, MODIFY COLUMN m SET DEFAULT '2024-01-30 00:00:00', MODIFY COLUMN n SET DEFAULT 300;

Affected Rows: 0

SHOW CREATE TABLE test1;

+-------+-------------------------------------------------------------+
| Table | Create Table                                                |
+-------+-------------------------------------------------------------+
| test1 | CREATE TABLE IF NOT EXISTS "test1" (                        |
|       |   "i" INT NULL,                                             |
|       |   "j" TIMESTAMP(3) NOT NULL,                                |
|       |   "k" INT NULL DEFAULT 101,                                 |
|       |   "l" INT NULL DEFAULT 201,                                 |
|       |   "m" TIMESTAMP(3) NULL DEFAULT '2024-01-30 00:00:00+0000', |
|       |   "n" INT NULL DEFAULT 300,                                 |
|       |   TIME INDEX ("j"),                                         |
|       |   PRIMARY KEY ("i")                                         |
|       | )                                                           |
|       |                                                             |
|       | ENGINE=mito                                                 |
|       |                                                             |
+-------+-------------------------------------------------------------+

INSERT INTO test1 VALUES (1, '2024-01-30 12:00:00', DEFAULT, DEFAULT, DEFAULT, DEFAULT);

Affected Rows: 1

SELECT * FROM test1;

+---+---------------------+-----+-----+---------------------+-----+
| i | j                   | k   | l   | m                   | n   |
+---+---------------------+-----+-----+---------------------+-----+
| 1 | 2024-01-30T12:00:00 | 101 | 201 | 2024-01-30T00:00:00 | 300 |
+---+---------------------+-----+-----+---------------------+-----+

--- SET `CURRENT_TIMESTAMP` as default
ALTER TABLE test1 MODIFY COLUMN m SET DEFAULT CURRENT_TIMESTAMP;

Affected Rows: 0

SHOW CREATE TABLE test1;

+-------+------------------------------------------------------+
| Table | Create Table                                         |
+-------+------------------------------------------------------+
| test1 | CREATE TABLE IF NOT EXISTS "test1" (                 |
|       |   "i" INT NULL,                                      |
|       |   "j" TIMESTAMP(3) NOT NULL,                         |
|       |   "k" INT NULL DEFAULT 101,                          |
|       |   "l" INT NULL DEFAULT 201,                          |
|       |   "m" TIMESTAMP(3) NULL DEFAULT current_timestamp(), |
|       |   "n" INT NULL DEFAULT 300,                          |
|       |   TIME INDEX ("j"),                                  |
|       |   PRIMARY KEY ("i")                                  |
|       | )                                                    |
|       |                                                      |
|       | ENGINE=mito                                          |
|       |                                                      |
+-------+------------------------------------------------------+

ALTER TABLE test1 ADD COLUMN o INTEGER NOT NULL DEFAULT 400;

Affected Rows: 0

ALTER TABLE test1 MODIFY COLUMN o SET DEFAULT 401;

Affected Rows: 0

SHOW CREATE TABLE test1;

+-------+------------------------------------------------------+
| Table | Create Table                                         |
+-------+------------------------------------------------------+
| test1 | CREATE TABLE IF NOT EXISTS "test1" (                 |
|       |   "i" INT NULL,                                      |
|       |   "j" TIMESTAMP(3) NOT NULL,                         |
|       |   "k" INT NULL DEFAULT 101,                          |
|       |   "l" INT NULL DEFAULT 201,                          |
|       |   "m" TIMESTAMP(3) NULL DEFAULT current_timestamp(), |
|       |   "n" INT NULL DEFAULT 300,                          |
|       |   "o" INT NOT NULL DEFAULT 401,                      |
|       |   TIME INDEX ("j"),                                  |
|       |   PRIMARY KEY ("i")                                  |
|       | )                                                    |
|       |                                                      |
|       | ENGINE=mito                                          |
|       |                                                      |
+-------+------------------------------------------------------+

ALTER TABLE test1 MODIFY COLUMN o SET DEFAULT "not allow";

Error: 1001(Unsupported), Unsupported default constraint for column: 'o', reason: expr '"not allow"' not supported

ALTER TABLE test1 MODIFY COLUMN o SET DEFAULT NULL;

Error: 1004(InvalidArguments), Default value should not be null for non null column

DROP TABLE test1;

Affected Rows: 0

