From 4f67131294874216b0a469cf3e7ca9dffb404761 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 8 Jun 2013 22:18:27 +0300 Subject: [PATCH] fix driver conditions --- ipf/orm/connection/unitofwork.php | 2 +- ipf/orm/query.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ipf/orm/connection/unitofwork.php b/ipf/orm/connection/unitofwork.php index d4e85b9..ff77796 100644 --- a/ipf/orm/connection/unitofwork.php +++ b/ipf/orm/connection/unitofwork.php @@ -426,7 +426,7 @@ class IPF_ORM_Connection_UnitOfWork extends IPF_ORM_Connection_Module if (empty($seq) && count($identifier) == 1 && $identifier[0] == $table->getIdentifier() && $table->getIdentifierType() != IPF_ORM::IDENTIFIER_NATURAL) { - if (strtolower($this->conn->getDriverName()) == 'pgsql') { + if (strtolower($this->conn->getDriverName()) == 'Pgsql') { $seq = $table->getTableName() . '_' . $identifier[0]; } diff --git a/ipf/orm/query.php b/ipf/orm/query.php index c0cad62..597b1a4 100644 --- a/ipf/orm/query.php +++ b/ipf/orm/query.php @@ -811,12 +811,12 @@ class IPF_ORM_Query extends IPF_ORM_Query_Abstract implements Countable, Seriali // what about composite keys? $idColumnName = $table->getColumnName($table->getIdentifier()); switch (strtolower($this->_conn->getDriverName())) { - case 'mysql': + case 'Mysql': // mysql doesn't support LIMIT in subqueries $list = $this->_conn->execute($subquery, $params)->fetchAll(IPF_ORM::FETCH_COLUMN); $subquery = implode(', ', array_map(array($this->_conn, 'quote'), $list)); break; - case 'pgsql': + case 'Pgsql': // pgsql needs special nested LIMIT subquery $subquery = 'SELECT ipf_orm_subquery_alias.' . $idColumnName . ' FROM (' . $subquery . ') AS ipf_orm_subquery_alias'; break; -- 2.49.0