Issues

ZF-5298: Zend_Db_Adapter_Pdo_Abstract->getServerVersion PDO_OCI - SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes

Issue Type: Bug Created: 2008-12-17T07:56:51.000+0000 Last Updated: 2009-01-22T12:00:09.000+0000 Status: Resolved Fix version(s): - 1.7.3 (19/Jan/09)

Reporter: Krzysztof Szatanik (diabl0) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db

Related issues: Attachments:

Description

First time I seen this problem with ZF 13325 SVN revision.

On first connect (when building metadata cache i'm getting

PDOException::SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes Full exception below

From my observations it looks like server related problem - it appears only on production server: Linux Debian, Apache 2.2.9-10+lenny1, PHP 5.2.6-5, PDO-1.0.3, PDO_OCI-1.0, instantclient-linuxAMD64-10.1.0.5.0-20060519

trying and catching this exception and returning null value works ( app is working as expected ).

/**
 * Retrieve server version in PHP style
 *
 * @return string
 */
public function getServerVersion()
{
    $this->_connect();
    // ********************* BEGIN OWN PATCH *********************
    try {
    // ********************** END OWN PATCH **********************
        $version = $this->_connection->getAttribute(PDO::ATTR_SERVER_VERSION);
        $matches = null;
        if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
            return $matches[1];
        } else {
            return null;
        }
    // ********************* BEGIN OWN PATCH *********************
    } catch ( PDOException $e) {
        return null;
    }
    // ********************** END OWN PATCH **********************
}

Almost whole exception:

PDOException Object ( [message:protected] => SQLSTATE[IM001]: Driver does not support this function: driver does not support getting attributes [string:private] => [code:protected] => IM001 [file:protected] => /home/www/some_project/library/Zend/Db/Adapter/Pdo/Abstract.php [line:protected] => 361 [trace:private] => Array ( [0] => Array ( [file] => /home/www/some_project/library/Zend/Db/Adapter/Pdo/Abstract.php [line] => 361 [function] => getAttribute [class] => PDO [type] => -> [args] => Array ( [0] => 4 )

            )

        [1] => Array
            (
                [file] => /home/www/some_project/library/Zend/Db/Adapter/Pdo/Oci.php
                [line] => 173
                [function] => getServerVersion
                [class] => Zend_Db_Adapter_Pdo_Abstract
                [type] => ->
                [args] => Array
                    (
                    )

            )

        [2] => Array
            (
                [file] => /home/www/some_project/library/Zend/Db/Table/Abstract.php
                [line] => 696
                [function] => describeTable
                [class] => Zend_Db_Adapter_Pdo_Oci
                [type] => ->
                [args] => Array
                    (
                        [0] => PACJ
                        [1] => 
                    )

            )

        [3] => Array
            (
                [file] => /home/www/some_project/library/Zend/Db/Table/Abstract.php
                [line] => 722
                [function] => _setupMetadata
                [class] => Zend_Db_Table_Abstract
                [type] => ->
                [args] => Array
                    (
                    )

            )

        [4] => Array
            (
                [file] => /home/www/some_project/library/Zend/Db/Table/Abstract.php
                [line] => 762
                [function] => _getCols
                [class] => Zend_Db_Table_Abstract
                [type] => ->
                [args] => Array
                    (
                    )

            )

        [5] => Array
            (
                [file] => /home/www/some_project/library/Zend/Db/Table/Abstract.php
                [line] => 846
                [function] => _setupPrimaryKey
                [class] => Zend_Db_Table_Abstract
                [type] => ->
                [args] => Array
                    (
                    )

            )

        [6] => Array
            (
                [file] => /home/www/some_project/library/Zend/Db/Table/Select.php
                [line] => 99
                [function] => info
                [class] => Zend_Db_Table_Abstract
                [type] => ->
                [args] => Array
                    (
                    )

            )

            ------- TRUNCATED UNRELATED TRACE ----------

[errorInfo] => Array
    (
        [0] => IM001
        [1] => 0
    )

)

Comments

Posted by Mickael Perraud (mikaelkael) on 2009-01-11T14:33:24.000+0000

Fixed with SVN 13600

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts