"added a query log, independent of the db used"

This commit is contained in:
Ralf Becker 2007-10-19 05:48:52 +00:00
parent 598a63379c
commit bd4b0cc4ef

View File

@ -61,11 +61,11 @@
* @var array * @var array
*/ */
var $max_index_length=array( var $max_index_length=array(
'sapdb' => 32, 'maxdb' => 32,
'oracle' => 30, 'oracle' => 30,
); );
/** /**
* type of the database, set by the the constructor: 'mysql','pgsql','mssql','sapdb' * type of the database, set by the the constructor: 'mysql','pgsql','mssql','maxdb'
* *
* @var string * @var string
*/ */
@ -98,7 +98,7 @@
/** /**
* Constructor of schema-processor * Constructor of schema-processor
* *
* @param string $dbms type of the database: 'mysql','pgsql','mssql','sapdb' * @param string $dbms type of the database: 'mysql','pgsql','mssql','maxdb'
* @param object $db=null database class, if null we use $GLOBALS['egw']->db * @param object $db=null database class, if null we use $GLOBALS['egw']->db
* @return schema_proc * @return schema_proc
*/ */
@ -129,7 +129,6 @@
switch($this->sType) switch($this->sType)
{ {
case 'sapdb':
case 'maxdb': case 'maxdb':
$this->max_varchar_length = 8000; $this->max_varchar_length = 8000;
break; break;
@ -836,8 +835,21 @@
*/ */
function ExecuteSqlArray($aSql,$debug_level,$debug) function ExecuteSqlArray($aSql,$debug_level,$debug)
{ {
$retval = $this->dict->ExecuteSQLArray($aSql); if ($this->m_odb->query_log) // we use egw_db::query to log the queries
{
$retval = 2;
foreach($aSql as $sql)
{
if (!$this->m_odb->query($sql,__LINE__,__FILE__))
{
$retval = 1;
}
}
}
else
{
$retval = $this->dict->ExecuteSQLArray($aSql);
}
if ($retval < 2 || $this->debug >= $debug_level || $this->debug > 3) if ($retval < 2 || $this->debug >= $debug_level || $this->debug > 3)
{ {
$debug_params = func_get_args(); $debug_params = func_get_args();