Bug #64161 [Opn->Csd]: PDO::__construct(): Called dbsetopt with parameter 3 NULL (severity 11)
Edit report at https://bugs.php.net/bug.php?id=64161&edit=1
ID: 64161
Updated by: ssufficool@php.net
Reported by: sivavivekanantha at gmail dot com
Summary: PDO::__construct(): Called dbsetopt with parameter 3
NULL (severity 11)
-Status: Open
+Status: Closed
Type: Bug
Package: PDO related
Operating System: linux centos 6
PHP Version: 5.4.11
-Assigned To:
+Assigned To: ssufficool
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
This is related to the quoted identifier passing NULL to FreeTDS. This has been
fixed in git master.
Previous Comments:
------------------------------------------------------------------------
[2013-03-20 18:41:09] jwatson at fh dot org
This may be a duplicate of issue #63638.
If so, a patch/pull request was submitted at https://github.com/php/php-
src/pull/306. Waiting on php developers to roll this into their release.
------------------------------------------------------------------------
[2013-02-06 04:52:28] sivavivekanantha at gmail dot com
Description:
------------
PDO::__construct(): Called dbsetopt with parameter 3 NULL (severity 11)
/var/www/framework/db/CDbConnection.php(423)
411 protected function createPdoInstance()
412 {
413 $pdoClass=$this->pdoClass;
414 if(($pos=strpos($this->connectionString,':'))!==false)
415 {
416 $driver=strtolower(substr($this->connectionString,0,$pos));
417 if($driver==='mssql' || $driver==='dblib')
418 $pdoClass='CMssqlPdoAdapter';
419 elseif($driver==='sqlsrv')
420 $pdoClass='CMssqlSqlsrvPdoAdapter';
421 }
422 return new $pdoClass($this->connectionString,$this->username,
423 $this->password,$this->_attributes);
Test script:
---------------
$sql = "[sp_Language] :Language_Code, :Language_Name, :Active, :Disp_Order, :Action ";
$command = $this->createCommand($sql);
$command->bindParam(":Language_Code", $languageCode, PDO::PARAM_INT);
$command->bindParam(":Language_Name", $language, PDO::PARAM_STR);
$command->bindParam(":Active", $active, PDO::PARAM_STR);
$command->bindParam(":Disp_Order", $displayOrder, PDO::PARAM_INT);
$command->bindParam(":Action", $action, PDO::PARAM_INT);
try {
$this->msg = '';
$command->execute();
}
catch(Exception $e)
{
//$this->msg = substr($ex->getMessage(),0,-30);
$this->msg = $e->getMessage();
// $this->msg = substr($e->errorInfo[2],0,-30);
}
Expected result:
----------------
PDO::__construct(): Called dbsetopt with parameter 3 NULL (severity 11)
Actual result:
--------------
Language Name Already Exists..this custom Exception shown in my UI
(I'm Using Sql stored procedure, that procedure throw custom message use Raiserror command.
That custom exception shown in my yii UI.)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64161&edit=1
Thread (3 messages)