- Define and pass compile time path variables as pre-processor definitions to
mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in
Platform SDK header ObjIdl.h which also defines DATADIR.
Initialize LOCK_open as a adapative mutex on platforms where the
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP macro is available. The flag
indicates that a thread should spin (busy wait) for some time on a
locked adaptive mutex before blocking (sleeping). It's intended to
to alleviate performance problems due to LOCK_open being a highly
contended mutex.
sql/mysqld.cc:
Initialize LOCK_open as a adapative mutex.
The maximum value of the max_join_size variable is set by converting
a signed type (long int) with negative value (-1) to a wider unsigned
type (unsigned long long), which yields the largest possible value of
the wider unsigned type -- as per the language conversion rules. But,
depending on build options, the type of the max_join_size might be a
shorter type (ha_rows - unsigned long) which causes the warning to be
thrown once the large value is truncated to fit.
The solution is to ensure that the maximum value of the variable is
always set to the maximum value of integer type of max_join_size.
Furthermore, it would be interesting to always have a fixed type for
this variable, but this would incur in a change of behavior which is
not acceptable for a GA version. See Bug#35346.
sql/mysqld.cc:
Set max value for type.
not logged
Errors encountered during initialization of the SSL subsystem
are printed to stderr, rather than to the error log.
This patch adds a parameter to several SSL init functions to
report the error (if any) out to the caller. The function
init_ssl() in mysqld.cc is moved after the initialization of
the log subsystem, so that any error messages can be logged to
the error log. Printing of messages to stderr has been
retained to get diagnostic output in a client context.
include/violite.h:
Adding an enumeration for the various errors that can
occur during initialization of the SSL module.
sql/mysqld.cc:
Adding more logging of SSL init errors, and moving
init_ssl() till after initialization of logging
subsystem.
vio/viosslfactories.c:
Define error strings, provide an access method for these
strings, and maintain an error parameter in several funcs
to return the error (if any) to the caller.
The reason for the crash was rotate_relay_log (mi=0x0) did not verify
the passed value of active_mi. There are more cases where active_mi
is supposed to be non-zero e.g change_master(), stop_slave(), and it's
reasonable to protect from a similar crash all of them with common
fixes.
Fixed with spliting end_slave() in slave threads release and slave
data clean-up parts (a new close_active_mi()). The new function is
invoked at the very end of close_connections() so that all users of
active_mi are proven to have left.
sql/mysqld.cc:
added the 2nd part (data) of the slave's clean up.
sql/slave.cc:
end_slave() is split in two part to release the slave threads and the remained
resources separately.
The new close_active_mi() should be called after all possible users ofactive_mi
has left, i.e at the very end of close_connections().
sql/slave.h:
interface to the new end_active_mi() function is added.
The problem: described in the bug report.
The fix:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
client/mysql.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/ha_ndbcluster.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/ha_ndbcluster_binlog.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/handler.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/log.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/mysqld.cc:
removed unnecessary line
sql/parse_file.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_acl.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_base.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_db.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_delete.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_partition.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_rename.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_show.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_table.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
sql/sql_view.cc:
--increase buffers where it's necessary
(buffers which are used in stxnmov)
--decrease buffer lengths which are used
as argument for strxnmov function
Remove custom DLL loader code from innodb plugin code, use
symbols exported from mysqld.
storage/innodb_plugin/handler/ha_innodb.cc:
Remove a Win32 workaround for current_thd.
The original problem that innodb plugin used
value of TLS variable across DLL boundaries is
solved in MySQL server (current_thd is a function
not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
Remove custom delay loader
storage/innodb_plugin/plug.in:
Remove commented out MYSQL_PLUGIN_STATIC,
CMake would not parse that correctly
variable. The problem was that THD::connect_utime could be
used without being initialized when the main thread is used
to handle connections (--thread-handling=no-threads).
sql/mysqld.cc:
Set THD::start_utime even in no-threads handling mode.
sql/sql_class.cc:
Initialize variable.
sql/sql_class.h:
Rename connect_utime to prior_thr_create_utime as to
better reflect it's use intention.
sql/sql_connect.cc:
Check only if a thread was actually created.
always rollsback.
There is failure on pushbuild machines which are using old compilers complaining about
ULLONG_MAX declaration. Changing this to ULONGLONG_MAX to solve the problem.
sql/mysqld.cc:
Change ULLONG_MAX to ULONGLONG_MAX for the max_binlog_cache_size option
always rollsback.
The global variable max_binlog_cache_size cannot be set more than 4GB on
32 bit systems, limiting transactions of all storage engines to 4G of changes.
The problem is max_binlog_cache_size is declared as ulong which is 4 bytes
on 32 bit and 8 bytes on 64 bit machines.
Fixed by using ulonglong for max_binlog_cache_size which is 8bytes on 32
and 64 bit machines.The range for max_binlog_cache_size on 32 bit and 64 bit
systems is 4096-18446744073709547520 bytes.
mysql-test/r/variables.result:
Result file for BUG#10206
mysql-test/t/variables.test:
Testcase for BUG#10206
sql/mysql_priv.h:
change the extern declaration of max_binlog_cache_size to ulonglong
sql/mysqld.cc:
change the declaration of max_binlog_cache_size to ulonglong and the option is fixed to extend the range of max_binlog_cache_size
sql/set_var.cc:
change the variable declaration of max_binlog_cache_size to ulonglong
for indexes of InnoDB table
Fixes by replacing the PRNG that is used to pick random pages with a
better one.
Also adds a configuration option "innodb_use_legacy_cardinality_algorithm"
to enable the fix only when the option is set.
This patch is from http://bugs.mysql.com/file.php?id=11789
The problem is that creating a event could fail if the value of
the variable server_id didn't fit in the originator column of
the event system table. The cause is two-fold: it was possible
to set server_id to a value outside the documented range (from
0 to 2^32-1) and the originator column of the event table didn't
have enough room for values in this range.
The log tables (general_log and slow_log) also don't have a proper
column type to store the server_id and having a large server_id
value could prevent queries from being logged.
The solution is to ensure that all system tables that store the
server_id value have a proper column type (int unsigned) and that
the variable can't be set to a value that is not within the range.
mysql-test/r/events_bugs.result:
Add test case result for Bug#36540
mysql-test/r/log_tables.result:
Update column type.
mysql-test/r/system_mysql_db.result:
Update column type.
mysql-test/r/variables.result:
Add test case result for server_id value range.
mysql-test/suite/sys_vars/r/server_id_basic_64.result:
Update test case results.
mysql-test/t/events_bugs.test:
Add test case for Bug#36540
mysql-test/t/log_tables.test:
Fix column type.
mysql-test/t/variables.test:
Add test case for server_id value range.
scripts/mysql_system_tables.sql:
Columns that store the server_id value must be of type INT UNSIGNED,
fix event (originator), general_log and slow_log (server_id) tables
in accordance.
scripts/mysql_system_tables_fix.sql:
Columns that store the server_id value must be of type INT UNSIGNED,
fix event (originator), general_log and slow_log (server_id) tables
in accordance.
sql/mysqld.cc:
Set min and max values for the server_id variable.
Unfortunately we can't easily change server_id variable type
from ulong to uint32 because of the sys_var classes.
mysql-test/r/index_merge_myisam.result:
Testcases
mysql-test/t/index_merge_myisam.test:
Testcases
sql/strfunc.cc:
Change optimizer_switch from no_xxx to xxx=on/xx=off.
- Add functions to parse the new syntax
The problem here seem to be that when mysql
is redirecting stderr to a file, stderr becomes
buffered, whereas it is unbuffered by definition.
The solution is to unbuffer it by setting buffer
to null.
sql/log.cc:
use setbuf(stderr, NULL) to set the buffer to null.
sql/mysqld.cc:
use setbuf(stderr, NULL) to set the buffer to null.
for bug #15936.
On some platforms fenv.h may #undef the min/max macros
defined in my_global.h.
Fixed by moving the #include directive for fenv.h from
mysqld.cc to my_global.h before definitions for min/max.
include/my_global.h:
Moved #include <fenv.h> from mysqld.cc.
sql/mysqld.cc:
Moved #include <fenv.h> to my_global.h.
- Add support for setting it as a server commandline argument
- Add support for those switches:
= no_index_merge
= no_index_merge_union
= no_index_merge_sort_union
= no_index_merge_intersection
mysql-test/r/index_merge_myisam.result:
Testcases for index_merge related @@optimizer_switch flags.
mysql-test/t/index_merge_myisam.test:
Testcases for index_merge related @@optimizer_switch flags.
sql/set_var.cc:
- Backport @@optimizer_switch support from 6.0
- Add support for setting it as a server commandline argument
sql/sql_class.h:
- Backport @@optimizer_switch support from 6.0
sql/sql_select.h:
- Backport @@optimizer_switch support from 6.0
Both of our own implementations of rint(3) were inconsistent with the
most common behavior of rint() on those platforms that have it: round
to nearest, break ties by rounding to nearest even.
Fixed by leaving just one implementation of rint() in our source tree,
and changing its behavior to match the most common native
implementations on other platforms.
configure.in:
Added checks for fenv.h and fesetround().
include/config-win.h:
Removed the incorrect implementation of rint() for Windows.
include/my_global.h:
Added an rint() implementation for platforms that do not have it.
mysql-test/r/func_math.result:
Added a test case for bug #15936.
mysql-test/t/func_math.test:
Added a test case for bug #15936.
sql/mysqld.cc:
Explicitly set the FPU rounding mode with fesetround().
- Remove bothersome warning messages. This change focuses on the warnings
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
The check for root-ness would signal an error. Errors would make the
server exit before usage (help) information was printed.
Now, test for whether we want help regardless of whether we're going
to exit with an error. If plugins are not initialized by the time we
print usage information, inform the user that some parameters are
missing.
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin
mysql-test/r/innodb_ignore_builtin.result:
test case
mysql-test/t/innodb_ignore_builtin-master.opt:
test case
mysql-test/t/innodb_ignore_builtin.test:
test case
sql/mysql_priv.h:
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin
sql/mysqld.cc:
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin
sql/set_var.cc:
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin
sql/sql_plugin.cc:
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin
Bounds-checks and blocksize corrections were applied to user-input,
but constants in the server were trusted implicitly. If these values
did not actually meet the requirements, the user could not set change
a variable, then set it back to the (wonky) factory default or maximum
by explicitly specifying it (SET <var>=<value> vs SET <var>=DEFAULT).
Now checks also apply to the server's presets. Wonky values and maxima
get corrected at startup. Consequently all non-offsetted values the user
sees are valid, and users can set the variable to that exact value if
they so desire.
mysql-test/r/read_buffer_size_basic.result:
test sets out of bounds value; we now throw a warning for this.
This is a side-effect: before, the maximum was higher than the
value we set here. The value was corrected to block-size, the
maximum was not, hence the value was smaller than the maximum
in this particular case. Now that we align the maxima at startup,
the value in SET is larger than the (corrected) maximum, and we
see a warning in this particular case. "This means we're doing it right."
mysql-test/r/read_rnd_buffer_size_basic.result:
test sets out of bounds value; we now throw a warning for this.
This is a side-effect: before, the maximum was higher than the
value we set here. The value was corrected to block-size, the
maximum was not, hence the value was smaller than the maximum
in this particular case. Now that we align the maxima at startup,
the value in SET is larger than the (corrected) maximum, and we
see a warning in this particular case. "This means we're doing it right."
mysys/my_getopt.c:
Do bounds-checking at start-up time so we'll catch and correct
wonky default values and upper limits.
sql/mysqld.cc:
If 0 is a legal value per the docs, not to mention the default, we shouldn't give 1 as
the lower limit.
storage/innobase/handler/ha_innodb.cc:
We are setting upper bounds here.
~0L gives -1. That is NOT what we want!