SQLite

Check-in [c41f04edb2]
Login

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

Overview
Comment:Merge together another accidental fork.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c41f04edb20c0c8fc8c49a53d42cc0b8a0ff7fe3
User & Date: dan 2010-07-07 16:23:37.000
Context
2010-07-07
16:49
Fix some MSVC compiler warnings in the ASYNC extension. (check-in: b951c8675d user: shaneh tags: trunk)
16:23
Merge together another accidental fork. (check-in: c41f04edb2 user: dan tags: trunk)
16:20
Fix test numbering issue in nan.test. (check-in: 5bb1330fef user: shaneh tags: trunk)
16:18
Do not make the SQLITE_FCNTL_SIZE_HINT call if an error has already occurred during transaction commit. (check-in: e92de834a3 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/nan.test.
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  } {{} null inf real -inf real {} null}
  do_test nan-1.1.5 {
    sqlite3_bind_double $::STMT 1 NaN0
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null {} null}
  do_test nan-1.1.5 {
    sqlite3_bind_double $::STMT 1 -NaN0
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null {} null {} null}
  do_test nan-1.1.6 {
    db eval {
      UPDATE t1 SET x=x-x;
      SELECT x, typeof(x) FROM t1;
    }
  } {{} null {} null {} null {} null {} null {} null}
}








|





|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  } {{} null inf real -inf real {} null}
  do_test nan-1.1.5 {
    sqlite3_bind_double $::STMT 1 NaN0
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null {} null}
  do_test nan-1.1.6 {
    sqlite3_bind_double $::STMT 1 -NaN0
    sqlite3_step $::STMT
    sqlite3_reset $::STMT
    db eval {SELECT x, typeof(x) FROM t1}
  } {{} null inf real -inf real {} null {} null {} null}
  do_test nan-1.1.7 {
    db eval {
      UPDATE t1 SET x=x-x;
      SELECT x, typeof(x) FROM t1;
    }
  } {{} null {} null {} null {} null {} null {} null}
}

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
} {{} null Inf real -Inf real {} null}
do_test nan-1.2.5 {
  sqlite3_bind_double $::STMT 1 NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null {} null}
do_test nan-1.2.5 {
  sqlite3_bind_double $::STMT 1 -NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null {} null {} null}
do_test nan-1.2.6 {
  db eval {
    UPDATE t1 SET x=x-x;
    SELECT CAST(x AS text), typeof(x) FROM t1;
  }
} {{} null {} null {} null {} null {} null {} null}

do_test nan-2.1 {







|





|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
} {{} null Inf real -Inf real {} null}
do_test nan-1.2.5 {
  sqlite3_bind_double $::STMT 1 NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null {} null}
do_test nan-1.2.6 {
  sqlite3_bind_double $::STMT 1 -NaN0
  sqlite3_step $::STMT
  sqlite3_reset $::STMT
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {{} null Inf real -Inf real {} null {} null {} null}
do_test nan-1.2.7 {
  db eval {
    UPDATE t1 SET x=x-x;
    SELECT CAST(x AS text), typeof(x) FROM t1;
  }
} {{} null {} null {} null {} null {} null {} null}

do_test nan-2.1 {
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
} {Inf real}
do_test nan-4.10 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 309].0)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {-Inf real}

do_test nan-4.10 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(1234.5[string repeat 0 10000]12345)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1234.5 real}
do_test nan-4.11 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-1234.5[string repeat 0 10000]12345)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1234.5 real}
do_test nan-4.12 {
  db eval {DELETE FROM t1}
  set small [string repeat 0 10000].[string repeat 0 324][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT x, typeof(x) FROM t1}
} {0.0 real}
do_test nan-4.13 {
  db eval {DELETE FROM t1}
  set small \
      -[string repeat 0 10000].[string repeat 0 324][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT x, typeof(x) FROM t1}
} {0.0 real}

# These tests test some really, really small floating point numbers.
#
if {$tcl_platform(platform) != "symbian"} {
  # These two are not run on symbian because tcl has trouble converting
  # the very small numbers back to text form (probably due to a difference
  # in the sprintf() implementation).
  #
  do_test nan-4.14 {
    db eval {DELETE FROM t1}
    set small \
        [string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
    db eval "INSERT INTO t1 VALUES($small)"
    db eval {SELECT x, typeof(x) FROM t1}
  } {9.88131291682493e-324 real}
  do_test nan-4.15 {
    db eval {DELETE FROM t1}
    set small \
        -[string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
    db eval "INSERT INTO t1 VALUES($small)"
    db eval {SELECT x, typeof(x) FROM t1}
  } {-9.88131291682493e-324 real}
}
do_test nan-4.16 {
  db eval {DELETE FROM t1}
  set small [string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {9.88131291682493e-324 real}
do_test nan-4.17 {
  db eval {DELETE FROM t1}
  set small \
      -[string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {-9.88131291682493e-324 real}








|




|




|





|














|






|







|





|







249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
} {Inf real}
do_test nan-4.10 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-[string repeat 9 309].0)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {-Inf real}

do_test nan-4.11 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(1234.5[string repeat 0 10000]12345)"
  db eval {SELECT x, typeof(x) FROM t1}
} {1234.5 real}
do_test nan-4.12 {
  db eval {DELETE FROM t1}
  db eval "INSERT INTO t1 VALUES(-1234.5[string repeat 0 10000]12345)"
  db eval {SELECT x, typeof(x) FROM t1}
} {-1234.5 real}
do_test nan-4.13 {
  db eval {DELETE FROM t1}
  set small [string repeat 0 10000].[string repeat 0 324][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT x, typeof(x) FROM t1}
} {0.0 real}
do_test nan-4.14 {
  db eval {DELETE FROM t1}
  set small \
      -[string repeat 0 10000].[string repeat 0 324][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT x, typeof(x) FROM t1}
} {0.0 real}

# These tests test some really, really small floating point numbers.
#
if {$tcl_platform(platform) != "symbian"} {
  # These two are not run on symbian because tcl has trouble converting
  # the very small numbers back to text form (probably due to a difference
  # in the sprintf() implementation).
  #
  do_test nan-4.15 {
    db eval {DELETE FROM t1}
    set small \
        [string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
    db eval "INSERT INTO t1 VALUES($small)"
    db eval {SELECT x, typeof(x) FROM t1}
  } {9.88131291682493e-324 real}
  do_test nan-4.16 {
    db eval {DELETE FROM t1}
    set small \
        -[string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
    db eval "INSERT INTO t1 VALUES($small)"
    db eval {SELECT x, typeof(x) FROM t1}
  } {-9.88131291682493e-324 real}
}
do_test nan-4.17 {
  db eval {DELETE FROM t1}
  set small [string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {9.88131291682493e-324 real}
do_test nan-4.18 {
  db eval {DELETE FROM t1}
  set small \
      -[string repeat 0 10000].[string repeat 0 323][string repeat 9 10000]
  db eval "INSERT INTO t1 VALUES($small)"
  db eval {SELECT CAST(x AS text), typeof(x) FROM t1}
} {-9.88131291682493e-324 real}