-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-33170: ASAN errors upon CONVERT TABLE TO PARTITION with query cache #5120
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
base: 10.11
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4631,8 +4631,6 @@ static int fast_end_partition(THD *thd, ulonglong copied, | |
|
|
||
| thd->proc_info="end"; | ||
|
|
||
| query_cache_invalidate3(thd, table_list, 0); | ||
|
|
||
| my_snprintf(tmp_name, sizeof(tmp_name), ER_THD(thd, ER_INSERT_INFO), | ||
| (ulong) (copied + deleted), | ||
| (ulong) deleted, | ||
|
|
@@ -7733,6 +7731,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, | |
| check_table_data(lpt)) | ||
| goto err; | ||
|
|
||
| query_cache_invalidate3(thd, table_list, 0); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While moving the invalidation here fixes the Use-After-Free for the |
||
|
|
||
| if (write_log_drop_shadow_frm(lpt) || | ||
| ERROR_INJECT("convert_partition_3") || | ||
| mysql_write_frm(lpt, WFRM_WRITE_SHADOW) || | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
query_cache_invalidate3fromfast_end_partitionintroduces a regression for other fast partition operations (e.g.,ADD PARTITION,DROP PARTITION,REORGANIZE PARTITION). Sincefast_end_partitionis the common exit point for all fast partition alterations, these operations will no longer invalidate the query cache, leading to stale results. To fix the Use-After-Free while maintaining correctness, the invalidation should be moved to a common point at the beginning offast_alter_partition_tableto ensure all operations are covered and the cache is invalidated before any tables are closed or freed.