-C Make\sthe\ssqliteOsCurrentTime()\sfunction\swork\sfor\sWindows.\s\sCode\scontributed\nby\s"e4liberty"\son\sthe\smailing\slist.\s(CVS\s1071)
-D 2003-08-10T16:16:22
+C Update\sthe\sNULL-handling\schart\swith\snew\sinformation\sabout\sFirebird.\s(CVS\s1072)
+D 2003-08-13T11:29:24
F Makefile.in 9ad23ed4ca97f9670c4496432e3fbd4b3760ebde
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F www/index.tcl 64f867e40c1c4a8a0ffe560ec372df737ceeaec5
F www/lang.tcl 5f39bbda1ba38a28f18f97bd98c81f40355393b2
F www/mingw.tcl d96b451568c5d28545fefe0c80bee3431c73f69c
-F www/nulls.tcl 4ac1c9bbb8a20a76500d18d63b383f51bb7d8be7
+F www/nulls.tcl 9cb56d98c0c623074cda4360a415f3f0a7074c90
F www/omitted.tcl fe59eaa9c1459cbf08fa7daa83421bfc814331bb
F www/opcode.tcl b8d561f33597c62955796b797646f00144d97332
F www/quickstart.tcl 4e97bef825e6a4153c43afb9f97235fc4da278ab
F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
-P 94243edac14b90ef898093b85e1959c20fa23ae9
-R d06ee94e7e293f14bb7a17592af45795
+P 02fac304c9ec9012f3cc4f04d2c4cac5e37b0024
+R c5c60d7816b69e7ad636fa582dc70cef
U drh
-Z c133f327a7247010c46dbc5ed1b64175
+Z 5cc44053e6e9f069f799212980612ed0
#
# Run this script to generated a nulls.html output file
#
-set rcsid {$Id: nulls.tcl,v 1.3 2003/07/07 00:10:40 drh Exp $}
+set rcsid {$Id: nulls.tcl,v 1.4 2003/08/13 11:29:24 drh Exp $}
puts {<html>
<head>
A SQL test script was developed and run by volunteers on various
SQL RDBMSes and the results of those tests were used to deduce
how each engine processed NULL values.
+The original tests were run in May of 2002.
A copy of the test script is found at the end of this document.
</p>
<tt>sqliteInt.h</tt> source file and recompile.
</p>
+<blockquote>
+<p>
+<i>Update 2003-07-13:</i>
+Since this document was originally written some of the database engines
+tested have been updated and users have been kind enough to send in
+corrections to the chart below. The original data showed a wide variety
+of behaviors, but over time the range of behaviors has converged toward
+the PostgreSQL/Oracle model. The only significant difference
+is that Informix and MS-SQL both threat NULLs as
+indistinct in a UNIQUE column.
+</p>
+
+<p>
+The fact that NULLs are distinct for UNIQUE columns but are indistinct for
+SELECT DISTINCT and UNION continues to be puzzling. It seems that NULLs
+should be either distinct everywhere or nowhere. And the SQL standards
+documents suggest that NULLs should be distinct everywhere. Yet as of
+this writing, no SQL engine tested treats NULLs as distinct in a SELECT
+DISTINCT statement or in a UNION.
+</p>
+</blockquote>
+
+
<p>
The following table shows the results of the NULL handling experiments.
</p>
</tr>
<tr><td>nulls are distinct in SELECT DISTINCT</td>
<td valign="center" align="center" bgcolor="#c7a9a9">No</td>
-<td valign="center" align="center" bgcolor="#aaaad2">(Note 1)</td>
+<td valign="center" align="center" bgcolor="#c7a9a9">No (Note 1)</td>
<td valign="center" align="center" bgcolor="#c7a9a9">No</td>
<td valign="center" align="center" bgcolor="#c7a9a9">No</td>
</tr>
<tr><td>nulls are distinct in a UNION</td>
<td valign="center" align="center" bgcolor="#aaaad2">(Note 3)</td>
-<td valign="center" align="center" bgcolor="#aaaad2">(Note 1)</td>
+<td valign="center" align="center" bgcolor="#c7a9a9">No (Note 1)</td>
<td valign="center" align="center" bgcolor="#c7a9a9">No</td>
<td valign="center" align="center" bgcolor="#c7a9a9">No</td>
</tr>
<tr><td>"CASE WHEN null THEN 1 ELSE 0 END" is 0?</td>
<td valign="center" align="center" bgcolor="#a9c7a9">Yes</td>
-<td valign="center" align="center" bgcolor="#aaaad2">(Note 2)</td>
+<td valign="center" align="center" bgcolor="#a9c7a9">Yes</td>
<td valign="center" align="center" bgcolor="#a9c7a9">Yes</td>
<td valign="center" align="center" bgcolor="#aaaad2">(Note 5)</td>
</tr>
<tr>
<td valign="top" rowspan=5>Notes: </td>
<td>1. </td>
-<td>Firebird omits all NULLs from SELECT DISTINCT and from UNION.</td>
+<td>Older versions of firebird omits all NULLs from SELECT DISTINCT
+and from UNION.</td>
</tr>
<tr><td>2. </td>
<td>Test data unavailable.</td>