/ Check-in [fe197955]
Login

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

Overview
Comment:Update test helper procedure 'get_pwd' to handle the ComSpec environment variable being absent.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fe1979552f43e0526f16481457e01981f29707401f77079f9854a8d91b35b5a4
User & Date: mistachkin 2021-01-18 19:27:56
Context
2021-01-18
19:28
Fix harmless compiler warnings seen with MSVC. (check-in: dc7938d2 user: mistachkin tags: trunk)
19:27
Update test helper procedure 'get_pwd' to handle the ComSpec environment variable being absent. (check-in: fe197955 user: mistachkin tags: trunk)
12:35
Enhance the query planner so that it is able to code EXISTS operators in the WHERE clause as if they were IN operators, when appropriate. (check-in: c1862abb user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/crash5.test.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Only run these tests if memory debugging is turned on.
#
ifcapable !crashtest||!memorymanage {
   puts "Skipping crash5 tests: not compiled with -DSQLITE_MEMDEBUG..."
   finish_test
   return
}

db close

for {set ii 0} {$ii < 10} {incr ii} {







|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Only run these tests if memory debugging is turned on.
#
ifcapable !crashtest||!memorymanage {
   puts "Skipping crash5 tests: not compiled with -DSQLITE_ENABLE_MEMORY_MANAGEMENT..."
   finish_test
   return
}

db close

for {set ii 0} {$ii < 10} {incr ii} {
45
46
47
48
49
50
51






52
53
54
55
56
57
58
59
60
    db close

    do_test crash5-$ii.$jj.1 {
      crashsql -delay 1 -file test.db-journal -seed $ii -tclbody [join [list \
        [list set iFail $jj] {
        proc get_pwd {} {
          if {$::tcl_platform(platform) eq "windows"} {






            return [string map [list \\ /] \
              [string trim [exec -- $::env(ComSpec) /c echo %CD%]]]
          } else {
            return [pwd]
          }
        }
        sqlite3_crashparams 0 [file join [get_pwd] test.db-journal]
      
        # Begin a transaction and evaluate a "CREATE INDEX" statement







>
>
>
>
>
>

|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    db close

    do_test crash5-$ii.$jj.1 {
      crashsql -delay 1 -file test.db-journal -seed $ii -tclbody [join [list \
        [list set iFail $jj] {
        proc get_pwd {} {
          if {$::tcl_platform(platform) eq "windows"} {
            if {[info exists ::env(ComSpec)]} {
              set comSpec $::env(ComSpec)
            } else {
              # NOTE: Hard-code the typical default value.
              set comSpec {C:\Windows\system32\cmd.exe}
            }
            return [string map [list \\ /] \
              [string trim [exec -- $comSpec /c echo %CD%]]]
          } else {
            return [pwd]
          }
        }
        sqlite3_crashparams 0 [file join [get_pwd] test.db-journal]
      
        # Begin a transaction and evaluate a "CREATE INDEX" statement

Changes to test/tester.tcl.

170
171
172
173
174
175
176






177
178
179
180
181
182
183
184
185
proc get_pwd {} {
  if {$::tcl_platform(platform) eq "windows"} {
    #
    # NOTE: Cannot use [file normalize] here because it would alter the
    #       case of the result to what Tcl considers canonical, which would
    #       defeat the purpose of this procedure.
    #






    return [string map [list \\ /] \
        [string trim [exec -- $::env(ComSpec) /c echo %CD%]]]
  } else {
    return [pwd]
  }
}

# Copy file $from into $to. This is used because some versions of
# TCL for windows (notably the 8.4.1 binary package shipped with the







>
>
>
>
>
>

|







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
proc get_pwd {} {
  if {$::tcl_platform(platform) eq "windows"} {
    #
    # NOTE: Cannot use [file normalize] here because it would alter the
    #       case of the result to what Tcl considers canonical, which would
    #       defeat the purpose of this procedure.
    #
    if {[info exists ::env(ComSpec)]} {
      set comSpec $::env(ComSpec)
    } else {
      # NOTE: Hard-code the typical default value.
      set comSpec {C:\Windows\system32\cmd.exe}
    }
    return [string map [list \\ /] \
        [string trim [exec -- $comSpec /c echo %CD%]]]
  } else {
    return [pwd]
  }
}

# Copy file $from into $to. This is used because some versions of
# TCL for windows (notably the 8.4.1 binary package shipped with the