-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Fix Connection.description migration for MySQL8 #12596
Fix Connection.description migration for MySQL8 #12596
Conversation
Trying to see if it works for both mysql 5.7 and 5.8 |
Does this mean we can't store emoji in connection descriptions? ;) |
dfdfd1d
to
da85aa4
Compare
Yeah . That's about it - and few really weird characters |
I really think we should disable support for utf8mb4 for MySQL (we can check it at runtime). I tested this version locally with both MySQL5.7 and MYSQL8. Both 5.7 and 8 have utf8mb3 set as default when you choose utf8: https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html. There is a note:
This is a bit of a joke when you match it with the offending client's behavior 🤦 I think we never really supported Utf8mb4 and while I tried to do it with separate collation for some too-long-indexes in 5.7 it was rather weird. WDYT? |
For me it looks like hard statement on no utf8mb4 support at all. |
BTW. The time when I looked at the uf8mb3 vs. utf8mb4 was when someone tried to use this in the description: 🦅 |
No idea, I haven't looked in to the details of mysql collations. Do you know if switching to TEXT instead has any other advantages? Going against mysql's docs seems like a bad idea? |
It's not going against it- we will likely have other "too big index" problems if we do that - just guessing. And it's not only this one field is a problem - in the same connection table there are already quite a few big test fields which are TEXT if you look at that. |
And it has another consequence - the migrations will have to be updated if we change the type of the colum - simply because for a short while during the migration the column will be added and fail. so we probably should somewhat adapt the old migrations to cope with it. |
Looking now. at the best way to fix the MySQL 8 problem |
2dd7ee5
to
246f90b
Compare
This change should address the migration @ashb and @kaxil - I made it in the way that the previous migration actually creates a Text field not string in case of mysql and the fix after that changes it to Text again. That should be safest if someone actually run the previous migration in non-UTF8mb4 mysql. I am looking at the two errors in MySQL8 that I saw in the previous run |
c9d318a
to
1573f04
Compare
OK @ashb -> everything works for MySQL8 now. |
I will split out the the change and we can merge one after the other |
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.
1573f04
to
7853311
Compare
Split out now. |
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! |
Good to merge now right? |
Due to a bug in Breeze initialization code, we were always running
against Postgres 9.6 and MySQL 5.7, even when the matrix selected
something else.
(We were overwriting the POSTGRES_VERSION and MYSQL_VERSION environment
variables in initialization code)
There was a connected problem that hidden the utf8mb4 problem as we
migrated to MySQL client 8, where utf8mb4 in mysql client 8
was silently falling back to latin 1 on database creation time
and we have not detected that.
We also fix uf8mb4 migration problem that was hidden due to those
missing tests.
Fixes #12588
^ 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.