From c5aceb33cbb4cdc6f0456ae82e885111893988e3 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 1 Jul 2003 01:16:30 +0000 Subject: [PATCH] Update the null-handling document to show how SQL Anywhere and Borland Interbase deal with NULLs. (CVS 1043) FossilOrigin-Name: 9a87f2f326d7fc8bb9f832d0e3fd31141e14e08f --- manifest | 12 +++--- manifest.uuid | 2 +- www/nulls.tcl | 105 ++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 84 insertions(+), 35 deletions(-) diff --git a/manifest b/manifest index 8f0d0c6e87..3601d13749 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Documentation\schange:\srefer\susers\sto\sthe\swiki\sfor\sadditional\sunsupported\nfeatures\srather\sthan\shave\sthem\ssend\sme\se-mail.\s(CVS\s1042) -D 2003-06-30T10:36:23 +C Update\sthe\snull-handling\sdocument\sto\sshow\show\sSQL\sAnywhere\sand\sBorland\nInterbase\sdeal\swith\sNULLs.\s(CVS\s1043) +D 2003-07-01T01:16:30 F Makefile.in 9ad23ed4ca97f9670c4496432e3fbd4b3760ebde F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -159,7 +159,7 @@ F www/formatchng.tcl ca6cc1cb1bef9bc36f0619049d3c95e749bc6983 F www/index.tcl a34315cada875af0b098b4c45981da8ab33fe7b6 F www/lang.tcl 2890eb85809c8fca20c1d81fa30fbdbceecc2a43 F www/mingw.tcl d96b451568c5d28545fefe0c80bee3431c73f69c -F www/nulls.tcl 29497dac2bc5b437aa7e2e94577dad4d8933ed26 +F www/nulls.tcl f0304bc4dbe344f4738e52ad45906c5ffd289fbb F www/omitted.tcl fe59eaa9c1459cbf08fa7daa83421bfc814331bb F www/opcode.tcl b8d561f33597c62955796b797646f00144d97332 F www/quickstart.tcl 4e97bef825e6a4153c43afb9f97235fc4da278ab @@ -167,7 +167,7 @@ F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3 F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 -P 7f5e8894ae37761d1015c426b5d383d3deef3e25 -R a6cc3a4266f28cd733e63c9a8d83c011 +P a3920b0804e9993bb21e6c46c612e72bd03178a2 +R a8b083bb866a87dcf70f77ed1fb561d9 U drh -Z eacae768ac4a586e6c3db54c44a1bdf7 +Z 3174cbe95c851c7270578015eafa897d diff --git a/manifest.uuid b/manifest.uuid index fe292b0632..117d1618f9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a3920b0804e9993bb21e6c46c612e72bd03178a2 \ No newline at end of file +9a87f2f326d7fc8bb9f832d0e3fd31141e14e08f \ No newline at end of file diff --git a/www/nulls.tcl b/www/nulls.tcl index ee7b5f92fd..5873280a1f 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.1 2002/09/02 14:11:04 drh Exp $} +set rcsid {$Id: nulls.tcl,v 1.2 2003/07/01 01:16:30 drh Exp $} puts { @@ -67,9 +67,6 @@ The following table shows the results of the NULL handling experiments. Informix DB2 MS-SQL -MySQL -OCELOT -Firebird Adding anything to null gives null @@ -79,9 +76,6 @@ The following table shows the results of the NULL handling experiments. Yes Yes Yes -Yes -Yes -Yes Multiplying null by zero gives null Yes @@ -90,9 +84,6 @@ The following table shows the results of the NULL handling experiments. Yes Yes Yes -Yes -Yes -Yes nulls are distinct in a UNIQUE index Yes @@ -101,9 +92,6 @@ The following table shows the results of the NULL handling experiments. No Yes No -Yes -Yes -Yes nulls are distinct in SELECT DISTINCT No @@ -112,9 +100,6 @@ The following table shows the results of the NULL handling experiments. No No No -No -Yes -(Note 1) nulls are distinct in a UNION No @@ -123,9 +108,6 @@ The following table shows the results of the NULL handling experiments. No No No -(Note 3) -Yes -(Note 1) "CASE WHEN null THEN 1 ELSE 0 END" is 0? Yes @@ -134,9 +116,6 @@ The following table shows the results of the NULL handling experiments. Yes Yes Yes -Yes -Yes -(Note 2) "null OR true" is true Yes @@ -145,9 +124,6 @@ The following table shows the results of the NULL handling experiments. Yes Yes Yes -Yes -No -Yes "not (null AND false)" is true Yes @@ -156,22 +132,95 @@ The following table shows the results of the NULL handling experiments. Yes Yes Yes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  MySQLOCELOTFirebirdSQL AnywhereBorland Interbase
Adding anything to null gives nullYesYesYesYesYes
Multiplying null by zero gives nullYesYesYesYesYes
nulls are distinct in a UNIQUE indexYesYesYes(Note 4)(Note 4)
nulls are distinct in SELECT DISTINCTNoYes(Note 1) No No
nulls are distinct in a UNION(Note 3)Yes(Note 1)NoNo
"CASE WHEN null THEN 1 ELSE 0 END" is 0?YesYes(Note 2)Yes(Note 5)
"null OR true" is trueYesNoYesYesYes
"not (null AND false)" is trueNoNoYesYes Yes
- + - + + - + + + + + + + +
Notes:  Notes:   1.  Firebird omits all NULLs from SELECT DISTINCT and from UNION.
2. Test data unavailable.
Test data unavailable.
3. The version of MySQL tested (3.23.41) does not support UNION.
The version of MySQL tested (3.23.41) does not support UNION.
4. SQL Anywhere and Borland Interbase +do not allow NULLs in a UNIQUE column.
5. Borland Interbase does not support CASE expressions.