-
Notifications
You must be signed in to change notification settings - Fork 15
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
Query database to retrieve mysql-version to support mariadb and other… #19
Conversation
… distros with non-standard ports, attributes etc.
This would get you past the server check logic, but there are other places where Craft (and the underlying framework Yii), use PDO::ATTR_SERVER_VERSION checks to determine what SQL to generate and/or logic to run. You can search for Seems like Azure has a workaround for this... if you use ports 3308 or 3309, it'll end up reporting the correct MySQL version. https://docs.microsoft.com/en-us/azure/mysql/single-server/concepts-connect-to-a-gateway-node |
I know this work around, but it doesn't work for MariaDB with disabled SSL. bash-5.1$ php sqltest.php I've searched for "Craft::$app->getDb()->getSchema()->getServerVersion()" as suggested and it only came up with one result in cms/application/vendor/craftcms/cms/src/db/mysql/Schema.php inside the getDefaultBackupCommand function. Are there more? |
Ewww...
But even then, there's nothing stopping a plugin or custom module from doing |
Yeah, it's really bad.
Alright. We've talked with Microsoft now directly and there apparently is a better server structure that should give us the correct version. It seems the others are kind of "legacy". |
Interesting - do you happen to have a public link to what Microsoft said so we can point people that run into this in the future? |
It's called "Azure Database for MySQL Flexible Server". MariaDB is currently not available for these so we will switch to MySQL now. But it's apparently more modern server structure compared to the other services. |
@benediktblank thanks for that! |
… distros with non-standard ports, attributes etc.
Description
We had an issue on Azure, that in certain conditions the version retrieved from PDO::ATTR_SERVER_VERSION was completely wrong, not even a mariadb version.
That PR would change the version check here to a query directly on the database to get the version.
If that fails, it would fallback to PDO::ATTR_SERVER_VERSIO
Related issues