List:Commits« Previous MessageNext Message »
From:ahristov Date:March 1 2006 2:12am
Subject:bk commit into 5.1 tree (andrey:1.2204)
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
  1.2204 06/03/01 02:11:58 andrey@lmy004. +1 -0
  fix problem 
  Error: Freeing unallocated data at line 900, 'sql_db.cc'
  (
   DROP DATABASE frees thd->db for everything but thd->slave_thread=1
   however we are not slave thread and more bugs could appear if we 
   pretend to be, then we will be good boys and just strdup the value.
   If not DROP DATABASE then THD::~THD() will free the value.
  )

  sql/event_timed.cc
    1.43 06/03/01 02:11:48 andrey@lmy004. +8 -5
    fix problem 
    Error: Freeing unallocated data at line 900, 'sql_db.cc'
    (
     DROP DATABASE frees thd->db for everything but thd->slave_thread=1
     however we are not slave thread and more bugs could appear if we 
     pretend to be, then we will be good boys and just strdup the value.
     If not DROP DATABASE then THD::~THD() will free the value.
    )
    - fix also a bad message

# 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:	lmy004.
# Root:	/work/mysql-5.1-bug16406

--- 1.42/sql/event_timed.cc	2006-02-28 20:32:31 +01:00
+++ 1.43/sql/event_timed.cc	2006-03-01 02:11:48 +01:00
@@ -1156,7 +1156,12 @@ Event_timed::execute(THD *thd, MEM_ROOT 
     goto done;
   /* Now we are sure we have valid this->sphead so we can copy the context */
   sphead->m_security_ctx= security_ctx;
-  thd->db= dbname.str;
+  /*
+    THD::~THD will clean this or if there is DROP DATABASE in the SP then
+    it will be free there. It should not point to our buffer which is allocated
+    on a mem_root.
+  */
+  thd->db= my_strdup(dbname.str, MYF(0));
   thd->db_length= dbname.length;
   if (!check_access(thd, EVENT_ACL,dbname.str, 0, 0, 0,is_schema_db(dbname.str)))
   {
@@ -1173,7 +1178,6 @@ Event_timed::execute(THD *thd, MEM_ROOT 
   restore_security_context(thd, save_ctx);
   DBUG_PRINT("info", ("master_access=%d db_access=%d",
              thd->security_ctx->master_access,
thd->security_ctx->db_access));
-  thd->db= 0;
 
   VOID(pthread_mutex_lock(&this->LOCK_running));
   running= false;
@@ -1236,12 +1240,12 @@ Event_timed::change_security_context(THD
     Event_timed::restore_security_context()
       thd    - thread
       backup - switch to this context
- */
+*/
 
 void
 Event_timed::restore_security_context(THD *thd, Security_context *backup)
 {
-  DBUG_ENTER("Event_timed::change_security_context");
+  DBUG_ENTER("Event_timed::restore_security_context");
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
   if (backup)
     thd->security_ctx= backup;
@@ -1488,7 +1492,6 @@ Event_timed::spawn_thread_finish(THD *th
     0 - ok
     1 - not locked by this thread
 */
- 
 
 int
 Event_timed::spawn_unlock(THD *thd)
Thread
bk commit into 5.1 tree (andrey:1.2204)ahristov1 Mar