1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Log all error from close() in os_unix.c to sqlite3_log() but do not attempt to

report errors back up to the application.  Update the unix error logging to
put the most important information earlier in the message.

FossilOrigin-Name: 7b6e30e6a712311d4ef275253b085b85e6e17116
This commit is contained in:
drh
2011-03-02 02:08:13 +00:00
parent 30f776fadb
commit 0e9365ced3
4 changed files with 77 additions and 97 deletions

View File

@ -56,7 +56,7 @@ do_test 1.1.2 {
catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } }
} {1}
do_re_test 1.1.3 { lindex $::log 0 } {^os_unix.c: open.*test.db$}
do_re_test 1.1.3 { lindex $::log 0 } {^os_unix.c:\d*: \(24\) open\(.*test.db\) - }
# Test a failure in open() due to the path being a directory.
@ -67,7 +67,7 @@ do_test 1.2.1 {
list [catch { sqlite3 dbh dir.db } msg] $msg
} {1 {unable to open database file}}
do_re_test 1.2.2 { lindex $::log 0 } {^os_unix.c: open.*dir.db$}
do_re_test 1.2.2 { lindex $::log 0 } {^os_unix.c:\d*: \(21\) open\(.*dir.db\) - }
# Test a failure in open() due to the path not existing.
#
@ -76,7 +76,7 @@ do_test 1.3.1 {
list [catch { sqlite3 dbh /x/y/z/test.db } msg] $msg
} {1 {unable to open database file}}
do_re_test 1.3.2 { lindex $::log 0 } {^os_unix.c: open.*test.db$}
do_re_test 1.3.2 { lindex $::log 0 } {^os_unix.c:\d*: \(2\) open\(.*test.db\) - }
# Test a failure in open() due to the path not existing.
#
@ -85,7 +85,7 @@ do_test 1.4.1 {
list [catch { sqlite3 dbh /root/test.db } msg] $msg
} {1 {unable to open database file}}
do_re_test 1.4.2 { lindex $::log 0 } {^os_unix.c: open.*test.db$}
do_re_test 1.4.2 { lindex $::log 0 } {^os_unix.c:\d*: \(13\) open\(.*test.db\) - }
#--------------------------------------------------------------------------
# Tests oserror-1.* test failures in the unlink() system call.
@ -98,7 +98,7 @@ do_test 2.1.1 {
catchsql { SELECT * FROM sqlite_master } dbh
} {1 {disk I/O error}}
do_re_test 2.1.2 { lindex $::log 0 } {^os_unix.c: unlink.*test.db-wal$}
do_re_test 2.1.2 { lindex $::log 0 } {^os_unix.c:\d*: \(21\) unlink\(.*test.db-wal\) - }
do_test 2.1.3 {
dbh close
forcedelete test.db-wal
@ -109,4 +109,3 @@ sqlite3_shutdown
test_sqlite3_log
sqlite3_initialize
finish_test