Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Nov 25, 2020

Based on #12596 so only the last commit counts.

We missed that when we added support
for differnet mysql versions in #7717 when we removed default
character set setting for the database server.

This change forces the default on database server to be
utf8mb4 - regardless if MySQL 5.7 or MySQL8 is used.
Utf8mb4 is default for MySQL8 but latin1 is default fo MySQL 5.7.

There was a suspected root cause of the problem:

https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html
where mysql client falls back to the default collation if
the client8 is used with 5.7 database, but this should be
no problem if the default DB character set is forced to be
utf8mb4

This PR restores forcing the server-side encoding.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

Due to not executing MySQL8 tests Fixed in apache#12591 added
description for connection table was not compatible with
MySQL8 with utf8mb4 character set.

This change adds migration and fixes the previous migration
to make it compatible.
@potiuk potiuk force-pushed the fix-mysql-client-8-5.7-compatible-encoding branch from c37b0f7 to 8d8e595 Compare November 25, 2020 12:33
@potiuk potiuk marked this pull request as draft November 25, 2020 12:45
We missed that when we added support
for differnet mysql versions in apache#7717 when we removed default
character set setting for the database server.

This change forces the default on database server to be
utf8mb4 - regardless if MySQL 5.7 or MySQL8 is used.
Utf8mb4 is default for MySQL8 but latin1 is default fo MySQL 5.7.

There was a suspected root cause of the problem:

https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html
where mysql client falls back to the default collation if
the client8 is used with 5.7 database, but this should be
no problem if the default DB character set is forced to be
utf8mb4

This PR restores forcing the server-side encoding.
@potiuk potiuk force-pushed the fix-mysql-client-8-5.7-compatible-encoding branch from 8d8e595 to c8dbff4 Compare November 25, 2020 12:48
@potiuk potiuk requested review from ashb and kaxil November 25, 2020 12:52
@potiuk potiuk marked this pull request as ready for review November 25, 2020 12:59
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Nov 25, 2020
@github-actions
Copy link

The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it!

@potiuk
Copy link
Member Author

potiuk commented Nov 25, 2020

Initialization and most tests work. Merging.

@potiuk potiuk merged commit 6d6ca14 into apache:master Nov 25, 2020
@potiuk potiuk deleted the fix-mysql-client-8-5.7-compatible-encoding branch November 25, 2020 13:37
@potiuk potiuk changed the title Fixes inconsistent behaviour of utf8mb4 encoding on Mysql 5.7/8 Fix Connection.description migration for MySQL8 Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants