diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index 5c1baa562c561cef130cbadd0f0ebec52afe1b70..98f9c93b25aeb0fc6a6449bd5e61c2207aaf5812 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -542,17 +542,25 @@ call p_verify_status_increment(0, 0, 0, 0);
 
 --echo # 16. A function changes non-trans-table.
 --echo #
+--echo # For row-based logging, there is an extra commit for the
+--echo # non-transactional changes saved in the transaction cache to
+--echo # the binary log. 
+--echo #
 select f1();
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(0, 0, 1, 0);
 commit;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(0, 0, 1, 0);
 
 --echo # 17. Read-only statement, a function changes non-trans-table.
 --echo #
+--echo # For row-based logging, there is an extra commit for the
+--echo # non-transactional changes saved in the transaction cache to
+--echo # the binary log. 
+--echo #
 select f1() from t1;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(1, 0, 2, 0);
 commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(1, 0, 2, 0);
 
 --echo # 18. Read-write statement: UPDATE, change 0 (transactional) rows. 
 --echo #
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index ed0034cfc997dfb62faadf248a25baa80159c50b..a2c1eb9a82ef2120901f56da5c18b802b3cc7ba9 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -571,27 +571,35 @@ SUCCESS
 
 # 16. A function changes non-trans-table.
 #
+# For row-based logging, there is an extra commit for the
+# non-transactional changes saved in the transaction cache to
+# the binary log. 
+#
 select f1();
 f1()
 2
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(0, 0, 1, 0);
 SUCCESS
 
 commit;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(0, 0, 1, 0);
 SUCCESS
 
 # 17. Read-only statement, a function changes non-trans-table.
 #
+# For row-based logging, there is an extra commit for the
+# non-transactional changes saved in the transaction cache to
+# the binary log. 
+#
 select f1() from t1;
 f1()
 2
 2
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(1, 0, 2, 0);
 SUCCESS
 
 commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(1, 0, 2, 0);
 SUCCESS
 
 # 18. Read-write statement: UPDATE, change 0 (transactional) rows.