File: 1.20.0b/server/test/mysql.sh (View as HTML)

  1: #!/usr/bin/php -q
  2: <?php
  3: require("../base/tests.inc.php");
  4: if ($argc<4)
  5:  {
  6:  echo "Usage: mysql.sh host user pass [database] [\"query\"] [timeout]\n";
  7:  exit();
  8:  }
  9: 
 10: $timeout=-1;
 11: $query="";
 12: $database="";
 13: 
 14: if ($argc>4) $database=$argv[4];
 15: if ($argc>5) $query=$argv[5];
 16: if ($argc>6) $timeout=$argv[6];
 17: 
 18: echo "Host: ".$argv[1]."\n";
 19: echo "User: ".$argv[2]."\n";
 20: echo "DB  : ".$database."\n";
 21: echo "Qry : ".$query."\n";
 22: echo "Time: ".$timeout."s\n";
 23: 
 24: echo "\nRows Test:\n";
 25: 
 26: $res=mysql_test_rows($argv[1],$argv[2],$argv[3],$database,$timeout,$query,true);
 27: 
 28: echo "\nResult: ".$res."\n";
 29: 
 30: echo "\nTimer Test:\n";
 31: 
 32: $time=mysql_test_time($argv[1],$argv[2],$argv[3],$database,$timeout,$query,true);
 33: 
 34: echo "\nResult: ".$time."\n";
 35: ?>
 36: