summaryrefslogtreecommitdiff
path: root/test/default.test
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:43 -0400
committerHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:43 -0400
commit9f67c0520ea0d5f11a190197cdf746c512db4ce4 (patch)
treec88a33f01f20a3d13a09594f114fffacebd0d1a4 /test/default.test
parentee20336e9c78d2e3782c8d096b9ab4f6ca8ce95f (diff)
parent569c6676a6ddb0ff73821d7693b5e18ddef809b9 (diff)
Merge tag 'upstream/3.2.0'
Upstream version 3.2.0 # gpg: Signature made Thu 16 Oct 2014 10:51:39 PM EDT using RSA key ID 374BBE81 # gpg: Good signature from "Hans-Christoph Steiner <hans@guardianproject.info>" # gpg: aka "Hans-Christoph Steiner <hans@eds.org>" # gpg: aka "Hans-Christoph Steiner <hans@at.or.at>" # gpg: aka "[jpeg image of size 5408]"
Diffstat (limited to 'test/default.test')
-rw-r--r--test/default.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/default.test b/test/default.test
index 95a4ee0..d6b6f97 100644
--- a/test/default.test
+++ b/test/default.test
@@ -64,4 +64,39 @@ ifcapable pragma {
} {0 c {} 0 'abc' 0}
}
+do_execsql_test default-3.1 {
+ CREATE TABLE t3(
+ a INTEGER PRIMARY KEY AUTOINCREMENT,
+ b INT DEFAULT 12345 UNIQUE NOT NULL CHECK( b>=0 AND b<99999 ),
+ c VARCHAR(123,456) DEFAULT 'hello' NOT NULL ON CONFLICT REPLACE,
+ d REAL,
+ e FLOATING POINT(5,10) DEFAULT 4.36,
+ f NATIONAL CHARACTER(15) COLLATE RTRIM,
+ g LONG INTEGER DEFAULT( 3600*12 )
+ );
+ INSERT INTO t3 VALUES(null, 5, 'row1', '5.25', 'xyz', 321, '432');
+ SELECT a, typeof(a), b, typeof(b), c, typeof(c),
+ d, typeof(d), e, typeof(e), f, typeof(f),
+ g, typeof(g) FROM t3;
+} {1 integer 5 integer row1 text 5.25 real xyz text 321 text 432 integer}
+do_execsql_test default-3.2 {
+ DELETE FROM t3;
+ INSERT INTO t3 DEFAULT VALUES;
+ SELECT * FROM t3;
+} {2 12345 hello {} 4.36 {} 43200}
+do_execsql_test default-3.3 {
+ CREATE TABLE t300(
+ a INT DEFAULT 2147483647,
+ b INT DEFAULT 2147483648,
+ c INT DEFAULT +9223372036854775807,
+ d INT DEFAULT -2147483647,
+ e INT DEFAULT -2147483648,
+ f INT DEFAULT -9223372036854775808,
+ g INT DEFAULT (-(-9223372036854775808)),
+ h INT DEFAULT (-(-9223372036854775807))
+ );
+ INSERT INTO t300 DEFAULT VALUES;
+ SELECT * FROM t300;
+} {2147483647 2147483648 9223372036854775807 -2147483647 -2147483648 -9223372036854775808 9.22337203685478e+18 9223372036854775807}
+
finish_test