Bug #51530 Selecting a single column returns incorrect data
Submitted: 25 Feb 2010 22:47 Modified: 25 Feb 2010 23:00
Reporter: Aaron Macks Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5,1,37 OS:Linux
Assigned to: CPU Architecture:Any

[25 Feb 2010 22:47] Aaron Macks
Description:
If I select a single column (ip_src) from a large table 13million rows (utf8, myIsam) it returns incorrect data, a collection of values near 3741305578.  If I select more than one column, it returns the correct info.  A similar problem exists with ip_dst but does not seem to with any other columns

How to repeat:
Table structure:
CREATE TABLE `iphdr` (
  `sid` int(10) unsigned NOT NULL,
  `cid` int(10) unsigned NOT NULL,
  `ip_src` int(10) unsigned NOT NULL,
  `ip_dst` int(10) unsigned NOT NULL,
  `ip_ver` tinyint(3) unsigned DEFAULT NULL,
  `ip_hlen` tinyint(3) unsigned DEFAULT NULL,
  `ip_tos` tinyint(3) unsigned DEFAULT NULL,
  `ip_len` smallint(5) unsigned DEFAULT NULL,
  `ip_id` smallint(5) unsigned DEFAULT NULL,
  `ip_flags` tinyint(3) unsigned DEFAULT NULL,
  `ip_off` smallint(5) unsigned DEFAULT NULL,
  `ip_ttl` tinyint(3) unsigned DEFAULT NULL,
  `ip_proto` tinyint(3) unsigned NOT NULL,
  `ip_csum` smallint(5) unsigned DEFAULT NULL,
  PRIMARY KEY (`sid`,`cid`),
  KEY `ip_src` (`ip_src`),
  KEY `ip_dst` (`ip_dst`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

I'll attach a sample of data to populate this.
[25 Feb 2010 22:48] Aaron Macks
csv file of sample table data

Attachment: iphdr_export (application/octet-stream, text), 6.38 KiB.

[25 Feb 2010 23:00] Aaron Macks
user error, the different queries were using different indexes, so the data coming back was different