Bug #71117 mysqld_safe testcase broken with debug build
Submitted: 9 Dec 2013 8:48 Modified: 23 Oct 2015 6:45
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.7.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug, mtr

[9 Dec 2013 8:48] Laurynas Biveinis
If the compiled server binary is named mysqld-debug (i.e. -DWITH_DEBUG=ON), then mysqld_safe will fail because it runs mysqld_safe without mysqld binary present and without telling it to look for mysqld-debug instead.

How to repeat:
mysql-test-run --debug-server mysqld_safe
main.mysqld_safe                         [ fail ]
        Test ended at 2013-12-09 10:43:11

CURRENT_TEST: main.mysqld_safe
mysqltest: In included file "./include/wait_until_connected_again.inc": 
included from ./include/wait_until_connected_again.inc at line 22:
At line 22: Server failed to restart

The result from queries just before the failure was:
use test;

Which is not very descriptive, thus find the "exec sh $MYSQLD_SAFE" line and remove "> /dev/null 2>&1" from its tail, and try again:

mysql-test-run --debug-server mysqld_safe

131209 08:45:27 mysqld_safe The file /home/laurynas/percona/src/mysql-server/obj-debug/sql//mysqld
does not exist or is not executable. Please cd to the mysql installation

Suggested fix:
Not sure.
[9 Dec 2013 10:05] MySQL Verification Team
Hello Laurynas,

Thank you for the bug report.
Verified as described.

[10 Dec 2013 11:44] Bjørn Munch
Just a comment. Even if you build with -DWITH_DEBUG=ON, the server will by default still be named mysqld even if it's built with debug. Anything else would have been very impractical for developers.

You should only be getting the mysqld-debug if you also use
-DBUILD_CONFIG=mysql_release or if you explicitly turn on the name change with 

The release packages of MySQL include *both* mysqld and mysqld-debug so this test will work on those even if run with mtr --debug-server.
[19 Jun 2015 3:59] Laurynas Biveinis
I forgot about this report and managed to report this bug a second time, with a fix: bug 77374.
[19 Jun 2015 10:34] Erlend Dahl
Bug#77374 main.mysqld_safe test fails if only mysqld-debug was built

was marked as a duplicate. There is a contributed patch in that bug report.
[23 Oct 2015 6:45] Laurynas Biveinis
This has been fixed in 5.7.9 without a bug id under

$ git show 0f2a294
commit 0f2a294ac3c59d38cc7d6e7d5b8a860cd2d2cbdf
Author: shipjain <shipra.x.jain@oracle.com>
Date:   Wed Jul 15 09:16:03 2015 +0200

    fix to work with debug