import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
* @subpackage Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ibm.php 9577 2008-05-31 01:50:27Z peptolab $
|
||||
* @version $Id: Ibm.php 13522 2009-01-06 16:35:55Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -260,7 +260,7 @@ class Zend_Db_Adapter_Pdo_Ibm extends Zend_Db_Adapter_Pdo_Abstract
|
||||
$newbind = array();
|
||||
if (is_array($bind)) {
|
||||
foreach ($bind as $name => $value) {
|
||||
if(!is_null($value)) {
|
||||
if($value !== null) {
|
||||
$newbind[$name] = $value;
|
||||
}
|
||||
}
|
||||
@ -333,4 +333,28 @@ class Zend_Db_Adapter_Pdo_Ibm extends Zend_Db_Adapter_Pdo_Abstract
|
||||
$this->_connect();
|
||||
return $this->_serverType->nextSequenceId($sequenceName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve server version in PHP style
|
||||
* Pdo_Idm doesn't support getAttribute(PDO::ATTR_SERVER_VERSION)
|
||||
* @return string
|
||||
*/
|
||||
public function getServerVersion()
|
||||
{
|
||||
try {
|
||||
$stmt = $this->query('SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO');
|
||||
$result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
|
||||
if (count($result)) {
|
||||
$matches = null;
|
||||
if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $result[0][0], $matches)) {
|
||||
return $matches[1];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (PDOException $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user