MYSQL INET_ATON. DID I FIND A BUG OR IS THIS KNOWN?

Lady Bird Johnson

Total Post:20

Points:140
Posted by  Lady Bird Johnson
MYSQL 
 1652  View(s)
Ratings:
Rate this:
Hi Developers,

Is this a known problem?

select * from 'tablename' where INET_ATON('any valid ip');
Shows the entire db. I accidentally forget to add ipaddress = INET_ATON('ip'); and cganged the entire db.

Thanks in advance. 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: MYSQL INET_ATON. Did I find a bug or is this known?

    Hi Lady!

    I don't see anything wrong with all rows returned. INET_ATON will return number > 0 if IP is valid OR NULL if IP is invalid. Which means, it's like issuing query

    SELECT * FROM `tablename` WHERE 1
    (or any other positive number) which will return all rows.

    Thanks in advance.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!