#!/bin/bash # Create et table and data echo "/*!40000 ALTER TABLE \`egy2\` ENABLE KEYS */;" echo "DROP TABLE IF EXISTS \`et\`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE \`et\` ( \`tip\` bigint(20) NOT NULL DEFAULT '0', \`eaz\` bigint(20) NOT NULL DEFAULT '0', \`raz\` int(11) unsigned NOT NULL DEFAULT '0', \`mad\` date DEFAULT NULL, \`szlaaz\` bigint(20) NOT NULL DEFAULT '0', \`szaz\` int(11) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES \`et\` WRITE; /*!40000 ALTER TABLE \`et\` DISABLE KEYS */; INSERT INTO \`et\` VALUES (1,0,11,'2009-09-08',1,19868); /*!40000 ALTER TABLE \`et\` ENABLE KEYS */; UNLOCK TABLES;" # Create egy2 table and data echo "DROP TABLE IF EXISTS \`egy2\`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE \`egy2\` ( \`egyaz\` int(10) unsigned NOT NULL AUTO_INCREMENT, \`szaz\` int(11) NOT NULL DEFAULT '0', \`raz\` int(10) unsigned NOT NULL DEFAULT '0', \`szlaaz\` mediumint(9) NOT NULL DEFAULT '0', \`datum\` date NOT NULL DEFAULT '0000-00-00', PRIMARY KEY (\`egyaz\`), KEY \`raz\` (\`raz\`), KEY \`szaz\` (\`szaz\`), KEY \`datum\` (\`datum\`), KEY \`szlaaz\` (\`szlaaz\`), KEY \`raz_2\` (\`raz\`,\`szaz\`,\`szlaaz\`,\`datum\`) ) ENGINE=InnoDB AUTO_INCREMENT=2516587 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */;" # start egyaz SSID=8739 # end egyaz ESID=2258823 # szaz interval SSZAZ=15000 ESZAZ=35000 # raz interval SRAZ=-1 ERAZ=1500 # szlaaz interval SSZLAAZ=-1 ESZLAAZ=3000 # minimum many szlaaz value 1 NSZLAAZ=2010379 # minimum datum value 2009-09-08 NDATE=3000 # minimum raz value 11 NRAZ=200 echo "/*!40000 ALTER TABLE \`egy2\` DISABLE KEYS */;" RND1="${SSZAZ}+((rand()*100000)%$ESZAZ)" RND2="${SRAZ}+((rand()*10000)%$ERAZ)" RND3="${SSZLAAZ}+((rand()*10000)%$ESZLAAZ)" RND4="date_add(\"2009-09-08\", interval -(rand()*10000) Day)" echo -en "insert into egy2 values (${SSID},${RND1},${RND2},${RND3},${RND4})" #(8739,15000+((rand()*100000)%35000),-1+((rand()*10000)%1500),+((rand()*10000)%3000),date_add("2009-09-08", interval -(rand()*10000) Day)) for((i=SSID+1;i