-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Merge MySQL 5.7.9 (GA) semantics into MySQL57Platform #2653
Conversation
|
||
if (version_compare($version, '5.7', '>=')) { | ||
if ($majorVersion === '5' && $minorVersion === '7' && null === $patchVersion) { |
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.
Please, use Yoda condition.
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.
Fixed
|
||
public function testReturnsJsonTypeDeclarationSQL() | ||
{ | ||
$this->assertSame('JSON', $this->_platform->getJsonTypeDeclarationSQL(array())); |
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.
Support for PHP < 7 has been dropped at master
. Could we use []
instead?
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.
@phansys is that really important here? We would need to fix all of that stuff in one PR anyways.
1412157
to
3efba67
Compare
[Edit: Petulant complaint retracted with apologies] |
[Edit: snarky response retracted, apologies accepted 👍 ] |
@rh389 I did not intend to rip anyone's work off. Originally I wanted to use either of the previous PRs getting merged but both of them were lacking some things. #2266 need merge into |
Sorry @deeky666, I was out of order. It was frustrating to work on this issue without a response but that's OS sometimes, not your fault. Apologies again, thanks for you efforts and looking forward to seeing this land. |
UPGRADE.md
Outdated
MySQL 5.7 ships with native JSON type support which now is adopted by DBAL. | ||
If you are using MySQL 5.7 and have columns with ``json_array`` type defined in your database, | ||
utilizing DBAL's schema comparator will cause a schema diff, where the previously used native type | ||
``LONGTEXT`` will be changed to ``JSON``. |
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.
I'm not sure this is actually true - the Comparator
doesn't inspect the actual column type so won't pick up the change (unless/until it has some other reason to alter that column). See #2266 (comment)
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.
@rh389 good point. Considering that, I can remove the upgrade notice again I suppose unless there are other reasons why BC could not be maintained here. Currently I can't think of any.
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.
Well, it will alter to a native JSON
type later if the user changes their column definition some other way, which might be a bit unexpected (buggy?) but I guess technically not a BC break.
When the column is updated though it's actually quite likely to fail in practice because the LONGTEXT
implementation used an empty string as a default value, which is invalid for native JSON
. It's not just the case that it'll only fail if the user was doing something weird.
Not a blocker IMO - just making sure you're aware.
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.
I see, there is nothing we can do about it if we want to move on. I'll remove the upgrade notice then.
3efba67
to
6b3ba2d
Compare
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.
Status: Needs work.
@@ -241,6 +242,7 @@ protected function getKeywords() | |||
'SSL', | |||
'STARTING', | |||
'STRAIGHT_JOIN', | |||
'STORED', |
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 should be placed after 'STARTING'
and before 'STRAIGHT_JOIN'
in order to keep the current sorting.
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.
Fixed.
public function testInitializesJsonTypeMapping() | ||
{ | ||
$this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('json')); | ||
$this->assertEquals('json_array', $this->_platform->getDoctrineTypeMapping('json')); |
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.
We should use assertSame()
instead.
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.
Fixed.
6b3ba2d
to
f4381c5
Compare
@Omranic waiting for an approval and merge from one of the other core members. |
Pending for 27 days...... |
That is quite short
…On 9 May 2017 9:14 a.m., "mpyw" ***@***.***> wrote:
Pending for 27 days......
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2653 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAJakMf7opT5a8Ss9FJeRQW4_f4lwLJgks5r4BJUgaJpZM4L8w1d>
.
|
@deeky666 Looks good to me |
@kimhemsoe @deeky666 I'm also using the branch in my product and working fine 👍 |
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.
LGTM 🚢
@Ocramius Thank you ✨ |
Hello guys, first of all thanks a lot for your work. I still get this message though :
Which makes me think that MySQL57Platform is never used or acknowledged? Any hints about where it could come from? Thanks in advance! Have a great week. |
@MartinVandersteen please report a separate issue with a way to reproduce it. |
I don't think there is any way I could find a way to reproduce it, just asking if something has to be done at some point for Dbal to understand it has to use MySQL57 ? On what ground does it decide which one to use? |
See dbal/lib/Doctrine/DBAL/Connection.php Line 391 in 399ab63
A test would:
That said, please report further findings on a new issue. |
The Type matrix does not reflect this change. In fact it doesn't show the https://www.doctrine-project.org/projects/doctrine-dbal/en/2.8/reference/types.html#mapping-matrix |
This is adopted from #2266 and #2455 and contains additional fixes, adjustments and upgrade notice.
I made the following decisions about this whole topic:
MySQL57Platform
as suggested by @beberlei because the first GA version of the5.7
series is5.7.9
UPGRADE.md
)json_array
type columns (they would be invalid with2.5
anyways so what's the point?)