SQLite

Check-in [72612a0373]
Login

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

Overview
Comment:Additional test cases for comparisons against NULL in the WHERE clause and elsewhere in a SELECT. (CVS 4051)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 72612a0373c7abf8aadfdeb46358c0b0ae7b07a0
User & Date: drh 2007-06-08 08:43:10.000
Context
2007-06-08
18:27
Use C-sylte comments exclusively, never C++ comments. Ticket #2406. (CVS 4052) (check-in: 8f5b789fea user: drh tags: trunk)
08:43
Additional test cases for comparisons against NULL in the WHERE clause and elsewhere in a SELECT. (CVS 4051) (check-in: 72612a0373 user: drh tags: trunk)
08:39
Make sure rowid comparisons against NULL work correctly. Ticket #2404. (CVS 4050) (check-in: 11ee8ea43f user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/where5.test.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing NULL comparisons in the WHERE clause.
# See ticket #2404.
#
# $Id: where5.test,v 1.1 2007/06/08 08:39:02 drh Exp $

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

# Build some test data
#
do_test where5-1.0 {







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing NULL comparisons in the WHERE clause.
# See ticket #2404.
#
# $Id: where5.test,v 1.2 2007/06/08 08:43:10 drh Exp $

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

# Build some test data
#
do_test where5-1.0 {
85
86
87
88
89
90
91











92
93
94
95
96
97
98
  }
} {}
do_test where5-1.11 {
  execsql {
    SELECT * FROM t1 WHERE x!=NULL
  }
} {}












do_test where5-2.0 {
  execsql {
    SELECT * FROM t2 WHERE x<0
  }
} {-1}
do_test where5-2.1 {







>
>
>
>
>
>
>
>
>
>
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
  }
} {}
do_test where5-1.11 {
  execsql {
    SELECT * FROM t1 WHERE x!=NULL
  }
} {}
do_test where5-1.12 {
  execsql {
    SELECT * FROM t1 WHERE x IS NULL
  }
} {}
do_test where5-1.13 {
  execsql {
    SELECT * FROM t1 WHERE x IS NOT NULL
  }
} {-1 0 1}


do_test where5-2.0 {
  execsql {
    SELECT * FROM t2 WHERE x<0
  }
} {-1}
do_test where5-2.1 {
146
147
148
149
150
151
152











153
154
155
156
157
158
159
  }
} {}
do_test where5-2.11 {
  execsql {
    SELECT * FROM t2 WHERE x!=NULL
  }
} {}












do_test where5-3.0 {
  execsql {
    SELECT * FROM t3 WHERE x<0
  }
} {-1}
do_test where5-3.1 {







>
>
>
>
>
>
>
>
>
>
>







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
  }
} {}
do_test where5-2.11 {
  execsql {
    SELECT * FROM t2 WHERE x!=NULL
  }
} {}
do_test where5-2.12 {
  execsql {
    SELECT * FROM t2 WHERE x IS NULL
  }
} {}
do_test where5-2.13 {
  execsql {
    SELECT * FROM t2 WHERE x IS NOT NULL
  }
} {-1 0 1}


do_test where5-3.0 {
  execsql {
    SELECT * FROM t3 WHERE x<0
  }
} {-1}
do_test where5-3.1 {
207
208
209
210
211
212
213



214




215











































216
  }
} {}
do_test where5-3.11 {
  execsql {
    SELECT * FROM t3 WHERE x!=NULL
  }
} {}




















































finish_test







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

229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
  }
} {}
do_test where5-3.11 {
  execsql {
    SELECT * FROM t3 WHERE x!=NULL
  }
} {}
do_test where5-3.12 {
  execsql {
    SELECT * FROM t3 WHERE x IS NULL
  }
} {}
do_test where5-3.13 {
  execsql {
    SELECT * FROM t3 WHERE x IS NOT NULL
  }
} {-1 0 1}

do_test where5-4.0 {
  execsql {
    SELECT x<NULL FROM t3
  }
} {{} {} {}}
do_test where5-4.1 {
  execsql {
    SELECT x<=NULL FROM t3
  }
} {{} {} {}}
do_test where5-4.2 {
  execsql {
    SELECT x==NULL FROM t3
  }
} {{} {} {}}
do_test where5-4.3 {
  execsql {
    SELECT x>NULL FROM t3
  }
} {{} {} {}}
do_test where5-4.4 {
  execsql {
    SELECT x>=NULL FROM t3
  }
} {{} {} {}}
do_test where5-4.5 {
  execsql {
    SELECT x!=NULL FROM t3
  }
} {{} {} {}}
do_test where5-4.6 {
  execsql {
    SELECT x IS NULL FROM t3
  }
} {0 0 0}
do_test where5-4.7 {
  execsql {
    SELECT x IS NOT NULL FROM t3
  }
} {1 1 1}

finish_test