Commit graph

172084 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
5d0c123007 Add missing sys_var test for innodb_stats_include_delete_marked 2017-03-05 01:00:21 +02:00
Vicențiu Ciorbaru
83da1a1e57 Merge branch 'merge-xtradb-5.6' into 10.0 2017-03-05 00:59:57 +02:00
Vicențiu Ciorbaru
8d69ce7b82 5.6.35-80.0 2017-03-04 20:50:02 +02:00
Vicențiu Ciorbaru
f4806772d3 Add missing DBUG_RETURN 2017-03-03 20:16:16 +02:00
Vicențiu Ciorbaru
606a4a4847 Post MDEV-11902 Fix test failures in maria and myisam storage engines
my_readline can fail due to missing file. Make my_readline report this
condition separately so that we can catch it and report an appropriate
error message to the user.
2017-03-03 20:12:48 +02:00
Marko Mäkelä
29c776cfd1 MDEV-11520: Retry posix_fallocate() after EINTR.
The function posix_fallocate() as well as the Linux system call
fallocate() can return EINTR when the operation was interrupted
by a signal. In that case, keep retrying the operation, except
if InnoDB shutdown has been initiated.
2017-03-03 12:03:33 +02:00
Marko Mäkelä
6b8173b6e9 MDEV-11520: Retry posix_fallocate() after EINTR.
The function posix_fallocate() as well as the Linux system call
fallocate() can return EINTR when the operation was interrupted
by a signal. In that case, keep retrying the operation, except
if InnoDB shutdown has been initiated.
2017-03-03 11:47:31 +02:00
Vicențiu Ciorbaru
1acfa942ed Merge branch '5.5' into 10.0 2017-03-03 01:37:54 +02:00
Daniel Black
d04d835f64 MDEV-11610: support-files/mysql-log-rotate.sh not binlog either
For the same reason as removing binlog rotation on Debian.
2017-03-02 15:16:21 +04:00
Daniel Black
156cf86def MDEV-11610: Alter Debian log rotate to not rotate binary/relay logs
Rotating binary/relay logs can cause interuption to the processing
on the server. Binary and relay logs have their own mechanism already
for not getting out of control (expire_logs_days).

By no longer rotating binary and relay logs log rotation is limited to
the following logs:
* error log
* general log
* slow query log

Writing these to the binary log would cause any logrotation on the
slave to occur twice, once due to this and another due to the log-
rotate script on the slave. Now --local is passed to mysqladmin to
prevent this duplication.
2017-03-02 15:16:06 +04:00
Daniel Black
0af8b565f2 MDEV-11610: mysqladmin flush-X-log options
Add the following options to mysqladmin

+  flush-binary-log        Flush binary log
+  flush-engine-log        Flush engine log(s)
+  flush-error-log         Flush error log
+  flush-general-log       Flush general log
+  flush-relay-log         Flush relay log
+  flush-user-resources    Flush user resources
2017-03-02 15:16:00 +04:00
Olivier Bertrand
b2956b2ab4 Update version number and date
modified:   storage/connect/ha_connect.cc

Add conditional SE exception support
  modified:   storage/connect/json.cpp
  modified:   storage/connect/plgdbutl.cpp

Change %p in %x in some sprintf functions.
This to avoid some compiler warnings.
  modified:   storage/connect/tabwmi.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/value.h

Add JavaWrappers.jar to the class path
  modified:   storage/connect/jdbconn.cpp

Fix wrong declare (char *buf[256]; --> char  buf[256];)
  modified:   storage/connect/xindex.cpp
2017-03-02 12:12:53 +01:00
Daniel Black
33c1f20d8e MDEV-11610: Add --local to mysqladmin 2017-03-02 15:09:24 +04:00
Daniel Black
659047b820 MDEV-11386: Advance Toochain library cache workaround (temporary)
Due to the way Advance Toolchain before 10.0-3 and 8.0-8 is
packaged, shared libraries installed after the library cache
advance-toolchain-atX.Y-runtime package aren't updated in
/opt/atX.Y/etc/ld.so.cache. This results in mysqld,
configured with RUNPATH set to /opt/atX.Y/lib64, resulting
in the Advance Toolchain loader being used and if libraries
such as jemalloc, libssl or any other library that mysqld uses
is installed after Advance Toolchain, these libraries aren't in
the cache and therefore won't be found in the RPM postinstall
when mysqld is executed by mysql_install_db.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-03-02 14:04:08 +04:00
Sergey Vojtovich
71f53bf72d MDEV-11221 - main.events_restart failed in bb
This is an addition to original fix. Buildbot revealed another sporadic failure
in perfschema.threads_mysql test. Tests relies on data stored in
performance_schema.threads, while performing waits on
information_schema.processlist. These tables are not updated synchronously.

Fixed by performing waits on performance_schema.threads instead.
2017-03-02 12:35:31 +04:00
Sergey Vojtovich
c1c5b7a8d2 Fixed missing DBUG_RETURN 2017-03-01 11:41:48 +04:00
Sergey Vojtovich
e9ad4bdb42 MDEV-11221 - main.events_restart failed in bb
Applied lost in a merge revision 7f38a07:

MDEV-10043 - main.events_restart fails sporadically in buildbot (crashes upon
             shutdown)

There was race condition between shutdown thread and event worker threads.

Shutdown thread waits for thread_count to become 0 in close_connections(). It
may happen so that event worker thread was started but didn't increment
thread_count by this time. In this case shutdown thread may miss wait for this
working thread and continue deinitialization. Worker thread in turn may continue
execution and crash on deinitialized data.

Fixed by incrementing thread_count before thread is actually created like it is
done for connection threads.

Also let event scheduler not to inc/dec running threads counter for symmetry
with other "service" threads.
2017-03-01 11:35:24 +04:00
Oleksandr Byelkin
75f6067e89 MDEV-9635: Server crashes in part_of_refkey or assertion `!created && key_to_save < (int)s->keys' failed in TABLE::use_index(int) or with join_cache_level>2
Do not try to create index where ref is for hash join.
2017-02-28 20:52:26 +01:00
Sergei Golubchik
cc413ce9a3 MDEV-11753 Link failure on missing -L${LIBLZ4_LIBRARY_DIR}
On FreeBSD liblz4 is installed in /usr/local/lib.
Groonga uses pkg_check_modules to check for liblz4 (that is, pkg-config),
and then it used to set for libgroonga.a

  link_directories({$LIBLZ4_LIBRARY_DIRS})
  target_link_libraries(... ${LIBLZ4_LIBRARIES})

Now groonga is a static library, linked into ha_mroonga.so. CMake won't
link dynamic liblz4.so into libgroonga.a, instead it'll pass it as a
dependency and will link it into ha_mroonga.so. Fine so far. But it will
not pass link_directories from the static library as a dependency,
so ha_mroonga.so won't find liblz4.so

As suggested on cmake mailing list (e.g.
here: http://public.kitware.com/pipermail/cmake/2011-November/047468.html)
we switch to use the full path to liblz4.so, instead of the -l/-L pair.
2017-02-28 16:19:44 +01:00
Sergei Golubchik
370cf70136 MDEV-11757 KEY_BLOCK_SIZE strangeness when UNCOMPRESSing COMPRESSed InnoDB tables
in ALTER TABLE ... DROP KEY, ADD KEY, don't forget to compare old
and new keys' block sizes. If they differ - the key definition has changed.
2017-02-28 16:19:44 +01:00
Monty
6a12c05347 Fixed wrong arguments to sql_print_error() 2017-02-28 16:10:47 +01:00
Monty
84ed5e1d5f Fixed hang doing FLUSH TABLES WITH READ LOCK and parallel replication
The problem was that waiting for pause_for_ftwrl was done before
event_group was completed. This caused rpl_pause_for_ftwrl() to wait
forever during FLUSH TABLES WITH READ LOCK.
Now we only wait for FLUSH TABLES WITH READ LOCK when we are changing
to a new event group.
2017-02-28 16:10:47 +01:00
Monty
f3c65ce951 Add protection to not access is_open() without LOCK_log mutex
Protection added to reopen_file() and new_file_impl().

Without this we could get an assert in fn_format() as name == 0,
because the file was closed and name reset, atthe same time
new_file_impl() was called.
2017-02-28 16:10:47 +01:00
Monty
b624b41abb Don't allow one to kill START SLAVE while the slaves IO_THREAD or SQL_THREAD
is starting.

This is needed as if we kill the START SLAVE thread too early during
shutdown then the IO_THREAD or SQL_THREAD will not have time to properly
initlize it's replication or THD structures and clean_up() will try to
delete master_info structures that are still in use.
2017-02-28 16:10:47 +01:00
Michael Widenius
d7a9aed43f Fixed test failing as myisam table was deleted before oqgraph table. 2017-02-28 16:10:47 +01:00
Monty
4bad74e139 Added error checking for all calls to flush_relay_log_info() and stmt_done() 2017-02-28 16:10:47 +01:00
Monty
a2de378c00 Add protection for reinitialization of mutex in parallel replaction
Added mutex_lock/mutex_unlock of mutex that is to be destroyed in
wait_for_commit::reinit() in a similar fashion that we do in
~wait_for_commit
2017-02-28 16:10:47 +01:00
Monty
c5e25c8b40 Added a separate lock for start/stop/reset slave.
This solves some possible dead locks when one calls stop slave while slave
is starting.
2017-02-28 16:10:46 +01:00
Monty
e65f667bb6 MDEV-9573 'Stop slave' hangs on replication slave
The reason for this is that stop slave takes LOCK_active_mi over the
whole operation while some slave operations will also need LOCK_active_mi
which causes deadlocks.

Fixed by introducing object counting for Master_info and not taking
LOCK_active_mi over stop slave or even stop_all_slaves()

Another benefit of this approach is that it allows:
- Multiple threads can run SHOW SLAVE STATUS at the same time
- START/STOP/RESET/SLAVE STATUS on a slave will not block other slaves
- Simpler interface for handling get_master_info()
- Added some missing unlock of 'log_lock' in error condtions
- Moved rpl_parallel_inactivate_pool(&global_rpl_thread_pool) to end
  of stop_slave() to not have to use LOCK_active_mi inside
  terminate_slave_threads()
- Changed argument for remove_master_info() to Master_info, as we always
  have this available
- Fixed core dump when doing FLUSH TABLES WITH READ LOCK and parallel
  replication. Problem was that waiting for pause_for_ftwrl was not done
  when deleting rpt->current_owner after a force_abort.
2017-02-28 16:10:46 +01:00
Monty
d5c54f3990 Fixed compiler warnings
- Removed not used variables
- Added __attribute__()
- Added static to some local functions
  (gcc 5.4 gives a warning for external functions without an external definition)
2017-02-28 16:10:46 +01:00
iangilfillan
ce903428a8 Update MariaDB Foundation sponsors 2017-02-28 17:15:36 +04:00
Vladislav Vaintroub
d4baeca441 Windows : Fix server compile errors when compile with /Zc:strictStrings option 2017-02-28 12:57:33 +00:00
Marko Mäkelä
fc673a2c12 MDEV-12127 InnoDB: Assertion failure loop_count < 5 in file log0log.cc
As suggested in MySQL Bug#58536, increase the limit in this
debug assertion in order to avoid false positives on heavily
loaded systems.
2017-02-28 09:54:12 +02:00
Daniel Black
b54566d73b MDEV-11619: mtr --mem {no argument of a directory} (#320)
This removes functionality of where ./mtr --mem /tmp/dir could be a directory.

Now MTR_MEM=/tmp/dir ./mtr is needed.

The case where MTR_MEM=/tmp/dir ./mtr --mem has the equivalent effect.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>

--mem works better as a pure flag, because it can be followed by command-line arguments (test names). If the option is allowed to have a value, the test name which directly follows it will be treated as the option value instead. It is possible to implement workarounds to avoid this, but they would not be completely reliable, and there is no practical purpose of such extension of functionality to justify them.
2017-02-28 01:08:12 +02:00
Igor Babaev
5a0fff50f8 Fixed bug mdev-12099.
The function mysql_derived_merge() erroneously did not mark newly formed
AND formulas in ON conditions with the flag abort_on_null. As a result
not_null_tables() calculated incorrectly for these conditions. This
could prevent conversion of embedded outer joins into inner joins.

Changed a test case from table_elim.test to preserve the former execution
plan.
2017-02-27 09:02:41 -08:00
Sergei Golubchik
199f88cb9c MDEV-5999 MySQL Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY - REQUIRES FLUSH PRIVILEGES
use update_hostname() to update the hostname.
test case comes from

  commit 0abdeed1d6d
  Author: gopal.shankar@oracle.com <>
  Date:   Thu Mar 29 00:20:54 2012 +0530

    Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY -
                          REQUIRES FLUSH PRIVILEGES
2017-02-27 12:35:10 +01:00
Dmitry Lenev
494a94158a Fix for bug#11759114 - '51401: GRANT TREATS NONEXISTENT
FUNCTIONS/PRIVILEGES DIFFERENTLY'.

The problem was that attempt to grant EXECUTE or ALTER
ROUTINE privilege on stored procedure which didn't exist
succeed instead of returning an appropriate error like
it happens in similar situation for stored functions or
tables.

The code which handles granting of privileges on individual
routine calls sp_exist_routines() function to check if routine
exists and assumes that the 3rd parameter of the latter
specifies whether it should check for existence of stored
procedure or function. In practice, this parameter had
completely different meaning and, as result, this check was
not done properly for stored procedures.

This fix addresses this problem by bringing sp_exist_routines()
signature and code in line with expectation of its caller.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
0a480f03c6 delete the installation warning for CentOS4/RHEL4
it went out of support five years ago
2017-02-27 12:35:10 +01:00
Sergei Golubchik
2c354e7468 MDEV-11789 MariaDB fails to restart after 10.0.29-1.el7 update 2017-02-27 12:35:10 +01:00
Sergei Golubchik
713d513624 MDEV-12074 selinux build failure on Fedora 24 2017-02-27 12:35:10 +01:00
Sergei Golubchik
831b531895 MDEV-10788 Not able to compile source with -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Debug
It's too plainful to require <my_config.h> to be included first
for third-party storage engines. And anyway, some source files
might not include <my_config.h> at all, so there is no guarantee
that all parts of the binary will see identical definitions of system
structures (e.g. struct stat).

Define _FILE_OFFSET_BITS on the compiler's command line instead.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
44534487d4 MDEV-11505 wrong databasename in mysqldump comment
fix_for_comment() uses a static buffer. cannot have two
fix_for_comment() calls as arguments to one printf().
2017-02-27 12:35:10 +01:00
Sergei Golubchik
d72dbb4122 bugfix: remove my_delete_with_symlink()
it was race condition prone. instead use either a pair of my_delete()
calls with already resolved paths, or a safe high-level function
my_handler_delete_with_symlink(), like MyISAM and Aria already do.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
955f2f036d race-condition safe implementation of test_if_data_home_dir()
don't realpath() twice
2017-02-27 12:35:10 +01:00
Sergei Golubchik
93cb0246b8 race-condition safe implementation of mi_delete_table/maria_delete_table 2017-02-27 12:35:10 +01:00
Sergei Golubchik
6d50324558 support MY_NOSYMLINKS in my_delete() 2017-02-27 12:35:10 +01:00
Sergei Golubchik
f2d24ea68b compilation failure
At least it would be a compilation failure with -DDONT_ALLOW_SHOW_COMMANDS.
Otherwise it only confuses ctags to ignore ~75% of sql_parse.cc
2017-02-27 12:35:10 +01:00
Sergei Golubchik
b6862c914f cleanup: remove now-unused argument 2017-02-27 12:35:10 +01:00
Sergei Golubchik
b27fd90ad3 MDEV-11902 mi_open race condition
TOCTOU bug. The path is checked to be valid, symlinks are resolved.
Then the resolved path is opened. Between the check and the open,
there's a window when one can replace some path component with a
symlink, bypassing validity checks.

Fix: after we resolved all symlinks in the path, don't allow open()
to resolve symlinks, there should be none.

Compared to the old MyISAM/Aria code:
* fastpath. Opening of not-symlinked files is just one open(),
  no fn_format() and lstat() anymore.
* opening of symlinked tables doesn't do fn_format() and lstat() either.
  it also doesn't to realpath() (which was lstat-ing every path
  component), instead if opens every path component with O_PATH.
* share->data_file_name stores realpath(path) not readlink(path). So,
  SHOW CREATE TABLE needs to do lstat/readlink() now (see ::info()),
  and certain error messages (cannot open file "XXX") show the real
  file path with all symlinks resolved.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
d78d0d459d cleanup: NO_OPEN_3 was never defined 2017-02-27 12:35:10 +01:00