• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 2009 June 17
2#
3# The author disclaims copyright to this source code.  In place of
4# a legal notice, here is a blessing:
5#
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.
9#
10#***********************************************************************
11#
12# $Id: tkt3922.test,v 1.2 2009/06/26 14:17:47 shane Exp $
13
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16
17if {[working_64bit_int]} {
18  do_test tkt3922.1 {
19    execsql {
20      CREATE TABLE t1(a NUMBER);
21      INSERT INTO t1 VALUES('-9223372036854775808');
22      SELECT a, typeof(a) FROM t1;
23    }
24  } {-9223372036854775808 integer}
25} else {
26  # this alternate version of tkt3922.1 doesn't
27  # really test the same thing as the original,
28  # but is needed to create the table and
29  # provided simply as a place holder for
30  # platforms without working 64bit support.
31  do_test tkt3922.1 {
32    execsql {
33      CREATE TABLE t1(a NUMBER);
34      INSERT INTO t1 VALUES('-1');
35      SELECT a, typeof(a) FROM t1;
36    }
37  } {-1 integer}
38}
39do_test tkt3922.2 {
40  execsql {
41    DELETE FROM t1;
42    INSERT INTO t1 VALUES('-9223372036854775809');
43    SELECT a, typeof(a) FROM t1;
44  }
45} {-9.22337203685478e+18 real}
46do_test tkt3922.3 {
47  execsql {
48    DELETE FROM t1;
49    INSERT INTO t1 VALUES('-9223372036854776832');
50    SELECT a, typeof(a) FROM t1;
51  }
52} {-9.22337203685478e+18 real}
53do_test tkt3922.4 {
54  execsql {
55    DELETE FROM t1;
56    INSERT INTO t1 VALUES('-9223372036854776833');
57    SELECT a, typeof(a) FROM t1;
58  }
59} {-9.22337203685478e+18 real}
60if {[working_64bit_int]} {
61  do_test tkt3922.5 {
62    execsql {
63      DELETE FROM t1;
64      INSERT INTO t1 VALUES('9223372036854775807');
65      SELECT a, typeof(a) FROM t1;
66    }
67  } {9223372036854775807 integer}
68} else {
69  # this alternate version of tkt3922.5 doesn't
70  # really test the same thing as the original,
71  # but provided simply as a place holder for
72  # platforms without working 64bit support.
73  do_test tkt3922.5 {
74    execsql {
75      DELETE FROM t1;
76      INSERT INTO t1 VALUES('1');
77      SELECT a, typeof(a) FROM t1;
78    }
79  } {1 integer}
80}
81do_test tkt3922.6 {
82  execsql {
83    DELETE FROM t1;
84    INSERT INTO t1 VALUES('9223372036854775808');
85    SELECT a, typeof(a) FROM t1;
86  }
87} {9.22337203685478e+18 real}
88
89finish_test
90