Set thread_stack after return from end_thread()

Fixes core dump when reusing thread when running debug binary


sql-bench/bench-init.pl.sh:
  Use ENGINE= instead of TYPE=
sql-bench/server-cfg.sh:
  Use ENGINE= instead of TYPE=
sql/mysqld.cc:
  Set thread_stack (to avoid core dump in store_globlas)
sql/sql_parse.cc:
  Set thread_stack after return from end_thread()
This commit is contained in:
unknown 2005-12-03 18:13:06 +02:00
parent 97bfd41fe1
commit bca61bcfde
4 changed files with 8 additions and 6 deletions

View File

@ -447,7 +447,7 @@ All benchmarks takes the following options:
--create-options=# --create-options=#
Extra argument to all create statements. If you for example want to Extra argument to all create statements. If you for example want to
create all MySQL tables as BDB tables use: create all MySQL tables as BDB tables use:
--create-options=TYPE=BDB --create-options=ENGINE=BDB
--database (Default $opt_database) --database (Default $opt_database)
In which database the test tables are created. In which database the test tables are created.

View File

@ -174,29 +174,29 @@ sub new
# Some fixes that depends on the environment # Some fixes that depends on the environment
if (defined($main::opt_create_options) && if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /type=heap/i) $main::opt_create_options =~ /engine=heap/i)
{ {
$limits{'working_blobs'} = 0; # HEAP tables can't handle BLOB's $limits{'working_blobs'} = 0; # HEAP tables can't handle BLOB's
} }
if (defined($main::opt_create_options) && if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /type=innodb/i) $main::opt_create_options =~ /engine=innodb/i)
{ {
$self->{'transactions'} = 1; # Transactions enabled $self->{'transactions'} = 1; # Transactions enabled
} }
if (defined($main::opt_create_options) && if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /type=ndb/i) $main::opt_create_options =~ /engine=ndb/i)
{ {
$self->{'transactions'} = 1; # Transactions enabled $self->{'transactions'} = 1; # Transactions enabled
$limits{'max_columns'} = 90; # Max number of columns in table $limits{'max_columns'} = 90; # Max number of columns in table
$limits{'max_tables'} = 32; # No comments $limits{'max_tables'} = 32; # No comments
} }
if (defined($main::opt_create_options) && if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /type=bdb/i) $main::opt_create_options =~ /engine=bdb/i)
{ {
$self->{'transactions'} = 1; # Transactions enabled $self->{'transactions'} = 1; # Transactions enabled
} }
if (defined($main::opt_create_options) && if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /type=gemini/i) $main::opt_create_options =~ /engine=gemini/i)
{ {
$limits{'working_blobs'} = 0; # Blobs not implemented yet $limits{'working_blobs'} = 0; # Blobs not implemented yet
$limits{'max_tables'} = 500; $limits{'max_tables'} = 500;

View File

@ -1589,6 +1589,7 @@ void end_thread(THD *thd, bool put_in_cache)
wake_thread--; wake_thread--;
thd=thread_cache.get(); thd=thread_cache.get();
thd->real_id=pthread_self(); thd->real_id=pthread_self();
thd->thread_stack= (char*) &thd; // For store_globals
(void) thd->store_globals(); (void) thd->store_globals();
thd->thr_create_time= time(NULL); thd->thr_create_time= time(NULL);
threads.append(thd); threads.append(thd);

View File

@ -1182,6 +1182,7 @@ end_thread:
or this thread has been schedule to handle the next query or this thread has been schedule to handle the next query
*/ */
thd= current_thd; thd= current_thd;
thd->thread_stack= (char*) &thd;
} while (!(test_flags & TEST_NO_THREADS)); } while (!(test_flags & TEST_NO_THREADS));
/* The following is only executed if we are not using --one-thread */ /* The following is only executed if we are not using --one-thread */
return(0); /* purecov: deadcode */ return(0); /* purecov: deadcode */