[Wifidog] More MySQL Problems (With Patch) in WifiDog-Auth SQL code,

Alexandre Carmel-Veilleux saruman at northernhacking.org
Thu Sep 30 17:51:02 EDT 2004

On Thu, Sep 30, 2004 at 04:37:15PM -0400, Yanik Crépeau wrote:
> By the way, who else had the idea to print the time
> up to the nanosecond (10 power minus 9 second)? No
> computer has a clock in sync with the official time
> of the Bureau international de l'heure to this

	This is the default behaviour of postgresql however. It can be
very useful if your data guenuinely has that kind of precision, like if
you had a cesium time source and calculated intervals based on it as the
gold standard.

	Not that I do, but I'm just saying...

> Let me try to understand:
> [...]
> 	WHERE (user_id = '$user' OR email = '$user')
> [...]
> Would be replaced by:
> [...]
> 	WHERE (users.user_id = '$user' OR email = '$user')
> [...]

	To me, this seems like a bug. It should either work in both or
fail in both.

> In my humble opinion it is always a good id to qualify column's name with
> [...]

	Nice in practice, but it should fail nicely.

> Since the SQL schema is gone from the cvs server, it is a good practice to give
> some extra explanations for people to will come later to do the code
> maintenance. Let's try to imagine someone, not involved in the project at the
> moment (2004), in 5 years trying to understand how to fix a problem.

	The schema should be back in the CVS, IMHO.

> In opensource/team development, the "SELECT *" could even be a bad idea. It
> assume that the table schema is frozen for ever or, worse, that future changes
> won't affect the today's code. This is an open door to break everything when we
> just change a column type for another (char(32) to varchar(32) for instance) and
> it forces the sql engine to work harder to get/handle/sort/display unneeded data.

	In the case of PHP, it will not "break" anything because you can
refer to fields by name.

> The "NATURAL JOIN" is not a good idea either. Implicit ways to join two tables
> [...]

	This is likely to be the problem with MySQL defining both pre-join
and post-join values for user_id while PostgreSQL only keeps one such
column. I've never been big on non-explicit joins, although merely because
I like relationships stated explicitely.


Wifidog mailing list
Wifidog at isf.waglo.com

More information about the Wifidog mailing list