de_mysqling

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: Re: what does this mysql statement mean?
From: Dave Lawrence <dkl@porkchop.redhat.com>
Date: Thu, 7 Dec 2000 23:40:24 -0500

On Thu, Dec 07, 2000 at 06:35:41PM +0000, Kevin Brannen claimed:
> As I'm going thru the SQL (to make it DB independent), I keep seeing SQL
> like:
> 
> SELECT cryptpassword = ENCRYPT($old, LEFT(cryptpassword, 2))
> FROM ...
> 

For the Oracle version i just move the ENCRYPT part out of the sql and 
replaced it with the perl function crypt(). Worked fine that way. Only
two places it had to be done, confirm_login and InsertNewUser.

> or
> 
> # from CGI.pl:535
> SELECT profiles.userid, profiles.groupset, profiles.login_name,
>   profiles.login_name = 'string' AND
>     profiles.cryptpassword = logincookies.cryptpassword AND
>     logincookies.hostname = 'string',
>   profiles.disabledtext
> FROM ...

Another MySQLism that needs to be removed for the rewrite. It is 
basically anded the three expressions together to come up with one
true or false value that is checked against.

> 
> etc.
> 
> where there is "WHERE" clause like stuff in the column list of the
> select.  I can't find an explanation in the mysql/manual.txt file.  Can
> someone please explain to me what it's doing?!
> 
> So far, I've been successful in replacing that stuff with equivalent
> code, but I'm wondering if I'm doing it correctly (as far as
> functionality goes).
> 
> Maybe my boss will continue to not assign me real work and I can get
> this done soon... :-)
> 

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu