imported ADOdb version 4.20 released 27 Feb 2004

This commit is contained in:
Ralf Becker
2004-03-15 22:17:52 +00:00
parent d8c602e654
commit 3df33d3ef6
127 changed files with 8961 additions and 2388 deletions

View File

@ -1,7 +1,7 @@
<?php
/*
V3.94 13 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
@ -88,10 +88,21 @@ class perf_postgres extends adodb_perf{
$this->conn =& $conn;
}
function Explain($sql)
function Explain($sql,$partial=false)
{
$sql = str_replace('?',"''",$sql);
$save = $this->conn->LogSQL(false);
if ($partial) {
$sqlq = $this->conn->qstr($sql.'%');
$arr = $this->conn->GetArray("select distinct distinct sql1 from adodb_logsql where sql1 like $sqlq");
if ($arr) {
foreach($arr as $row) {
$sql = reset($row);
if (crc32($sql) == $partial) break;
}
}
}
$sql = str_replace('?',"''",$sql);
$s = '<p><b>Explain</b>: '.htmlspecialchars($sql).'</p>';
$rs = $this->conn->Execute('EXPLAIN '.$sql);
$this->conn->LogSQL($save);
@ -102,7 +113,7 @@ class perf_postgres extends adodb_perf{
$rs->MoveNext();
}
$s .= '</pre>';
$s .= $this->Tracer($sql);
$s .= $this->Tracer($sql,$partial);
return $s;
}
}