[MDEV-8297] information_schema.innodb_sys_tablestats.modified_counter doesn't change on UPDATE Created: 2015-06-10 Updated: 2016-04-21 Resolved: 2015-12-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0, 10.1 |
| Fix Version/s: | 10.0.23, 10.1.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Erik Cederstrand | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream-wontfix | ||
| Environment: |
10.0.14-MariaDB installed via homebrew on OS X 10.10.3 |
||
| Sprint: | 10.0.23 |
| Description |
|
According to https://dev.mysql.com/doc/refman/5.6/en/innodb-sys-tablestats-table.html (can't find the corresponding MariaDB documentation), the MODIFIED_COUNTER value in information_schema.INNODB_SYS_TABLESTATS is supposed to change on all DML operations. However, the value doesn't change when I issue an UPDATE on an InnoDB table:
I was expecting modified_counter to also change on the UPDATE statements. I'm trying to use these two values to emulate CHECKSUM TABLE foo QUICK; from MyISAM, to monitor for data changes to an InnoDB table. |
| Comments |
| Comment by Elena Stepanova [ 2015-06-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Same with MySQL 5.7:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
ErikCederstrand, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Erik Cederstrand [ 2015-06-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Elena, Thanks for the confirmation. I would be grateful if you would report upstream on my behalf. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-10-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Response from upstream:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-10-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Assigning to jplindst to decide whether we want to do anything about it on MariaDB side. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Erik Cederstrand [ 2015-10-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm happy to accept a #wontfix here, too, if there is an alternative way of monitoring an InnoDB table for (any) changes without requiring filesystem access and with performance comparable to CHECKSUM TABLE ... QUICK for MyISAM. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2015-12-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
commit 98c9fbfa215242f2930990a0a80b9c5642d23e58 Update modified-counter also if update effects non-indexed columns. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Erik Cederstrand [ 2016-04-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry to reopen this, but there's still something unexpected going on (for me, at least) with both indexed and non-indexed columns.
Looks good. num_rows is 1 and modified_counter is 1.
What? modified_counter counts backwards on UPDATE?
What? num_rows and modified_counter are now the same with table contents [(1, 2)] and [(3, 2)], even though I did two updates in a row.
No-op UPDATE doesn't change values. Looks good.
Looks good, modified_counter got incremented.
What? No-op UPDATE increments modified_counter even though MariaDB reports "Changed: 0". But maybe this is intentional, and I'm just misunderstanding the way num_rows and modified_counter is supposed to work? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Erik Cederstrand [ 2016-04-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I opened |