title: MySQL Truncated incorrect DOUBLE value?
body: <p>I have a GeoIP table in MySQL.
  The IP ranges are defined with <code>BINARY(16)</code>.
  When I look up the IP address with the query:</p>
  
  <pre><code>SELECT `countries_countryID` FROM `geoIP` WHERE INET_ATON("84.224.199.84") BETWEEN `geoIP`.`ipFrom` AND `geoIP`.`ipTo` LIMIT 1;
  </code></pre>
  
  <p>I get warning messages (20-30000), saying: <code>"Truncated incorrect DOUBLE value: '17498112\x00\x00\x00\x00\x00\x00\x00\x00'"</code></p>
  
  <p>The Table:</p>
  
  <pre><code>DROP TABLE IF EXISTS `geoIP` ;
  
  CREATE  TABLE IF NOT EXISTS `geoIP` (
    `geoIPID` INT NOT NULL AUTO_INCREMENT ,
    `IPFrom` BINARY(16) NOT NULL ,
    `IPTo` BINARY(16) NOT NULL ,
    `countries_countryID` INT NOT NULL ,
    PRIMARY KEY (`geoIPID`) ,
    INDEX `fk_geoIP_countries1_idx` (`countries_countryID` ASC) ,
    INDEX `IPTo_INDEX` (`IPTo` ASC) ,
    INDEX `IPFrom_INDEX` (`IPFrom` ASC) ,
    CONSTRAINT `fk_geoIP_countries1`
      FOREIGN KEY (`countries_countryID` )
      REFERENCES `countries` (`countryID` )
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  </code></pre>
  
  <p>The result is correct, the country code is returned correctly, but there are theese warning messages. What is wrong?</p>