#At file:///home/lsoares/Workspace/mysql-server/bugfix/42444/6.0-rpl/
2805 Luis Soares 2009-01-29
BUG#42444: main.change_user: result from com_select differs between embedded and other runs
In 6.0-rpl this test was failing when mtr was running tests in embedded mode.
This happened because when in embedded mode, mtr does run "check_testcase" which
seems to cause extra selects. Since this test case relies on:
SHOW GLOBAL STATUS LIKE 'com_select';
for passing, this will get different values whether mtr is run in embedded
mode or other modes, therefore the test failure surfaces.
This patch address this issue by making the part of the test dependent from
SHOW GLOBAL STATUS LIKE 'com_select'; to work with relative instead of
absolute values (have a test start timestamp and then subtract it in
the checks).
modified:
mysql-test/r/change_user.result
mysql-test/t/change_user.test
=== modified file 'mysql-test/r/change_user.result'
--- a/mysql-test/r/change_user.result 2009-01-26 16:03:39 +0000
+++ b/mysql-test/r/change_user.result 2009-01-29 11:05:07 +0000
@@ -51,9 +51,3 @@ SELECT IS_USED_LOCK('bug31418');
IS_USED_LOCK('bug31418')
NULL
FLUSH STATUS;
-SHOW GLOBAL STATUS LIKE 'com_select';
-Variable_name Value
-Com_select 119
-SHOW GLOBAL STATUS LIKE 'com_select';
-Variable_name Value
-Com_select 119
=== modified file 'mysql-test/t/change_user.test'
--- a/mysql-test/t/change_user.test 2009-01-26 16:03:39 +0000
+++ b/mysql-test/t/change_user.test 2009-01-29 11:05:07 +0000
@@ -53,6 +53,7 @@ SELECT IS_USED_LOCK('bug31418');
FLUSH STATUS;
+let $start= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select', Value, 1);
--disable_result_log
--disable_query_log
@@ -68,8 +69,20 @@ while ($i)
--enable_query_log
--enable_result_log
-SHOW GLOBAL STATUS LIKE 'com_select';
+let $probe= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select', Value, 1);
+let $before= `SELECT $probe - $start`;
--change_user
-SHOW GLOBAL STATUS LIKE 'com_select';
+let $probe= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select', Value, 1);
+let $after= `SELECT $probe - $start`;
+
+# we check to see if the value is the same after the change user. note that we
+# need to add one to the $before variable as we need to account for the
+# select in the "let $before=`SELECT $probe - $start`" instruction
+if (!`SELECT $after = $before+1`)
+{
+ let $expected= `SELECT $before+1`;
+ --echo Expected: $expected, Got: $after
+ die select count mismatch!;
+}
| Thread |
|---|
| • bzr commit into mysql-6.0-rpl branch (luis.soares:2805) Bug#42444 | Luis Soares | 29 Jan |