fixed differently: wake up select_thread with THR_SERVER_ALARM instead
mysys/thr_alarm.c:
reverted linuxthreads thr_client_alarm fix (not future-proof)
(in thr_alarm.cc it happened too late).
mysys/thr_alarm.c:
move thr_client_alarm initialization to mysqld.cc
(here it happened too late)
sql/mysqld.cc:
move thr_client_alarm initialization to mysqld.cc
(in thr_alarm.cc it happened too late).
moved thr_kill_signal initialization to init_signals()
TABLE ... WRITE".
CPU hogging occured when connection which had to wait for table lock was
serviced by thread which previously serviced connection that was killed
(note that connections can reuse threads if thread cache is enabled).
One possible scenario which exposed this problem was when thread which
provided binlog dump to replication slave was implicitly/automatically
killed when the same slave reconnected and started pulling data through
different thread/connection.
In 5.* versions memory hogging was added to CPU hogging. Moreover in
those versions the problem also occured when one killed particular query
in connection (using KILL QUERY) and later this connection had to wait for
some table lock.
This problem was caused by the fact that thread-specific mysys_var::abort
variable, which indicates that waiting operations on mysys layer should
be aborted (this includes waiting for table locks), was set by kill
operation but was never reset back. So this value was "inherited" by the
following statements or even other connections (which reused the same
physical thread). Such discrepancy between this variable and THD::killed
flag broke logic on SQL-layer and caused CPU and memory hogging.
This patch tries to fix this problem by properly resetting this member.
There is no test-case associated with this patch since it is hard to test
for memory/CPU hogging conditions in our test-suite.
sql/mysqld.cc:
We should not forget to reset THD::mysys_var::abort after kill operation
if we are going to use thread to which this operation was applied for
handling of other connections.
- Add printout of current time when mysqld is killed by an
unhandled signal
sql/mysqld.cc:
Add printout of current time before the "mysqld got signal %d" message
Hopefully we don't crash in the calls to 'time' or 'localtime_r'
but if that should start to happen we can move the printout of
time further down. At least it's now below the check for segfault
inside of segfault handler.
into chilla.local:/home/mydev/mysql-4.1-axmrg
mysql-test/r/symlink.result:
Auto merged
mysql-test/t/symlink.test:
Auto merged
sql/mysqld.cc:
Auto merged
Notes:
This patch doesn't fix all issues in the tree and we need jani's fix for that
This patch shoud not be merged into 5.0
mysql-test/r/ps.result:
result fix
mysql-test/r/symlink.result:
result fix
mysql-test/t/ps.test:
test is moved to 'symlink' test
mysql-test/t/symlink.test:
test from 'ps' test
sql/field_conv.cc:
valgrind error fix: backport from 5.0
sql/mysqld.cc:
release of ssl_context
vio/viosslfactories.c:
release of ssl_context
mysql-test/valgrind.supp:
New BitKeeper file ``mysql-test/valgrind.supp''
This file is backported from 5.0, added suppressing of OpenSSL errors
into chilla.local:/home/mydev/mysql-4.1-axmrg
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
include/thr_alarm.h:
Auto merged
mysys/default.c:
Auto merged
mysys/my_pthread.c:
Auto merged
mysys/thr_alarm.c:
Auto merged
mysys/my_thr_init.c:
Manual merged
sql/mysqld.cc:
Manual merged
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
configure.in:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
scripts/mysqld_multi.sh:
Auto merged
sql/mysqld.cc:
Auto merged
Depending on the queries we use different data processing methods
and can lose some data in case of double (and decimal in 4.1) fields.
The fix consists of two parts:
1. double comparison changed, now double a is equal to double b
if (a-b) is less than 5*0.1^(1 + max(a->decimals, b->decimals)).
For example, if a->decimals==1, b->decimals==2, a==b if (a-b)<0.005
2. if we use a temporary table, store double values there as is
to avoid any data conversion (rounding).
mysql-test/r/type_float.result:
fix for bug #19690: ORDER BY eliminates rows from the result
- test result
mysql-test/t/type_float.test:
fix for bug #19690: ORDER BY eliminates rows from the result
- test case
sql/field.cc:
fix for bug #19690: ORDER BY eliminates rows from the result
- use not_fixed flag instead of dec to check bounds.
sql/field.h:
fix for bug #19690: ORDER BY eliminates rows from the result
- Field_Double::not_fixed flag introduced, which is set if dec == NOT_FIXED_DEC
and is used in the ::store() to check bounds.
- new constructor introduced (with not_fixed_arg parameter).
sql/init.cc:
fix for bug #19690: ORDER BY eliminates rows from the result
- fill log_01[] array with 0.1 powers.
sql/item_cmpfunc.cc:
fix for bug #19690: ORDER BY eliminates rows from the result
- compare_real_fixed() and compare_e_real_fixed() introduced,
they consider double a == double b if a-b is less than 'precision',
'precision' is set to 5*0.1^(1 + max(a->decimals, b->decimals)),
for example, if a->decimals==1, b->decimals==2, 'precision' is 0.005
- use the above functions if both arguments are fixed.
sql/item_cmpfunc.h:
fix for bug #19690: ORDER BY eliminates rows from the result
- Arg_comparator::presision introduced.
- Arg_comparator::compare_real_fixed(), Arg_comparator::compare_e_real_fixed() introduced.
sql/mysql_priv.h:
fix for bug #19690: ORDER BY eliminates rows from the result
- log_01 array of 0.1 powers added.
sql/mysqld.cc:
fix for bug #19690: ORDER BY eliminates rows from the result
- log_01 array of 0.1 powers added.
sql/sql_select.cc:
fix for bug #19690: ORDER BY eliminates rows from the result
- if we create double field in a temporary table, set not_fixed flag
(use proper constructor) to avoid data conversion
in the Field_double::store(). Otherwise we can lose some data.
- Set the timeout values only where needed
sql/mysql_priv.h:
Add new functions for setting read and write timeout on "net"
sql/mysqld.cc:
- Move the setting of "read_timeout" to the value of "connect_timeout" to
just before 'check_connection' which is the function where we want
to use the different timeout
- With the new functions to set timeout on "net", there is no need to
specifically set the default wait_timeout on windows.
sql/net_serv.cc:
Add new functions for setting read and write timeout of "net, when
server is compiled not to use alarms it will set the write/read timeout
directly on connection using 'vio_timeout'(using setsockopt if socket)
sql/repl_failsafe.cc:
Put unused code within "#if NOT_USED"
sql/set_var.cc:
Use 'net_set_*_timeout' when adjusting timeout value
on the current connection
sql/slave.cc:
The read timeout used when connecting to master server is set
using 'mysql_options' in 'connect_to_master' function
sql/sql_parse.cc:
- Set read and write timeout values to "connect_timeout" during
connect phase
- Use "read_timeout" value during sslaccept phase, since this is during
connect phase it implies "connect-timeout"
- Set read and write timeout value back to default after connect phase
- Set "read_timeout" to "wait_timeout" while waiting for client.
sql/sql_repl.cc:
Set "read_timeout" to "wait_timeout" while ask other mysqld to send file
sql-common/client.c:
Call 'vio_timeout' to set up the read and write timeout's for the
newly created connection. It only need to be done once at connect time.
vio/vio.c:
Use 'vio_timeout' for setting timeout also on an SSL connection
since they both use sockets
vio/viossl.c:
Remove 'vio_ssl_timeout' function
Move get_thread_lib to mysys/my_pthread.c
Set 'thr_client_alarm' to signal number used by thr_alarm to give alarms
include/my_global.h:
Fixed to be same as in 5.1
include/my_pthread.h:
Move things around to be more in line with rest of code
include/thr_alarm.h:
extern of thr_client_alarm
mysys/default.c:
Fixed two wrong pointer incrementations.
mysys/my_pthread.c:
Cleanup: Use variable thr_client_alarm
mysys/my_thr_init.c:
Detect thread library at startup
mysys/thr_alarm.c:
Set thr_client_alarm depending on which thread library we are using
sql/mysqld.cc:
Move get_thread_lib to mysys/my_pthread.c
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
include/thr_alarm.h:
Auto merged
mysys/my_pthread.c:
Auto merged
BUILD/SETUP.sh:
Merged from 4.0
configure.in:
Merged from 4.0
include/my_global.h:
Merged from 4.0
include/my_pthread.h:
Merged from 4.0
mysys/thr_alarm.c:
Merged from 4.0
sql/mysqld.cc:
Merged from 4.0
BUILD/SETUP.sh.rej:
Merged from 4.0
configure.in.rej:
Merged from 4.0
include/my_global.h.rej:
Merged from 4.0
include/my_pthread.h.rej:
Merged from 4.0
mysys/thr_alarm.c.rej:
Merged from 4.0
sql/mysqld.cc.rej:
Merged from 4.0
Fix to check library in use during runtime.
Fix for Bug#16995, "idle connections not being killed due to timeout when NPTL is used".
BUILD/SETUP.sh:
To avoid warnings during compilation.
configure.in:
Fixed configure so that it can correctly detect
between NPTL and Linuxthreads.
include/my_global.h:
Fix for Linuxthreads.
include/my_pthread.h:
Added defines for different libraries that can be detected.
Currently only 'other', 'nptl', and 'lt' (linuxthreads) are
being used.
changed sigset() and signal() to my_sigset() and my_signal()
include/thr_alarm.h:
Removed defines for Linuxthreads. This is now detected during
runtime and handled in the thr_alarm.c
mysys/my_pthread.c:
Runtime check for library.
mysys/thr_alarm.c:
Runtime checks for library and corresponding
signals.
sql/mysqld.cc:
Added function for detecting thread library in use
during start-up.
THR_KILL_SIGNAL removed, setting signals during runtime.
2nd version
During tmp tables cleanup we get the handler for temporary table
and delete table using handler method.
sql/mysql_priv.h:
added function prototype
sql/mysqld.cc:
added call of mysql_rm_tmp_tables() function
sql/sql_base.cc:
mysql_rm_tmp_tables()
-removed from table_cache_init
-During tmp tables cleanup we get the handler for temporary table
and delete table using handler method.
it allows to remove orphan records from data dictionary(InnoDB)
into neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
Makefile.am:
Auto merged
client/mysqltest.c:
Auto merged
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
sql/mysqld.cc:
Auto merged
Make Prepared_stmt_count a global status variable, accessible via
SHOW STATUS LIKE 'Prepared_stmt_count';. Documentation should be
updated.
mysql-test/r/ps.result:
Update result for bug#16365: Prepared Statements: DoS with too many
open statements, according to bug#23159: prepared_stmt_count should be
status variable.
mysql-test/t/ps.test:
Update test case for bug#16365: Prepared Statements: DoS with too many
open statements, according to bug#23159: prepared_stmt_count should be
status variable.
sql/mysqld.cc:
Add Prepared_stmt_count as global status variable.
sql/set_var.cc:
Remove prepared_stmt_count as system variable.
Support says that memlock doesn't work on OSes other than Solaris.
Add a warning about --memlock to the crash monologue.
sql/mysqld.cc:
On a crash when --memlock was active, emit advice about the insta-
bility of that parameter.
into bodhi.local:/opt/local/work/mysql-4.1-runtime
mysql-test/r/ps.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
If the user has specified --max-connections=N or --table-open-cache=M
options to the server, a warning could be given that some values were
recalculated, and table-open-cache could be assigned greater value.
Note that both warning and increase of table-open-cache were totally
harmless.
This patch fixes recalculation code to ensure that table-open-cache will
be never increased automatically and that a warning will be given only if
some values had to be decreased due to operating system limits.
No test case is provided because we neither can't predict nor control
operating system limits for maximal number of open files.
sql/mysql_priv.h:
Add constants for table_cache minimum and default values.
sql/mysqld.cc:
Fix max_connections and table_cache_size re-computation.
into rama.(none):/home/jimw/my/mysql-4.1-clean
include/my_global.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/mysqld.cc:
Resolve conflict
Fix OPT_MYISAM_STATS_METHOD case, where the NULLS_EQUAL and NULLS_NOT_EQUAL methods were mixed up
sql/mysqld.cc:
Fix OPT_MYISAM_STATS_METHOD case, bug #21054
Fix when __attribute__() is stubbed out, add ATTRIBUTE_FORMAT() for specifying
__attribute__((format(...))) safely, make more use of the format attribute,
and fix some of the warnings that this turns up (plus a bonus unrelated one).
include/m_ctype.h:
Add ATTRIBUTE_FORMAT to printf-like functions.
include/m_string.h:
Add ATTRIBUTE_FORMAT to my_snprintf() declaration.
include/my_global.h:
Fix neutering of __attribute__() on old versions of GCC and non-GCC compilers.
Add ATTRIBUTE_FORMAT() macro for setting __attribute_((format(...)), since it
is available from different versions of gcc and g++.
include/my_sys.h:
Add ATTRIBUTE_FORMAT() to my_printf_error declaration
sql/item_subselect.cc:
Silence warning about members being initialized out-of-order
sql/item_timefunc.cc:
Fix format specifier in snprintf() calls with milliseconds
sql/mysql_priv.h:
Add ATTRIBUTE_FORMAT to printf-like functions.
sql/mysqld.cc:
Fix various format specifiers
Make sure that method_conv is always set by myisam_stats_method
sql/opt_range.cc:
Cast pointers to correct type for %lx
sql/set_var.cc:
Fix __attribute__((unused)) (missing inner set of parens)
sql/slave.cc:
Fix format specifier
sql/slave.h:
Add ATTRIBUTE_FORMAT to slave_print_error() declaration.
sql/sql_acl.cc:
Fix number of arguments passed for formatting, and fix acl_host_or_ip being
passed instead of just the hostname.
sql/sql_class.h:
Add ATTRIBUTE_FORMAT to MYSQL_LOG::write().
didn't work as expected: collation_server was set not to xxx,
but to the default collation of character set "yyy".
With different argument order it worked as expected:
mysqld --character-set-server=yyy --collation-server=yyy
Fix:
initializate default_collation_name to 0
when processing --character-set-server
only if --collation-server has not been specified
in command line.
mysql-test/r/ctype_ucs2_def.result:
Adding test cast
mysql-test/t/ctype_ucs2_def-master.opt:
Adding test case
mysql-test/t/ctype_ucs2_def.test:
Adding test case
sql/mysqld.cc:
Don't clear default_collation_name when processing
--character-set-server if collation has already
been specified using --collation-server
- A segfault occured when the function 'kill_server' called
'my_sigset' with signal number 0. 'my_sigset' is a macro which
uses 'sigaction' to install the signal handler with an invalid
signal number will on most platforms return EINVAL but yields
a segfauilt on IRIX 6.5
- The server crash was detected by mysqld_safe and it was restarted although
a shutdown was requested.
- Semantics of kill_server(0) is not known, leaving it intact
include/my_pthread.h:
Check return value from sigaction with a DBUG_ASSERT
Also DBUG_ASSERT if signal number 0 is passed
sql/mysqld.cc:
Don't call my_sigset if signo is 0
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
include/config-netware.h:
Auto merged
innobase/os/os0thread.c:
Auto merged
netware/mysqld_safe.c:
Merge from 4.0 to 4.1
sql/mysqld.cc:
Merge from 4.0 to 4.1
Changes to Netware specific mysqld_safe.c
include/config-netware.h:
NetWare specific change to increase thread stack size.
innobase/os/os0thread.c:
NetWare specific change to increase thread stack size.
netware/mysqld_safe.c:
NetWare specific change to make multiple mysqld_safe instances
work when called through a NCF file.
sql/mysqld.cc:
NetWare specific change to increase thread stack size.
Bug#14960, reverted code to make symdir work on Windows
symlink.test:
Disabled test case on Windows
mysql-test/t/symlink.test:
Disabled test case on Windows
sql/mysqld.cc:
Bug#14960, reverted code to make symdir work on Windows
because they are used by net_printf() and push_warning(), which can be called if check_connection() fails.
sql/mysqld.cc:
not needed anymore
sql/repl_failsafe.cc:
not needed anymore
sql/slave.cc:
not needed anymore
sql/sql_class.cc:
query_id needs to be inited early (already fixed in 5.0 by Konstantin) and so does client_capabilities (not fixed in 5.0);
because they are used by net_printf() and push_warning(), which may be called if check_connection() fails.
signal handlers are set up, the blocking flags for sockets are set,
and which thread-related functions are used. (Bug #8731)
configure.in:
Fix flags for Darwin 6 and later. Simplify Darwin 7-9 blocks to simply
be a catch-all for *darwin* so that future Darwin releases get the
latest flags.
include/config-win.h:
Define my_sigset() instead of sigset().
include/my_pthread.h:
Define my_sigset() instead of trying to monkey with sigset(), and favor
an implementation based on sigaction().
mysys/my_pthread.c:
Remove pthread_signal(), which is identical to the new my_sigset() macro.
mysys/thr_alarm.c:
Use my_sigset() instead of sigset().
sql/mysqld.cc:
Use my_sigset() instead of signal() and sigset(), remove unnecessary
definition of sigset on __amiga__. Remove unused THREAD_SPECIFIC_SIGPIPE
code.
A future improvement would be to re-assess the use of sigaction() here
and convert its usage to use my_sigset().
vio/vio.c:
Always call fcntl() to initialize flags of socket in initialization to
avoid problems on systems that don't report the flags on a socket
correctly right after it has been returned from accept(), such as
FreeBSD, Mac OS X, and possibly other BSD-derived systems.
vio/viosocket.c:
If fcntl() fails in vio_blocking(), restore the flags stored in the
vio struct.
mysql-test/r/wait_timeout.result:
New BitKeeper file ``mysql-test/r/wait_timeout.result''
mysql-test/t/wait_timeout-master.opt:
New BitKeeper file ``mysql-test/t/wait_timeout-master.opt''
mysql-test/t/wait_timeout.test:
New BitKeeper file ``mysql-test/t/wait_timeout.test''
The fix is needed to perform locking on shared data structures
This is modification of patch proposed by Leandro Santi
(see http://webs.sinectis.com.ar/lesanti/misc/mysql-4.0.23a-openssl_locking.patch)
sql/mysqld.cc:
Fix for bug#9270 multiple SSL race conditions (for 5.0 tree)
The fix is needed to perform locking on shared data structures
mysql-test/r/variables.result:
Add new results
mysql-test/t/variables.test:
Add new regression test
sql/mysqld.cc:
Fix minimum value of query_prealloc_size to be the same as its default.
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
my_regex.h:
Rename: regex/regex.h -> regex/my_regex.h
client/mysqltest.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
os2/MySQL-Source.icc:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/Makefile.am:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/debug.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/debug.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/engine.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/engine.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/main.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/main.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regcomp.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regerror.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regerror.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/my_regex.h:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regexec.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regfree.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/reginit.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
sql/item_cmpfunc.cc:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
sql/item_cmpfunc.h:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
sql/mysqld.cc:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.