--- 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));

ALTER TABLE test1 ADD COLUMN k INTEGER DEFAULT 100;
ALTER TABLE test1 ADD COLUMN l INTEGER DEFAULT 200;
ALTER TABLE test1 ADD COLUMN m TIMESTAMP DEFAULT '2024-01-30 00:00:00';
ALTER TABLE test1 ADD COLUMN n INTEGER DEFAULT 300;

SHOW CREATE TABLE test1;

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

SELECT * FROM test1;

ALTER TABLE test1 MODIFY COLUMN k DROP DEFAULT;
ALTER TABLE test1 MODIFY COLUMN l DROP DEFAULT, MODIFY COLUMN m DROP DEFAULT, MODIFY COLUMN n DROP DEFAULT;

SHOW CREATE TABLE test1;

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

SELECT * FROM test1;

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

ALTER TABLE test1 MODIFY COLUMN o DROP DEFAULT;

DROP TABLE test1;
