=== modified file 'mysql-test/t/show_explain.test'
--- mysql-test/t/show_explain.test	2013-10-16 09:38:42 +0000
+++ mysql-test/t/show_explain.test	2013-10-17 08:45:19 +0000
@@ -1167,9 +1167,34 @@ reap;
 
 set debug_dbug=@old_debug;
 DROP TABLE t1,t2;
+drop table t0;
+
+--echo #
+--echo #
+--echo #
+create table t0 (a int not null);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int, b int);
+insert into t1 select a,a from t0;
+
+create table t2 as select * from t1;
+
+set @show_explain_probe_select_id=2;
+set debug_dbug='+d,show_explain_probe_best_ext_lim_search';
+send
+explain 
+select * from t0 
+where not exists ( select 1 from t1, t2 where t1.b=t2.b and t2.a=t0.a) and a is null;
+
+connection default;
+--source include/wait_condition.inc
+evalp kill query $thr2;
+
+connection con1;
+reap;
 
 --echo # End
-drop table t0;
 connection default;
 disconnect con1;
 set debug_sync='RESET';

=== modified file 'sql/sql_select.cc'
--- sql/sql_select.cc	2013-10-16 09:38:42 +0000
+++ sql/sql_select.cc	2013-10-17 08:46:13 +0000
@@ -7412,6 +7412,14 @@ best_extension_by_limited_search(JOIN
   DBUG_ENTER("best_extension_by_limited_search");
 
   THD *thd= join->thd;
+
+  DBUG_EXECUTE_IF("show_explain_probe_best_ext_lim_search", 
+                  if (dbug_user_var_equals_int(thd, 
+                                               "show_explain_probe_select_id", 
+                                               join->select_lex->select_number))
+                        dbug_serve_apcs(thd, 1);
+                 );
+
   if (thd->check_killed())  // Abort
     DBUG_RETURN(TRUE);
 

