Просмотр исходного кода

ZF-8557
- Added casting of i5 specific option for naming when provided as config to Zend_Db_Adapter factory


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23180 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 15 лет назад
Родитель
Сommit
1a2dde9fce
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      library/Zend/Db/Adapter/Db2.php

+ 10 - 2
library/Zend/Db/Adapter/Db2.php

@@ -154,6 +154,14 @@ class Zend_Db_Adapter_Db2 extends Zend_Db_Adapter_Abstract
             $this->_config['driver_options']['DB2_ATTR_CASE'] = $caseAttrMap[$this->_config['options'][Zend_Db::CASE_FOLDING]];
         }
 
+        if ($this->_isI5 && isset($this->_config['driver_options']['i5_naming'])) {
+            if ($this->_config['driver_options']['i5_naming']) {
+                $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_ON;
+            } else {
+                $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_OFF;
+            }
+        }
+        
         if ($this->_config['host'] !== 'localhost' && !$this->_isI5) {
             // if the host isn't localhost, use extended connection params
             $dbname = 'DRIVER={IBM DB2 ODBC DRIVER}' .
@@ -411,10 +419,10 @@ class Zend_Db_Adapter_Db2 extends Zend_Db_Adapter_Abstract
                        AND C.TABLE_NAME = k.TABLE_NAME
                        AND C.COLUMN_NAME = k.COLUMN_NAME)
                 WHERE "
-                 . $this->quoteInto('UPPER(C.TABLE_NAME) = UPPER(?)', $tableName);
+                 . $this->quoteInto('UPPER(C.TABLE_NAME) = ?', strtoupper($tableName));
 
             if ($schemaName) {
-                $sql .= $this->quoteInto(' AND UPPER(C.TABLE_SCHEMA) = UPPER(?)', $schemaName);
+                $sql .= $this->quoteInto(' AND UPPER(C.TABLE_SCHEMA) = ?', strtoupper($schemaName));
             }
 
             $sql .= " ORDER BY C.ORDINAL_POSITION FOR FETCH ONLY";