List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:February 11 2003 6:15pm
Subject:Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]
View as plain text  
Hi!

> Sergei,
> 
> Thanks, although I'm still wondering about why the NULL-always-sorts-first
> change was made for 4.0.2.  Wasn't that done for ANSI compliance?  Did
> the ANSI spec change?

No. A user pointed out that according to ANSI, NULL's should be always
first (or last, may be). Monty checked up the specs, and, as this issue
was described somewhat vague, believed that the user was right.

Now, another customer complained, and Peter Gulutzan's understanding was
that old behaviour was correct. And, btw, majority of DBMS vendors
implemented it the way MySQL does now (or did before 4.0.2).

ANSI Specs (copy-pasted from customer's email, I didn't check that):

  ANSI X3.135-1992 (Database Language SQL) in section 13.1, General 
  Rule 3)b), page 309, says "Whether a sort key value that is null is
  considered greater or less than a non-null value is implementation-
  defined, but all sort key values that are null shall either be
  considered greater than all non-null values or be considered less than
  all non-null values."

Database comparison (according to Peter Gulutzan):
 
                    NULLs Sort
  ANSI SQL         Low Or High
  DB2              High
  Informix         Low
  Ingres           High
  InterBase        At End
  SQL Server       Low
  Oracle           High
  Sybase           Low

Regards,
Sergei

-- 
MySQL Development Team
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/
Thread
bk commit into 4.0 tree (1.1560)monty6 Feb
  • Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Paul DuBois7 Feb
    • Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Sergei Golubchik10 Feb
      • Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Paul DuBois10 Feb
        • Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Sergei Golubchik11 Feb
          • Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Michael Widenius16 Feb
            • Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Paul DuBois16 Feb
Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Peter Gulutzan11 Feb
Re: bk commit into 4.0 tree (1.1560)[ARRRRRRGGGGGGHHHHHHH!!!!!]Peter Gulutzan11 Feb
Re: bk commit into 4.0 tree (1.1560) [ARRRRRRGGGGGGHHHHHHH!!!!!]Peter Gulutzan17 Feb