1
0
mirror of synced 2025-01-18 22:41:43 +03:00

fixed little bugs in firebird import driver

This commit is contained in:
zYne 2007-01-15 21:54:27 +00:00
parent 31da317fcc
commit 45fdb318de

View File

@ -53,7 +53,7 @@ class Doctrine_Import_Firebird extends Doctrine_Import
public function listTableFields($table)
{
$table = $this->conn->quote(strtoupper($table), 'text');
$query = 'SELECT RDB\$FIELD_NAME FROM RDB$RELATION_FIELDS WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
$query = 'SELECT RDB$FIELD_NAME FROM RDB$RELATION_FIELDS WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
return $this->conn->fetchColumn($query);
}
@ -85,7 +85,7 @@ class Doctrine_Import_Firebird extends Doctrine_Import
{
$query = 'SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS';
$table = $this->conn->quote(strtoupper($table), 'text');
$query .= 'WHERE UPPER(RDB\$RELATION_NAME) = ' . $table;
$query .= ' WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
return $this->conn->fetchColumn($query);
}
@ -110,14 +110,11 @@ class Doctrine_Import_Firebird extends Doctrine_Import
*/
public function listTableTriggers($table = null)
{
$query = 'SELECT RDB$TRIGGER_NAME
FROM RDB$TRIGGERS
WHERE RDB$SYSTEM_FLAG IS NULL
OR RDB$SYSTEM_FLAG = 0';
$query = 'SELECT RDB$TRIGGER_NAME FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0';
if ( ! is_null($table)) {
$table = $this->conn->quote(strtoupper($table), 'text');
$query .= 'WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
$query .= ' WHERE UPPER(RDB$RELATION_NAME) = ' . $table;
}
return $this->conn->fetchColumn($query);