List:Internals« Previous MessageNext Message »
From:igor Date:November 24 2005 5:44am
Subject:bk commit into 5.0 tree (igor:1.1965)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor 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.1965 05/11/23 21:44:21 igor@stripped +6 -0
  Merge rurik.mysql.com:/home/igor/mysql-5.0
  into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2

  sql/sql_yacc.yy
    1.443 05/11/23 21:44:10 igor@stripped +0 -0
    Auto merged

  sql/sql_parse.cc
    1.516 05/11/23 21:44:10 igor@stripped +0 -0
    Auto merged

  sql/sql_class.h
    1.276 05/11/23 21:44:10 igor@stripped +0 -0
    Auto merged

  sql/sql_class.cc
    1.221 05/11/23 21:44:10 igor@stripped +0 -0
    Auto merged

  sql/sql_base.cc
    1.318 05/11/23 21:44:10 igor@stripped +0 -0
    Auto merged

  sql/mysql_priv.h
    1.368 05/11/23 21:44:09 igor@stripped +0 -0
    Auto merged

# 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:	igor
# Host:	rurik.mysql.com
# Root:	/home/igor/dev/mysql-5.0-2/RESYNC

--- 1.367/sql/mysql_priv.h	2005-11-16 20:09:27 -08:00
+++ 1.368/sql/mysql_priv.h	2005-11-23 21:44:09 -08:00
@@ -102,6 +102,7 @@
 #define MAX_FIELDS_BEFORE_HASH	32
 #define USER_VARS_HASH_SIZE     16
 #define STACK_MIN_SIZE		8192	// Abort if less stack during eval.
+#define STACK_MIN_SIZE_FOR_OPEN 1024*80
 #define STACK_BUFF_ALLOC	256	// For stack overrun checks
 #ifndef MYSQLD_NET_RETRY_COUNT
 #define MYSQLD_NET_RETRY_COUNT  10	// Abort read after this many int.

--- 1.317/sql/sql_base.cc	2005-11-22 23:00:44 -08:00
+++ 1.318/sql/sql_base.cc	2005-11-23 21:44:10 -08:00
@@ -1090,7 +1090,7 @@
     *refresh=0;
 
   /* an open table operation needs a lot of the stack space */
-  if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (char *)&alias))
+  if (check_stack_overrun(thd, STACK_MIN_SIZE_FOR_OPEN, (char *)&alias))
     return 0;
 
   if (thd->killed)

--- 1.220/sql/sql_class.cc	2005-11-22 23:00:45 -08:00
+++ 1.221/sql/sql_class.cc	2005-11-23 21:44:10 -08:00
@@ -517,6 +517,12 @@
 
 bool THD::store_globals()
 {
+  /*
+    Assert that thread_stack is initialized: it's necessary to be able
+    to track stack overrun.
+  */
+  DBUG_ASSERT(this->thread_stack);
+
   if (my_pthread_setspecific_ptr(THR_THD,  this) ||
       my_pthread_setspecific_ptr(THR_MALLOC, &mem_root))
     return 1;
@@ -1498,7 +1504,7 @@
     {
       Item_splocal *var;
       (void)local_vars.push_back(var= new Item_splocal(mv->s, mv->offset));
-#ifndef DEBUG_OFF
+#ifndef DBUG_OFF
       var->owner= mv->owner;
 #endif
     }

--- 1.275/sql/sql_class.h	2005-11-22 23:00:45 -08:00
+++ 1.276/sql/sql_class.h	2005-11-23 21:44:10 -08:00
@@ -2073,7 +2073,7 @@
 class my_var : public Sql_alloc  {
 public:
   LEX_STRING s;
-#ifndef DEBUG_OFF
+#ifndef DBUG_OFF
   /*
     Routine to which this Item_splocal belongs. Used for checking if correct
     runtime context is used for variable handling.

--- 1.515/sql/sql_parse.cc	2005-11-22 23:00:45 -08:00
+++ 1.516/sql/sql_parse.cc	2005-11-23 21:44:10 -08:00
@@ -1097,6 +1097,7 @@
   VOID(sigemptyset(&set));			// Get mask in use
   VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
 #endif
+  thd->thread_stack= (char*) &thd;
   if (thd->store_globals())
   {
     close_connection(thd, ER_OUT_OF_RESOURCES, 1);
@@ -1110,7 +1111,6 @@
     int error;
     NET *net= &thd->net;
     Security_context *sctx= thd->security_ctx;
-    thd->thread_stack= (char*) &thd;
     net->no_send_error= 0;
 
     if ((error=check_connection(thd)))
@@ -1201,6 +1201,7 @@
   char *buff;
 
   /* The following must be called before DBUG_ENTER */
+  thd->thread_stack= (char*) &thd;
   if (my_thread_init() || thd->store_globals())
   {
 #ifndef EMBEDDED_LIBRARY
@@ -5288,6 +5289,7 @@
 			 char *buf __attribute__((unused)))
 {
   long stack_used;
+  DBUG_ASSERT(thd == current_thd);
   if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
       (long) (thread_stack - margin))
   {
@@ -6739,7 +6741,10 @@
       allocate temporary THD for execution of acl_reload()/grant_reload().
     */
     if (!thd && (thd= (tmp_thd= new THD)))
+    {
+      thd->thread_stack= (char*) &tmp_thd;
       thd->store_globals();
+    }
     if (thd)
     {
       (void)acl_reload(thd);

--- 1.442/sql/sql_yacc.yy	2005-11-22 23:00:46 -08:00
+++ 1.443/sql/sql_yacc.yy	2005-11-23 21:44:10 -08:00
@@ -2288,7 +2288,7 @@
 	      ivar.length= 5;
 	      Item_splocal *var= new Item_splocal(ivar,
                                                   ctx->current_pvars()-1);
-#ifndef DEBUG_OFF
+#ifndef DBUG_OFF
               if (var)
                 var->owner= sp;
 #endif
@@ -5875,7 +5875,7 @@
                my_var *var;
 	       ((select_dumpvar *)lex->result)->
                  var_list.push_back(var= new my_var($1,1,t->offset,t->type));
-#ifndef DEBUG_OFF
+#ifndef DBUG_OFF
 	       if (var)
 		 var->owner= lex->sphead;
 #endif
@@ -7181,7 +7181,7 @@
             Item_splocal *splocal;
             splocal= new Item_splocal($1, spv->offset, lex->tok_start_prev - 
                                       lex->sphead->m_tmp_query);
-#ifndef DEBUG_OFF
+#ifndef DBUG_OFF
             if (splocal)
               splocal->owner= lex->sphead;
 #endif
Thread
bk commit into 5.0 tree (igor:1.1965)igor24 Nov