Yesterday I noticed that we use the SQL != syntax instead of the ANSI standard <> syntax. This seems like a cross-database compatability problem to me, and I've written a coder rule in the SQL review to check for it. It found about 20 uses of this in core. But I haven't committed it yet. I'd like to get feedback if others think that this is a problem. Thanks! -- Doug Green douggreen@douggreenconsulting.com 904-583-3342 Bringing Ideas to Life with Software Artistry and Invention...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Doug Green schrieb:
Yesterday I noticed that we use the SQL != syntax instead of the ANSI standard <> syntax. This seems like a cross-database compatability problem to me, and I've written a coder rule in the SQL review to check for it. It found about 20 uses of this in core. But I haven't committed it yet. I'd like to get feedback if others think that this is a problem.
Can you give us links to: 1) the ANSI specs, 2) the MySQL and postgres specs which mention thie operator? If it indeed is ANSI and both MySQL and Postgres are fine with it I propose to change the coding standard to demand <> being used. Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG98mMfg6TFvELooQRAlo7AJ42nP40k/vf2B9YKxU8s4oeZo3FSwCfXGt1 3mCxTat3TCt9hyZaLi0vrIs= =tnkf -----END PGP SIGNATURE-----
ANSI 2003 - http://savage.net.au/SQL/sql-2003-2.bnf - search for <not equals operator>: <not equals operator> ::= <less than operator> <greater than operator> MySQL - http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html - supports both != and <> Postgres - http://www.faqs.org/docs/ppbook/c7547.htm - supports both These aren't the official links (with the exception of MySQL) Gerhard Killesreiter wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Doug Green schrieb:
Yesterday I noticed that we use the SQL != syntax instead of the ANSI standard <> syntax. This seems like a cross-database compatability problem to me, and I've written a coder rule in the SQL review to check for it. It found about 20 uses of this in core. But I haven't committed it yet. I'd like to get feedback if others think that this is a problem.
Can you give us links to:
1) the ANSI specs, 2) the MySQL and postgres specs
which mention thie operator?
If it indeed is ANSI and both MySQL and Postgres are fine with it I propose to change the coding standard to demand <> being used.
Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFG98mMfg6TFvELooQRAlo7AJ42nP40k/vf2B9YKxU8s4oeZo3FSwCfXGt1 3mCxTat3TCt9hyZaLi0vrIs= =tnkf -----END PGP SIGNATURE-----
-- Doug Green douggreen@douggreenconsulting.com 904-583-3342 Bringing Ideas to Life with Software Artistry and Invention...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Doug Green schrieb:
ANSI 2003 - http://savage.net.au/SQL/sql-2003-2.bnf - search for <not equals operator>:
<not equals operator> ::= <less than operator> <greater than operator>
MySQL - http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html - supports both != and <> Postgres - http://www.faqs.org/docs/ppbook/c7547.htm - supports both
These aren't the official links (with the exception of MySQL)
Good enough for me. Anybody got objections? Doug, can you roll a patch? Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG9+dHfg6TFvELooQRAiuoAJ9i2UTmuvp658k9F9fkBMWgttsv4QCeNtpN edtuogG55k1hqs7qEN7I/Ps= =ka4x -----END PGP SIGNATURE-----
On Mon, 24 Sep 2007 18:35:19 +0200, Gerhard Killesreiter <gerhard@killesreiter.de> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Doug Green schrieb:
ANSI 2003 - http://savage.net.au/SQL/sql-2003-2.bnf - search for <not equals operator>:
<not equals operator> ::= <less than operator> <greater than operator>
MySQL - http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html - supports both != and <> Postgres - http://www.faqs.org/docs/ppbook/c7547.htm - supports both
These aren't the official links (with the exception of MySQL)
Good enough for me. Anybody got objections? Doug, can you roll a patch?
Cheers, Gerhard
Honestly, I usually use NOT (blah) anyway, as != never seemed to like me in MySQL, either. :-) (And because <> struck me as too VB-ish, but I guess I can get over that.) --Larry Garfield
Gerhard Killesreiter wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Doug Green schrieb:
ANSI 2003 - http://savage.net.au/SQL/sql-2003-2.bnf - search for <not equals operator>:
<not equals operator> ::= <less than operator> <greater than operator>
MySQL - http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html - supports both != and <> Postgres - http://www.faqs.org/docs/ppbook/c7547.htm - supports both
These aren't the official links (with the exception of MySQL)
Good enough for me. Anybody got objections? Doug, can you roll a patch?
I've added it to the coder SQL review. I'll let someone else roll the patch for core... I'm working on trying to get http://drupal.org/node/146466 (Remove temporary table usage from search module) into 6.x.
Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFG9+dHfg6TFvELooQRAiuoAJ9i2UTmuvp658k9F9fkBMWgttsv4QCeNtpN edtuogG55k1hqs7qEN7I/Ps= =ka4x -----END PGP SIGNATURE-----
-- Doug Green douggreen@douggreenconsulting.com 904-583-3342 Bringing Ideas to Life with Software Artistry and Invention...
Quoting Doug Green <douggreen@douggreenconsulting.com>:
ANSI 2003 - http://savage.net.au/SQL/sql-2003-2.bnf - search for <not equals operator>:
<not equals operator> ::= <less than operator> <greater than operator>
MySQL - http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html - supports both != and <> Postgres - http://www.faqs.org/docs/ppbook/c7547.htm - supports both
These aren't the official links (with the exception of MySQL)
Oracle supports both. Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
participants (4)
-
Doug Green -
Earnie Boyd -
Gerhard Killesreiter -
Larry Garfield