Commit graph

17415 commits

Author SHA1 Message Date
Jan Lindström
071ae303bd MDEV-9121: innodb_force_recovery = 6 cannot recover ANY DATA when
change buffer not empty

Fix: Allow not empty change buffer when innodb_force_recovery >= 5
and output only a warning to error log.

Note: Before using force recovery you should always take backup
of your database.
2016-04-27 11:11:08 +03:00
Monty
3f6125129f Fixed results 2016-04-07 20:38:21 +03:00
Vladislav Vaintroub
4b6a3518e4 Use _ReadWriteBarrier() rather than MemoryBarrier() for preventing compile optimization 2016-04-06 14:15:44 +02:00
Vladislav Vaintroub
fd7a8d18ea Fix compile error in UT_COMPILER_BARRIER on Visual Studio compiler. 2016-04-06 13:38:22 +02:00
Jan Lindström
9794cf2311 Merge pull request #168 from grooverdan/10.1-MDEV-8684-UT_RELAX_CPU_isnt_relaxing
MDEV-8684 ut relax cpu isnt relaxing
2016-04-06 08:50:59 +03:00
Sergei Petrunia
04737330be MDEV-9860: TokuDB ORDER BY DESC query is slower in 10.1 with ICP ON
Implement ha_tokudb::cancel_pushed_idx_cond().

This is a conservative fix which follows the approach from the previous
patch for:
BUG#1000051: Query with simple join and ORDER BY takes thousands times...
2016-04-03 20:19:59 +03:00
Daniel Black
26c38de804 MDEV-8684: Use POWER wrappers rather than direct asm
i.e. __ppc_set_ppr_low rather than 'or 1,1,1'
2016-04-01 09:38:17 +11:00
Jan Lindström
c395aad668 MDEV-9840: Test encryption.innodb-log-encrypt-crash fails on buildbot
Problem: We created more than 5 encryption keys for redo-logs.
Idea was that we do not anymore create more than one encryption
key for redo-logs but if existing checkpoint from earlier
MariaDB contains more keys, we should read all of them.

Fix: Add new encryption key to memory structure only if there
currently has none or if we are reading checkpoint from the log.
Checkpoint from older MariaDB version could contain more than
one key.
2016-03-31 13:12:48 +03:00
Daniel Black
64824a760d MDEV-8684: UT_RELAX_CPU on Power to non-empty expansion
Using __ppc_get_timebase will translate to mfspr instruction
The mfspr instruction will block FXU1 until complete but the other
Pipelines are available for execution of instructions from other
SMT threads on the same core.

The latency time to read the timebase SPR is ~10 cycles.

So any impact on other threads is limited other FXU1 only instructions
(basically other mfspr/mtspr ops).

Suggested by Steven J. Munroe, Linux on Power Toolchain Architect,
Linux Technology Center
IBM Corporation
2016-03-31 16:35:26 +11:00
Sergey Vojtovich
3d1a7cba71 MDEV-8684: Remove delaying maths in ut_delay
Also introduce compiler barrier properly on all architectures.
2016-03-31 16:35:19 +11:00
Yasufumi Kinoshita
d4ba50477e Some POWER specific optimizations
Bug#18842925 : SET THREAD PRIORITY IN INNODB MUTEX SPINLOOP
Like "pause" instruction for hyper-threading at Intel CPUs,
POWER has special instructions only for hinting priority of hardware-threads.

Approved by Sunny in rb#6256

Backport of the 5.7 fix - c92102a6ef
(excluded cache line size patch)

Suggestion by Stewart Smith
2016-03-31 16:34:56 +11:00
Marko Mäkelä
2275640deb Bug#20045167 UT_DELAY MISSING COMPILER BARRIER
UT_RELAX_CPU(): Use a compiler barrier.

ut_delay(): Remove the dummy global variable ut_always_false.

RB: 11399
Reviewed-by: Jimmy Yang <jimmy.yang@oracle.com>

Backported from MySQL-5.7 - patch 5e3efb0396

Suggestion by Stewart Smith
2016-03-31 16:34:21 +11:00
Jan Lindström
37a65e3335 MDEV-9793: getting mysqld crypto key from key version failed
Make sure that we read all possible encryption keys from checkpoint
and if log block checksum does not match, print all found
checkpoint encryption keys.
2016-03-30 16:09:47 +03:00
Jan Lindström
4ddb9deaf3 MDEV-9678: Data Directory bug
MDEV-9833: Log files are opened using O_DIRECT causing problems if block size != 512

Fix typo.
2016-03-30 14:59:25 +03:00
Sergei Golubchik
fd6c588659 Merge branch 'bb-10.1-serg' into 10.1 2016-03-22 19:18:48 +01:00
Jan Lindström
f71c45c71d MDEV-9678: Data Directory bug
Problem was that link file (.isl) is also opened using O_DIRECT
    mode and if this fails the whole create table fails on internal
    error.

    Fixed by not using O_DIRECT on link files as they are used only
    on create table and startup and do not contain real data.
    O_DIRECT failures are successfully ignored for data files
    if O_DIRECT is not supported by file system on used
    data directory.
2016-03-22 19:39:52 +02:00
Sergei Golubchik
d5a80519c9 Merge branch 'connect/10.1' into 10.1 2016-03-21 21:43:28 +01:00
Sergei Golubchik
3b0c7ac1f9 Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
Sergei Golubchik
22ebf3cb45 MDEV-9527 build FAILs with GCC 5.1 with release supported "-std=c+11"
10.0 part of the fix
2016-03-21 11:55:03 +01:00
Sergei Golubchik
d158ba62f7 ASAN error in OQGraph engine
Fixed more cases for MDEV-6282
2016-03-21 11:43:19 +01:00
Sergei Golubchik
a2de604309 ASAN error in CONNECT engine
don't strcpy a string to itself
2016-03-21 11:43:19 +01:00
Sergei Golubchik
2ed882f9c4 update tests and results
s/Execute/Query/ to account for --ps-protocol
2016-03-21 11:43:19 +01:00
Bernard Spil
ee687771ee Use /bin/sh
Remove Linuxism. 

Works fine with a POSIX-compat shell
2016-03-21 11:43:19 +01:00
Sergei Golubchik
a1782b4ab9 MDEV-9739 Assertion `m_status == DA_ERROR || m_status == DA_OK' failed in Diagnostics_area::message() ; connect.xml* tests fail in buildbot 2016-03-19 19:40:25 +01:00
Olivier Bertrand
59c4675c6b - Fix compile error when copying a string on itself.
modified:   storage/connect/value.cpp

- Fix compile error of MDEV-9603
  modified:   storage/connect/tabmysql.cpp
2016-03-19 12:02:03 +01:00
Sergei Golubchik
3fdc6140a3 update plugins' maturity levels 2016-03-18 22:05:23 +01:00
Jan Lindström
7cb16dc2a3 MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables
Fix incorrectly merged files on innodb_plugin.
2016-03-18 20:55:54 +02:00
Jan Lindström
ee768d8e0e MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION 2016-03-18 11:48:49 +02:00
Jan Lindström
f448a800e1 MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables
Analysis:

-- InnoDB has n (>0) redo-log files.
-- In the first page of redo-log there is 2 checkpoint records on fixed location (checkpoint is not encrypted)
-- On every checkpoint record there is up to 5 crypt_keys containing the keys used for encryption/decryption
-- On crash recovery we read all checkpoints on every file
-- Recovery starts by reading from the latest checkpoint forward
-- Problem is that latest checkpoint might not always contain the key we need to decrypt all the
   redo-log blocks (see MDEV-9422 for one example)
-- Furthermore, there is no way to identify is the log block corrupted or encrypted

For example checkpoint can contain following keys :

write chk: 4 [ chk key ]: [ 5 1 ] [ 4 1 ] [ 3 1 ] [ 2 1 ] [ 1 1 ]

so over time we could have a checkpoint

write chk: 13 [ chk key ]: [ 14 1 ] [ 13 1 ] [ 12 1 ] [ 11 1 ] [ 10 1 ]

killall -9 mysqld causes crash recovery and on crash recovery we read as
many checkpoints as there is log files, e.g.

read [ chk key ]: [ 13 1 ] [ 12 1 ] [ 11 1 ] [ 10 1 ] [ 9 1 ]
read [ chk key ]: [ 14 1 ] [ 13 1 ] [ 12 1 ] [ 11 1 ] [ 10 1 ] [ 9 1 ]

This is problematic, as we could still scan log blocks e.g. from checkpoint 4 and we do
not know anymore the correct key.

CRYPT INFO: for checkpoint 14 search 4
CRYPT INFO: for checkpoint 13 search 4
CRYPT INFO: for checkpoint 12 search 4
CRYPT INFO: for checkpoint 11 search 4
CRYPT INFO: for checkpoint 10 search 4
CRYPT INFO: for checkpoint 9 search 4 (NOTE: NOT FOUND)

For every checkpoint, code generated a new encrypted key based on key
from encryption plugin and random numbers. Only random numbers are
stored on checkpoint.

Fix: Generate only one key for every log file. If checkpoint contains only
one key, use that key to encrypt/decrypt all log blocks. If checkpoint
contains more than one key (this is case for databases created
using MariaDB server version 10.1.0 - 10.1.12 if log encryption was
used). If looked checkpoint_no is found from keys on checkpoint we use
that key to decrypt the log block. For encryption we use always the
first key. If the looked checkpoint_no is not found from keys on checkpoint
we use the first key.

Modified code also so that if log is not encrypted, we do not generate
any empty keys. If we have a log block and no keys is found from
checkpoint we assume that log block is unencrypted. Log corruption or
missing keys is found by comparing log block checksums. If we have
a keys but current log block checksum is correct we again assume
log block to be unencrypted. This is because current implementation
stores checksum only before encryption and new checksum after
encryption but before disk write is not stored anywhere.
2016-03-18 07:58:04 +02:00
Olivier Bertrand
b80b292117 - Fix crash when sorting a TBL table with thread=yes.
This was because Tablist can be NULL when no lacal tables are in the list.
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/mysql-test/connect/r/tbl.result
  modified:   storage/connect/mysql-test/connect/t/tbl.test
2016-03-17 00:08:00 +01:00
Olivier Bertrand
7829cefa41 - Fix MDEV-9603 compiler error.
modified:   storage/connect/tabmysql.cpp

- Test invalid CSV separator when creating the table (MDEV-9714)
  modified:   storage/connect/ha_connect.cc

- Stop using SQLDescribeParam anymore
  modified:   storage/connect/odbconn.cpp

- Fix MDEV-9723 Regression due to calling Cardinality instead of
  GetMaxSize in info.
  modified:   storage/connect/tabtbl.h
  modified:   storage/connect/mysql-test/connect/r/tbl.result
  modified:   storage/connect/mysql-test/connect/t/tbl.test

- Typo
  modified:   storage/connect/tabodbc.cpp
2016-03-16 18:53:56 +01:00
Jan Lindström
d5d0c35f23 Merge pull request #160 from grooverdan/crc32_power_abi_fix
MDEV-9699: power8 crc32: Per the PPC64 ABI, v20-v31 are non-volatile registers
2016-03-15 10:46:33 +02:00
Jan Lindström
a12326458d Add check to avoid NULL-pointer access if encryption information
is not available. Clarify system tablespace page 0 check.
2016-03-13 15:37:47 +02:00
Jan Lindström
f341d94423 MDEV-9549: Trying to decrypt a not encrypted page
Make sure that on decrypt we do not try to reference
NULL pointer and if page contains undefined
FIL_PAGE_FILE_FLUSH_LSN field on when page is not
the first page or page is not in system tablespace,
clear it.
2016-03-12 13:43:33 +02:00
Jan Lindström
8103526b38 MDEV-9667: Server hangs after select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
In row_search_for_mysql function on XtraDB there was a old logic
where null bytes were inited. This caused server to think that
key value is null and continue on incorrect path.
2016-03-11 13:36:29 +02:00
Anton Blanchard
5ea894a7c8 MDEV-9699: power crc32: Per the PPC64 ABI, v20-v31 are non-volatile registers
These where modified and not restored.

Corrected as per upstream:

f2145e5858...aaf0ac4
2016-03-08 16:17:32 +11:00
Otto Kekäläinen
1777fd5f55 Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
Elena Stepanova
e7d50efc45 MDEV-7907 tokudb.cluster_filter_unpack_varchar_hidden fails sporadically in buildbot
Index access becomes range every once in a while. Masked the value in addition
to other already masked columns
2016-02-26 00:25:55 +02:00
Nirbhay Choubey
0251232f8c Fix to ensure updates in gtid_slave_state table do not get binlogged.
Also, renamed wsrep_skip_append_keys to wsrep_ignore_table.
Test case : galera.galera_as_slave_gtid.test
2016-02-24 23:32:37 -05:00
Sergei Golubchik
d044507dc5 Merge branch 'bb-10.1-serg' into 10.1
10.0 merge
10.0-galera merge
connect/10.1 merge
2016-02-24 10:27:23 +01:00
Nirbhay Choubey
cceec7858f Merge branch '10.0-galera' into bb-10.1-serg 2016-02-24 01:21:40 -05:00
Nirbhay Choubey
0d58323e26 Merge tag 'mariadb-10.0.24' into 10.0-galera 2016-02-23 20:53:29 -05:00
Sergei Golubchik
88576b3a80 Merge tracking branch 'connect/10.1' into 10.1 2016-02-23 22:16:35 +01:00
Sergei Golubchik
a5679af1b1 Merge branch '10.0' into 10.1 2016-02-23 21:35:05 +01:00
Vicențiu Ciorbaru
0e20137a80 [Code cleanup] Refactor duplicate code within myisam and maria sort.cc 2016-02-23 13:05:16 +02:00
Sergei Golubchik
e6d51aac77 MDEV-9550 COUNT(NULL) returns incorrect result with sequence storage engine
when calculating COUNT(basic_const), take into account that
this basic_const may be NULL
2016-02-23 10:54:35 +01:00
Nirbhay Choubey
2cdcde93c5 Merge sync point from previous commit to XtraDB. 2016-02-23 00:19:41 -05:00
sjaakola
18f160d954 refs codership/mysql-wsrep#233
- added dbug sync points for further mtr test for this issue
2016-02-23 00:13:12 -05:00
Nirbhay Choubey
c1ea0570af refs codership/mysql-wsrep#184
Merge fix to XtraDB engine.
2016-02-22 16:51:45 -05:00
Daniele Sciascia
251c53a8a7 refs codership/mysql-wsrep#184
- Adds runtime check wsrep_on(), to not interfere with default
  innodb behavior.
2016-02-22 16:47:44 -05:00