Details
Description
While reading statistics for a table in function read_statistics_for_table_is_needed we don't protect the table_share fields and there is a chance that multiple threads would try to access it at the same time.
To see this
Lets add this patch to read_statistics_for_table
+fprintf(stderr, "READ %p\n", current_thd); fflush(stderr); |
+sleep(10);
|
+fprintf(stderr, "DONE %p\n", current_thd); fflush(stderr); |
+
|
and the server output is
 |
READ 0x7fc870000b00
|
READ 0x7fc874000b00
|
DONE 0x7fc870000b00
|
DONE 0x7fc874000b00
|
so different threads are entering the function at the same time.
So i think we need an exclusive lock to protect the members of table_share
Attachments
Issue Links
- relates to
-
MDEV-18899 Server crashes in Field::set_warning_truncated_wrong_value
- Closed
-
MDEV-19407 Assertion `field->table->stats_is_read' failed in is_eits_usable
- Closed
-
MDEV-29693 ANALYZE TABLE still flushes table definition cache when engine-independent statistics is used
- Closed