Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
N/A
Description
This is a regression introduced by MDEV-33151.
The column rows_changed already existed, it wasn't added by MDEV-33151; but it now shows wrong counts for UPDATE/DELETE, which wasn't happening before, apparently due to the typo:
@@ -40,14 +47,22 @@ static int table_stats_fill(THD *thd, TABLE_LIST *tables, COND *cond) |
check_grant(thd, SELECT_ACL, &tmp_table, 1, 1, 1)) |
continue; |
|
+ rows_changed= (rows_stats->inserted + rows_stats->updated +
|
+ rows_stats->updated);
|
set @userstat.save= @@userstat; |
set global userstat= 1; |
|
create table t (a int); |
insert into t values (1),(2); |
|
flush table_statistics;
|
update t set a = a + 10; |
select rows_changed from information_schema.table_statistics where table_name = 't'; |
delete from t where a = 11; |
select rows_changed from information_schema.table_statistics where table_name = 't'; |
|
# Cleanup
|
drop table t; |
set global userstat= @userstat.save; |
bb-11.5-MDEV-33151-userstat 36c7a912bc |
flush table_statistics;
|
update t set a = a + 10; |
select rows_changed from information_schema.table_statistics where table_name = 't'; |
rows_changed
|
4
|
delete from t where a = 11; |
select rows_changed from information_schema.table_statistics where table_name = 't'; |
rows_changed
|
4
|
The expected result is "2" and "3" correspondingly, which is returned by the baseline.
Attachments
Issue Links
- is caused by
-
MDEV-33151 Add more columns to TABLE_STATISTICS and USER STATS
- Closed