NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL is very smart - but why does this work?

Tim Sailer sailer at bnl.gov
Tue Dec 23 08:31:19 EST 2003


On Tue, Dec 23, 2003 at 08:24:32AM -0500, Hans Zaunere wrote:
> > SELECT * FROM archives WHERE genre_match = 2
> > 
> > it selects the rows whose genre_match column has the following info
> > - 2
> > - 2, 34, 96
> > - 14, 2, 25
> 
> To be honest, I'm not sure why that works - but I wouldn't rely on it.
> My initial guess is that some esoteric cast behavior is surfacing, since
> that behavior is undocumented AFAIK.  I'd recommend doing it The Right
> Way (tm).

I agree. It looks like the server is casting it to the 'set' type. I would
play with that, since it's looking like that kind of behavior is what you
want. Like Hans said, don't rely on undocumented behaviour.

Tim

-- 
Tim Sailer <sailer at bnl.gov> 
Information and Special Technologies Program
Office of CounterIntelligence 
Brookhaven National Laboratory  (631) 344-3001



More information about the talk mailing list