Skip to content
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

Fixed: DatabaseConnection_mysql::$utf8mb4Supported is never initialized. #6370

Closed
kiamlaluno opened this issue Jan 15, 2024 · 2 comments · Fixed by backdrop/backdrop#4637
Closed

Comments

@kiamlaluno
Copy link
Member

kiamlaluno commented Jan 15, 2024

DatabaseConnection_mysql::utf8mb4IsSupported() uses a property ($utf8mb4Supported) to avoid running the CREATE TABLE {backdrop_utf8mb4_test} (id VARCHAR(255), PRIMARY KEY(id(255))) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=DYNAMIC ENGINE=INNODB query more than once, but that property is never initialized (and the query will be always executed when DatabaseConnection_mysql::utf8mb4IsSupported() is called).

DatabaseConnection_mysql::utf8mb4IsSupported() must be changed to set that property to FALSE (when an exception is caught) or TRUE.

@herbdool
Copy link

This makes sense to me.

@quicksketch
Copy link
Member

Nice catch on this oversight @kiamlaluno! I don't know how many times this method gets called within a single request, but it's clear that the intention was to set the property only once per request.

I merged backdrop/backdrop#4637 into 1.x and 1.27.x. Thanks @kiamlaluno and @herbdool!

@jenlampton jenlampton changed the title DatabaseConnection_mysql::$utf8mb4Supported is never initialized Fixed: DatabaseConnection_mysql::$utf8mb4Supported is never initialized. Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants