3 function getmicrotime()
7 return (float)$t[1]+ (float)$t[0];
14 $sql = "select id,firstname,lastname from adoxyz where
15 firstname not like ? and lastname not like ? and id=?";
17 /*$sql = "select * from juris9.employee join juris9.emp_perf_plan on epp_empkey = emp_id
18 where emp_name not like ? and emp_name not like ? and emp_id=28000+?";
20 for ($i=1; $i <= $MAX; $i++) {
22 $x = (rand() % 10) + 1;
24 $id = $db->GetOne($sql,
26 if($id != $offset+$x) {
27 print "<p>Error at $x";
33 include_once('../adodb.inc.php');
34 $db = NewADOConnection('postgres7');
35 $db->PConnect('localhost','tester','test','test') || die("failed connection");
37 $enc = "GIF89a%01%00%01%00%80%FF%00%C0%C0%C0%00%00%00%21%F9%04%01%00%00%00%00%2C%00%00%00%00%01%00%01%00%00%01%012%00%3Bt_clear.gif%0D";
38 $val = rawurldecode($enc);
42 adodb_pr($db->ServerInfo());
44 echo "<h4>Testing PREPARE/EXECUTE PLAN</h4>";
47 $db->_bindInputArray = true; // requires postgresql 7.3+ and ability to modify database
50 echo '<p>',$MAX,' times, with plan=',getmicrotime() - $t,'</p>';
53 $db->_bindInputArray = false;
56 echo '<p>',$MAX,' times, no plan=',getmicrotime() - $t,'</p>';
60 echo "<h4>Testing UPDATEBLOB</h4>";
65 $db->Execute("insert into photos (id,name) values(9999,'dot.gif')");
66 $db->UpdateBlob('photos','photo',$val,'id=9999');
67 $v = $db->GetOne('select photo from photos where id=9999');
72 $db->Execute("delete from photos where id=9999");
76 if ($v !== $val) echo "<b>*** ERROR: Inserted value does not match downloaded val<b>";
77 else echo "<b>*** OK: Passed</b>";
80 echo "INSERTED: ", $enc;
82 echo"RETURNED: ", rawurlencode($v);
84 echo "INSERTED: ", $val;
86 echo "RETURNED: ", $v;