In some situation (as described below in “how to repeat”) the
table_rows column
in the information_schema.tables table is not computed
correctly.
The problem arise only for tables included in a merge table.
It seems that if you issue a select statement on a “merged table”
the following
insert statement does not update the metadata table_rows.
How-to-repeat
First of all let’s try the example showing the expected behavior
mysql> create table t1 (a int);
Query OK, 0 rows affected (0.00 sec)
mysql> create table t2 (a int);
Query OK, 0 rows affected (0.01 sec)
mysql> create table t (a int) engine=merge union=(t1,t2)
insert_method=last;
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t values(1),(2);
Query OK, 2 rows …
[Read more]