mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Add a version number to the wal-index header. If SQLite encounters a version number in either the wal or wal-index files that it does not understand, the operation is abandoned and SQLITE_CANTOPEN returned.
FossilOrigin-Name: 8d0f8a7f70d6fb42369411a934b30f8c8ca8322f
This commit is contained in:
@ -500,30 +500,32 @@ datetest 13.34 {date('2001-01-01','-1.5 years')} {1999-07-02}
|
||||
# Put a floating point number in the database so that we can manipulate
|
||||
# raw bits using the hexio interface.
|
||||
#
|
||||
do_test date-14.1 {
|
||||
execsql {
|
||||
PRAGMA auto_vacuum=OFF;
|
||||
PRAGMA page_size = 1024;
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(1.1);
|
||||
if {0==[sqlite3 -has-codec]} {
|
||||
do_test date-14.1 {
|
||||
execsql {
|
||||
PRAGMA auto_vacuum=OFF;
|
||||
PRAGMA page_size = 1024;
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(1.1);
|
||||
}
|
||||
db close
|
||||
hexio_write test.db 2040 4142ba32bffffff9
|
||||
sqlite3 db test.db
|
||||
db eval {SELECT * FROM t1}
|
||||
} {2454629.5}
|
||||
|
||||
# Changing the least significant byte of the floating point value between
|
||||
# 00 and FF should always generate a time of either 23:59:59 or 00:00:00,
|
||||
# never 24:00:00
|
||||
#
|
||||
for {set i 0} {$i<=255} {incr i} {
|
||||
db close
|
||||
hexio_write test.db 2047 [format %02x $i]
|
||||
sqlite3 db test.db
|
||||
do_test date-14.2.$i {
|
||||
set date [db one {SELECT datetime(x) FROM t1}]
|
||||
expr {$date eq "2008-06-12 00:00:00" || $date eq "2008-06-11 23:59:59"}
|
||||
} {1}
|
||||
}
|
||||
db close
|
||||
hexio_write test.db 2040 4142ba32bffffff9
|
||||
sqlite3 db test.db
|
||||
db eval {SELECT * FROM t1}
|
||||
} {2454629.5}
|
||||
|
||||
# Changing the least significant byte of the floating point value between
|
||||
# 00 and FF should always generate a time of either 23:59:59 or 00:00:00,
|
||||
# never 24:00:00
|
||||
#
|
||||
for {set i 0} {$i<=255} {incr i} {
|
||||
db close
|
||||
hexio_write test.db 2047 [format %02x $i]
|
||||
sqlite3 db test.db
|
||||
do_test date-14.2.$i {
|
||||
set date [db one {SELECT datetime(x) FROM t1}]
|
||||
expr {$date eq "2008-06-12 00:00:00" || $date eq "2008-06-11 23:59:59"}
|
||||
} {1}
|
||||
}
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user