diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 7cbd225178e56dc825903dcde55867e57d1a5790..1bef01e3bd584868a0cafd257330019b34e73fc7 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2826,8 +2826,9 @@ sub check_ipv6_support {
 
 sub check_debug_support ($) {
   my $mysqld_variables= shift;
-
-  if ( ! $mysqld_variables->{'debug'} )
+  my $debug_var= $mysqld_variables->{'debug'};
+  
+  if ( !$debug_var || $debug_var eq "disabled")
   {
     #mtr_report(" - binaries are not debug compiled");
     $debug_compiled_binaries= 0;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 41e554fabd552245f977f688a8f3098c006bf81c..cc0ee652b169cf27dcace1b2b3e599ba6c0b8cbd 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1182,7 +1182,7 @@ static my_bool plugins_are_initialized= FALSE;
 #ifndef DBUG_OFF
 static const char* default_dbug_option;
 #endif
-static const char *current_dbug_option;
+static const char *current_dbug_option="disabled";
 #ifdef HAVE_LIBWRAP
 const char *libwrapName= NULL;
 int allow_severity = LOG_INFO;