MDEV-39768: Optimizer trace should use utf8mb4#5132
Open
spetrunia wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Code Review
This pull request addresses MDEV-39768 by modifying the optimizer trace to use the utf8mb4 character set. It updates the Type and Longtext classes in sql/sql_i_s.h to support custom character sets, and modifies Type_handler_varchar::make_schema_field in sql/sql_type.cc to respect the custom charset and dynamically calculate octet length based on the character set's maximum byte length. The TRACE column in sql/opt_trace.cc is updated to use utf8mb4_general_ci, and corresponding test files and results are updated to verify this change. There are no review comments, and I have no additional feedback to provide.
f12af37 to
65eddba
Compare
JSON is utf8mb4. Change INFORMATION_SCHEMA.OPTIMIZER_TRACE.TRACE from using utf8mb3 to mb4. In order to do that: - Add m_charset into Show::Type (NULL means "use the default") - Make Type_handler_varchar::make_schema_field() check that field and use the specified charset/collation. - Add a constructor to Show::Longtext that allows to specify the charset - Make optimizer_trace use my_charset_utf8mb4_general_ci. - In fill_optimizer_trace_info(), indicate that the trace we've collected is utf8mb4
65eddba to
96cf971
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSON is utf8mb4. Change INFORMATION_SCHEMA.OPTIMIZER_TRACE.TRACE from using utf8mb3 to mb4.
In order to do that: