diff --git a/mysql-test/suite/tianmu/r/alter_column.result b/mysql-test/suite/tianmu/r/alter_column.result index 2af9b1075..c8697862d 100644 --- a/mysql-test/suite/tianmu/r/alter_column.result +++ b/mysql-test/suite/tianmu/r/alter_column.result @@ -39,4 +39,26 @@ NULL 2 b NULL NULL NULL 3 c NULL NULL NULL 4 d NULL NULL NULL 5 e NULL NULL +CREATE TABLE st1 ( +task_id INT NOT NULL, +subject VARCHAR(45) NULL, +start_date DATE NULL, +end_date DATE NULL, +description VARCHAR(200) NULL, +PRIMARY KEY (task_id) +); +ALTER TABLE st1 ADD COLUMN test numeric(20,10); +ERROR HY000: Unable to inplace alter table +ALTER TABLE st1 ADD COLUMN test1 numeric(8,2); +SHOW CREATE TABLE st1; +Table Create Table +st1 CREATE TABLE `st1` ( + `task_id` int(11) NOT NULL, + `subject` varchar(45) DEFAULT NULL, + `start_date` date DEFAULT NULL, + `end_date` date DEFAULT NULL, + `description` varchar(200) DEFAULT NULL, + `test1` decimal(8,2) DEFAULT NULL, + PRIMARY KEY (`task_id`) +) ENGINE=TIANMU DEFAULT CHARSET=latin1 DROP DATABASE alter_colunm; diff --git a/mysql-test/suite/tianmu/t/alter_column.test b/mysql-test/suite/tianmu/t/alter_column.test index 8c52efd9d..41c6fce43 100644 --- a/mysql-test/suite/tianmu/t/alter_column.test +++ b/mysql-test/suite/tianmu/t/alter_column.test @@ -56,5 +56,25 @@ ALTER TABLE t1 DROP COLUMN c11; SHOW CREATE TABLE t1; SELECT * FROM t1 ORDER BY c1; +################# +# ADD COLUMEN BEFORE THE FIRST ADDING COLUMN IS WRONG +################# + +CREATE TABLE st1 ( + task_id INT NOT NULL, + subject VARCHAR(45) NULL, + start_date DATE NULL, + end_date DATE NULL, + description VARCHAR(200) NULL, + PRIMARY KEY (task_id) +); + +--error 6 +ALTER TABLE st1 ADD COLUMN test numeric(20,10); + +ALTER TABLE st1 ADD COLUMN test1 numeric(8,2); + +SHOW CREATE TABLE st1; + # Clean UP DROP DATABASE alter_colunm; diff --git a/storage/tianmu/core/value_set.cpp b/storage/tianmu/core/value_set.cpp index a9377fa3e..a816d7bb1 100644 --- a/storage/tianmu/core/value_set.cpp +++ b/storage/tianmu/core/value_set.cpp @@ -154,7 +154,6 @@ void ValueSet::Add(const types::TianmuValueObject &rcv) { if (rcv.IsNull()) contains_nulls = true; else { - // Add(rcv.Get()->Clone()); std::unique_ptr tianmu_dt = rcv.Get()->Clone(); if (tianmu_dt->IsNull()) { contains_nulls = true;