diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result
index a075c01fe61ef68697be120ab5de4c08df47901f..70da464a612d58e63978aabf7173b127a22a4577 100644
--- a/mysql-test/r/change_user.result
+++ b/mysql-test/r/change_user.result
@@ -44,3 +44,10 @@ IS_FREE_LOCK('bug31418')
 SELECT IS_USED_LOCK('bug31418');
 IS_USED_LOCK('bug31418')
 NULL
+FLUSH STATUS;
+SHOW GLOBAL STATUS LIKE 'com_select';
+Variable_name	Value
+Com_select	112
+SHOW GLOBAL STATUS LIKE 'com_select';
+Variable_name	Value
+Com_select	112
diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result
index 1b734136e6c0f5e7a594aebbb942967796423da8..f2ffe28895d34eb8262456290981ea86d791c53d 100644
--- a/mysql-test/r/not_embedded_server.result
+++ b/mysql-test/r/not_embedded_server.result
@@ -3,10 +3,3 @@ execute stmt1;
 ID	USER	HOST	DB	COMMAND	TIME	STATE	INFO
 number	root	localhost	test	Query	time	executing	SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!='Daemon'
 deallocate prepare stmt1;
-FLUSH STATUS;
-SHOW GLOBAL STATUS LIKE 'com_select';
-Variable_name	Value
-Com_select	102
-SHOW GLOBAL STATUS LIKE 'com_select';
-Variable_name	Value
-Com_select	102
diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test
index f200c76196c9d2d2323b977d406647b8eab19e92..47e503a9afd07a0913956707f3198f919b95be94 100644
--- a/mysql-test/t/change_user.test
+++ b/mysql-test/t/change_user.test
@@ -45,9 +45,26 @@ SELECT IS_USED_LOCK('bug31418');
 # Bug#31222: com_% global status counters behave randomly with
 # mysql_change_user.
 #
-# Moved to not_embedded_server.test due to Bug#34517: SHOW GLOBAL STATUS does
-# not work properly in embedded server.
-#
-# TODO: move it back when Bug#34517 is fixed (don't forget to add
-# --force-restart into change_user-master.opt).
-#
+
+FLUSH STATUS;
+
+--disable_result_log
+--disable_query_log
+
+let $i = 100;
+
+while ($i)
+{
+  dec $i;
+
+  SELECT 1;
+}
+
+--enable_query_log
+--enable_result_log
+
+SHOW GLOBAL STATUS LIKE 'com_select';
+
+--change_user
+
+SHOW GLOBAL STATUS LIKE 'com_select';
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index ffc13cf80f726bb0855375d81ffc24d1d359ba5d..5beee5967a3e6a0c1c3f0a433571e9ff27dd7121 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -20,38 +20,4 @@ prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!
 execute stmt1;
 deallocate prepare stmt1;
 
-
-#
-# Bug#31222: com_% global status counters behave randomly with
-# mysql_change_user.
-#
-# Moved from change_user.test due to Bug#34517: SHOW GLOBAL STATUS does not
-# work properly in embedded server.
-#
-# TODO: move it back when Bug#34517 is fixed.
-#
-
-FLUSH STATUS;
-
---disable_result_log
---disable_query_log
-
-let $i = 100;
-
-while ($i)
-{
-  dec $i;
-
-  SELECT 1;
-}
-
---enable_query_log
---enable_result_log
-
-SHOW GLOBAL STATUS LIKE 'com_select';
-
---change_user
-
-SHOW GLOBAL STATUS LIKE 'com_select';
-
 # End of 5.1 tests