Changeset 5102
- Timestamp:
- 10/16/08 11:03:01 (9 months ago)
- Location:
- branches/1.0
- Files:
-
- 3 modified
-
lib/Doctrine/Export.php (modified) (1 diff)
-
lib/Doctrine/Export/Oracle.php (modified) (3 diffs)
-
tests/Export/OracleTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Export.php
r5067 r5102 243 243 244 244 if (isset($options['primary']) && ! empty($options['primary'])) { 245 $queryFields .= ', PRIMARY KEY(' . implode(', ', array_values($options['primary'])) . ')'; 245 $primaryKeys = array_map(array($this->conn, 'quoteIdentifier'), array_values($options['primary'])); 246 $queryFields .= ', PRIMARY KEY(' . implode(', ', $primaryKeys) . ')'; 246 247 } 247 248 -
branches/1.0/lib/Doctrine/Export/Oracle.php
r5067 r5102 97 97 { 98 98 $sql = array(); 99 $table = strtoupper($table);100 99 $indexName = $table . '_AI_PK'; 101 100 $definition = array( … … 134 133 last_InsertID NUMBER; 135 134 BEGIN 136 SELECT ' . $ sequenceName. '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL;135 SELECT ' . $this->conn->quoteIdentifier($sequenceName) . '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL; 137 136 IF (:NEW.' . $name . ' IS NULL OR :NEW.'.$name.' = 0) THEN 138 SELECT ' . $ sequenceName. '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL;137 SELECT ' . $this->conn->quoteIdentifier($sequenceName) . '.NEXTVAL INTO :NEW.' . $name . ' FROM DUAL; 139 138 ELSE 140 139 SELECT NVL(Last_Number, 0) INTO last_Sequence … … 143 142 SELECT :NEW.' . $name . ' INTO last_InsertID FROM DUAL; 144 143 WHILE (last_InsertID > last_Sequence) LOOP 145 SELECT ' . $ sequenceName. '.NEXTVAL INTO last_Sequence FROM DUAL;144 SELECT ' . $this->conn->quoteIdentifier($sequenceName) . '.NEXTVAL INTO last_Sequence FROM DUAL; 146 145 END LOOP; 147 146 END IF; -
branches/1.0/tests/Export/OracleTestCase.php
r5067 r5102 107 107 $this->assertEqual($this->adapter->pop(), 'COMMIT'); 108 108 $this->assertEqual(substr($this->adapter->pop(), 0, 14), 'CREATE TRIGGER'); 109 $this->assertEqual($this->adapter->pop(), 'CREATE SEQUENCE MYTABLE_seq START WITH 1 INCREMENT BY 1 NOCACHE');109 $this->assertEqual($this->adapter->pop(), 'CREATE SEQUENCE mytable_seq START WITH 1 INCREMENT BY 1 NOCACHE'); 110 110 $this->assertEqual(substr($this->adapter->pop(), 0, 7), "DECLARE"); 111 111 $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (id INT)');