Zend Framework

Zend_Db_Adapter_Pdo_Pgsql (lastInsertId)

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.6
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Db
  • Labels:
    None

Description

line [325]
file Zend/Db/Adapter/Pdo/Pgsql.php
now return $this->lastSequenceId($sequenceName);
need return $this->lastSequenceId('"' . $sequenceName . '"');

example:
$table = 'User';
$row = "ID";

PostgreSQL considers 'User_ID_seq' == 'user_id_seq', but '"User_ID_seq"' != '"user_id_seq"'

Activity

Hide
Ramon Henrique Ornelas added a comment - - edited

The problem not is in the called and yes within Zend_Db_Adapter_Pdo_Pgsql:>lastSequenceId().

See line 284:
Current code:

$value = $this->fetchOne("SELECT CURRVAL(".$this->quote($sequenceName).")");

Could be;

$value = $this->fetchOne("SELECT CURRVAL('".$this->quoteIdentifier($sequenceName, true)."')");

Problem applicant too in Zend_Db_Adapter_Pdo_Pgsql:>nextSequenceId()

Show
Ramon Henrique Ornelas added a comment - - edited The problem not is in the called and yes within Zend_Db_Adapter_Pdo_Pgsql:>lastSequenceId(). See line 284: Current code:
$value = $this->fetchOne("SELECT CURRVAL(".$this->quote($sequenceName).")");
Could be;
$value = $this->fetchOne("SELECT CURRVAL('".$this->quoteIdentifier($sequenceName, true)."')");
Problem applicant too in Zend_Db_Adapter_Pdo_Pgsql:>nextSequenceId()
Hide
Ramon Henrique Ornelas added a comment -

Thanks by the report, fixed in r22566,

Show
Ramon Henrique Ornelas added a comment - Thanks by the report, fixed in r22566,

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: