Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
-
None
Description
When a table is renamed, the previously collected statistics remain in userstat under the old table name.
If later a new table with the same name is created, the statistics are still not reset, but continue being updated as if it is still the same table.
The test case shows the effect for table_statistics, at least to some extent the same applies to index_statistics.
set @userstat.save= @@userstat; |
set global userstat= 1; |
|
create table t (a int); |
insert into t values (1),(2); |
select * from t; |
select table_name, rows_read from information_schema.table_statistics; |
|
rename table t to t2; |
create table t (b varchar(8)); |
select table_name, rows_read from information_schema.table_statistics; |
insert into t values ('foo'),('bar'),('baz'); |
select * from t; |
select table_name, rows_read from information_schema.table_statistics; |
|
# Cleanup
|
drop table t, t2; |
set global userstat= @userstat.save; |
10.4 23101304887e9e1987c45f001377382e3fdfd88f |
select table_name, rows_read from information_schema.table_statistics; |
table_name rows_read
|
t 2
|
rename table t to t2; |
create table t (b varchar(8)); |
select table_name, rows_read from information_schema.table_statistics; |
table_name rows_read
|
t 2
|
insert into t values ('foo'),('bar'),('baz'); |
select * from t; |
b
|
foo
|
bar
|
baz
|
select table_name, rows_read from information_schema.table_statistics; |
table_name rows_read
|
t 5
|