SQLite

Check-in [a27b0b88]
Login

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

Overview
Comment:Changes to oserror.test so that it works even on systems that allow an unusually large number of file descriptors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a27b0b880d76c6838c0365f66bcd69b1b49b7594470993b608f4e490cbdc4882
User & Date: drh 2019-04-29 16:44:11
Context
2019-04-30
01:08
Slightly smaller and faster implementation of the OP_MakeRecord opcode. (check-in: 3bdce7ef user: drh tags: trunk)
2019-04-29
16:44
Changes to oserror.test so that it works even on systems that allow an unusually large number of file descriptors. (check-in: a27b0b88 user: drh tags: trunk)
13:48
Do not de-duplicate columns index columns associated with a WITHOUT ROWID table if the columns have different collating sequences. This is the fix for ticket [3182d3879020ef3b2]. There is one test case added, but most of the tests are done in TH3. (check-in: 1b1dd4d4 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/oserror.test.

48
49
50
51
52
53
54



55
56
57
58
59




60





61
62

63
64
65
66

67
68
69
70
71
72
73
#
# The xOpen() method of the unix VFS calls getcwd() as well as open().
# Although this does not appear to be documented in the man page, on OSX
# a call to getcwd() may fail if there are no free file descriptors. So
# an error may be reported for either open() or getcwd() here.
#
if {![clang_sanitize_address]} {



  do_test 1.1.1 {
    set ::log [list]
    list [catch {
      for {set i 0} {$i < 20000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
    } msg] $msg




  } {1 {unable to open database file}}





  do_test 1.1.2 {
    catch { for {set i 0} {$i < 20000} {incr i} { dbh_$i close } }

  } {1}
  do_re_test 1.1.3 { 
    lindex $::log 0 
  } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - }

}


# Test a failure in open() due to the path being a directory.
#
do_test 1.2.1 {
  file mkdir dir.db







>
>
>


|
|
|
>
>
>
>
|
>
>
>
>
>

|
>
|
|
|
|
>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# The xOpen() method of the unix VFS calls getcwd() as well as open().
# Although this does not appear to be documented in the man page, on OSX
# a call to getcwd() may fail if there are no free file descriptors. So
# an error may be reported for either open() or getcwd() here.
#
if {![clang_sanitize_address]} {
  unset -nocomplain rc
  unset -nocomplain nOpen
  set nOpen 20000
  do_test 1.1.1 {
    set ::log [list]
    set ::rc [catch {
      for {set i 0} {$i < $::nOpen} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
    } msg]
    if {$::rc==0} {
      # Some system (ex: Debian) are able to create 20000+ file descriptiors
      # such systems will not fail here
      set x ok
    } elseif {$::rc==1 && $msg=="unable to open database file"} {
      set x ok
    } else {
      set x [list $::rc $msg]
    }
  } {ok}
  do_test 1.1.2 {
    catch { for {set i 0} {$i < $::nOpen} {incr i} { dbh_$i close } }
  } $::rc
  if {$rc} {
    do_re_test 1.1.3 { 
      lindex $::log 0 
    } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - }
  }
}


# Test a failure in open() due to the path being a directory.
#
do_test 1.2.1 {
  file mkdir dir.db