Changeset 5116
- Timestamp:
- 10/21/08 20:35:42 (9 months ago)
- Location:
- branches/1.0
- Files:
-
- 3 modified
-
lib/Doctrine/Connection/Oracle.php (modified) (1 diff)
-
lib/Doctrine/DataDict/Oracle.php (modified) (2 diffs)
-
tests/DataDict/OracleTestCase.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Connection/Oracle.php
r5069 r5116 60 60 'pattern_escaping' => true, 61 61 ); 62 $this->sql_file_delimiter = "\n/\n"; 62 63 $this->properties['sql_file_delimiter'] = "\n/\n"; 64 $this->properties['varchar2_max_length'] = 4000; 65 $this->properties['number_max_precision'] = 38; 66 63 67 parent::__construct($manager, $adapter); 64 68 } -
branches/1.0/lib/Doctrine/DataDict/Oracle.php
r4768 r5116 67 67 case 'char': 68 68 case 'varchar': 69 $length = !empty($field['length']) 70 ? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length']; 69 $length = !empty($field['length']) ? $field['length'] : false; 71 70 72 71 $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; 73 74 return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')'; 72 73 if ($length && $length <= $this->conn->varchar2_max_length) { 74 return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')'; 75 } 75 76 case 'clob': 76 77 return 'CLOB'; … … 79 80 case 'integer': 80 81 case 'int': 81 if ( ! empty($field['length']) ){82 if ( ! empty($field['length']) && $field['length'] <= $this->conn->number_max_precision) { 82 83 return 'NUMBER('.$field['length'].')'; 83 84 } -
branches/1.0/tests/DataDict/OracleTestCase.php
r3884 r5116 211 211 212 212 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'NUMBER(2)'); 213 214 unset($a['length']); 215 216 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'INT'); 213 217 } 214 218 … … 277 281 $a = array('type' => 'string'); 278 282 279 $this->assertEqual($this->dataDict->getNativeDeclaration($a), ' VARCHAR2(16777215)');283 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'CLOB'); 280 284 } 281 285 public function testGetNativeDefinitionSupportsArrayType2() … … 283 287 $a = array('type' => 'array'); 284 288 285 $this->assertEqual($this->dataDict->getNativeDeclaration($a), ' VARCHAR2(16777215)');289 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'CLOB'); 286 290 } 287 291 public function testGetNativeDefinitionSupportsObjectType() … … 289 293 $a = array('type' => 'object'); 290 294 291 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'VARCHAR2(16777215)'); 292 } 295 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'CLOB'); 296 } 297 public function testGetNativeDefinitionSupportsLargerStrings() 298 { 299 $a = array('type' => 'string', 'length' => 4001); 300 301 $this->assertEqual($this->dataDict->getNativeDeclaration($a), 'CLOB'); 302 } 303 293 304 }