Project

General

Profile

Actions

Bug #66674

closed

exec_SELECTgetRows does not return any rows

Added by Xavier Perseguers over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2015-04-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Using ADOdb with MSSQL native driver.

exec_SELECTgetRows() checks for sql_errors() and this method is overridden in DBAL:

    public function sql_error() {
        $output = '';
        switch ($this->handlerCfg[$this->lastHandlerKey]['type']) {
            case 'native':
                $output = $this->handlerInstance[$this->lastHandlerKey]['link']->error;
                break;
            case 'adodb':
                $output = $this->handlerInstance[$this->lastHandlerKey]->ErrorMsg();
                break;
            case 'userdefined':
                $output = $this->handlerInstance[$this->lastHandlerKey]->sql_error();
                break;
        }
        return $output;
    }

Problem is that ->ErrorMsg in ADOdb for mssql_native is defined as

    function ErrorMsg()
    {
        $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
        if($retErrors != null) {
            foreach($retErrors as $arrError) {
                $this->_errorMsg .= "SQLState: ".$arrError[ 'SQLSTATE']."\n";
                $this->_errorMsg .= "Error Code: ".$arrError[ 'code']."\n";
                $this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
            }
        } else {
            $this->_errorMsg = "No errors found";
        }
        return $this->_errorMsg;
    }

It should return an empty string instead of "No errors found".

Actions #1

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39069

Actions #2

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39069

Actions #3

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39071

Actions #4

Updated by Xavier Perseguers over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF