mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-09 08:25:03 +02:00
imported ADOdb version 4.20 released 27 Feb 2004
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user