Commit 635598f1 authored by Michael Widenius's avatar Michael Widenius

automatic merge

parents 43960b93 90bd2e81
......@@ -1139,3 +1139,4 @@ libmysqld/gcalc_slicescan.cc
libmysqld/gcalc_tools.cc
sql/share/errmsg.sys
sql/share/mysql
install_manifest.txt
......@@ -1685,7 +1685,7 @@ count(*)
drop table t1;
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
511
ok
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
16384
......
......@@ -1339,7 +1339,7 @@ drop table t1;
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
--replace_result 512 511 2047 511
--replace_result 511 ok 512 ok 2047 ok 513 ok
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
......
......@@ -15,6 +15,7 @@
KILL_MYSQLD=1;
MYSQLD=
niceness=0
nowatch=0
mysqld_ld_preload=
mysqld_ld_library_path=
......@@ -44,16 +45,18 @@ usage () {
cat <<EOF
Usage: $0 [OPTIONS]
--no-defaults Don't read the system defaults file
--core-file-size=LIMIT Limit core files to the specified size
--defaults-file=FILE Use the specified defaults file
--defaults-extra-file=FILE Also use defaults from the specified file
--ledir=DIRECTORY Look for mysqld in the specified directory
--open-files-limit=LIMIT Limit the number of open files
--core-file-size=LIMIT Limit core files to the specified size
--timezone=TZ Set the system timezone
--malloc-lib=LIB Preload shared library LIB if available
--mysqld=FILE Use the specified file as mysqld
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--nice=NICE Set the scheduling priority of mysqld
--no-auto-restart Exit after starting mysqld
--nowatch Exit after starting mysqld
--plugin-dir=DIR Plugins are under DIR or DIR/VERSION, if
VERSION is given
--skip-kill-mysqld Don't try to kill stray mysqld processes
......@@ -140,8 +143,16 @@ eval_log_error () {
;;
esac
#echo "Running mysqld: [$cmd]"
eval "$cmd"
if test $nowatch -eq 1
then
# We'd prefer to exec $cmd here, but SELinux needs to be fixed first
#/usr/bin/logger "Running mysqld: $cmd"
eval "$cmd &"
exit 0
else
#echo "Running mysqld: [$cmd]"
eval "$cmd"
fi
}
shell_quote_string() {
......@@ -202,6 +213,7 @@ parse_arguments() {
fi
;;
--nice=*) niceness="$val" ;;
--nowatch|--no-watch|--no-auto-restart) nowatch=1 ;;
--open-files-limit=*) open_files="$val" ;;
--open_files_limit=*) open_files="$val" ;;
--skip-kill-mysqld*) KILL_MYSQLD=0 ;;
......
......@@ -2852,6 +2852,70 @@ static void init_signals(void)
}
/* pthread_attr_setstacksize without so much platform-dependency */
/* returns the actual stack size if possible */
static size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize)
{
size_t guard_size = 0;
#if defined(__ia64__) || defined(__ia64)
/*
On IA64, half of the requested stack size is used for "normal stack"
and half for "register stack". The space measured by check_stack_overrun
is the "normal stack", so double the request to make sure we have the
caller-expected amount of normal stack.
NOTE: there is no guarantee that the register stack can't grow faster
than normal stack, so it's very unclear that we won't dump core due to
stack overrun despite check_stack_overrun's efforts. Experimentation
shows that in the execution_constants test, the register stack grows
less than half as fast as normal stack, but perhaps other scenarios are
less forgiving. If it turns out that more space is needed for the
register stack, that could be forced (rather inefficiently) by using a
multiplier higher than 2 here.
*/
stacksize *= 2;
#endif
/*
On many machines, the "guard space" is subtracted from the requested
stack size, and that space is quite large on some platforms. So add
it to our request, if we can find out what it is.
FIXME: autoconfiscate use of pthread_attr_getguardsize
*/
if (pthread_attr_getguardsize(attr, &guard_size))
guard_size = 0; /* if can't find it out, treat as 0 */
pthread_attr_setstacksize(attr, stacksize + guard_size);
/* Retrieve actual stack size if possible */
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
{
size_t real_stack_size= 0;
/* We must ignore real_stack_size = 0 as Solaris 2.9 can return 0 here */
if (pthread_attr_getstacksize(attr, &real_stack_size) == 0 &&
real_stack_size > guard_size)
{
real_stack_size -= guard_size;
if (real_stack_size < stacksize)
{
if (global_system_variables.log_warnings)
sql_print_warning("Asked for %zu thread stack, but got %zu",
stacksize, real_stack_size);
stacksize= real_stack_size;
}
}
}
#endif
#if defined(__ia64__) || defined(__ia64)
stacksize /= 2;
#endif
return stacksize;
}
static void start_signal_handler(void)
{
int error;
......@@ -2862,15 +2926,7 @@ static void start_signal_handler(void)
#if !defined(HAVE_DEC_3_2_THREADS)
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
(void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
#if defined(__ia64__) || defined(__ia64)
/*
Peculiar things with ia64 platforms - it seems we only have half the
stack size in reality, so we have to double it here
*/
pthread_attr_setstacksize(&thr_attr,my_thread_stack_size*2);
#else
pthread_attr_setstacksize(&thr_attr,my_thread_stack_size);
#endif
(void) my_setstacksize(&thr_attr,my_thread_stack_size);
#endif
mysql_mutex_lock(&LOCK_thread_count);
......@@ -4694,37 +4750,9 @@ int mysqld_main(int argc, char **argv)
unireg_abort(1); // Will do exit
init_signals();
#if defined(__ia64__) || defined(__ia64)
/*
Peculiar things with ia64 platforms - it seems we only have half the
stack size in reality, so we have to double it here
*/
pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size*2);
#else
pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size);
#endif
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
{
/* Retrieve used stack size; Needed for checking stack overflows */
size_t stack_size= 0;
pthread_attr_getstacksize(&connection_attrib, &stack_size);
#if defined(__ia64__) || defined(__ia64)
stack_size/= 2;
#endif
/* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
if (stack_size && stack_size < my_thread_stack_size)
{
if (global_system_variables.log_warnings)
sql_print_warning("Asked for %llu thread stack, but got %zu",
my_thread_stack_size, stack_size);
#if defined(__ia64__) || defined(__ia64)
my_thread_stack_size= stack_size*2;
#else
my_thread_stack_size= stack_size;
#endif
}
}
#endif
my_thread_stack_size= my_setstacksize(&connection_attrib,
my_thread_stack_size);
(void) thr_setconcurrency(concurrency); // 10 by default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment