1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Enhance ALTER TABLE ADD COLUMN to support "DEFAULT true" and "DEFAULT false".

FossilOrigin-Name: 594ebc69557095c9262db39129dd50a3dbf038556a3d2a3ea69b82ed4c61e2b9
This commit is contained in:
drh
2018-04-18 11:35:35 +00:00
parent e7df892ad8
commit 3bc431550a
4 changed files with 28 additions and 9 deletions

View File

@@ -143,4 +143,19 @@ foreach {tn val} [list 1 NaN 2 -NaN 3 NaN0 4 -NaN0 5 Inf 6 -Inf] {
} {0}
}
do_execsql_test istrue-700 {
CREATE TABLE t7(
a INTEGER PRIMARY KEY,
b BOOLEAN DEFAULT false,
c BOOLEAN DEFAULT true
);
INSERT INTO t7(a) VALUES(1);
INSERT INTO t7(a,b,c) VALUES(2,true,false);
ALTER TABLE t7 ADD COLUMN d BOOLEAN DEFAULT false;
ALTER TABLE t7 ADD COLUMN e BOOLEAN DEFAULT true;
INSERT INTO t7(a,b,c) VALUES(3,true,false);
INSERT INTO t7 VALUES(4,false,true,true,false);
SELECT *,'x' FROM t7 ORDER BY a;
} {1 0 1 0 1 x 2 1 0 0 1 x 3 1 0 0 1 x 4 0 1 1 0 x}
finish_test