List:General Discussion« Previous MessageNext Message »
From:Joerg Bruehe Date:June 15 2010 9:36am
Subject:Re: alias problem and odd warnings
View as plain text  
Hi Brian, all!

brian wrote:
> On 10-06-14 09:13 PM, brian wrote:
>> [[...]]
>> This not only gives an empty set, but also throws 171 warnings (more on
>> that below). I've remove both the WHERE and GROUP BY clauses with no
>> success. I've been staring at this for an hour now and can't see what
>> the trouble is. Can any of you?
> Solved. I just noticed the quoting difference here:
> ON `Member`.`country_id` = ''
> is entirely wrapped in single quotes rather than the alias
> and column being separately wrapped with back-ticks. I've changed my
> code so that the query is created properly.

Quote inserted by Jörg:
>> As for the warnings:
>> Warning | 1292 | Truncated incorrect DOUBLE value: ''

> I'm still curious about the strange warning, though.

AIUI, the wrong quotes in your statement made the parser take
as a string, which was then to be compared to an integer (the country_id
column). This comparison forced a conversion from string to number, and
the string contained a dot which was assumed to be a decimal point,
hence a floating point number.

If 171 is the number of rows in your countries table, then it is also
the number of times this comparison is done.

The warnings should be gone, I assume, now that you fixed the quoting.


Joerg Bruehe,  MySQL Build Team,  Joerg.Bruehe@stripped
Sun Microsystems GmbH,   Komturstrasse 18a,   D-12099 Berlin
Geschaeftsfuehrer: Juergen Kunz
Amtsgericht Muenchen: HRB161028

alias problem and odd warningsbrian15 Jun
  • Re: alias problem and odd warningsbrian15 Jun
    • Re: alias problem and odd warningsJoerg Bruehe15 Jun