List:Commits« Previous MessageNext Message »
From:ahristov Date:September 13 2006 8:54am
Subject:bk commit into 5.1 tree (andrey:1.2313)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-13 10:54:18+02:00, andrey@stripped +5 -0
  provisional, experimental, patch for testing debug info
  in release build

  sql/event_data_objects.cc@stripped, 2006-09-13 10:54:11+02:00, andrey@stripped +86 -84
    provisional, experimental, patch for testing debug info
    in release build

  sql/event_db_repository.cc@stripped, 2006-09-13 10:54:12+02:00, andrey@stripped +41 -39
    provisional, experimental, patch for testing debug info
    in release build

  sql/event_queue.cc@stripped, 2006-09-13 10:54:12+02:00, andrey@stripped +52 -52
    provisional, experimental, patch for testing debug info
    in release build

  sql/event_scheduler.cc@stripped, 2006-09-13 10:54:12+02:00, andrey@stripped +40 -36
    provisional, experimental, patch for testing debug info
    in release build

  sql/events.cc@stripped, 2006-09-13 10:54:12+02:00, andrey@stripped +21 -15
    provisional, experimental, patch for testing debug info
    in release build

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	andrey
# Host:	example.com
# Root:	/work/mysql-5.1-runtime-wl3337-tree4_experiment

--- 1.65/sql/events.cc	2006-09-13 10:54:29 +02:00
+++ 1.66/sql/events.cc	2006-09-13 10:54:29 +02:00
@@ -22,6 +22,12 @@
 #include "event_scheduler.h"
 #include "sp_head.h"
 
+
+#define DBUG_PRINT_MINE(a,b) DBUG_PRINT(a, b); sql_print_information(b);
+#define DBUG_ENTER_MINE(a) DBUG_ENTER(a); sql_print_information("enter %s", a);
+  
+
+
 /*
  TODO list :
  - CREATE EVENT should not go into binary log! Does it now? The SQL statements
@@ -341,7 +347,7 @@ bool
 Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists)
 {
   int ret;
-  DBUG_ENTER("Events::create_event");
+  DBUG_ENTER_MINE("Events::create_event");
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -388,7 +394,7 @@ bool
 Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to)
 {
   int ret;
-  DBUG_ENTER("Events::update_event");
+  DBUG_ENTER_MINE("Events::update_event");
   LEX_STRING *new_dbname= rename_to ? &rename_to->m_db : NULL;
   LEX_STRING *new_name= rename_to ? &rename_to->m_name : NULL;
   if (unlikely(check_system_tables_error))
@@ -439,7 +445,7 @@ Events::drop_event(THD *thd, LEX_STRING 
                    bool only_from_disk)
 {
   int ret;
-  DBUG_ENTER("Events::drop_event");
+  DBUG_ENTER_MINE("Events::drop_event");
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -472,8 +478,8 @@ Events::drop_schema_events(THD *thd, cha
 {
   LEX_STRING const db_lex= { db, strlen(db) };
   
-  DBUG_ENTER("Events::drop_schema_events");  
-  DBUG_PRINT("enter", ("dropping events from %s", db));
+  DBUG_ENTER_MINE("Events::drop_schema_events");  
+  DBUG_PRINT_MINE("enter", ("dropping events from %s", db));
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -509,8 +515,8 @@ Events::show_create_event(THD *thd, LEX_
   int ret;
   Event_timed *et= new Event_timed();
 
-  DBUG_ENTER("Events::show_create_event");
-  DBUG_PRINT("enter", ("name: %s@%s", dbname.str, name.str));
+  DBUG_ENTER_MINE("Events::show_create_event");
+  DBUG_PRINT_MINE("enter", ("name: %s@%s", dbname.str, name.str));
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -585,7 +591,7 @@ int
 Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
 {
   char *db= NULL;
-  DBUG_ENTER("Events::fill_schema_events");
+  DBUG_ENTER_MINE("Events::fill_schema_events");
   Events *myself= get_instance();
   if (unlikely(myself->check_system_tables_error))
   {
@@ -628,7 +634,7 @@ Events::init()
 {
   THD *thd;
   bool res= FALSE;
-  DBUG_ENTER("Events::init");
+  DBUG_ENTER_MINE("Events::init");
 
   if (opt_event_scheduler == Events::EVENTS_DISABLED)
     DBUG_RETURN(FALSE);
@@ -690,7 +696,7 @@ end:
 void
 Events::deinit()
 {
-  DBUG_ENTER("Events::deinit");
+  DBUG_ENTER_MINE("Events::deinit");
   if (likely(!check_system_tables_error))
   {
     scheduler->stop();
@@ -749,7 +755,7 @@ Events::destroy_mutexes()
 void
 Events::dump_internal_status()
 {
-  DBUG_ENTER("Events::dump_internal_status");
+  DBUG_ENTER_MINE("Events::dump_internal_status");
   puts("\n\n\nEvents status:");
   puts("LLA = Last Locked At  LUA = Last Unlocked At");
   puts("WOC = Waiting On Condition  DL = Data Locked");
@@ -775,7 +781,7 @@ Events::dump_internal_status()
 bool
 Events::start_execution_of_events()
 {
-  DBUG_ENTER("Events::start_execution_of_events");
+  DBUG_ENTER_MINE("Events::start_execution_of_events");
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -801,7 +807,7 @@ Events::start_execution_of_events()
 bool
 Events::stop_execution_of_events()
 {
-  DBUG_ENTER("Events::stop_execution_of_events");
+  DBUG_ENTER_MINE("Events::stop_execution_of_events");
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -825,7 +831,7 @@ Events::stop_execution_of_events()
 bool
 Events::is_execution_of_events_started()
 {
-  DBUG_ENTER("Events::is_execution_of_events_started");
+  DBUG_ENTER_MINE("Events::is_execution_of_events_started");
   if (unlikely(check_system_tables_error))
   {
     my_error(ER_EVENTS_DB_ERROR, MYF(0));
@@ -857,7 +863,7 @@ Events::check_system_tables(THD *thd)
   Open_tables_state backup;
   bool ret= FALSE;
 
-  DBUG_ENTER("Events::check_system_tables");
+  DBUG_ENTER_MINE("Events::check_system_tables");
   DBUG_PRINT("enter", ("thd=0x%lx", thd));
 
   thd->reset_n_backup_open_tables_state(&backup);

--- 1.17/sql/event_db_repository.cc	2006-09-13 10:54:29 +02:00
+++ 1.18/sql/event_db_repository.cc	2006-09-13 10:54:29 +02:00
@@ -22,6 +22,8 @@
 #include "sp.h"
 #include "sp_head.h"
 
+#define DBUG_PRINT_MINE(a,b) DBUG_PRINT(a, b); sql_print_information b;
+#define DBUG_ENTER_MINE(a) DBUG_ENTER(a); sql_print_information("enter %s", a);
 
 static
 time_t mysql_event_last_create_time= 0L;
@@ -150,11 +152,11 @@ mysql_event_fill_row(THD *thd, TABLE *ta
   enum enum_events_table_field f_num;
   Field **fields= table->field;
 
-  DBUG_ENTER("mysql_event_fill_row");
+  DBUG_ENTER_MINE("mysql_event_fill_row");
 
-  DBUG_PRINT("info", ("dbname=[%s]", et->dbname.str));
-  DBUG_PRINT("info", ("name  =[%s]", et->name.str));
-  DBUG_PRINT("info", ("body  =[%s]", et->body.str));
+  DBUG_PRINT_MINE("info", ("dbname=[%s]", et->dbname.str));
+  DBUG_PRINT_MINE("info", ("name  =[%s]", et->name.str));
+  DBUG_PRINT_MINE("info", ("body  =[%s]", et->body.str));
 
   if (fields[f_num= ET_FIELD_DEFINER]->
                               store(et->definer.str, et->definer.length, scs))
@@ -272,9 +274,9 @@ Event_db_repository::index_read_for_db_f
   byte *key_buf= NULL;
   LINT_INIT(key_buf);
 
-  DBUG_ENTER("Event_db_repository::index_read_for_db_for_i_s");
+  DBUG_ENTER_MINE("Event_db_repository::index_read_for_db_for_i_s");
 
-  DBUG_PRINT("info", ("Using prefix scanning on PK"));
+  DBUG_PRINT_MINE("info", ("Using prefix scanning on PK"));
   event_table->file->ha_index_init(0, 1);
   event_table->field[ET_FIELD_DB]->store(db, strlen(db), scs);
   key_info= event_table->key_info;
@@ -291,7 +293,7 @@ Event_db_repository::index_read_for_db_f
     if (!(ret= event_table->file->index_read(event_table->record[0], key_buf,
                                              key_len, HA_READ_PREFIX)))
     {
-      DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret));
+      DBUG_PRINT_MINE("info",("Found rows. Let's retrieve them. ret=%d", ret));
       do
       {
         ret= copy_event_to_schema_table(thd, schema_table, event_table);
@@ -300,7 +302,7 @@ Event_db_repository::index_read_for_db_f
                                                   key_buf, key_len); 
       } while (ret == 0);
     }
-    DBUG_PRINT("info", ("Scan finished. ret=%d", ret));
+    DBUG_PRINT_MINE("info", ("Scan finished. ret=%d", ret));
   }
   event_table->file->ha_index_end(); 
   /*  ret is guaranteed to be != 0 */
@@ -331,7 +333,7 @@ Event_db_repository::table_scan_all_for_
 {
   int ret;
   READ_RECORD read_record_info;
-  DBUG_ENTER("Event_db_repository::table_scan_all_for_i_s");
+  DBUG_ENTER_MINE("Event_db_repository::table_scan_all_for_i_s");
 
   init_read_record(&read_record_info, thd, event_table, NULL, 1, 0);
 
@@ -347,7 +349,7 @@ Event_db_repository::table_scan_all_for_
       ret= copy_event_to_schema_table(thd, schema_table, event_table);
   } while (ret == 0);
 
-  DBUG_PRINT("info", ("Scan finished. ret=%d", ret));
+  DBUG_PRINT_MINE("info", ("Scan finished. ret=%d", ret));
   end_read_record(&read_record_info);
 
   /*  ret is guaranteed to be != 0 */
@@ -379,8 +381,8 @@ Event_db_repository::fill_schema_events(
   Open_tables_state backup;
   int ret= 0;
 
-  DBUG_ENTER("Event_db_repository::fill_schema_events");
-  DBUG_PRINT("info",("db=%s", db? db:"(null)"));
+  DBUG_ENTER_MINE("Event_db_repository::fill_schema_events");
+  DBUG_PRINT_MINE("info",("db=%s", db? db:"(null)"));
 
   thd->reset_n_backup_open_tables_state(&backup);
   if (open_event_table(thd, TL_READ, &event_table))
@@ -407,7 +409,7 @@ Event_db_repository::fill_schema_events(
   close_thread_tables(thd);
   thd->restore_backup_open_tables_state(&backup);
 
-  DBUG_PRINT("info", ("Return code=%d", ret));
+  DBUG_PRINT_MINE("info", ("Return code=%d", ret));
   DBUG_RETURN(ret);
 }
 
@@ -432,7 +434,7 @@ Event_db_repository::open_event_table(TH
                                       TABLE **table)
 {
   TABLE_LIST tables;
-  DBUG_ENTER("Event_db_repository::open_event_table");
+  DBUG_ENTER_MINE("Event_db_repository::open_event_table");
 
   bzero((char*) &tables, sizeof(tables));
   tables.db= (char*) "mysql";
@@ -472,7 +474,7 @@ Event_db_repository::open_event_table(TH
 static int
 check_parse_params(THD *thd, Event_parse_data *parse_data)
 {
-  DBUG_ENTER("check_parse_params");
+  DBUG_ENTER_MINE("check_parse_params");
 
   if (parse_data->check_parse_data(thd))
     DBUG_RETURN(EVEX_BAD_PARAMS);
@@ -525,12 +527,12 @@ Event_db_repository::create_event(THD *t
   LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
   bool dbchanged= FALSE;
 
-  DBUG_ENTER("Event_db_repository::create_event");
+  DBUG_ENTER_MINE("Event_db_repository::create_event");
 
   if (check_parse_params(thd, parse_data))
     goto err;
 
-  DBUG_PRINT("info", ("open mysql.event for update"));
+  DBUG_PRINT_MINE("info", ("open mysql.event for update"));
   if (open_event_table(thd, TL_WRITE, &table))
   {
     my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0));
@@ -538,10 +540,10 @@ Event_db_repository::create_event(THD *t
   }
 
 
-  DBUG_PRINT("info", ("name: %.*s", parse_data->name.length,
+  DBUG_PRINT_MINE("info", ("name: %.*s", parse_data->name.length,
              parse_data->name.str));
 
-  DBUG_PRINT("info", ("check existance of an event with the same name"));
+  DBUG_PRINT_MINE("info", ("check existance of an event with the same name"));
   if (!find_named_event(thd, parse_data->dbname, parse_data->name, table))
   {
     if (create_if_not)
@@ -555,7 +557,7 @@ Event_db_repository::create_event(THD *t
     goto err;
   }
 
-  DBUG_PRINT("info", ("non-existant, go forward"));
+  DBUG_PRINT_MINE("info", ("non-existant, go forward"));
 
   if ((ret= sp_use_new_db(thd, parse_data->dbname, &old_db, 0, &dbchanged)))
   {
@@ -591,7 +593,7 @@ Event_db_repository::create_event(THD *t
 
   if (!(parse_data->expression) && !(parse_data->execute_at.year))
   {
-    DBUG_PRINT("error", ("neither expression nor execute_at are set!"));
+    DBUG_PRINT_MINE("error", ("neither expression nor execute_at are set!"));
     my_error(ER_EVENT_NEITHER_M_EXPR_NOR_M_AT, MYF(0));
     goto err;
   }
@@ -658,7 +660,7 @@ Event_db_repository::update_event(THD *t
 {
   CHARSET_INFO *scs= system_charset_info;
   TABLE *table= NULL;
-  DBUG_ENTER("Event_db_repository::update_event");
+  DBUG_ENTER_MINE("Event_db_repository::update_event");
 
   if (open_event_table(thd, TL_WRITE, &table))
   {
@@ -669,11 +671,11 @@ Event_db_repository::update_event(THD *t
   if (check_parse_params(thd, parse_data))
     goto err;
 
-  DBUG_PRINT("info", ("dbname: %s", parse_data->dbname.str));
-  DBUG_PRINT("info", ("name: %s", parse_data->name.str));
-  DBUG_PRINT("info", ("user: %s", parse_data->definer.str));
+  DBUG_PRINT_MINE("info", ("dbname: %s", parse_data->dbname.str));
+  DBUG_PRINT_MINE("info", ("name: %s", parse_data->name.str));
+  DBUG_PRINT_MINE("info", ("user: %s", parse_data->definer.str));
   if (new_dbname)
-    DBUG_PRINT("info", ("rename to: %s@%s", new_dbname->str, new_name->str));
+    DBUG_PRINT_MINE("info", ("rename to: %s@%s", new_dbname->str, new_name->str));
 
   /* first look whether we overwrite */
   if (new_name)
@@ -767,8 +769,8 @@ Event_db_repository::drop_event(THD *thd
   Open_tables_state backup;
   int ret;
 
-  DBUG_ENTER("Event_db_repository::drop_event");
-  DBUG_PRINT("enter", ("%s@%s", db.str, name.str));
+  DBUG_ENTER_MINE("Event_db_repository::drop_event");
+  DBUG_PRINT_MINE("enter", ("%s@%s", db.str, name.str));
 
   thd->reset_n_backup_open_tables_state(&backup);
   if ((ret= open_event_table(thd, TL_WRITE, &table)))
@@ -826,8 +828,8 @@ Event_db_repository::find_named_event(TH
                                      TABLE *table)
 {
   byte key[MAX_KEY_LENGTH];
-  DBUG_ENTER("Event_db_repository::find_named_event");
-  DBUG_PRINT("enter", ("name: %.*s", name.length, name.str));
+  DBUG_ENTER_MINE("Event_db_repository::find_named_event");
+  DBUG_PRINT_MINE("enter", ("name: %.*s", name.length, name.str));
 
   /*
     Create key to find row. We have to use field->store() to be able to
@@ -849,11 +851,11 @@ Event_db_repository::find_named_event(TH
                                   table->key_info->key_length,
                                   HA_READ_KEY_EXACT))
   {
-    DBUG_PRINT("info", ("Row not found"));
+    DBUG_PRINT_MINE("info", ("Row not found"));
     DBUG_RETURN(TRUE);
   }
 
-  DBUG_PRINT("info", ("Row found!"));
+  DBUG_PRINT_MINE("info", ("Row found!"));
   DBUG_RETURN(FALSE);
 }
 
@@ -870,7 +872,7 @@ Event_db_repository::find_named_event(TH
 void
 Event_db_repository::drop_schema_events(THD *thd, LEX_STRING schema)
 {
-  DBUG_ENTER("Event_db_repository::drop_schema_events");
+  DBUG_ENTER_MINE("Event_db_repository::drop_schema_events");
   drop_events_by_field(thd, ET_FIELD_DB, schema);
   DBUG_VOID_RETURN;
 }
@@ -895,8 +897,8 @@ Event_db_repository::drop_events_by_fiel
   int ret= 0;
   TABLE *table= NULL;
   READ_RECORD read_record_info;
-  DBUG_ENTER("Event_db_repository::drop_events_by_field");  
-  DBUG_PRINT("enter", ("field=%d field_value=%s", field, field_value.str));
+  DBUG_ENTER_MINE("Event_db_repository::drop_events_by_field");  
+  DBUG_PRINT_MINE("enter", ("field=%d field_value=%s", field, field_value.str));
 
   if (open_event_table(thd, TL_WRITE, &table))
   {
@@ -917,12 +919,12 @@ Event_db_repository::drop_events_by_fiel
     char *et_field= get_field(thd->mem_root, table->field[field]);
 
     LEX_STRING et_field_lex= { et_field, strlen(et_field) };
-    DBUG_PRINT("info", ("Current event %s name=%s", et_field,
+    DBUG_PRINT_MINE("info", ("Current event %s name=%s", et_field,
                get_field(thd->mem_root, table->field[ET_FIELD_NAME])));
 
     if (!sortcmp_lex_string(et_field_lex, field_value, system_charset_info))
     {
-      DBUG_PRINT("info", ("Dropping"));
+      DBUG_PRINT_MINE("info", ("Dropping"));
       ret= table->file->ha_delete_row(table->record[0]);
     }
   }
@@ -957,8 +959,8 @@ Event_db_repository::load_named_event(TH
   int ret= 0;
   Open_tables_state backup;
 
-  DBUG_ENTER("Event_db_repository::load_named_event");
-  DBUG_PRINT("enter",("thd=0x%lx name:%*s",thd, name.length, name.str));
+  DBUG_ENTER_MINE("Event_db_repository::load_named_event");
+  DBUG_PRINT_MINE("enter",("thd=0x%lx name:%*s",thd, name.length, name.str));
 
   thd->reset_n_backup_open_tables_state(&backup);
 

--- 1.15/sql/event_queue.cc	2006-09-13 10:54:29 +02:00
+++ 1.16/sql/event_queue.cc	2006-09-13 10:54:29 +02:00
@@ -19,6 +19,8 @@
 #include "event_data_objects.h"
 #include "event_db_repository.h"
 
+#define DBUG_PRINT_MINE(a,b) DBUG_PRINT(a, b); sql_print_information b;
+#define DBUG_ENTER_MINE(a) DBUG_ENTER(a); sql_print_information("enter %s", a);
 
 #define EVENT_QUEUE_INITIAL_SIZE 30
 #define EVENT_QUEUE_EXTENT       30
@@ -140,8 +142,8 @@ Event_queue::init_queue(THD *thd, Event_
   bool res;
   struct event_queue_param *event_queue_param_value= NULL;
 
-  DBUG_ENTER("Event_queue::init_queue");
-  DBUG_PRINT("enter", ("this=0x%lx", this));
+  DBUG_ENTER_MINE("Event_queue::init_queue");
+  DBUG_PRINT_MINE("enter", ("this=0x%lx", this));
 
   LOCK_QUEUE_DATA();
   db_repository= db_repo;
@@ -186,7 +188,7 @@ err:
 void
 Event_queue::deinit_queue()
 {
-  DBUG_ENTER("Event_queue::deinit_queue");
+  DBUG_ENTER_MINE("Event_queue::deinit_queue");
 
   LOCK_QUEUE_DATA();
   empty_queue();
@@ -215,8 +217,8 @@ Event_queue::create_event(THD *thd, LEX_
 {
   int res;
   Event_queue_element *new_element;
-  DBUG_ENTER("Event_queue::create_event");
-  DBUG_PRINT("enter", ("thd=0x%lx et=%s.%s",thd, dbname.str, name.str));
+  DBUG_ENTER_MINE("Event_queue::create_event");
+  DBUG_PRINT_MINE("enter", ("thd=0x%lx et=%s.%s",thd, dbname.str, name.str));
 
   new_element= new Event_queue_element();
   res= db_repository->load_named_event(thd, dbname, name, new_element);
@@ -227,7 +229,7 @@ Event_queue::create_event(THD *thd, LEX_
     new_element->compute_next_execution_time();
 
     LOCK_QUEUE_DATA();
-    DBUG_PRINT("info", ("new event in the queue 0x%lx", new_element));
+    DBUG_PRINT_MINE("info", ("new event in the queue 0x%lx", new_element));
     queue_insert_safe(&queue, (byte *) new_element);
     dbug_dump_queue(thd->query_start());
     pthread_cond_broadcast(&COND_queue_state);  
@@ -261,8 +263,8 @@ Event_queue::update_event(THD *thd, LEX_
   int res;
   Event_queue_element *new_element;
 
-  DBUG_ENTER("Event_queue::update_event");
-  DBUG_PRINT("enter", ("thd=0x%lx et=[%s.%s]", thd, dbname.str, name.str));
+  DBUG_ENTER_MINE("Event_queue::update_event");
+  DBUG_PRINT_MINE("enter", ("thd=0x%lx et=[%s.%s]", thd, dbname.str, name.str));
 
   new_element= new Event_queue_element();
 
@@ -275,7 +277,7 @@ Event_queue::update_event(THD *thd, LEX_
   }
   else if (new_element->status == Event_queue_element::DISABLED)
   {
-    DBUG_PRINT("info", ("The event is disabled."));
+    DBUG_PRINT_MINE("info", ("The event is disabled."));
     /*
       Destroy the object but don't skip to end: because we may have to remove
       object from the cache.
@@ -292,7 +294,7 @@ Event_queue::update_event(THD *thd, LEX_
   /* If not disabled event */
   if (new_element)
   {
-    DBUG_PRINT("info", ("new event in the Q 0x%lx", new_element));
+    DBUG_PRINT_MINE("info", ("new event in the Q 0x%lx", new_element));
     queue_insert_safe(&queue, (byte *) new_element);
     pthread_cond_broadcast(&COND_queue_state);  
   }
@@ -301,7 +303,7 @@ Event_queue::update_event(THD *thd, LEX_
   UNLOCK_QUEUE_DATA();
 
 end:
-  DBUG_PRINT("info", ("res=%d", res));
+  DBUG_PRINT_MINE("info", ("res=%d", res));
   DBUG_RETURN(res);
 }
 
@@ -319,8 +321,8 @@ end:
 void
 Event_queue::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name)
 {
-  DBUG_ENTER("Event_queue::drop_event");
-  DBUG_PRINT("enter", ("thd=0x%lx db=%s name=%s", thd, dbname, name));
+  DBUG_ENTER_MINE("Event_queue::drop_event");
+  DBUG_PRINT_MINE("enter", ("thd=0x%lx db=%s name=%s", thd, dbname, name));
 
   LOCK_QUEUE_DATA();
   find_n_remove_event(dbname, name);
@@ -358,13 +360,13 @@ Event_queue::drop_matching_events(THD *t
                            bool (*comparator)(LEX_STRING, Event_basic *))
 {
   uint i= 0;
-  DBUG_ENTER("Event_queue::drop_matching_events");
-  DBUG_PRINT("enter", ("pattern=%s", pattern.str));
+  DBUG_ENTER_MINE("Event_queue::drop_matching_events");
+  DBUG_PRINT_MINE("enter", ("pattern=%s", pattern.str));
 
   while (i < queue.elements)
   {
     Event_queue_element *et= (Event_queue_element *) queue_element(&queue, i);
-    DBUG_PRINT("info", ("[%s.%s]?", et->dbname.str, et->name.str));
+    DBUG_PRINT_MINE("info", ("[%s.%s]?", et->dbname.str, et->name.str));
     if (comparator(pattern, et))
     {
       /*
@@ -408,7 +410,7 @@ Event_queue::drop_matching_events(THD *t
 void
 Event_queue::drop_schema_events(THD *thd, LEX_STRING schema)
 {
-  DBUG_ENTER("Event_queue::drop_schema_events");
+  DBUG_ENTER_MINE("Event_queue::drop_schema_events");
   LOCK_QUEUE_DATA();
   drop_matching_events(thd, schema, event_basic_db_equal);
   UNLOCK_QUEUE_DATA();
@@ -433,12 +435,12 @@ void
 Event_queue::find_n_remove_event(LEX_STRING db, LEX_STRING name)
 {
   uint i;
-  DBUG_ENTER("Event_queue::find_n_remove_event");
+  DBUG_ENTER_MINE("Event_queue::find_n_remove_event");
 
   for (i= 0; i < queue.elements; ++i)
   {
     Event_queue_element *et= (Event_queue_element *) queue_element(&queue, i);
-    DBUG_PRINT("info", ("[%s.%s]==[%s.%s]?", db.str, name.str,
+    DBUG_PRINT_MINE("info", ("[%s.%s]==[%s.%s]?", db.str, name.str,
                         et->dbname.str, et->name.str));
     if (event_basic_identifier_equal(db, name, et))
     {
@@ -481,8 +483,8 @@ Event_queue::load_events_from_db(THD *th
   uint count= 0;
   bool clean_the_queue= TRUE;
 
-  DBUG_ENTER("Event_queue::load_events_from_db");
-  DBUG_PRINT("enter", ("thd=0x%lx", thd));
+  DBUG_ENTER_MINE("Event_queue::load_events_from_db");
+  DBUG_PRINT_MINE("enter", ("thd=0x%lx", thd));
 
   if ((ret= db_repository->open_event_table(thd, TL_READ, &table)))
   {
@@ -496,10 +498,10 @@ Event_queue::load_events_from_db(THD *th
     Event_queue_element *et;
     if (!(et= new Event_queue_element))
     {
-      DBUG_PRINT("info", ("Out of memory"));
+      DBUG_PRINT_MINE("info", ("Out of memory"));
       break;
     }
-    DBUG_PRINT("info", ("Loading event from row."));
+    DBUG_PRINT_MINE("info", ("Loading event from row."));
 
     if ((ret= et->load_from_row(table)))
     {
@@ -509,7 +511,7 @@ Event_queue::load_events_from_db(THD *th
     }
     if (et->status != Event_queue_element::ENABLED)
     {
-      DBUG_PRINT("info",("%s is disabled",et->name.str));
+      DBUG_PRINT_MINE("info",("%s is disabled",et->name.str));
       delete et;
       continue;
     }
@@ -524,7 +526,7 @@ Event_queue::load_events_from_db(THD *th
 
     {
       Event_job_data temp_job_data;
-      DBUG_PRINT("info", ("Event %s loaded from row. ", et->name.str));
+      DBUG_PRINT_MINE("info", ("Event %s loaded from row. ", et->name.str));
 
       temp_job_data.load_from_row(table);
 
@@ -553,7 +555,7 @@ Event_queue::load_events_from_db(THD *th
       goto end;
     }
 
-    DBUG_PRINT("load_events_from_db", ("Adding 0x%lx to the exec list."));
+    DBUG_PRINT_MINE("load_events_from_db", ("Adding 0x%lx to the exec list."));
     queue_insert_safe(&queue,  (byte *) et);
     count++;
   }
@@ -575,7 +577,7 @@ end:
 
   close_thread_tables(thd);
 
-  DBUG_PRINT("info", ("Status code %d. Loaded %d event(s)", ret, count));
+  DBUG_PRINT_MINE("info", ("Status code %d. Loaded %d event(s)", ret, count));
   DBUG_RETURN(ret);
 }
 
@@ -597,10 +599,10 @@ void
 Event_queue::recalculate_activation_times(THD *thd)
 {
   uint i;
-  DBUG_ENTER("Event_queue::recalculate_activation_times");
+  DBUG_ENTER_MINE("Event_queue::recalculate_activation_times");
 
   LOCK_QUEUE_DATA();
-  DBUG_PRINT("info", ("%u loaded events to be recalculated", queue.elements));
+  DBUG_PRINT_MINE("info", ("%u loaded events to be recalculated", queue.elements));
   for (i= 0; i < queue.elements; i++)
   {
     ((Event_queue_element*)queue_element(&queue, i))->compute_next_execution_time();
@@ -628,8 +630,8 @@ void
 Event_queue::empty_queue()
 {
   uint i;
-  DBUG_ENTER("Event_queue::empty_queue");
-  DBUG_PRINT("enter", ("Purging the queue. %d element(s)", queue.elements));
+  DBUG_ENTER_MINE("Event_queue::empty_queue");
+  DBUG_PRINT_MINE("enter", ("Purging the queue. %d element(s)", queue.elements));
   sql_print_information("SCHEDULER: Purging queue. %u events", queue.elements);
   /* empty the queue */
   for (i= 0; i < queue.elements; ++i)
@@ -653,16 +655,15 @@ Event_queue::empty_queue()
 void
 Event_queue::dbug_dump_queue(time_t now)
 {
-#ifndef DBUG_OFF
   Event_queue_element *et;
   uint i;
-  DBUG_ENTER("Event_queue::dbug_dump_queue");
-  DBUG_PRINT("info", ("Dumping queue . Elements=%u", queue.elements));
+  DBUG_ENTER_MINE("Event_queue::dbug_dump_queue");
+  DBUG_PRINT_MINE("info", ("Dumping queue . Elements=%u", queue.elements));
   for (i = 0; i < queue.elements; i++)
   {
     et= ((Event_queue_element*)queue_element(&queue, i));
-    DBUG_PRINT("info",("et=0x%lx db=%s name=%s",et, et->dbname.str, et->name.str));
-    DBUG_PRINT("info", ("exec_at=%llu starts=%llu ends=%llu execs_so_far=%u"
+    DBUG_PRINT_MINE("info",("et=0x%lx db=%s name=%s",et, et->dbname.str, et->name.str));
+    DBUG_PRINT_MINE("info", ("exec_at=%llu starts=%llu ends=%llu execs_so_far=%u"
                " expr=%lld et.exec_at=%d now=%d (et.exec_at - now)=%d if=%d",
                TIME_to_ulonglong_datetime(&et->execute_at),
                TIME_to_ulonglong_datetime(&et->starts),
@@ -673,7 +674,6 @@ Event_queue::dbug_dump_queue(time_t now)
                sec_since_epoch_TIME(&et->execute_at) <= now));
   }
   DBUG_VOID_RETURN;
-#endif
 }
 
 static const char *queue_empty_msg= "Waiting on empty queue";
@@ -708,7 +708,7 @@ Event_queue::get_top_for_execution_if_ti
   struct timespec top_time;
   struct timespec *abstime;
   *job_data= NULL;
-  DBUG_ENTER("Event_queue::get_top_for_execution_if_time");
+  DBUG_ENTER_MINE("Event_queue::get_top_for_execution_if_time");
 
   top_time.tv_nsec= 0;
   LOCK_QUEUE_DATA();
@@ -746,7 +746,7 @@ Event_queue::get_top_for_execution_if_ti
       cond_wait(thd, abstime, msg, SCHED_FUNC, __LINE__);
       if (thd->killed)
       {
-        DBUG_PRINT("info", ("thd->killed=%d", thd->killed));
+        DBUG_PRINT_MINE("info", ("thd->killed=%d", thd->killed));
         goto end;
       }
       /*
@@ -757,7 +757,7 @@ Event_queue::get_top_for_execution_if_ti
       continue;
     }
 
-    DBUG_PRINT("info", ("Ready for execution"));
+    DBUG_PRINT_MINE("info", ("Ready for execution"));
     if (!(*job_data= new Event_job_data()))
     {
       ret= TRUE;
@@ -766,7 +766,7 @@ Event_queue::get_top_for_execution_if_ti
     if ((res= db_repository->load_named_event(thd, top->dbname, top->name,
                                               *job_data)))
     {
-      DBUG_PRINT("error", ("Got %d from load_named_event", res));
+      DBUG_PRINT_MINE("error", ("Got %d from load_named_event", res));
       delete *job_data;
       *job_data= NULL;
       ret= TRUE;
@@ -776,7 +776,7 @@ Event_queue::get_top_for_execution_if_ti
     top->mark_last_executed(thd);
     if (top->compute_next_execution_time())
       top->status= Event_queue_element::DISABLED;
-    DBUG_PRINT("info", ("event %s status is %d", top->name.str, top->status));
+    DBUG_PRINT_MINE("info", ("event %s status is %d", top->name.str, top->status));
 
     (*job_data)->execution_count= top->execution_count;
 
@@ -784,7 +784,7 @@ Event_queue::get_top_for_execution_if_ti
     if (((top->execute_at.year && !top->expression) || top->execute_at_null) ||
         (top->status == Event_queue_element::DISABLED))
     {
-      DBUG_PRINT("info", ("removing from the queue"));
+      DBUG_PRINT_MINE("info", ("removing from the queue"));
       sql_print_information("SCHEDULER: Last execution of %s.%s. %s",
                             top->dbname.str, top->name.str,
                             top->dropped? "Dropping.":"");
@@ -802,11 +802,11 @@ Event_queue::get_top_for_execution_if_ti
 end:
   UNLOCK_QUEUE_DATA();
   
-  DBUG_PRINT("info", ("returning %d. et_new=0x%lx abstime.tv_sec=%d ",
+  DBUG_PRINT_MINE("info", ("returning %d. et_new=0x%lx abstime.tv_sec=%d ",
              ret, *job_data, abstime? abstime->tv_sec:0));
 
   if (*job_data)
-    DBUG_PRINT("info", ("db=%s  name=%s definer=%s", (*job_data)->dbname.str,
+    DBUG_PRINT_MINE("info", ("db=%s  name=%s definer=%s", (*job_data)->dbname.str,
                (*job_data)->name.str, (*job_data)->definer.str));
 
   DBUG_RETURN(ret);
@@ -826,8 +826,8 @@ end:
 void
 Event_queue::lock_data(const char *func, uint line)
 {
-  DBUG_ENTER("Event_queue::lock_data");
-  DBUG_PRINT("enter", ("func=%s line=%u", func, line));
+  DBUG_ENTER_MINE("Event_queue::lock_data");
+  DBUG_PRINT_MINE("enter", ("func=%s line=%u", func, line));
   mutex_last_attempted_lock_in_func= func;
   mutex_last_attempted_lock_at_line= line;
   mutex_queue_data_attempting_lock= TRUE;
@@ -857,8 +857,8 @@ Event_queue::lock_data(const char *func,
 void
 Event_queue::unlock_data(const char *func, uint line)
 {
-  DBUG_ENTER("Event_queue::unlock_data");
-  DBUG_PRINT("enter", ("func=%s line=%u", func, line));
+  DBUG_ENTER_MINE("Event_queue::unlock_data");
+  DBUG_PRINT_MINE("enter", ("func=%s line=%u", func, line));
   mutex_last_unlocked_at_line= line;
   mutex_queue_data_locked= FALSE;
   mutex_last_unlocked_in_func= func;
@@ -883,7 +883,7 @@ void
 Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
                        const char *func, uint line)
 {
-  DBUG_ENTER("Event_queue::cond_wait");
+  DBUG_ENTER_MINE("Event_queue::cond_wait");
   waiting_on_cond= TRUE;
   mutex_last_unlocked_at_line= line;
   mutex_queue_data_locked= FALSE;
@@ -891,7 +891,7 @@ Event_queue::cond_wait(THD *thd, struct 
 
   thd->enter_cond(&COND_queue_state, &LOCK_event_queue, msg);
 
-  DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":""));
+  DBUG_PRINT_MINE("info", ("pthread_cond_%swait", abstime? "timed":""));
   if (!abstime)
     pthread_cond_wait(&COND_queue_state, &LOCK_event_queue);
   else
@@ -923,7 +923,7 @@ Event_queue::cond_wait(THD *thd, struct 
 void
 Event_queue::dump_internal_status()
 {
-  DBUG_ENTER("Event_queue::dump_internal_status");
+  DBUG_ENTER_MINE("Event_queue::dump_internal_status");
 
   /* element count */
   puts("");

--- 1.27/sql/event_scheduler.cc	2006-09-13 10:54:29 +02:00
+++ 1.28/sql/event_scheduler.cc	2006-09-13 10:54:29 +02:00
@@ -20,6 +20,10 @@
 #include "event_scheduler.h"
 #include "event_queue.h"
 
+#define DBUG_PRINT_MINE(a,b) DBUG_PRINT(a, b); sql_print_information b;
+#define DBUG_ENTER_MINE(a) DBUG_ENTER(a); sql_print_information("enter %s", a);
+
+
 #ifdef __GNUC__
 #if __GNUC__ >= 2
 #define SCHED_FUNC __FUNCTION__
@@ -65,7 +69,7 @@ static void
 evex_print_warnings(THD *thd, Event_job_data *et)
 {
   MYSQL_ERROR *err;
-  DBUG_ENTER("evex_print_warnings");
+  DBUG_ENTER_MINE("evex_print_warnings");
   if (!thd->warn_list.elements)
     DBUG_VOID_RETURN;
 
@@ -148,7 +152,7 @@ deinit_event_thread(THD *thd)
   thd->proc_info= "Clearing";
   DBUG_ASSERT(thd->net.buff != 0);
   net_end(&thd->net);
-  DBUG_PRINT("exit", ("Event thread finishing"));
+  DBUG_PRINT_MINE("exit", ("Event thread finishing"));
   pthread_mutex_lock(&LOCK_thread_count);
   thread_count--;
   thread_running--;
@@ -176,7 +180,7 @@ deinit_event_thread(THD *thd)
 void
 pre_init_event_thread(THD* thd)
 {
-  DBUG_ENTER("pre_init_event_thread");
+  DBUG_ENTER_MINE("pre_init_event_thread");
   thd->client_capabilities= 0;
   thd->security_ctx->master_access= 0;
   thd->security_ctx->db_access= 0;
@@ -226,7 +230,7 @@ event_scheduler_thread(void *arg)
 
   thd->thread_stack= (char *)&thd;              // remember where our stack is
 
-  DBUG_ENTER("event_scheduler_thread");
+  DBUG_ENTER_MINE("event_scheduler_thread");
 
   if (!post_init_event_thread(thd))
     scheduler->run(thd);
@@ -260,11 +264,11 @@ event_worker_thread(void *arg)
   thd= event->thd;
 
   thd->thread_stack= (char *) &thd;             // remember where our stack is
-  DBUG_ENTER("event_worker_thread");
+  DBUG_ENTER_MINE("event_worker_thread");
 
   if (!post_init_event_thread(thd))
   {
-    DBUG_PRINT("info", ("Baikonur, time is %d, BURAN reporting and operational."
+    DBUG_PRINT_MINE("info", ("Baikonur, time is %d, BURAN reporting and operational."
                "THD=0x%lx", time(NULL), thd));
 
     sql_print_information("SCHEDULER: [%s.%s of %s] executing in thread %lu. "
@@ -289,7 +293,7 @@ event_worker_thread(void *arg)
     else if (ret == EVEX_MICROSECOND_UNSUP)
       sql_print_information("SCHEDULER: MICROSECOND is not supported");
   }
-  DBUG_PRINT("info", ("BURAN %s.%s is landing!", event->dbname.str,
+  DBUG_PRINT_MINE("info", ("BURAN %s.%s is landing!", event->dbname.str,
              event->name.str));
   delete event;
 
@@ -375,10 +379,10 @@ Event_scheduler::start()
   bool ret= FALSE;
   pthread_t th;
   struct scheduler_param *scheduler_param_value;
-  DBUG_ENTER("Event_scheduler::start");
+  DBUG_ENTER_MINE("Event_scheduler::start");
 
   LOCK_DATA();
-  DBUG_PRINT("info", ("state before action %s", scheduler_states_names[state]));
+  DBUG_PRINT_MINE("info", ("state before action %s", scheduler_states_names[state]));
   if (state > INITIALIZED)
     goto end;
 
@@ -398,13 +402,13 @@ Event_scheduler::start()
   scheduler_param_value->scheduler= this;
 
   scheduler_thd= new_thd;
-  DBUG_PRINT("info", ("Setting state go RUNNING"));
+  DBUG_PRINT_MINE("info", ("Setting state go RUNNING"));
   state= RUNNING;
-  DBUG_PRINT("info", ("Forking new thread for scheduduler. THD=0x%lx", new_thd));
+  DBUG_PRINT_MINE("info", ("Forking new thread for scheduduler. THD=0x%lx", new_thd));
   if (pthread_create(&th, &connection_attrib, event_scheduler_thread,
                     (void*)scheduler_param_value))
   {
-    DBUG_PRINT("error", ("cannot create a new thread"));
+    DBUG_PRINT_MINE("error", ("cannot create a new thread"));
     state= INITIALIZED;
     scheduler_thd= NULL;
     ret= TRUE;
@@ -443,7 +447,7 @@ Event_scheduler::run(THD *thd)
   int res= FALSE;
   struct timespec abstime;
   Event_job_data *job_data;
-  DBUG_ENTER("Event_scheduler::run");
+  DBUG_ENTER_MINE("Event_scheduler::run");
 
   sql_print_information("SCHEDULER: Manager thread started with id %lu",
                         thd->thread_id);
@@ -463,7 +467,7 @@ Event_scheduler::run(THD *thd)
       break;
     }
 
-    DBUG_PRINT("info", ("get_top returned job_data=0x%lx", job_data));
+    DBUG_PRINT_MINE("info", ("get_top returned job_data=0x%lx", job_data));
     if (job_data)
     {
       if ((res= execute_top(thd, job_data)))
@@ -472,12 +476,12 @@ Event_scheduler::run(THD *thd)
     else
     {
       DBUG_ASSERT(thd->killed);
-      DBUG_PRINT("info", ("job_data is NULL, the thread was killed"));
+      DBUG_PRINT_MINE("info", ("job_data is NULL, the thread was killed"));
     }
-    DBUG_PRINT("info", ("state=%s", scheduler_states_names[state].str));
+    DBUG_PRINT_MINE("info", ("state=%s", scheduler_states_names[state].str));
   }
   LOCK_DATA();
-  DBUG_PRINT("info", ("Signalling back to the stopper COND_state"));
+  DBUG_PRINT_MINE("info", ("Signalling back to the stopper COND_state"));
   state= INITIALIZED;
   pthread_cond_signal(&COND_state);
   UNLOCK_DATA();
@@ -505,14 +509,14 @@ Event_scheduler::execute_top(THD *thd, E
   THD *new_thd;
   pthread_t th;
   int res= 0;
-  DBUG_ENTER("Event_scheduler::execute_top");
+  DBUG_ENTER_MINE("Event_scheduler::execute_top");
   if (!(new_thd= new THD()))
     goto error;
 
   pre_init_event_thread(new_thd);
   new_thd->system_thread= SYSTEM_THREAD_EVENT_WORKER;
   job_data->thd= new_thd;
-  DBUG_PRINT("info", ("BURAN %s@%s ready for start t-3..2..1..0..ignition",
+  DBUG_PRINT_MINE("info", ("BURAN %s@%s ready for start t-3..2..1..0..ignition",
              job_data->dbname.str, job_data->name.str));
 
   /* Major failure */
@@ -522,11 +526,11 @@ Event_scheduler::execute_top(THD *thd, E
 
   ++started_events;
 
-  DBUG_PRINT("info", ("Launch succeeded. BURAN is in THD=0x%lx", new_thd));
+  DBUG_PRINT_MINE("info", ("Launch succeeded. BURAN is in THD=0x%lx", new_thd));
   DBUG_RETURN(FALSE);
 
 error:
-  DBUG_PRINT("error", ("Baikonur, we have a problem! res=%d", res));
+  DBUG_PRINT_MINE("error", ("Baikonur, we have a problem! res=%d", res));
   if (new_thd)
   {
     new_thd->proc_info= "Clearing";
@@ -580,17 +584,17 @@ bool
 Event_scheduler::stop()
 {
   THD *thd= current_thd;
-  DBUG_ENTER("Event_scheduler::stop");
-  DBUG_PRINT("enter", ("thd=0x%lx", current_thd));
+  DBUG_ENTER_MINE("Event_scheduler::stop");
+  DBUG_PRINT_MINE("enter", ("thd=0x%lx", current_thd));
 
   LOCK_DATA();
-  DBUG_PRINT("info", ("state before action %s", scheduler_states_names[state]));
+  DBUG_PRINT_MINE("info", ("state before action %s", scheduler_states_names[state]));
   if (state != RUNNING)
     goto end;
 
   /* Guarantee we don't catch spurious signals */
   do {
-    DBUG_PRINT("info", ("Waiting for COND_started_or_stopped from the manager "
+    DBUG_PRINT_MINE("info", ("Waiting for COND_started_or_stopped from the manager "
                         "thread.  Current value of state is %s . "
                         "workers count=%d", scheduler_states_names[state].str,
                         workers_count()));
@@ -605,7 +609,7 @@ Event_scheduler::stop()
     */
 
     state= STOPPING;
-    DBUG_PRINT("info", ("Manager thread has id %d", scheduler_thd->thread_id));
+    DBUG_PRINT_MINE("info", ("Manager thread has id %d", scheduler_thd->thread_id));
     /* Lock from delete */
     pthread_mutex_lock(&scheduler_thd->LOCK_delete);
     /* This will wake up the thread if it waits on Queue's conditional */
@@ -618,7 +622,7 @@ Event_scheduler::stop()
     sql_print_information("SCHEDULER: Waiting the manager thread to reply");
     COND_STATE_WAIT(thd, NULL, "Waiting scheduler to stop");
   } while (state == STOPPING);
-  DBUG_PRINT("info", ("Manager thread has cleaned up. Set state to INIT"));
+  DBUG_PRINT_MINE("info", ("Manager thread has cleaned up. Set state to INIT"));
   /*
     The rationale behind setting it to NULL here but not destructing it
     beforehand is because the THD will be deinited in event_scheduler_thread().
@@ -649,14 +653,14 @@ Event_scheduler::workers_count()
   THD *tmp;
   uint count= 0;
   
-  DBUG_ENTER("Event_scheduler::workers_count");
+  DBUG_ENTER_MINE("Event_scheduler::workers_count");
   pthread_mutex_lock(&LOCK_thread_count);       // For unlink from list
   I_List_iterator<THD> it(threads);
   while ((tmp=it++))
     if (tmp->system_thread == SYSTEM_THREAD_EVENT_WORKER)
       ++count;
   pthread_mutex_unlock(&LOCK_thread_count);
-  DBUG_PRINT("exit", ("%d", count));
+  DBUG_PRINT_MINE("exit", ("%d", count));
   DBUG_RETURN(count);
 }
 
@@ -674,8 +678,8 @@ Event_scheduler::workers_count()
 void
 Event_scheduler::lock_data(const char *func, uint line)
 {
-  DBUG_ENTER("Event_scheduler::lock_data");
-  DBUG_PRINT("enter", ("func=%s line=%u", func, line));
+  DBUG_ENTER_MINE("Event_scheduler::lock_data");
+  DBUG_PRINT_MINE("enter", ("func=%s line=%u", func, line));
   pthread_mutex_lock(&LOCK_scheduler_state);
   mutex_last_locked_in_func= func;
   mutex_last_locked_at_line= line;
@@ -697,8 +701,8 @@ Event_scheduler::lock_data(const char *f
 void
 Event_scheduler::unlock_data(const char *func, uint line)
 {
-  DBUG_ENTER("Event_scheduler::unlock_data");
-  DBUG_PRINT("enter", ("func=%s line=%u", func, line));
+  DBUG_ENTER_MINE("Event_scheduler::unlock_data");
+  DBUG_PRINT_MINE("enter", ("func=%s line=%u", func, line));
   mutex_last_unlocked_at_line= line;
   mutex_scheduler_data_locked= FALSE;
   mutex_last_unlocked_in_func= func;
@@ -723,7 +727,7 @@ void
 Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
                            const char *func, uint line)
 {
-  DBUG_ENTER("Event_scheduler::cond_wait");
+  DBUG_ENTER_MINE("Event_scheduler::cond_wait");
   waiting_on_cond= TRUE;
   mutex_last_unlocked_at_line= line;
   mutex_scheduler_data_locked= FALSE;
@@ -731,7 +735,7 @@ Event_scheduler::cond_wait(THD *thd, str
   if (thd)
     thd->enter_cond(&COND_state, &LOCK_scheduler_state, msg);
 
-  DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":""));
+  DBUG_PRINT_MINE("info", ("pthread_cond_%swait", abstime? "timed":""));
   if (!abstime)
     pthread_cond_wait(&COND_state, &LOCK_scheduler_state);
   else
@@ -763,7 +767,7 @@ Event_scheduler::cond_wait(THD *thd, str
 void
 Event_scheduler::dump_internal_status()
 {
-  DBUG_ENTER("Event_scheduler::dump_internal_status");
+  DBUG_ENTER_MINE("Event_scheduler::dump_internal_status");
 
   puts("");
   puts("Event scheduler status:");

--- 1.76/sql/event_data_objects.cc	2006-09-13 10:54:29 +02:00
+++ 1.77/sql/event_data_objects.cc	2006-09-13 10:54:29 +02:00
@@ -21,6 +21,8 @@
 #include "event_db_repository.h"
 #include "sp_head.h"
 
+#define DBUG_PRINT_MINE(a,b) DBUG_PRINT(a, b); sql_print_information b;
+#define DBUG_ENTER_MINE(a) DBUG_ENTER(a); sql_print_information("enter %s", a);
 
 #define EVEX_MAX_INTERVAL_VALUE 1000000000L
 
@@ -64,7 +66,7 @@ Event_parse_data::Event_parse_data()
    starts_null(TRUE), ends_null(TRUE), execute_at_null(TRUE),
    item_expression(NULL), expression(0)
 {
-  DBUG_ENTER("Event_parse_data::Event_parse_data");
+  DBUG_ENTER_MINE("Event_parse_data::Event_parse_data");
 
   /* Actually in the parser STARTS is always set */
   set_zero_time(&starts, MYSQL_TIMESTAMP_DATETIME);
@@ -90,7 +92,7 @@ Event_parse_data::Event_parse_data()
 void
 Event_parse_data::init_name(THD *thd, sp_name *spn)
 {
-  DBUG_ENTER("Event_parse_data::init_name");
+  DBUG_ENTER_MINE("Event_parse_data::init_name");
 
   /* We have to copy strings to get them into the right memroot */
   dbname.length= spn->m_db.length;
@@ -123,8 +125,8 @@ Event_parse_data::init_name(THD *thd, sp
 void
 Event_parse_data::init_body(THD *thd)
 {
-  DBUG_ENTER("Event_parse_data::init_body");
-  DBUG_PRINT("info", ("body=[%s] body_begin=0x%lx end=0x%lx", body_begin,
+  DBUG_ENTER_MINE("Event_parse_data::init_body");
+  DBUG_PRINT_MINE("info", ("body=[%s] body_begin=0x%lx end=0x%lx", body_begin,
              body_begin, thd->lex->ptr));
 
   body.length= thd->lex->ptr - body_begin;
@@ -159,7 +161,7 @@ Event_parse_data::init_body(THD *thd)
     */
     if ((*(body_end - 1) == '*') && (*body_end == '/'))
     {
-      DBUG_PRINT("info", ("consumend one '*" "/' comment in the query '%s'",
+      DBUG_PRINT_MINE("info", ("consumend one '*" "/' comment in the query '%s'",
           body_begin));
       body.length-= 2;
       body_end-= 2;
@@ -201,7 +203,7 @@ Event_parse_data::init_execute_at(THD *t
   my_time_t t;
   TIME time_tmp;
 
-  DBUG_ENTER("Event_parse_data::init_execute_at");
+  DBUG_ENTER_MINE("Event_parse_data::init_execute_at");
 
   if (!item_execute_at)
     DBUG_RETURN(0);
@@ -210,7 +212,7 @@ Event_parse_data::init_execute_at(THD *t
     goto wrong_value;
   
   /* no starts and/or ends in case of execute_at */
-  DBUG_PRINT("info", ("starts_null && ends_null should be 1 is %d",
+  DBUG_PRINT_MINE("info", ("starts_null && ends_null should be 1 is %d",
                       (starts_null && ends_null)));
   DBUG_ASSERT(starts_null && ends_null);
 
@@ -237,7 +239,7 @@ Event_parse_data::init_execute_at(THD *t
   my_tz_UTC->gmt_sec_to_TIME(&ltime,t=TIME_to_timestamp(thd,&ltime,&not_used));
   if (!t)
   {
-    DBUG_PRINT("error", ("Execute AT after year 2037"));
+    DBUG_PRINT_MINE("error", ("Execute AT after year 2037"));
     goto wrong_value;
   }
 
@@ -270,7 +272,7 @@ Event_parse_data::init_interval(THD *thd
   String value;
   INTERVAL interval_tmp;
 
-  DBUG_ENTER("Event_parse_data::init_interval");
+  DBUG_ENTER_MINE("Event_parse_data::init_interval");
   if (!item_expression)
     DBUG_RETURN(0);
 
@@ -385,7 +387,7 @@ Event_parse_data::init_starts(THD *thd)
   TIME ltime, time_tmp;
   my_time_t t;
 
-  DBUG_ENTER("Event_parse_data::init_starts");
+  DBUG_ENTER_MINE("Event_parse_data::init_starts");
   if (!item_starts)
     DBUG_RETURN(0);
 
@@ -399,8 +401,8 @@ Event_parse_data::init_starts(THD *thd)
   thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp,
                                             (my_time_t) thd->query_start());
 
-  DBUG_PRINT("info",("now   =%lld", TIME_to_ulonglong_datetime(&time_tmp)));
-  DBUG_PRINT("info",("starts=%lld", TIME_to_ulonglong_datetime(&ltime)));
+  DBUG_PRINT_MINE("info",("now   =%lld", TIME_to_ulonglong_datetime(&time_tmp)));
+  DBUG_PRINT_MINE("info",("starts=%lld", TIME_to_ulonglong_datetime(&ltime)));
   if (TIME_to_ulonglong_datetime(&ltime) <
       TIME_to_ulonglong_datetime(&time_tmp))
     goto wrong_value;
@@ -452,14 +454,14 @@ Event_parse_data::init_ends(THD *thd)
   my_bool not_used;
   my_time_t t;
 
-  DBUG_ENTER("Event_parse_data::init_ends");
+  DBUG_ENTER_MINE("Event_parse_data::init_ends");
   if (!item_ends)
     DBUG_RETURN(0);
 
   if (item_ends->fix_fields(thd, &item_ends))
     goto error_bad_params;
 
-  DBUG_PRINT("info", ("convert to TIME"));
+  DBUG_PRINT_MINE("info", ("convert to TIME"));
   if ((not_used= item_ends->get_date(&ltime, TIME_NO_ZERO_DATE)))
     goto error_bad_params;
 
@@ -469,13 +471,13 @@ Event_parse_data::init_ends(THD *thd)
     mysql_priv.h currently lists 
       #define TIMESTAMP_MAX_YEAR 2038 (see TIME_to_timestamp())
   */
-  DBUG_PRINT("info", ("get the UTC time"));
+  DBUG_PRINT_MINE("info", ("get the UTC time"));
   my_tz_UTC->gmt_sec_to_TIME(&ltime,t=TIME_to_timestamp(thd, &ltime, &not_used));
   if (!t)
     goto error_bad_params;
 
   /* Check whether ends is after starts */
-  DBUG_PRINT("info", ("ENDS after STARTS?"));
+  DBUG_PRINT_MINE("info", ("ENDS after STARTS?"));
   if (!starts_null && my_time_compare(&starts, &ltime) != -1)
     goto error_bad_params;
 
@@ -484,7 +486,7 @@ Event_parse_data::init_ends(THD *thd)
     set before NOW() and in this case the following check should be done.
     Check whether ENDS is not in the past.
   */
-  DBUG_PRINT("info", ("ENDS after NOW?"));
+  DBUG_PRINT_MINE("info", ("ENDS after NOW?"));
   my_tz_UTC->gmt_sec_to_TIME(&ltime_now, thd->query_start());
   if (my_time_compare(&ltime_now, &ltime) == 1)
     goto error_bad_params;
@@ -535,8 +537,8 @@ bool
 Event_parse_data::check_parse_data(THD *thd)
 {
   bool ret;
-  DBUG_ENTER("Event_parse_data::check_parse_data");
-  DBUG_PRINT("info", ("execute_at=0x%lx expr=0x%lx starts=0x%lx ends=0x%lx",
+  DBUG_ENTER_MINE("Event_parse_data::check_parse_data");
+  DBUG_PRINT_MINE("info", ("execute_at=0x%lx expr=0x%lx starts=0x%lx ends=0x%lx",
              item_execute_at, item_expression, item_starts, item_ends));
 
   init_name(thd, identifier);
@@ -562,9 +564,9 @@ Event_parse_data::init_definer(THD *thd)
 {
   int definer_user_len;
   int definer_host_len;
-  DBUG_ENTER("Event_parse_data::init_definer");
+  DBUG_ENTER_MINE("Event_parse_data::init_definer");
 
-  DBUG_PRINT("info",("init definer_user thd->mem_root=0x%lx "
+  DBUG_PRINT_MINE("info",("init definer_user thd->mem_root=0x%lx "
                      "thd->sec_ctx->priv_user=0x%lx", thd->mem_root,
                      thd->security_ctx->priv_user));
 
@@ -572,19 +574,19 @@ Event_parse_data::init_definer(THD *thd)
   definer_host_len= strlen(thd->security_ctx->priv_host);
 
   /* + 1 for @ */
-  DBUG_PRINT("info",("init definer as whole"));
+  DBUG_PRINT_MINE("info",("init definer as whole"));
   definer.length= definer_user_len + definer_host_len + 1;
   definer.str= thd->alloc(definer.length + 1);
 
-  DBUG_PRINT("info",("copy the user"));
+  DBUG_PRINT_MINE("info",("copy the user"));
   memcpy(definer.str, thd->security_ctx->priv_user, definer_user_len);
   definer.str[definer_user_len]= '@';
 
-  DBUG_PRINT("info",("copy the host"));
+  DBUG_PRINT_MINE("info",("copy the host"));
   memcpy(definer.str + definer_user_len + 1, thd->security_ctx->priv_host,
          definer_host_len);
   definer.str[definer.length]= '\0';
-  DBUG_PRINT("info",("definer [%s] initted", definer.str));
+  DBUG_PRINT_MINE("info",("definer [%s] initted", definer.str));
 
   DBUG_VOID_RETURN;
 }
@@ -599,7 +601,7 @@ Event_parse_data::init_definer(THD *thd)
 
 Event_basic::Event_basic()
 {
-  DBUG_ENTER("Event_basic::Event_basic");
+  DBUG_ENTER_MINE("Event_basic::Event_basic");
   /* init memory root */
   init_alloc_root(&mem_root, 256, 512);
   dbname.str= name.str= NULL;
@@ -642,7 +644,7 @@ Event_basic::load_string_fields(Field **
   enum enum_events_table_field field_name;
   LEX_STRING *field_value;
 
-  DBUG_ENTER("Event_basic::load_string_fields");
+  DBUG_ENTER_MINE("Event_basic::load_string_fields");
 
   va_start(args, fields);
   field_name= (enum enum_events_table_field) va_arg(args, int);
@@ -676,7 +678,7 @@ Event_queue_element::Event_queue_element
   on_completion(ON_COMPLETION_DROP), status(ENABLED),
   expression(0), dropped(FALSE), execution_count(0)
 {
-  DBUG_ENTER("Event_queue_element::Event_queue_element");
+  DBUG_ENTER_MINE("Event_queue_element::Event_queue_element");
 
   set_zero_time(&starts, MYSQL_TIMESTAMP_DATETIME);
   set_zero_time(&ends, MYSQL_TIMESTAMP_DATETIME);
@@ -709,7 +711,7 @@ Event_queue_element::~Event_queue_elemen
 Event_timed::Event_timed():
   created(0), modified(0), sql_mode(0)
 {
-  DBUG_ENTER("Event_timed::Event_timed");
+  DBUG_ENTER_MINE("Event_timed::Event_timed");
   init();
   DBUG_VOID_RETURN;
 }
@@ -766,7 +768,7 @@ Event_job_data::~Event_job_data()
 void
 Event_timed::init()
 {
-  DBUG_ENTER("Event_timed::init");
+  DBUG_ENTER_MINE("Event_timed::init");
 
   definer_user.str= definer_host.str= body.str= comment.str= NULL;
   definer_user.length= definer_host.length= body.length= comment.length= 0;
@@ -798,7 +800,7 @@ Event_job_data::load_from_row(TABLE *tab
 {
   char *ptr;
   uint len;
-  DBUG_ENTER("Event_job_data::load_from_row");
+  DBUG_ENTER_MINE("Event_job_data::load_from_row");
 
   if (!table)
     goto error;
@@ -853,7 +855,7 @@ Event_queue_element::load_from_row(TABLE
   char *ptr;
   bool res1, res2;
 
-  DBUG_ENTER("Event_queue_element::load_from_row");
+  DBUG_ENTER_MINE("Event_queue_element::load_from_row");
 
   if (!table)
     goto error;
@@ -903,7 +905,7 @@ Event_queue_element::load_from_row(TABLE
   if ((ptr= get_field(&mem_root, table->field[ET_FIELD_STATUS])) == NullS)
     goto error;
 
-  DBUG_PRINT("load_from_row", ("Event [%s] is [%s]", name.str, ptr));
+  DBUG_PRINT_MINE("load_from_row", ("Event [%s] is [%s]", name.str, ptr));
   status= (ptr[0]=='E'? Event_queue_element::ENABLED:
                         Event_queue_element::DISABLED);
 
@@ -943,7 +945,7 @@ Event_timed::load_from_row(TABLE *table)
   char *ptr;
   uint len;
 
-  DBUG_ENTER("Event_timed::load_from_row");
+  DBUG_ENTER_MINE("Event_timed::load_from_row");
 
   if (Event_queue_element::load_from_row(table))
     goto error;
@@ -1016,8 +1018,8 @@ bool get_next_time(TIME *next, TIME *sta
   INTERVAL interval;
   TIME tmp;
   longlong months=0, seconds=0;
-  DBUG_ENTER("get_next_time");
-  DBUG_PRINT("enter", ("start=%llu now=%llu", TIME_to_ulonglong_datetime(start),
+  DBUG_ENTER_MINE("get_next_time");
+  DBUG_PRINT_MINE("enter", ("start=%llu now=%llu", TIME_to_ulonglong_datetime(start),
                       TIME_to_ulonglong_datetime(time_now)));
 
   bzero(&interval, sizeof(interval));
@@ -1066,7 +1068,7 @@ bool get_next_time(TIME *next, TIME *sta
   case INTERVAL_LAST:
     DBUG_ASSERT(0);
   }
-  DBUG_PRINT("info", ("seconds=%ld months=%ld", seconds, months));
+  DBUG_PRINT_MINE("info", ("seconds=%ld months=%ld", seconds, months));
   if (seconds)
   {
     longlong seconds_diff;
@@ -1074,7 +1076,7 @@ bool get_next_time(TIME *next, TIME *sta
 
     if (calc_time_diff(time_now, start, 1, &seconds_diff, &microsec_diff))
     {
-      DBUG_PRINT("error", ("negative difference"));
+      DBUG_PRINT_MINE("error", ("negative difference"));
       DBUG_ASSERT(0);
     }
     uint multiplier= seconds_diff / seconds;
@@ -1084,13 +1086,13 @@ bool get_next_time(TIME *next, TIME *sta
       event two times for the same time
       get the next exec if the modulus is not
     */
-    DBUG_PRINT("info", ("multiplier=%d", multiplier));
+    DBUG_PRINT_MINE("info", ("multiplier=%d", multiplier));
     if (seconds_diff % seconds || (!seconds_diff && last_exec->year) ||
         TIME_to_ulonglong_datetime(time_now) ==
           TIME_to_ulonglong_datetime(last_exec))
       ++multiplier;
     interval.second= seconds * multiplier;
-    DBUG_PRINT("info", ("multiplier=%u interval.second=%u", multiplier,
+    DBUG_PRINT_MINE("info", ("multiplier=%u interval.second=%u", multiplier,
                         interval.second));
     tmp= *start;
     if (!(ret= date_add_interval(&tmp, INTERVAL_SECOND, interval)))
@@ -1143,7 +1145,7 @@ bool get_next_time(TIME *next, TIME *sta
   }
 
 done:
-  DBUG_PRINT("info", ("next=%llu", TIME_to_ulonglong_datetime(next)));
+  DBUG_PRINT_MINE("info", ("next=%llu", TIME_to_ulonglong_datetime(next)));
   DBUG_RETURN(ret);
 }
 
@@ -1169,15 +1171,15 @@ Event_queue_element::compute_next_execut
   TIME time_now;
   int tmp;
 
-  DBUG_ENTER("Event_queue_element::compute_next_execution_time");
-  DBUG_PRINT("enter", ("starts=%llu ends=%llu last_executed=%llu this=0x%lx",
+  DBUG_ENTER_MINE("Event_queue_element::compute_next_execution_time");
+  DBUG_PRINT_MINE("enter", ("starts=%llu ends=%llu last_executed=%llu this=0x%lx",
                         TIME_to_ulonglong_datetime(&starts),
                         TIME_to_ulonglong_datetime(&ends),
                         TIME_to_ulonglong_datetime(&last_executed), this));
 
   if (status == Event_queue_element::DISABLED)
   {
-    DBUG_PRINT("compute_next_execution_time",
+    DBUG_PRINT_MINE("compute_next_execution_time",
                   ("Event %s is DISABLED", name.str));
     goto ret;
   }
@@ -1187,10 +1189,10 @@ Event_queue_element::compute_next_execut
     /* Let's check whether it was executed */
     if (last_executed.year)
     {
-      DBUG_PRINT("info",("One-time event %s.%s of was already executed",
+      DBUG_PRINT_MINE("info",("One-time event %s.%s of was already executed",
                          dbname.str, name.str, definer.str));
       dropped= (on_completion == Event_queue_element::ON_COMPLETION_DROP);
-      DBUG_PRINT("info",("One-time event will be dropped=%d.", dropped));
+      DBUG_PRINT_MINE("info",("One-time event will be dropped=%d.", dropped));
 
       status= Event_queue_element::DISABLED;
       status_changed= TRUE;
@@ -1200,18 +1202,18 @@ Event_queue_element::compute_next_execut
 
   my_tz_UTC->gmt_sec_to_TIME(&time_now, current_thd->query_start());
 
-  DBUG_PRINT("info",("NOW=[%llu]", TIME_to_ulonglong_datetime(&time_now)));
+  DBUG_PRINT_MINE("info",("NOW=[%llu]", TIME_to_ulonglong_datetime(&time_now)));
 
   /* if time_now is after ends don't execute anymore */
   if (!ends_null && (tmp= my_time_compare(&ends, &time_now)) == -1)
   {
-    DBUG_PRINT("info", ("NOW after ENDS, don't execute anymore"));
+    DBUG_PRINT_MINE("info", ("NOW after ENDS, don't execute anymore"));
     /* time_now is after ends. don't execute anymore */
     set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME);
     execute_at_null= TRUE;
     if (on_completion == Event_queue_element::ON_COMPLETION_DROP)
       dropped= TRUE;
-    DBUG_PRINT("info", ("Dropped=%d", dropped));
+    DBUG_PRINT_MINE("info", ("Dropped=%d", dropped));
     status= Event_queue_element::DISABLED;
     status_changed= TRUE;
 
@@ -1234,7 +1236,7 @@ Event_queue_element::compute_next_execut
     }
     else
     {
-      DBUG_PRINT("info", ("STARTS is future, NOW <= STARTS,sched for STARTS"));
+      DBUG_PRINT_MINE("info", ("STARTS is future, NOW <= STARTS,sched for STARTS"));
       /*
         starts is in the future
         time_now before starts. Scheduling for starts
@@ -1253,10 +1255,10 @@ Event_queue_element::compute_next_execut
       after m_ends set execute_at to 0. And check for on_completion
       If not set then schedule for now.
     */
-    DBUG_PRINT("info", ("Both STARTS & ENDS are set"));
+    DBUG_PRINT_MINE("info", ("Both STARTS & ENDS are set"));
     if (!last_executed.year)
     {
-      DBUG_PRINT("info", ("Not executed so far."));
+      DBUG_PRINT_MINE("info", ("Not executed so far."));
     }
 
     {
@@ -1270,7 +1272,7 @@ Event_queue_element::compute_next_execut
       /* There was previous execution */
       if (my_time_compare(&ends, &next_exec) == -1)
       {
-        DBUG_PRINT("info", ("Next execution of %s after ENDS. Stop executing.",
+        DBUG_PRINT_MINE("info", ("Next execution of %s after ENDS. Stop executing.",
                    name.str));
         /* Next execution after ends. No more executions */
         set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME);
@@ -1282,7 +1284,7 @@ Event_queue_element::compute_next_execut
       }
       else
       {
-        DBUG_PRINT("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
+        DBUG_PRINT_MINE("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
         execute_at= next_exec;
         execute_at_null= FALSE;
       }
@@ -1292,7 +1294,7 @@ Event_queue_element::compute_next_execut
   else if (starts_null && ends_null)
   {
     /* starts is always set, so this is a dead branch !! */
-    DBUG_PRINT("info", ("Neither STARTS nor ENDS are set"));
+    DBUG_PRINT_MINE("info", ("Neither STARTS nor ENDS are set"));
     /*
       Both starts and m_ends are not set, so we schedule for the next
       based on last_executed.
@@ -1304,12 +1306,12 @@ Event_queue_element::compute_next_execut
                         expression, interval))
         goto err;
       execute_at= next_exec;
-      DBUG_PRINT("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
+      DBUG_PRINT_MINE("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
     }
     else
     {
       /* last_executed not set. Schedule the event for now */
-      DBUG_PRINT("info", ("Execute NOW"));
+      DBUG_PRINT_MINE("info", ("Execute NOW"));
       execute_at= time_now;
     }
     execute_at_null= FALSE;
@@ -1319,7 +1321,7 @@ Event_queue_element::compute_next_execut
     /* either starts or m_ends is set */
     if (!starts_null)
     {
-      DBUG_PRINT("info", ("STARTS is set"));
+      DBUG_PRINT_MINE("info", ("STARTS is set"));
       /*
         - starts is set.
         - starts is not in the future according to check made before
@@ -1328,7 +1330,7 @@ Event_queue_element::compute_next_execut
       */
       if (!last_executed.year)
       {
-        DBUG_PRINT("info", ("Not executed so far."));
+        DBUG_PRINT_MINE("info", ("Not executed so far."));
       }
 
       {
@@ -1338,14 +1340,14 @@ Event_queue_element::compute_next_execut
                           expression, interval))
           goto err;
         execute_at= next_exec;
-        DBUG_PRINT("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
+        DBUG_PRINT_MINE("info",("Next[%llu]",TIME_to_ulonglong_datetime(&next_exec)));
       }
       execute_at_null= FALSE;
     }
     else
     {
       /* this is a dead branch, because starts is always set !!! */
-      DBUG_PRINT("info", ("STARTS is not set. ENDS is set"));
+      DBUG_PRINT_MINE("info", ("STARTS is not set. ENDS is set"));
       /*
         - m_ends is set
         - m_ends is after time_now or is equal
@@ -1365,7 +1367,7 @@ Event_queue_element::compute_next_execut
 
         if (my_time_compare(&ends, &next_exec) == -1)
         {
-          DBUG_PRINT("info", ("Next execution after ENDS. Stop executing."));
+          DBUG_PRINT_MINE("info", ("Next execution after ENDS. Stop executing."));
           set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME);
           execute_at_null= TRUE;
           status= Event_queue_element::DISABLED;
@@ -1375,7 +1377,7 @@ Event_queue_element::compute_next_execut
         }
         else
         {
-          DBUG_PRINT("info", ("Next[%llu]",
+          DBUG_PRINT_MINE("info", ("Next[%llu]",
                               TIME_to_ulonglong_datetime(&next_exec)));
           execute_at= next_exec;
           execute_at_null= FALSE;
@@ -1385,11 +1387,11 @@ Event_queue_element::compute_next_execut
     goto ret;
   }
 ret:
-  DBUG_PRINT("info", ("ret=0 execute_at=%llu",
+  DBUG_PRINT_MINE("info", ("ret=0 execute_at=%llu",
              TIME_to_ulonglong_datetime(&execute_at)));
   DBUG_RETURN(FALSE);
 err:
-  DBUG_PRINT("info", ("ret=1"));
+  DBUG_PRINT_MINE("info", ("ret=1"));
   DBUG_RETURN(TRUE);
 }
 
@@ -1437,7 +1439,7 @@ Event_queue_element::mark_last_executed(
 int
 Event_queue_element::drop(THD *thd)
 {
-  DBUG_ENTER("Event_queue_element::drop");
+  DBUG_ENTER_MINE("Event_queue_element::drop");
 
   DBUG_RETURN(Events::get_instance()->
                     drop_event(thd, dbname, name, FALSE, TRUE));
@@ -1465,9 +1467,9 @@ Event_queue_element::update_timing_field
   Open_tables_state backup;
   int ret= FALSE;
 
-  DBUG_ENTER("Event_queue_element::update_timing_fields");
+  DBUG_ENTER_MINE("Event_queue_element::update_timing_fields");
 
-  DBUG_PRINT("enter", ("name: %*s", name.length, name.str));
+  DBUG_PRINT_MINE("enter", ("name: %*s", name.length, name.str));
 
   /* No need to update if nothing has changed */
   if (!(status_changed || last_executed_changed))
@@ -1537,8 +1539,8 @@ Event_timed::get_create_event(THD *thd, 
   String expr_buf(tmp_buf, sizeof(tmp_buf), system_charset_info);
   expr_buf.length(0);
 
-  DBUG_ENTER("get_create_event");
-  DBUG_PRINT("ret_info",("body_len=[%d]body=[%s]", body.length, body.str));
+  DBUG_ENTER_MINE("get_create_event");
+  DBUG_PRINT_MINE("ret_info",("body_len=[%d]body=[%s]", body.length, body.str));
 
   if (expression && Events::reconstruct_interval_expression(&expr_buf, interval,
                                                             expression))
@@ -1607,7 +1609,7 @@ Event_timed::get_create_event(THD *thd, 
 int
 Event_job_data::get_fake_create_event(THD *thd, String *buf)
 {
-  DBUG_ENTER("Event_job_data::get_create_event");
+  DBUG_ENTER_MINE("Event_job_data::get_create_event");
   buf->append(STRING_WITH_LEN("CREATE EVENT anonymous ON SCHEDULE "
                               "EVERY 3337 HOUR DO "));
   buf->append(body.str, body.length);
@@ -1636,8 +1638,8 @@ Event_job_data::execute(THD *thd)
   /* this one is local and not needed after exec */
   int ret= 0;
 
-  DBUG_ENTER("Event_job_data::execute");
-  DBUG_PRINT("info", ("EXECUTING %s.%s", dbname.str, name.str));
+  DBUG_ENTER_MINE("Event_job_data::execute");
+  DBUG_PRINT_MINE("info", ("EXECUTING %s.%s", dbname.str, name.str));
 
   if ((ret= compile(thd, NULL)))
     goto done;
@@ -1663,7 +1665,7 @@ Event_job_data::execute(THD *thd)
   }
   else
   {
-    DBUG_PRINT("error", ("%s@%s has no rights on %s", definer_user.str,
+    DBUG_PRINT_MINE("error", ("%s@%s has no rights on %s", definer_user.str,
                definer_host.str, dbname.str));
     ret= -99;
   }
@@ -1673,7 +1675,7 @@ done:
   thd->end_statement();
   thd->cleanup_after_query();
 
-  DBUG_PRINT("info", ("EXECUTED %s.%s ret=%d", dbname.str, name.str, ret));
+  DBUG_PRINT_MINE("info", ("EXECUTED %s.%s ret=%d", dbname.str, name.str, ret));
 
   DBUG_RETURN(ret);
 }
@@ -1713,7 +1715,7 @@ Event_job_data::compile(THD *thd, MEM_RO
                *old_character_set_results;
   Security_context save_ctx;
 
-  DBUG_ENTER("Event_job_data::compile");
+  DBUG_ENTER_MINE("Event_job_data::compile");
 
   show_create.length(0);
 
@@ -1737,7 +1739,7 @@ Event_job_data::compile(THD *thd, MEM_RO
 
   thd->update_charset();
 
-  DBUG_PRINT("info",("old_sql_mode=%d new_sql_mode=%d",old_sql_mode, sql_mode));
+  DBUG_PRINT_MINE("info",("old_sql_mode=%d new_sql_mode=%d",old_sql_mode, sql_mode));
   thd->variables.sql_mode= this->sql_mode;
   /* Change the memory root for the execution time */
   if (mem_root)
@@ -1754,7 +1756,7 @@ Event_job_data::compile(THD *thd, MEM_RO
 
   thd->query= show_create.c_ptr_safe();
   thd->query_length= show_create.length();
-  DBUG_PRINT("info", ("query:%s",thd->query));
+  DBUG_PRINT_MINE("info", ("query:%s",thd->query));
 
   event_change_security_context(thd, definer_user, definer_host, dbname,
                                 &save_ctx);
@@ -1762,7 +1764,7 @@ Event_job_data::compile(THD *thd, MEM_RO
   mysql_init_query(thd, (uchar*) thd->query, thd->query_length);
   if (MYSQLparse((void *)thd) || thd->is_fatal_error)
   {
-    DBUG_PRINT("error", ("error during compile or thd->is_fatal_error=%d",
+    DBUG_PRINT_MINE("error", ("error during compile or thd->is_fatal_error=%d",
                           thd->is_fatal_error));
     /*
       Free lex associated resources
@@ -1778,7 +1780,7 @@ Event_job_data::compile(THD *thd, MEM_RO
     ret= EVEX_COMPILE_ERROR;
     goto done;
   }
-  DBUG_PRINT("note", ("success compiling %s.%s", dbname.str, name.str));
+  DBUG_PRINT_MINE("note", ("success compiling %s.%s", dbname.str, name.str));
 
   sphead= lex.sphead;
 
@@ -1790,7 +1792,7 @@ done:
 
   lex_end(&lex);
   event_restore_security_context(thd, &save_ctx);
-  DBUG_PRINT("note", ("return old data on its place. set back NAMES"));
+  DBUG_PRINT_MINE("note", ("return old data on its place. set back NAMES"));
 
   thd->lex= old_lex;
   thd->query= old_query;
@@ -1873,8 +1875,8 @@ static bool
 event_change_security_context(THD *thd, LEX_STRING user, LEX_STRING host,
                               LEX_STRING db, Security_context *backup)
 {
-  DBUG_ENTER("event_change_security_context");
-  DBUG_PRINT("info",("%s@%s@%s", user.str, host.str, db.str));
+  DBUG_ENTER_MINE("event_change_security_context");
+  DBUG_PRINT_MINE("info",("%s@%s@%s", user.str, host.str, db.str));
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
 
   *backup= thd->main_security_ctx;
@@ -1902,7 +1904,7 @@ event_change_security_context(THD *thd, 
 static void
 event_restore_security_context(THD *thd, Security_context *backup)
 {
-  DBUG_ENTER("event_restore_security_context");
+  DBUG_ENTER_MINE("event_restore_security_context");
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
   if (backup)
   {
Thread
bk commit into 5.1 tree (andrey:1.2313)ahristov13 Sep