Change the table_info pragma so that it returns NULL for the default

value if there is no default value.  Ticket #2078. (CVS 3527)

FossilOrigin-Name: 5f21c3a5f02b4f2c4550f5904e9d0e1e2eafb0f3
This commit is contained in:
drh
2006-11-30 13:06:37 +00:00
parent 741f70633d
commit 736c7d4b2c
4 changed files with 21 additions and 15 deletions
+11 -3
View File
@@ -12,7 +12,7 @@
#
# This file implements tests for the PRAGMA command.
#
# $Id: pragma.test,v 1.44 2006/08/14 14:23:43 drh Exp $
# $Id: pragma.test,v 1.45 2006/11/30 13:06:37 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -351,12 +351,20 @@ do_test pragma-6.2 {
pragma table_info(t2)
}
} {0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0}
db nullvalue <<NULL>>
do_test pragma-6.2.2 {
execsql {
CREATE TABLE t5(a TEXT DEFAULT CURRENT_TIMESTAMP, b DEFAULT (5+3));
CREATE TABLE t5(
a TEXT DEFAULT CURRENT_TIMESTAMP,
b DEFAULT (5+3),
c TEXT,
d INTEGER DEFAULT NULL,
e TEXT DEFAULT ''
);
PRAGMA table_info(t5);
}
} {0 a TEXT 0 CURRENT_TIMESTAMP 0 1 b {} 0 5+3 0}
} {0 a TEXT 0 CURRENT_TIMESTAMP 0 1 b {} 0 5+3 0 2 c TEXT 0 <<NULL>> 0 3 d INTEGER 0 NULL 0 4 e TEXT 0 '' 0}
db nullvalue {}
ifcapable {foreignkey} {
do_test pragma-6.3 {
execsql {