File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -287,3 +287,17 @@ test t1 a 8 1
287
287
drop table t1;
288
288
set global userstat=@save_userstat;
289
289
# End of 11.5 tests
290
+ #
291
+ # MDEV-34782 SIGSEGV in handler::update_global_table_stats in
292
+ # close_thread_table()
293
+ #
294
+ CREATE TABLE t1 (a CHAR(1));
295
+ HANDLER t1 OPEN;
296
+ INSERT INTO t1 VALUES (1);
297
+ HANDLER t1 READ NEXT;
298
+ a
299
+ 1
300
+ SET GLOBAL userstat=1;
301
+ HANDLER t1 close;
302
+ drop table t1;
303
+ SET GLOBAL userstat=@save_userstat;
Original file line number Diff line number Diff line change @@ -162,3 +162,17 @@ drop table t1;
162
162
set global userstat=@save_userstat;
163
163
164
164
--echo # End of 11.5 tests
165
+
166
+ --echo #
167
+ --echo # MDEV-34782 SIGSEGV in handler::update_global_table_stats in
168
+ --echo # close_thread_table()
169
+ --echo #
170
+
171
+ CREATE TABLE t1 (a CHAR(1));
172
+ HANDLER t1 OPEN;
173
+ INSERT INTO t1 VALUES (1);
174
+ HANDLER t1 READ NEXT;
175
+ SET GLOBAL userstat=1;
176
+ HANDLER t1 close;
177
+ drop table t1;
178
+ SET GLOBAL userstat=@save_userstat;
Original file line number Diff line number Diff line change @@ -6106,8 +6106,11 @@ void handler::update_global_table_stats()
6106
6106
table_stats->rows_stats .deleted += rows_stats.deleted ;
6107
6107
table_stats->rows_stats .key_read_hit += rows_stats.key_read_hit ;
6108
6108
table_stats->rows_stats .key_read_miss += rows_stats.key_read_miss ;
6109
- table_stats->rows_stats .pages_accessed += handler_stats->pages_accessed ;
6110
- table_stats->rows_stats .pages_read_count += handler_stats->pages_read_count ;
6109
+ if (handler_stats)
6110
+ {
6111
+ table_stats->rows_stats .pages_accessed += handler_stats->pages_accessed ;
6112
+ table_stats->rows_stats .pages_read_count += handler_stats->pages_read_count ;
6113
+ }
6111
6114
changed= rows_stats.updated + rows_stats.inserted + rows_stats.deleted ;
6112
6115
table_stats->rows_changed_x_indexes += (changed *
6113
6116
(table->s ->keys ? table->s ->keys :
You can’t perform that action at this time.
0 commit comments