CREATE DATABASE  IF NOT EXISTS `mytest` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `mytest`;
-- MySQL dump 10.13  Distrib 5.5.29, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: mytest
-- ------------------------------------------------------
-- Server version	5.5.29-0ubuntu0.12.10.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `testtab`
--

DROP TABLE IF EXISTS `testtab`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `testtab` (
  `foo` int(11) NOT NULL AUTO_INCREMENT,
  `bar` char(3) NOT NULL,
  PRIMARY KEY (`foo`),
  KEY `idx_active` (`bar`),
  KEY `idx_listfieldmashup` (`foo`,`bar`)
) ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `testtab`
--

LOCK TABLES `testtab` WRITE;
/*!40000 ALTER TABLE `testtab` DISABLE KEYS */;
INSERT INTO `testtab` VALUES (28,'yes'),(29,'yes'),(30,'yes'),(31,'yes'),(32,'yes'),(33,'yes'),(34,'yes'),(35,'yes'),(36,'yes'),(37,'yes'),(38,'yes'),(39,'yes'),(40,'yes'),(42,'yes'),(43,'yes'),(44,'yes'),(45,'yes'),(46,'yes'),(47,'yes'),(49,'yes'),(50,'yes'),(51,'yes'),(52,'yes'),(53,'yes'),(55,'yes'),(56,'yes'),(57,'yes'),(58,'yes'),(59,'yes'),(60,'yes'),(61,'yes'),(62,'yes'),(63,'yes'),(64,'yes'),(65,'yes'),(66,'yes'),(67,'yes'),(68,'yes'),(69,'yes'),(70,'yes'),(71,'yes'),(72,'yes'),(73,'yes'),(74,'yes'),(76,'yes'),(77,'yes'),(78,'yes'),(79,'yes'),(80,'yes'),(81,'yes'),(82,'yes'),(83,'yes'),(85,'yes'),(86,'yes'),(87,'yes'),(88,'yes'),(91,'yes'),(92,'yes'),(93,'yes'),(94,'yes'),(96,'yes'),(97,'yes'),(98,'yes'),(99,'yes'),(100,'yes'),(101,'yes'),(102,'yes'),(103,'yes'),(104,'yes'),(105,'yes'),(106,'yes'),(107,'yes'),(109,'yes'),(110,'yes'),(111,'yes'),(112,'yes'),(113,'yes'),(114,'yes'),(115,'yes'),(116,'yes'),(117,'yes'),(119,'yes'),(120,'yes'),(121,'yes'),(122,'yes'),(123,'yes'),(124,'yes'),(125,'yes'),(126,'yes'),(127,'yes'),(128,'yes'),(129,'yes'),(131,'yes'),(132,'yes'),(133,'yes'),(134,'yes'),(135,'yes'),(136,'yes'),(137,'yes'),(138,'yes'),(139,'yes'),(140,'yes'),(141,'yes'),(142,'yes'),(143,'yes'),(145,'yes'),(146,'yes'),(147,'yes'),(148,'yes'),(149,'yes'),(150,'yes');
/*!40000 ALTER TABLE `testtab` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2013-01-31 15:50:52

-- Test code
SELECT count(distinct(testtab.foo))  FROM testtab WHERE (bar = 'yes');
SELECT count(testtab.foo)  FROM testtab WHERE (bar = 'yes');
SELECT count(distinct(testtab.foo))  FROM testtab;


