tkt3922.test 2.3 KB

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