#1337: It`s wrong index and triggers creation in the oracle
database(createTablesFromModels)
------------------------+---------------------------------------------------
Reporter: FreeBolik | Owner: jwage
Type: defect | Status: new
Priority: major | Milestone: Unknown
Component: Other | Version: 0.11
Resolution: | Keywords: oracle index triggers
Has_test: 1 | Mystatus: Pending Core Response
Has_patch: 0 |
------------------------+---------------------------------------------------
Comment (by FreeBolik):
1. Error in the function lastInsertID - none using " FROM DUAL"
file: Doctrine/Sequence/Oracle.php
--- Doctrine/Sequence/Oracle.php (revision 13)
+++ Doctrine/Sequence/Oracle.php (revision 14)
@@ -74,7 +74,7 @@
$seqName = $table . (empty($field) ? '' : '_'.$field);
$sequenceName =
$this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName),
true);
- return $this->conn->fetchOne('SELECT ' . $sequenceName .
'.currval');
+ return $this->conn->fetchOne('SELECT ' . $sequenceName .
'.currval FROM DUAL');
}
2. Wrong index generation(Doctrine\Export.php)
Doctrine sytax(it`s mysql like):
CREATE TABLE test (id INT, test_field INT, INDEX(test_field_idx),
PRIMARY KEY (id));
Should be
CREATE TABLE test (id INT PRIMARY KEY USING INDEX (create index id_idx
on test (id)), test_field INT);
Or just create it in the another query
CREATE INDEX test_field_idx ON test(test_field);
3. Wrone generation on sequense name in the function processSingleInsert
(file Doctrine/Connection/UnitOfWork.php)
for oracle i use.
--- Doctrine/Connection/UnitOfWork.php (revision 13)
+++ Doctrine/Connection/UnitOfWork.php (revision 14)
@@ -579,7 +579,10 @@
if (strtolower($this->conn->getDriverName()) == 'pgsql') {
$seq = $table->getTableName() . '_' . $identifier[0];
}
-
+ if (strtolower($this->conn->getDriverName()) == 'oracle') {
+ $seq = $table->getTableName();
+ }
+
$id = $this->conn->sequence->lastInsertId($seq);
4. When you put autoincrement=true triggers generates, but - will be no
result - the triggers not have been added.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1337#comment:2>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---