From: drh Date: Wed, 13 Aug 2003 11:29:23 +0000 (+0000) Subject: Update the NULL-handling chart with new information about Firebird. (CVS 1072) X-Git-Tag: version-3.6.10~4996 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2446f9bbf827baac83026f836b0a9d77afc5fbc;p=thirdparty%2Fsqlite.git Update the NULL-handling chart with new information about Firebird. (CVS 1072) FossilOrigin-Name: 17bdfeb284880d82cd546e6c191c3a37121ec861 --- diff --git a/manifest b/manifest index 23e421eaf4..6cd51e8ddd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -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 @@ -160,7 +160,7 @@ F www/formatchng.tcl ca6cc1cb1bef9bc36f0619049d3c95e749bc6983 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 @@ -168,7 +168,7 @@ F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3 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 diff --git a/manifest.uuid b/manifest.uuid index af25ccb45f..1f397b7b48 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -02fac304c9ec9012f3cc4f04d2c4cac5e37b0024 \ No newline at end of file +17bdfeb284880d82cd546e6c191c3a37121ec861 \ No newline at end of file diff --git a/www/nulls.tcl b/www/nulls.tcl index 699830b632..ef933ae120 100644 --- a/www/nulls.tcl +++ b/www/nulls.tcl @@ -1,7 +1,7 @@ # # 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 { @@ -33,6 +33,7 @@ was to make SQLite work like all the other engines. 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.

@@ -55,6 +56,29 @@ change the value of the NULL_ALWAYS_DISTINCT #define in the sqliteInt.h source file and recompile.

+
+

+Update 2003-07-13: +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. +

+ +

+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. +

+
+ +

The following table shows the results of the NULL handling experiments.

@@ -172,19 +196,19 @@ The following table shows the results of the NULL handling experiments. nulls are distinct in SELECT DISTINCT No -(Note 1) +No (Note 1) No No nulls are distinct in a UNION (Note 3) -(Note 1) +No (Note 1) No No "CASE WHEN null THEN 1 ELSE 0 END" is 0? Yes -(Note 2) +Yes Yes (Note 5) @@ -206,7 +230,8 @@ The following table shows the results of the NULL handling experiments. Notes:   1.  -Firebird omits all NULLs from SELECT DISTINCT and from UNION. +Older versions of firebird omits all NULLs from SELECT DISTINCT +and from UNION. 2.  Test data unavailable.