Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/notnullfault.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / notnullfault.test` 55 lines ยท 1392 bytes Raw Blame History 1 # 2021 February 15 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 6 # May you do good and not evil. 7 # May you find forgiveness for yourself and forgive others. 8 # May you share freely, never taking more than you give. 9 # 10 #*********************************************************************** 11 # This file implements regression tests for SQLite library. The 12 # focus of this file is testing optimizations associated with "IS NULL" 13 # and "IS NOT NULL" operators on columns with NOT NULL constraints. 14 # 15 16 set testdir [file dirname $argv0] 17 source $testdir/tester.tcl 18 set testprefix notnullfault 19 20 do_execsql_test 1.0 { 21 CREATE TABLE t1(a, b); 22 CREATE TABLE t2(c, d NOT NULL); 23 } 24 faultsim_save_and_close 25 26 do_faultsim_test 1 -prep { 27 faultsim_restore_and_reopen 28 } -body { 29 execsql { 30 SELECT * FROM t2 WHERE d NOT NULL 31 } 32 } -test { 33 faultsim_test_result {0 {}} 34 } 35 36 #------------------------------------------------------------------------- 37 reset_db 38 do_execsql_test 2.0 { 39 CREATE TABLE t1(a, b, c); 40 CREATE TABLE t2(a, b, c, PRIMARY KEY(a, b, c)) WITHOUT ROWID; 41 } 42 faultsim_save_and_close 43 44 do_faultsim_test 2.1 -faults oom-t* -prep { 45 faultsim_restore_and_reopen 46 } -body { 47 execsql { 48 SELECT dense_rank() OVER win FROM t2 49 WINDOW win AS (ORDER BY c IS NULL) 50 } 51 } -test { 52 faultsim_test_result {0 {}} 53 } 54 55 finish_test