From: Andrey Kutejko Date: Sat, 8 Jun 2013 19:18:27 +0000 (+0300) Subject: fix driver conditions X-Git-Tag: 0.6~118 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=4f67131294874216b0a469cf3e7ca9dffb404761;p=ipf-legacy-orm.git fix driver conditions --- 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;