MDEV-40837: Crash while recording context when character_set_result is NULL - #5732
Closed
bsrikanth-mariadb wants to merge 1 commit into
Closed
bsrikanth-mariadb wants to merge 1 commit into
bsrikanth-mariadb wants to merge 1 commit into
Conversation
…is NULL The value of character_set_results can be set to null unlike character_set_client, or collation_connection. When recording context for a query in opt_context_store_replay.cc, character_set_results->cs_name was accessed, without checking if character_set_results value was null or not. Hence the crash. The solution is to add a null check for the variable character_set_results, before accessing cs_name, inside Optimizer_context_recorder::dump_sql_script().
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.
The value of character_set_results can be set to null unlike character_set_client, or collation_connection.
When recording context for a query in opt_context_store_replay.cc, character_set_results->cs_name was accessed, without checking if character_set_results value was null or not. Hence the crash.
The solution is to add a null check for the variable character_set_results, before accessing cs_name, inside Optimizer_context_recorder::dump_sql_script().