Skip to content

[7.x] Allow overriding the MySQL server version for strict mode - #32708

Merged
taylorotwell merged 2 commits into
laravel:7.xfrom
Propaganistas:7.x-mysql-version
May 6, 2020
Merged

[7.x] Allow overriding the MySQL server version for strict mode#32708
taylorotwell merged 2 commits into
laravel:7.xfrom
Propaganistas:7.x-mysql-version

Conversation

@Propaganistas

Copy link
Copy Markdown
Contributor

A PR in response to #32681.

When working with managed MySQL servers from Azure there's quite a peculiar catch: the database servers are behind a proxy and these don't know in advance which version you're connecting to while handshaking.

As a consequence $connection->getAttribute(PDO::ATTR_SERVER_VERSION) will always yield 5.6.42.0 regardless of the actual MySQL version (like 8.0.x!), and Laravel is unable to set the correct modes.

Since there's no way to circumvent the spoofed server version, a simple version config -if present- seemed like the cleanest approach to me.

@taylorotwell
taylorotwell merged commit 25730a8 into laravel:7.x May 6, 2020
@Propaganistas
Propaganistas deleted the 7.x-mysql-version branch May 7, 2020 06:26
@GrahamCampbell GrahamCampbell changed the title Allow overriding the MySQL server version for strict mode [7.x] Allow overriding the MySQL server version for strict mode May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants