3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file implements regression tests for SQLite library. Specifically,
13 # it tests that ticket [8454a207b9fd2243c4c6b7a73f67ea0315717c1a]. Verify
14 # that a negative default value on an added text column actually comes
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
21 do_test tkt-8454a207b9.1 {
24 INSERT INTO t1 VALUES(1);
25 ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
26 SELECT b, typeof(b) FROM t1;
29 do_test tkt-8454a207b9.2 {
31 ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
32 SELECT c, typeof(c) FROM t1;
35 do_test tkt-8454a207b9.3 {
37 ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT -'hello';
38 SELECT d, typeof(d) FROM t1;
41 do_test tkt-8454a207b9.4 {
43 ALTER TABLE t1 ADD COLUMN e DEFAULT -123.0;
44 SELECT e, typeof(e) FROM t1;
47 do_test tkt-8454a207b9.5 {
49 ALTER TABLE t1 ADD COLUMN f DEFAULT -123.5;
50 SELECT f, typeof(f) FROM t1;
53 do_test tkt-8454a207b9.6 {
55 ALTER TABLE t1 ADD COLUMN g DEFAULT -9223372036854775808;
56 SELECT g, typeof(g) FROM t1;
58 } {-9223372036854775808 integer}
59 do_test tkt-8454a207b9.7 {
61 ALTER TABLE t1 ADD COLUMN h DEFAULT 9223372036854775807;
62 SELECT h, typeof(h) FROM t1;
64 } {9223372036854775807 integer}