Commit graph

172475 commits

Author SHA1 Message Date
Sergei Golubchik
f81f985f37 fix conpilation on OpenBSD 2016-08-29 11:53:33 +02:00
Terje Rosten
754e7eff28 Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFE
Post push fix: Solaris 10 /bin/sh don't understand $().
2016-08-26 16:44:32 +05:30
Nirbhay Choubey
16702ec95f Record wsrep.variables test result (with non-debug galera library). 2016-08-25 21:19:25 -04:00
Daniel Bartholomew
39ec5ac403 bump the VERSION 2016-08-25 11:55:54 -04:00
Sivert Sorumgard
48bd8b16fe Bug#24388753: PRIVILEGE ESCALATION USING MYSQLD_SAFE
[This is the 5.5/5.6 version of the bugfix].

The problem was that it was possible to write log files ending
in .ini/.cnf that later could be parsed as an options file.
This made it possible for users to specify startup options
without the permissions to do so.

This patch fixes the problem by disallowing general query log
and slow query log to be written to files ending in .ini and .cnf.
2016-08-25 13:42:17 +05:30
Jon Olav Hauglid
4e5473862e Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file with chmod/chown. If a user
managed to replace the temporary file before chmod/chown was executed,
it was possible to get an arbitrary file with the privileges of the
mysql user.

This patch fixes the problem by not copying stats from the old
file to the new file. This is not needed as the new file was
created with the correct stats. This fix only changes server
behavior - external utilities such as myisamchk still does
chmod/chown.

No test case provided since the problem involves synchronization
with file system operations.
2016-08-25 13:38:54 +05:30
Terje Rosten
684a165f28 Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFE
Argument to malloc-lib must be included in restricted list of
directories, symlink guards added, and mysqld and mysqld-version
options restricted to command line only. Don't redirect errors to
stderr.
2016-08-25 13:32:25 +05:30
Monty
ee97274ca7 DEV-10595 MariaDB daemon leaks memory with specific query
The issue was that in some extreme cases when doing GROUP BY,
buffers for temporary blobs where not properly cleared.
2016-08-25 09:50:04 +03:00
Nirbhay Choubey
b506d9527b Merge branch '5.5-galera' into 10.0-galera 2016-08-24 19:41:11 -04:00
Nirbhay Choubey
c309e99ff9 Merge branch '10.0' into 10.0-galera 2016-08-24 19:30:32 -04:00
Nirbhay Choubey
8b09db8bfb Fixes/improvements in galera test suite 2016-08-24 17:13:20 -04:00
Nirbhay Choubey
1b7c5dedf7 MDEV-10566: Create role statement replicated inconsistently in Galera Cluster
In galera cluster, the definer (and thus binlog invoker) must be set
for CREATE ROLE before Query_log_event is created during TOI on the
originating node.
2016-08-24 15:32:48 -04:00
Elena Stepanova
5bbe929d70 MDEV-10604 Create a list of unstable MTR tests to be disabled in distribution builds
- mysql-test/unstable-tests list is created, it includes
  = tests identified as unstable by Debian;
  = tests which failed in buildbot on 10.0 over the last ~6 months and were not fixed;
  = tests which have been recently modified or newly added
- '*' wildcard is now supported in skip lists
2016-08-24 17:39:57 +03:00
Vicențiu Ciorbaru
ed99e2cdd3 MDEV-10341: InnoDB: Failing assertion: mutex_own(mutex) - mutex_exit_func
Followup from 5.5 patch. Removing memory barriers on intel is wrong as
this doesn't prevent the compiler and/or processor from reorganizing reads
before the mutex release. Forcing a memory barrier before reading the waiters will
guarantee that no speculative reading takes place.
2016-08-23 21:24:36 +03:00
Vicențiu Ciorbaru
4eb898bb16 MDEV-10563 Crash during shutdown in Master_info_index::any_slave_sql_running
In well defined C code, the "this" pointer is never NULL. Currently, we
were potentially dereferencing a NULL pointer (master_info_index). GCC v6
removes any "if (!this)" conditions as it assumes this is always a
non-null pointer. In order to prevent undefined behaviour, check the
pointer before dereferencing and remove the check within member
functions.
2016-08-23 21:24:36 +03:00
Monty
4da2b83af7 Fixed compiler error and some warnings on windows 2016-08-23 15:03:31 +03:00
Monty
a5051cd3b2 Minor cleanups
- Remove impossible test in test_quick_select
- Ensure that is_fatal_error is set if we run out of stack space
2016-08-22 10:19:07 +03:00
Monty
b51109693e MDEV-10630 rpl.rpl_mdev6020 fails in buildbot with timeout
The issue was that when running with valgrind the wait for master_pos_Wait()
was not long enough.

This patch also fixes two other failures that could affect rpl_mdev6020:
- check_if_conflicting_replication_locks() didn't properly check domains
- 'did_mark_start_commit' was after signals to other threads was sent which could
  get the variable read too early.
2016-08-22 10:16:00 +03:00
Nirbhay Choubey
f381ad5230 Update WSREP_PATCH_REVNO. 2016-08-21 20:13:51 -04:00
Nirbhay Choubey
3f481e52e4 Fixes for failing tests (post-merge). 2016-08-21 20:09:05 -04:00
Nirbhay Choubey
cced23cf23 MDEV-9423: cannot add new node to the cluser: Binlog..
.. file '/var/log/mysql/mariadb-bin.000001' not found in binlog
index, needed for recovery. Aborting.

In Galera cluster, while preparing for rsync/xtrabackup based
SST, the donor node takes an FTWRL followed by (REFRESH_ENGINE_LOG
in rsync based state transfer and) REFRESH_BINARY_LOG. The latter
rotates the binary log and logs Binlog_checkpoint_log_event
corresponding to the penultimate binary log file into the new file.
The checkpoint event for the current file is later logged
synchronously by binlog_background_thread.

Now, since in rsync/xtrabackup based snapshot state transfer methods,
only the last binary log file is transferred to the joiner node; the
file could get transferred even before the checkpoint event for the
same file gets written to it. As a result, the joiner node would fail
to start complaining about the missing binlog file needed for recovery.

In order to fix this, a mechanism has been put in place to make
REFRESH_BINARY_LOG operation wait for Binlog_checkpoint_log_event
to be logged for the current binary log file if the node is part of
a Galera cluster. As further safety, during rsync based state transfer
the donor node now acquires and owns LOCK_log for the duration of file
transfer during SST.
2016-08-21 16:20:09 -04:00
sjaakola
415823a41c Refs: MW-279
- fixes in innodb to skip wsrep processing (like kill victim) when running in native mysql mode
- similar fixes in mysql server side
- forcing tc_log_dummy in native mysql mode when no binlog used. wsrep hton messes up handler counter
  and used to lead in using tc_log_mmap instead. Bad news is that tc_log_mmap does not seem to work at all
2016-08-21 16:20:09 -04:00
Damien Ciabrini
fec296cc10 refs codership/mysql-wsrep#267
Fix Galera crash at startup when compiled with gcc 6
2016-08-21 16:20:08 -04:00
Philip Stoev
2e56c7f3cd Bump WSREP_PATCH_VERSION to 16 2016-08-21 16:20:08 -04:00
Philip Stoev
f01a16b541 Galera MTR Tests: fortify galera_bf_abort_flush_for_export against sporadic failures. 2016-08-21 16:20:07 -04:00
Philip Stoev
30c6ac3cd1 Galera MTR Tests: Attempt to fortify galera_kill_ddl.test against sporadic failures 2016-08-21 16:20:07 -04:00
Philip Stoev
0656453135 Galera MTR Tests: increase timeouts and adjust some sporadically-failing tests so that the Galera suites can be run with --parallel=4 2016-08-21 16:17:18 -04:00
Philip Stoev
85b9718b22 Galera MTR Tests: Test case for galera#414 - crash on shutdown with gcs.max_packet_size=2 2016-08-21 16:17:18 -04:00
Daniele Sciascia
ea3ff73031 GCF-837 Fix crash when loading wrong provider version
mysqld would crash with "double free or corrruption message"
if wrong provider version was given.
2016-08-21 16:17:17 -04:00
Daniele Sciascia
bf19492e3b GCF-837 Check wsrep interface version before loading provider 2016-08-21 16:17:17 -04:00
Daniele Sciascia
dfa9012abb MW-285 MTR test case for broken foreign key constraints 2016-08-21 16:17:16 -04:00
Krunal Bauskar
c9ac48f845 - PXC#592: Tried closing fk-reference-table that was never opened.
Function "wsrep_row_upd_check_foreign_constraints" tried to mark
  fk-reference-table opened without ensuring it table is really opened.
2016-08-21 16:17:16 -04:00
Daniele Sciascia
88a1592b0a MW-286 Avoid spurious deadlock errors when wsrep_on is disabled
If a conflict happens under wsrep_on, the THD's wsrep_conflict_state
is typically set to MUST_ABORT and cleared later, when transaction is
aborted. However, when wsrep_on is disabled, no check is performed to
see whether wsrep_conflict_state is set. So this potentially creates
spurious deadlock errors on the subsequent statement that runs with
wsrep_on enabled.
To avoid this problem wsrep_thd_set_conflict_state() sets the conflict
state only if wsrep_on is enabled.
2016-08-21 16:17:15 -04:00
Philip Stoev
a12fa57d35 Galera MTR Tests: Run galera_pc_weight on freshly started servers in order to prevent interaction with other tests 2016-08-21 16:17:15 -04:00
sjaakola
5996c7baad refs: MW-279
- At startup time global wsrep_on is set too late and some wsrep paths may be executed
  because of this. e.g. replication slave restart could happen before wsrep_on state is defined.
- This fix checks both global wsrep_on and wsrep_provider values to determine if wsrep
  processing should happen
- Fix affects all instances where WSREP_ON macro is used
2016-08-21 16:17:14 -04:00
Philip Stoev
0e83726edb Galera MTR Tests: force galera_3nodes.galera_pc_bootstrap.test to run on a fresh cluster in order to avoid interaction with galera_3nodes.galera_innobackupex_backup.test 2016-08-21 16:17:14 -04:00
Philip Stoev
5609020c71 Galera MTR Tests: fortify galera_parallel_simple.test against sporadic failures 2016-08-21 16:17:14 -04:00
Philip Stoev
1cb01fe7d2 Galera MTR Tests: Fortify galera_restart_nochanges.test against sporadic failures due to node not being ready immediately after restart 2016-08-21 16:17:13 -04:00
Daniele Sciascia
92162e6d87 MW-175 Fix definitively lost memory in wsrep_get_params 2016-08-21 16:17:13 -04:00
Philip Stoev
137af55ca1 Galera MTR Tests: stability fixes 2016-08-21 16:17:12 -04:00
Philip Stoev
db837fde87 Galera MTR Tests: Adjust tests for xtrabackup 2.4.2 2016-08-21 16:17:12 -04:00
Nirbhay Choubey
81174c9ab1 Fix galera/MW-44 test post-merge. 2016-08-21 16:17:11 -04:00
Philip Stoev
182787f39e Galera MTR Tests: Adjust galera_log_output_csv.test to account for the fix for MW-44 2016-08-21 16:17:11 -04:00
Philip Stoev
675bcf3b6d Galera MTR Tests: A test for MW-44 - Disable general log for applier threads 2016-08-21 16:17:11 -04:00
Teemu Ollakka
f49500a803 MW-44 Disable general log for applier threads 2016-08-21 16:17:10 -04:00
Nirbhay Choubey
3f22e743c5 Fix galera/GAL-382 test post-merge. 2016-08-21 16:17:10 -04:00
Philip Stoev
9b42f09902 Galera MTR Tests: Add test for GAL-382, codership/galera#382 - InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno in trx0sys.cc line 356 2016-08-21 16:17:09 -04:00
Philip Stoev
fce9217c21 Galera MTR Test: Fix for MW-258.test - do not use SHOW PROCESSLIST 2016-08-21 16:17:09 -04:00
Philip Stoev
dda114461e Galera MTR Tests: Fixed tests to account for GAL-391 , GAL-374 2016-08-21 16:17:08 -04:00
Alexey Yurchenko
d45b58263d MW-259 - moved wsrep desync/resync calls from wsrep_desync_update() to wsrep_desync_check() method which does not hold the lock and is arguably a more fitting place to change provider state - before changing the actual variable value. 2016-08-21 16:17:08 -04:00