<?php
/*another app to determine which statement is taking too long, for bug17984*/

$s=microtime(TRUE);
$link=mysql_connect("localhost:3306","root","12345",FALSE) or die("cannot connect!!!");
mysql_select_db("test",$link);
$ab_ave=0;
$bc_ave=0;
for($i=0;$i<1000;$i++)
{
	$a=microtime(TRUE);
	mysql_query("DROP TABLE IF EXISTS `t1`",$link);
	$b=microtime(TRUE);	
	mysql_query("CREATE TABLE t1(c1 INT NOT NULL, c2 INT NOT NULL, PRIMARY KEY (c1,c2))",$link);
	$c=microtime(TRUE);
	printf("%.9f \t %.9f\n", ($b-$a) , ($c-$b));
	$ab_ave+=(($b-$a));
	$bc_ave+=(($c-$b));
}

mysql_close($link);
$t=microtime(TRUE);
printf("TOTAL TIME: %.9f\n", ($t-$s));
printf("AVERAGE A->B: %.9f\n",($ab_ave/1000));
printf("AVERAGE B->C: %.9f\n",($bc_ave/1000));
?>