-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[DBAL-2555] Fix date and dat 8000 etimetz type mapping on Oracle #2612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -102,7 +102,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) | |||
|
|||
$dbType = strtolower($tableColumn['data_type']); | |||
if (strpos($dbType, "timestamp(") === 0) { | |||
if (strpos($dbType, "WITH TIME ZONE")) { | |||
if (strpos($dbType, "with time zone")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this seems to be something that the DB engine doesn't guarantee, strtolower()
should be used (or at least case insensitive matching).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test probably also needed with it, but unsure if practical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at line 193 ;)
But besides that you reminded me that I forgot a unit test case for the mapping issue in the platform which I added now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is is covered by the functional test case btw. Not sure how else to test this :>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dammit, didn't read that, thanks :-)
@@ -102,7 +102,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) | |||
|
|||
$dbType = strtolower($tableColumn['data_type']); | |||
if (strpos($dbType, "timestamp(") === 0) { | |||
if (strpos($dbType, "WITH TIME ZONE")) { | |||
if (strpos($dbType, "with time zone")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dammit, didn't read that, thanks :-)
@@ -412,13 +412,19 @@ public function testAlterTableNotNULL() | |||
$this->assertEquals($expectedSql, $this->_platform->getAlterTableSQL($tableDiff)); | |||
} | |||
|
|||
/** | |||
* @group DBAK-2555 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DBAL 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, fixed
|
Backported via 8a13144 |
Fixes #2555
Oracle's
DATE
type was erroneously mapped to Doctrine'sDateTime
type. Although I wonder why nobody ever complained about that until now, the fix looks straight forward and also complies to what we have documented.Additionally the instrospection of
DateTimeTzType
was wrong and has been fixed (wrong case in type comparison).Tests pass locally.