MDEV-38726 Assertion `table->default_field != dfield_ptr' failed in b…#4629
Open
MDEV-38726 Assertion `table->default_field != dfield_ptr' failed in b…#4629
Conversation
…ool parse_vcol_defs(THD *, MEM_ROOT *, TABLE *, bool *, vcol_init_mode) A new assertion added by MDEV-36290 is correct in trying to identify default_fields that weren't correctly accounted in parse_vcol_defs. It caught a case for INSERT DELAYED on tables using TIMESTAMP and DATETIME types with ON UPDATE default values. That is, the insert delayed logic opens the table in one thread, and then copies the field info to another table in the user thread. This copy loses most flag metadata for these fields though. In this case, the flag ON_UPDATE_NOW_FLAG was dropped, and the parse_col_defs() logic was unable to properly account for that default field, and the assertion fired. This patch proposes two different options for a fix: Option 1: During the field copy, ensure all flag info is copied from the original field. I'm not sure sure about this though, as the existing logic seems quite clear that only a subset of flags are copied, rather than all. Option 2: Add ON_UPDATE_NOW_FLAG to be another specific hand-picked flag to be copied. Reviewed-by: TODO Signed-off-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
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.
…ool parse_vcol_defs(THD *, MEM_ROOT *, TABLE *, bool *, vcol_init_mode)
A new assertion added by MDEV-36290 is correct in trying to identify default_fields that weren't correctly accounted in parse_vcol_defs. It caught a case for INSERT DELAYED on tables using TIMESTAMP and DATETIME types with ON UPDATE default values. That is, the insert delayed logic opens the table in one thread, and then copies the field info to another table in the user thread. This copy loses most flag metadata for these fields though. In this case, the flag ON_UPDATE_NOW_FLAG was dropped, and the parse_col_defs() logic was unable to properly account for that default field, and the assertion fired.
This patch proposes two different options for a fix:
Option 1: During the field copy, ensure all flag info is copied from the original field. I'm not sure sure about this though, as the existing logic seems quite clear that only a subset of flags are copied, rather than all.
Option 2: Add ON_UPDATE_NOW_FLAG to be another specific hand-picked flag to be copied.