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
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue is caused by |
Description |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} {code:sql} 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'; # Cleanup drop table t; set global userstat= @userstat.save; {code} {code:sql|title=bb-11.5- flush table_statistics; update t set a = a + 10; select rows_changed from information_schema.table_statistics where table_name = 't'; rows_changed 4 {code} The expected result is "2", which is returned by the baseline. |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} Possibly the idea was to include *deleted* rows instead, which would seem quite logical, but before {code:sql} 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'; # Cleanup drop table t; set global userstat= @userstat.save; {code} {code:sql|title=bb-11.5- flush table_statistics; update t set a = a + 10; select rows_changed from information_schema.table_statistics where table_name = 't'; rows_changed 4 {code} The expected result is "2", which is returned by the baseline. |
Description |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} Possibly the idea was to include *deleted* rows instead, which would seem quite logical, but before {code:sql} 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'; # Cleanup drop table t; set global userstat= @userstat.save; {code} {code:sql|title=bb-11.5- flush table_statistics; update t set a = a + 10; select rows_changed from information_schema.table_statistics where table_name = 't'; rows_changed 4 {code} The expected result is "2", which is returned by the baseline. |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} Possibly the idea was to include *deleted* rows instead, which would seem quite logical, but on whatever reason, before {code:sql} 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'; # Cleanup drop table t; set global userstat= @userstat.save; {code} {code:sql|title=bb-11.5- flush table_statistics; update t set a = a + 10; select rows_changed from information_schema.table_statistics where table_name = 't'; rows_changed 4 {code} The expected result is "2", which is returned by the baseline. |
Description |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} Possibly the idea was to include *deleted* rows instead, which would seem quite logical, but on whatever reason, before {code:sql} 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'; # Cleanup drop table t; set global userstat= @userstat.save; {code} {code:sql|title=bb-11.5- flush table_statistics; update t set a = a + 10; select rows_changed from information_schema.table_statistics where table_name = 't'; rows_changed 4 {code} The expected result is "2", which is returned by the baseline. |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} {code:sql} 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; {code} {code:sql|title=bb-11.5- 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 {code} The expected result is "2" and "3" correspondingly, which is returned by the baseline. |
Summary | TABLE_STATISTICS increments rows_changed twice upon update | TABLE_STATISTICS increments rows_changed twice upon UPDATE and does not count DELETE |
Summary | TABLE_STATISTICS increments rows_changed twice upon UPDATE and does not count DELETE | TABLE_STATISTICS increments ROWS_CHANGED twice upon UPDATE and does not count DELETE |
Description |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} {code:sql} 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; {code} {code:sql|title=bb-11.5- 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 {code} The expected result is "2" and "3" correspondingly, which is returned by the baseline. |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} {code:sql} 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; {code} {code:sql|title=bb-11.5- 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 {code} The expected result is "2" and "3" correspondingly, which is returned by the baseline. |
Description |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} {code:sql} 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; {code} {code:sql|title=bb-11.5- 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 {code} The expected result is "2" and "3" correspondingly, which is returned by the baseline. |
This is a regression introduced by The column {{rows_changed}} already existed, it wasn't added by {code:java} @@ -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); {code} {code:sql} 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; {code} {code:sql|title=bb-11.5- 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 {code} The expected result is "2" and "3" correspondingly, which is returned by the baseline. |
Assignee | Michael Widenius [ monty ] | Elena Stepanova [ elenst ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Elena Stepanova [ elenst ] | Michael Widenius [ monty ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | In Testing [ 10301 ] |
Fix Version/s | 11.5.1 [ 29634 ] | |
Fix Version/s | 11.5 [ 29506 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Testing [ 10301 ] | Closed [ 6 ] |