> 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):
ANSI SQL Low Or High
InterBase At End
SQL Server Low
MySQL Development Team
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, http://www.mysql.com/
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany