-
Notifications
You must be signed in to change notification settings - Fork 170
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
Wrong MySQL platform is being returned by the TracingDriverForV32 #734
Comments
We fixed this in #731, with version 4.9.1 being released today that contains the change. So to confirm, you already updated to 4.9.1, and the issue persists? |
Ok, so I understand we should also add |
Yes, I've updated to 4.9.1 and the issue persists. The reason is that the |
The This might be an issue in the The |
I tried looking at the changes that have been made in the DBAL in the next future major version (
To me, there is something missing for a deprecation-free and clean upgrade path from version @morozov since you are the original author of the changes in the DBAL, can you give us some hints on how you envisioned the upgrade path? |
I would like to go this route for now. I rather have some deprecation warnings than a broken SDK. I'll get the PR ready. |
@ste93cry Mind copying your comment over to #579? I reopened the issue. @SanderVerkuil This issue was fixed in 4.9.2, sorry for the trouble! |
@cleptric Yep, it has indeed been fixed! Thanks for the quick iteration and fast feedback ❤️ |
@ste93cry if you believe that there is an upgrade issue that might/should be addressed in the DBAL, please file an issue with doctrine/dbal and provide the relevant details there. |
Environment
What version are you running? Etc.
Steps to Reproduce
bin/console doctrine:schema:update --complete --dump-sql
.Expected Result
The command should succeed
Actual Result
An exception occurred that the platform does not support the
json
type.When building the connection, doctrine is fetching the DatabasePlatform. This calls the
detectDatabasePlatform
method, which chooses whether it will call the methodcreateDatabasePlatformForVersion
or the methodgetDatabasePlatform
.The
version
is fetched with the methodgetDatabasePlatformVersion()
. If the driver is not an instance of theVersionAwarePlatformDriver
interface, it always returnsnull
, which then calls thegetDatabasePlatform
method, which returns the defaultMySqlPlatform
, which does not support thejson
type.It should have returned the
MySQL80Platform
in my case.The fix appears to be as simple as implementing the
VersionAwarePlatformDriver
on theTracingDriverForV32
class, but in this comment the choice was made to not implement the deprecated interface, which makes sense.Though I do not fully understand why the
VersionAwarePlatformDriver
was deprecated, as the comment itself says thatAll drivers will have to be aware of the server version in the next major release.
, which leads me to believe that as of the next major version of thedoctrine/dbal
, thecreateDatabasePlatformForVersion
will be moved to theDriver
interface... This makes sense, but then theTracingDriverForV32
should still implement theVersionAwarePlatformDriver
right? At least until the next major version?The text was updated successfully, but these errors were encountered: