/ Check-in [79ec485b]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add test cases for INSERT INTO ... DEFAULT VALUES on tables with numeric constants in CHECK constraints.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | expr-codegen-enhancement
Files: files | file ages | folders
SHA1: 79ec485b548fcfc508c4d5fa32ed0604e1b0c5d9
User & Date: drh 2013-11-15 16:48:23
Context
2013-11-15
18:15
Changes to make the new constant expression factoring logic more general and more testable. check-in: d10fb49a user: drh tags: expr-codegen-enhancement
16:48
Add test cases for INSERT INTO ... DEFAULT VALUES on tables with numeric constants in CHECK constraints. check-in: 79ec485b user: drh tags: expr-codegen-enhancement
15:52
Improvements to the Expr comparison routine to make it more general. Improvements to unary-minus code generation so that it can make use of a global constant register with a zero value. check-in: 835be656 user: drh tags: expr-codegen-enhancement
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/default.test.

60
61
62
63
64
65
66



































67
    execsql {
      INSERT INTO t4 DEFAULT VALUES;
      PRAGMA table_info(t4);
    }
  } {0 c {} 0 'abc' 0}
}




































finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
    execsql {
      INSERT INTO t4 DEFAULT VALUES;
      PRAGMA table_info(t4);
    }
  } {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