Bug #37312 Make tests binlog_row_innodb_stat and binlog_stm_innodb_stat more robust
Submitted: 10 Jun 2008 17:19 Modified: 17 Oct 2008 19:34
Reporter: Vasil Dimov
Status: Closed
Category:Server: Tests Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Bugs System Target Version:5.1+
Tags: Contribution
Triage: Triaged: D3 (Medium)

[10 Jun 2008 17:19] Vasil Dimov
Description:
binlog_row_innodb_stat and binlog_stm_innodb_stat mysql-tests expect the output from:

  show status like "Innodb_buffer_pool_pages_total";

to be

  Innodb_buffer_pool_pages_total	512

but for the InnoDB Plugin the number is 511 without this being a bug. The tests should
not fail if something else than 512 is printed, this could change in the builtin InnoDB
too.

How to repeat:
Run the above tests with the InnoDB Plugin and observe the failures.

Suggested fix:
Support either 511 or 512 in the output, here is a patch:

--- patch begins here ---
--- mysql-test/extra/binlog_tests/innodb_stat.test.orig	2008-06-10 15:12:02.000000000
+0300
+++ mysql-test/extra/binlog_tests/innodb_stat.test	2008-06-10 15:12:06.000000000 +0300
@@ -41,6 +41,7 @@
 
 # Test for testable InnoDB status variables. This test
 # uses previous ones(pages_created, rows_deleted, ...).
+-- replace_regex /51[12]/51_/
 show status like "Innodb_buffer_pool_pages_total";
 show status like "Innodb_page_size";
 show status like "Innodb_rows_deleted";
--- mysql-test/suite/binlog/r/binlog_row_innodb_stat.result.orig	2008-06-10
15:29:44.000000000 +0300
+++ mysql-test/suite/binlog/r/binlog_row_innodb_stat.result	2008-06-10 15:30:04.000000000
+0300
@@ -24,7 +24,7 @@
 drop table t1;
 show status like "Innodb_buffer_pool_pages_total";
 Variable_name	Value
-Innodb_buffer_pool_pages_total	512
+Innodb_buffer_pool_pages_total	51_
 show status like "Innodb_page_size";
 Variable_name	Value
 Innodb_page_size	16384
--- mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result.orig	2008-06-10
15:33:43.000000000 +0300
+++ mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result	2008-06-10 15:33:55.000000000
+0300
@@ -24,7 +24,7 @@
 drop table t1;
 show status like "Innodb_buffer_pool_pages_total";
 Variable_name	Value
-Innodb_buffer_pool_pages_total	512
+Innodb_buffer_pool_pages_total	51_
 show status like "Innodb_page_size";
 Variable_name	Value
 Innodb_page_size	16384
--- patch ends here ---
[10 Jun 2008 17:20] Vasil Dimov
patch

Attachment: patch (application/octet-stream, text), 1.36 KiB.

[10 Jun 2008 17:27] Vasil Dimov
Probably it makes sense to remove this whole Innodb_buffer_pool_pages_total inspection,
e.g. delete the line that does show status like 'Innodb_buffer_pool_pages_total'; and the
correspoding lines in the results.
[10 Jun 2008 22:42] Sveta Smirnova
Thank you for the report.

Verified as described using code analysis.
[3 Sep 2008 16:30] Chad MILLER
There is still an error:

$ ./mtr binlog_row_innodb_stat 

binlog.binlog_row_innodb_stat 'row' [ pass ]           1317
binlog.binlog_row_innodb_stat 'stmt' [ fail ]

---
/home/cmiller/work/mysqlbzr/mysql-6.0-bugteam/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
      2008-09-03 17:27:26.000000000 +0300
+++
/home/cmiller/work/mysqlbzr/mysql-6.0-bugteam/mysql-test/suite/binlog/r/binlog_row_innodb_stat.reject
      2008-09-03 17:29:17.000000000 +0300
@@ -1,36 +1,36 @@
 show status like "binlog_cache_use";
 Variable_name  Value
-Binlog_cache_use       0
+Binlog_cache_use       2
 show status like "binlog_cache_disk_use";
 Variable_name  Value
-Binlog_cache_disk_use  0
+Binlog_cache_disk_use  1
 drop table if exists t1;
 create table t1 (a int) engine=innodb;
 show status like "binlog_cache_use";
 Variable_name  Value
-Binlog_cache_use       1
+Binlog_cache_use       3
 show status like "binlog_cache_disk_use";
 Variable_name  Value
-Binlog_cache_disk_use  1
+Binlog_cache_disk_use  2
 begin;
 delete from t1;
 commit;
 show status like "binlog_cache_use";
 Variable_name  Value
-Binlog_cache_use       2
+Binlog_cache_use       4
 show status like "binlog_cache_disk_use";
 Variable_name  Value
-Binlog_cache_disk_use  1
+Binlog_cache_disk_use  2
 drop table t1;
 show status like "Innodb_page_size";
 Variable_name  Value
 Innodb_page_size       16384
 show status like "Innodb_rows_deleted";
 Variable_name  Value
-Innodb_rows_deleted    2000
+Innodb_rows_deleted    4000
 show status like "Innodb_rows_inserted";
 Variable_name  Value
-Innodb_rows_inserted   2000
+Innodb_rows_inserted   4000
 show status like "Innodb_rows_updated";
 Variable_name  Value
 Innodb_rows_updated    0
[3 Sep 2008 16:31] Chad MILLER
That last result confirmed on OSX and Linux.
[8 Sep 2008 22:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53549

2733 Chad MILLER	2008-09-08
      Bug#37312: Make test binlog_{row,stm}_innodb_stat more robust
      
      The size of the Innodb_buffer_pool_pages differs by one byte on row versus
statement
      log, so neuter the last position of the stringified decimal representation. 
Innobase
      says the size isn't very important in any case.
      
      Also, split out the "mixed" format to its own file, as mtr seems to dislike having
only 
      stm and row but not mix.
[9 Sep 2008 1:20] Patrick Crews
Ok to push.
[18 Sep 2008 9:41] Chad MILLER
Reviewed over my shoulder in Riga/Latvija.
[18 Sep 2008 9:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54270

2741 Chad MILLER	2008-09-18 [merge]
      Merge Bug#37312.
[18 Sep 2008 10:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54271

2818 Chad MILLER	2008-09-18 [merge]
      Merge Bug#37312.
[18 Sep 2008 10:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54272

2818 Chad MILLER	2008-09-18 [merge]
      Merge Bug#37312.
[18 Sep 2008 10:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54273

2741 Chad MILLER	2008-09-18 [merge]
      Merge Bug#37312.
[18 Sep 2008 14:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54290
[18 Sep 2008 15:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54300
[22 Sep 2008 21:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54460

2744 Patrick Crews	2008-09-22
      Bug#37312 Make tests binlog_row_innodb_stat and binlog_stm_innodb_stat more robust
      
      Trimmed some error-prone and variable portions of the test and added 'flush status'
to ensure deterministic test
[22 Sep 2008 21:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54461

2821 Patrick Crews	2008-09-22 [merge]
      Bug#37312 Make tests binlog_row_innodb_stat and binlog_stm_innodb_stat more robust
      
      Upmerge 5.1-> 6.0
[22 Sep 2008 21:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54462

2821 Patrick Crews	2008-09-22 [merge]
      Bug#37312 Make tests binlog_row_innodb_stat and binlog_stm_innodb_stat more robust
      
      Upmerge 5.1-> 6.0
[9 Oct 2008 20:08] Bugs System
Pushed into 5.1.30  (revid:msvensson@mysql.com-20080922090300-g502675tuw4ytn33) (version
source revid:kpettersson@mysql.com-20080925170846-pq6nrweqvm2yfiym) (pib:4)
[15 Oct 2008 17:05] Paul DuBois
This is actually pushed to 5.1.29, not 5.1.30.
[15 Oct 2008 19:32] Paul DuBois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[17 Oct 2008 18:45] Bugs System
Pushed into 6.0.8-alpha  (revid:msvensson@mysql.com-20080922090300-g502675tuw4ytn33)
(version source revid:mattias.jonsson@sun.com-20080923130815-s8m77qazkowf0oc0) (pib:5)
[17 Oct 2008 19:34] Paul DuBois
No changelog entry needed.
[28 Oct 2008 22:04] Bugs System
Pushed into 5.1.29-ndb-6.2.17  (revid:msvensson@mysql.com-20080922090300-g502675tuw4ytn33)
(version source revid:tomas.ulin@sun.com-20081028140209-u4emkk1xphi5tkfb) (pib:5)
[28 Oct 2008 23:23] Bugs System
Pushed into 5.1.29-ndb-6.3.19  (revid:msvensson@mysql.com-20080922090300-g502675tuw4ytn33)
(version source revid:tomas.ulin@sun.com-20081028194045-0353yg8cvd2c7dd1) (pib:5)
[1 Nov 2008 10:49] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:msvensson@mysql.com-20080922090300-g502675tuw4ytn33)
(version source revid:jonas@mysql.com-20081101082305-qx5a1bj0z7i8ueys) (pib:5)