getLastGeneratedValue() bug in Db\Adapter\Driver\Pdo\Pdo.php

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

getLastGeneratedValue() bug in Db\Adapter\Driver\Pdo\Pdo.php

imel96
Hey all,

Hope this the right place for this, I check jira but it seems like it's not used anymore.

I was trying to getLastInsertId from pdo_pgsql and only getting null. I found getLastGeneratedValue() method
in Pdo\Connection which is wrapped by Pdo\Pdo. The problem is Connection::getLastGeneratedValue() expects a sequence name argument which is needed for postgresql.

Here's the original in Pdo.php (ZF 2.0.6):

public function getLastGeneratedValue()
{
    return $this->connection->getLastGeneratedValue();
}

it should be:

public function getLastGeneratedValue($name = null)
{
    return $this->connection->getLastGeneratedValue($name);
}


Cheers,
Reply | Threaded
Open this post in threaded view
|

Re: getLastGeneratedValue() bug in Db\Adapter\Driver\Pdo\Pdo.php

imel96
Thanks for that, didn't know github has issue tracker too. I was hoping some maintainer see it on the list and pick it up.
I just created a new issue on github, not a pull request.

Cheers,


--
мелбий шамсуддин


On 11/01/2013, at 8:32 AM, Bart McLeod wrote:

> The right place to put this is on github: it has replaced JIRA. Or alternatively, you can fix it if you are certain it is a bug and issue a pull request.
>
> -Bart
>
> Op 10 jan. 2013, om 10:53 heeft imel96 <[hidden email]> het volgende geschreven:
>
>> Hey all,
>>
>> Hope this the right place for this, I check jira but it seems like it's not
>> used anymore.
>>
>> I was trying to getLastInsertId from pdo_pgsql and only getting null. I
>> found getLastGeneratedValue() method
>> in Pdo\Connection which is wrapped by Pdo\Pdo. The problem is
>> Connection::getLastGeneratedValue() expects a sequence name argument which
>> is needed for postgresql.
>>
>> Here's the original in Pdo.php (ZF 2.0.6):
>>
>> public function getLastGeneratedValue()
>> {
>>   return $this->connection->getLastGeneratedValue();
>> }
>>
>> it should be:
>>
>> public function getLastGeneratedValue($name = null)
>> {
>>   return $this->connection->getLastGeneratedValue($name);
>> }


--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]