#!/bin/bash

# Create egy2 table and data

echo "DROP TABLE IF EXISTS \`testtable\`;

/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE \`testtable\` (
  \`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,
  \`others\` int(11) NOT NULL DEFAULT '0',
  \`datum\` date NOT NULL DEFAULT '0000-00-00',
  PRIMARY KEY (\`id\`),
  KEY \`raz\` (\`others\`),
  KEY \`datum\` (\`datum\`),
  KEY \`raz_2\` (\`id\`,\`others\`,\`datum\`)
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;"

for((i=1;i<10;i++))
do
    echo -en "insert into testtable (others,datum) values (${i},'20090911');\n"
done

for((i=11;i<100;i++))
do
    echo -en "insert into testtable (others,datum) values (${i},'20090912');\n"
done

for((i=101;i<110;i++))
do
    echo -en "insert into testtable (others,datum) values (${i},'20090913');\n"
done

echo "/*!40000 ALTER TABLE \`testtable\` ENABLE KEYS */;"
