Commit graph

9172 commits

Author SHA1 Message Date
Kristian Nielsen
93c039dd3c MDEV-8294: Inconsistent behavior of slave parallel threads at runtime
Follow-up patch to temporarily avoid a sporadic failure in the test
rpl.rpl_000011 due to MDEV-8301.

There is a window during thread exit where the global status is
counted incorrectly - the contribution for the exiting thread is
counted twice. The patch for MDEV-8294 made this window visible to the
test case rpl.rpl_000011, causing it to sporadically fail. Temporarily
silence this with a wait for the expected value; can be removed once
MDEV-8294 is fixed.
2015-06-15 08:13:40 +02:00
Jan Lindström
e2879ac526 MDEV-7881: InnoDB Logfile size - misleading error message
Added test case to show that correct error message is printed when
log file size is too small for big blob.
2015-06-14 08:14:28 +03:00
Sergei Golubchik
e85b6615d8 Merge branch 'bb-10.0-serg' into 10.0 2015-06-12 08:00:48 +02:00
Sergei Golubchik
810cf362ea Merge branch '5.5' into 10.0 2015-06-11 20:20:35 +02:00
Sergei Golubchik
d199a0ffb0 more renames after tokudb merge 2015-06-11 17:47:52 +02:00
Kristian Nielsen
b1b0db294f Merge MDEV-8294 into 10.1 2015-06-10 12:42:18 +02:00
Kristian Nielsen
36f37a4890 Merge MDEV-8294 into 10.0 2015-06-10 12:01:06 +02:00
Kristian Nielsen
682ed005c5 MDEV-8294: Inconsistent behavior of slave parallel threads at runtime
There were some cases where the slave SQL thread could stop without
the pool of parallel replication worker threads being correctly
de-activated.
2015-06-10 11:57:42 +02:00
Sergey Vojtovich
80f6b22593 MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with disabled
keys

Fixed that OPTIMIZE TABLE against MyISAM/Aria table may write uninitialized key
root position for disabled keys.
2015-06-09 23:24:03 +04:00
Nirbhay Choubey
f965cae5fb MDEV-7110 : Add missing MySQL variable log_bin_basename and log_bin_index
Add log_bin_index, log_bin_basename and relay_log_basename system
variables. Also, convert relay_log_index system variable to
NO_CMD_LINE and implement --relay-log-index as a command line
option.
2015-06-09 13:38:29 -04:00
Alexander Barkov
92b365981b MDEV-7268 Column of table cannot be converted from type 'decimal(0,?)' to type ' 'decimal(10,7)'
Changing the error message to:
 "...from type 'decimal(0,?)/*old*/' to type ' 'decimal(10,7)'..."
So it's now clear that the master data type is OLD decimal.
2015-06-09 12:05:06 +04:00
Sergei Golubchik
a4d93e07cc MDEV-8050 sphinx test cases cannot run with sphinxsearch-2.2.6
remove/replace deprecated options
2015-06-08 21:48:19 +02:00
Alexey Botchkov
1707cfc9ef MDEV-8211 plugins.server_audit fails sporadically in buildbot.
More fixes to assure the order of queries in the log.
2015-06-08 21:55:52 +05:00
Alexey Botchkov
87088b91f7 MDEV-8211 plugins.server_audit fails sporadically in buildbot.
This test also should be fixed - delay added so the connection
  event doesn't happen before the query.
2015-06-08 21:44:13 +05:00
Alexey Botchkov
96b37035e4 MDEV-8211 plugins.server_audit fails sporadically in buildbot.
Connection event can happen before the query ends. Added a delay to
   confirm the order.
2015-06-08 21:40:17 +05:00
Alexey Botchkov
69ed429aff MDEV-7500 thread_handling option in my.cnf is not passing "connect events" to audit plugin.
The MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT() call moved to the login_connection()
  function. So that it'll be invoked in any thread handling mode.
2015-06-08 12:09:13 +05:00
Alexey Botchkov
1ae05db49c MDEV-8078 Memory disclosure/buffer overread on audit plugin.
If the SET PASSWORD query doesn't have the password string,
        the parsing of it can fail. It manifested first in MySQL 5.6 as
        it started to hide password lines sent to the plugins.
        Fixed by checking for that case.
2015-06-07 15:40:42 +05:00
Alexey Botchkov
db0ecf2662 MDEV-8032 [PATCH] audit plugin - csv output broken.
Symbols like TAB or NEWLINE should be escaped, which was
        forgotten in one place.
2015-06-06 19:12:44 +05:00
Sergei Golubchik
9a3b975da6 Merge branch '5.5' into bb-5.5-serg 2015-06-05 09:51:17 +02:00
Sergei Golubchik
ae0c576d46 Merge branch 'merge/merge-xtradb-5.5' into bb-5.5-serg
update tests
2015-06-05 02:14:49 +02:00
Sergei Golubchik
f84f577aa1 Merge tag 'mysql-5.5.44' into bb-5.5-serg 2015-06-05 02:06:51 +02:00
Alexander Barkov
9da8a8f946 MDEV-7269 mysqlbinlog Don't know how to handle column type=0 meta=0 (0000)#
MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL
2015-06-04 18:49:12 +04:00
Jan Lindström
f7002c05ae MDEV-8250: InnoDB: Page compressed tables are not compressed and compressed+encrypted tables cause crash
Analysis: Problem is that both encrypted tables and compressed tables use
FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION to store
required metadata. Furhermore, for only compressed tables currently
code skips compression.

Fixes:
- Only encrypted pages store key_version to FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
  no need to fix
- Only compressed pages store compression algorithm to FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
  no need to fix as they have different page type FIL_PAGE_PAGE_COMPRESSED
- Compressed and encrypted pages now use a new page type FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED and
  key_version is stored on FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION and compression
  method is stored after FIL header similar way as compressed size, so that first
  FIL_PAGE_COMPRESSED_SIZE is stored followed by FIL_PAGE_COMPRESSION_METHOD
- Fix buf_page_encrypt_before_write function to really compress pages if compression is enabled
- Fix buf_page_decrypt_after_read function to really decompress pages if compression is used
- Small style fixes
2015-06-04 09:47:06 +03:00
Sergei Golubchik
7b05650c7d Merge tag 'tokudb-engine/tokudb-7.5.7' into 5.5 2015-06-03 20:24:51 +02:00
Sergei Golubchik
cd70bed05e fix for 32-bit tests 2015-06-03 11:12:50 +02:00
Sergei Golubchik
8e7d6652ad CRLF->LF 2015-06-02 22:07:47 +02:00
Nirbhay Choubey
6d5b723bdc Merge branch '5.5-galera' into 10.0-galera 2015-06-02 13:27:39 -04:00
Sergei Golubchik
51d67633ef AES-GCM support in file_key_management plugin 2015-06-02 19:00:23 +02:00
Sergei Golubchik
487e5f4590 file_key_management plugin: complain if key id 1 is not found
and don't recommend aes_ctr if it's unavailable
2015-06-02 19:00:23 +02:00
Sergei Golubchik
d9340d6c8e MDEV-8126 encryption for temp files
IO_CACHE tempfiles encryption
2015-06-02 18:53:37 +02:00
Sergei Golubchik
8f92a70e21 update for 32-bit, again 2015-06-02 09:26:16 +02:00
Sergei Golubchik
2133230305 avoid ulong sysvars, prefer uint or ulonglong
ulong is not portable - different width on different architectures
2015-06-01 21:31:31 +02:00
Sergei Golubchik
fce4ab0ab4 generalize ER_TABLE_NEEDS_UPGRADE to work for views too 2015-06-01 16:01:23 +02:00
Sergei Golubchik
5091a4ba75 Merge tag 'mariadb-10.0.19' into 10.1 2015-06-01 15:51:25 +02:00
Sergei Golubchik
c6b4212821 temporarily disable failing test 2015-05-30 09:16:06 +02:00
Sergei Golubchik
c1c22c043b update test results
(yes, we no longer add all variables to sys_vars suite!)
2015-05-29 21:23:52 +02:00
Nirbhay Choubey
903cfde149 MDEV-7067: Server outputs Galera (WSREP) information, even if Galera is disabled
* mysqld_safe: Since wsrep_on variable is mandatory in 10.1, skip wsrep
position recovery if its OFF.
* mysqld: Remove "-wsrep" from server version
* mysqld: Remove wsrep patch version from @@version_comment
* mysqld: Introduce @@wsrep_patch_version
2015-05-29 11:26:46 -04:00
Sergei Golubchik
34e01f80e4 restore innodb_encrypt_tables validation function
that was apparently lost in 20c23048:

  commit 20c23048c1
  Author: Jan Lindström <jan.lindstrom@mariadb.com>
  Date:   Sun May 17 14:14:16 2015 +0300

      MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing

This also reverts 8635c4b4:

  commit 8635c4b4e6
  Author: Jan Lindström <jan.lindstrom@mariadb.com>
  Date:   Thu May 21 11:02:03 2015 +0300

      Fix test failure.
2015-05-28 14:41:48 +02:00
Jan Lindström
979c5049ef MDEV-8242: encryption.innodb_page_encryption_key_change fails in buildbot
Forgot that echo will also expand variables and path might be different.
2015-05-28 07:52:27 +03:00
Jan Lindström
a25ccd4f83 MDEV-8238: Tables with encryption=yes using file_key_management plugin are not encrypted
Analysis: Problem was that encryption was skipped.

Fixed by making sure that tables with ENCRYPTED=YES are encrypted.
2015-05-27 16:52:36 +03:00
Jan Lindström
2bea4bd9ed MDEV-8233: InnoDB: Assertion failure in fil_page_decompress with encrypted tables
Analysis: Problem was that used compression method needs to be stored
to the page.

Fixed by storing compression method after key_version to the page.
2015-05-27 15:34:10 +03:00
Jan Lindström
58d7e35f59 Fixed innodb_scrub_background test. 2015-05-27 11:00:46 +03:00
Kristian Nielsen
903f8dc72d Merge MDEV-8147 into 10.1 2015-05-26 15:03:22 +02:00
Kristian Nielsen
f7385980d3 Merge MDEV-8147 into 10.0 2015-05-26 13:15:57 +02:00
Kristian Nielsen
e5f1e841dc MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication
When the slave processes the master restart format_description event,
parallel replication needs to complete any prior events before processing
the restart event (which closes temporary tables and such stuff).

This happens in wait_for_workers_idle(), however it was not waiting long
enough. The wait was using wait_for_prior_commit(), but at that points table
can still be open. This lead to assertion in this case.

So change wait_for_workers_idle() to wait until all worker threads have
reached finish_event_group(), at which point all tables should have been
closed.
2015-05-26 13:04:15 +02:00
Jan Lindström
b3aece9b99 MDEV-8209: encryption.encrypt_and_grep fails in buildbot and outside
Problem is that when encryption/decryption is marked done on memory
cache, dirty pages might not be physically written.

Fixed by adding sleep on test.
2015-05-25 09:38:47 +03:00
Jan Lindström
8635c4b4e6 Fix test failure. 2015-05-21 11:02:03 +03:00
Jan Lindström
3e55ef26d4 MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
Make sure that when we publish the crypt_data we access the
memory cache of the tablespace crypt_data. Make sure that
crypt_data is stored whenever it is really needed.

All this is not yet enough in my opinion because:

sql/encryption.cc has DBUG_ASSERT(scheme->type == 1) i.e.
crypt_data->type == CRYPT_SCHEME_1

However, for InnoDB point of view we have global crypt_data
for every tablespace. When we change variables on crypt_data
we take mutex. However, when we use crypt_data for
encryption/decryption we use pointer to this global
structure and no mutex to protect against changes on
crypt_data.

Tablespace encryption starts in fil_crypt_start_encrypting_space
from crypt_data that has crypt_data->type = CRYPT_SCHEME_UNENCRYPTED
and later we write page 0 CRYPT_SCHEME_1 and finally whe publish
that to memory cache.
2015-05-20 14:10:07 +03:00
Jan Lindström
80333ad847 Add missing requirement to test case and remove unnecessary output. 2015-05-20 07:57:55 +03:00
Jan Lindström
20c23048c1 MDEV-8164: Server crashes in pfs_mutex_enter_func after fil_crypt_is_closing or alike
Analysis: Problem was that tablespaces not encrypted might not have
crypt_data stored on disk.

Fixed by always creating crypt_data to memory cache of the tablespace.

MDEV-8138: strange results from encrypt-and-grep test

Analysis: crypt_data->type is not updated correctly on memory
cache. This caused problem with state tranfer on
encrypted => unencrypted => encrypted.

Fixed by updating memory cache of crypt_data->type correctly based on
current srv_encrypt_tables value to either CRYPT_SCHEME_1 or
CRYPT_SCHEME_UNENCRYPTED.
2015-05-18 13:28:13 +03:00
Nirbhay Choubey
0bfae356d4 MDEV-8166 : Adding index on new table from select crashes Galera cluster
In wsrep, CTAS should be handled like a regular transaction.
Added a test case.
2015-05-16 11:11:26 -04:00
Sergei Golubchik
9cc7eb3226 upate test results after 2300fe2e
that is, after

  commit 2300fe2e0e
  Author: Sergei Golubchik <serg@mariadb.org>
  Date:   Wed May 13 21:57:24 2015 +0200

      Identical key derivation code in XtraDB/InnoDB/Aria
2015-05-16 16:31:46 +02:00
Sergei Golubchik
8815fb3d45 MDEV-8158 InnoDB: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID on dynamic change of encryption variables
don't allow to enable srv_encrypt_tables if no
encryption plugin is loaded
2015-05-15 18:12:02 +02:00
Sergei Golubchik
8258a34800 InnoDB: check if scrubbing is enabled before scanning the tablespace 2015-05-15 18:12:02 +02:00
Sergei Golubchik
a94cabd503 MDEV-8159 InnoDB: Failing assertion: key_state->key_id
to simplify various checks, set crypt_data->key_id even
for not encrypted tablespaces
2015-05-15 18:12:02 +02:00
Sergei Golubchik
2300fe2e0e Identical key derivation code in XtraDB/InnoDB/Aria
* Extract it into the "encryption_scheme" service.
* Make these engines to use the service, remove duplicate code.
* Change MY_AES_xxx error codes, to return them safely
  from encryption_scheme_encrypt/decrypt without conflicting
  with ENCRYPTION_SCHEME_KEY_INVALID error
2015-05-15 18:12:01 +02:00
Nirbhay Choubey
14b816a5c8 Disabling some more sporadically failing galera tests. 2015-05-14 21:48:54 -04:00
Jan Lindström
f8cacd03a7 MDEV-8143: InnoDB: Database page corruption on disk or a failed file read
Analysis: Problem was that we did create crypt data for encrypted table but
this new crypt data was not written to page 0. Instead a default crypt data
was written to page 0 at table creation.

Fixed by explicitly writing new crypt data to page 0 after successfull
table creation.
2015-05-14 11:32:24 +03:00
Sergei Golubchik
16b6ec2e37 MDEV-8130 Wrong error code/message while encrypting a partitioned InnoDB table
when checking for a flag, use & not ==
2015-05-13 14:27:18 +02:00
Sergei Golubchik
acd992d4b7 MDEV-8022 Assertion `rc == 0' failed in ma_encrypt on dropping an encrypted Aria table
fix encryption of the last partial block

* now really encrypt it, using key and iv
* support the case of very short plaintext (less than one block)
* recommend aes_ctr over aes_cbc, because the former
  doesn't have problems with partial blocks
2015-05-13 14:27:17 +02:00
Sergei Golubchik
66380916ee MDEV-7993 file_key_management_filekey doesn't work as expected with FILE:
chomp the secret, as read from the file. remove trailing
CR and LF bytes.
2015-05-13 14:27:16 +02:00
Sergei Golubchik
ab8415d983 move encryption tests to a dedicate suite
remove few tests for variables that never existed (merge error)
2015-05-13 14:27:16 +02:00
Elena Stepanova
0b4231e9f1 MDEV-8154 rpl.show_status_stop_slave_race-7126 sporadically causes internal check failure
The test did not have a proper replication cleanup
2015-05-13 15:17:19 +03:00
Alexander Barkov
8345bc6921 MDEV-8152 is_columns_is_embedded test fails
Recording --ps and --embedded tests (a postfix for MDEV-7807)
2015-05-13 15:34:20 +04:00
Nirbhay Choubey
c9c8e0554f Update galera/disabled.def & some more test fixes. 2015-05-12 23:43:06 -04:00
Elena Stepanova
7003776e73 MDEV-8144 percona.innodb_sys_index test fails
Restoring the line affected by 5.5=>10.0 merge
2015-05-12 19:16:17 -04:00
Nirbhay Choubey
6ae27e4098 Merge branch '5.5-galera' into 10.0-galera 2015-05-12 18:50:59 -04:00
Nirbhay Choubey
c8ad5b2f12 MDEV-8151 : wsrep.foreign_key, wsrep.pool_of_threads,
.. wsrep.binlog_format, wsrep.mdev_6832 fail in buildbot

Galera-3.9 logs an additional warning in the error log if
it fails to find gvwstate.dat file. Update wsrep/suite.pm.
2015-05-12 17:15:16 -04:00
Nirbhay Choubey
c6c9a69cce Fix for some more test failures. 2015-05-12 16:56:06 -04:00
Elena Stepanova
b3d3dd25eb MDEV-8144 percona.innodb_sys_index test fails
Restoring the line affected by 5.5=>10.0 merge
2015-05-12 03:44:10 +03:00
Kristian Nielsen
8bedb638d7 MDEV-8113: Parallel slave: slave hangs on ALTER TABLE (or other DDL) as the first event after slave start
In optimistic parallel replication, it is not safe to try to run a following
transaction in parallel with a DDL statement, and there is code to prevent
this.

However, the code was missing the case where the DDL is the very first event
after slave start. In this case, following transactions could run in
parallel with the DDL, which can cause the slave to hang or even corrupt
slave in unlucky cases.
2015-05-11 12:43:38 +02:00
Ajo Robert
515b2203c5 Bug #18075170 SQL NODE RESTART REQUIRED TO
AVOID DEADLOCK AFTER RESTORE

Analysis
--------
Accessing the restored NDB table in an active multi-statement
transaction was resulting in deadlock found error.

MySQL Server needs to discover metadata of NDB table from
data nodes after table is restored from backup. Metadata
discovery happens on the first access to restored table.
Current code mandates this statement to be the first one
in the transaction. This is because discover needs exclusive
metadata lock on the table. Lock upgrade at this point can
lead to MDL deadlock and the code was written at the time
when MDL deadlock detector was not present. In case when
discovery attempted in the statement other than the first
one in transaction ER_LOCK_DEADLOCK error is reported
pessimistically.

Fix:
---
Removed the constraint as any potential deadlock will be
handled by deadlock detector. Also changed code in discover
to keep metadata locks of active transaction.

Same issue was present in table auto repair scenario. Same
fix is added in repair path also.
2015-05-11 16:05:50 +05:30
Nirbhay Choubey
e11cad9e9d Merge tag 'mariadb-10.0.19' into 10.0-galera 2015-05-09 17:09:21 -04:00
Sergei Golubchik
5fdb14542a MDEV-8021 "InnoDB: Tablespace id 4 encrypted but encryption service not available. Can't continue opening tablespace" on server restart when there are encrypted tables
key id was written in the wrong place on the tablespace first page
(thus its value could not be read back later)
2015-05-09 11:19:36 +02:00
Nirbhay Choubey
99f496ae65 Fix for some failing tests 2015-05-08 17:43:58 -04:00
Nirbhay Choubey
3331d4e07e Merge galera tests from github.com/codership/mysql-wsrep 2015-05-08 17:43:57 -04:00
Philip Stoev
58bbe9b004 Fix suite/galera/t/galera_var_OSU_method.test 2015-05-08 17:41:08 -04:00
Philip Stoev
504ff56ece Adjust tests now that wsrep_OSU_method is a session variable. 2015-05-08 17:41:08 -04:00
Philip Stoev
03a8f83e2c Add tests for galera/mysql-wsrep#90 2015-05-08 17:41:07 -04:00
Teemu Ollakka
f5bce5a600 codership/mysql-wsrep#67 - total order isolation for FLUSH
The following FLUSH commands are now executed under total
order isolation:
* FLUSH DES_KEY_FILE
* FLUSH HOSTS
* FLUSH PRIVILEGES
* FLUSH QUERY CACHE
* FLUSH STATUS
* FLUSH USER_RESOURCES
2015-05-08 17:41:06 -04:00
Alexander Barkov
91ee98a8c8 MDEV-7807 information_schema.processlist truncates queries with binary strings
Adding a new column INFORMATION_SCHEMA.PROCESSLIST.INFO_BINARY.
2015-05-08 00:34:06 +04:00
Sergey Vojtovich
0fcc350f73 MDEV-7922 - ERROR 1939 (HY000): Engine PERFORMANCE_SCHEMA failed to discover
table

Performance schema discovery fails if connection has no active database set.

This happened due to restriction in SQL parser: table name with no database name
is ambiguous in such case.

Fixed by temporary substitution of default database with being discovered table
database.
2015-05-07 20:45:46 +04:00
Jan Lindström
3832bda1ba Fix compiler error if compiler does not support c99 style
initializers.
2015-05-07 18:30:42 +03:00
Jan Lindström
bad81f23f6 MDEV-8046: Server crashes in pfs_mutex_enter_func on select from I_S.INNODB_TABLESPACES_ENCRYPTION if InnoDB is disabled
Problem was that information schema tables innodb_tablespaces_encryption and
innodb_tablespaces_scrubbing where missing required check is InnoDB enabled
or not.
2015-05-06 15:16:28 +03:00
Sergei Golubchik
1d3ea9ecd8 perfschema 5.6.24
including the big commit
  commit 305130361bf72726de220f3d2b2787395e10be61
  Author: Marc Alff <marc.alff@oracle.com>
  Date:   Tue Feb 10 11:31:32 2015 +0100

      WL#8354 BACKPORT DIGEST IMPROVEMENTS TO MYSQL 5.6

(with the following commits) and related changes in sql/
2015-05-05 15:23:47 +02:00
Sergei Golubchik
d71d411905 5.6.24 2015-05-04 22:16:00 +02:00
Sergei Golubchik
49c853fb94 Merge branch '5.5' into 10.0 2015-05-04 22:00:24 +02:00
Nirbhay Choubey
d2562004c5 Merge tag 'mariadb-5.5.43' into 5.5-galera 2015-05-04 13:50:52 -04:00
Sergei Golubchik
f875c9f2a0 MDEV-5114 seconds_behind_master flips to 0 & spikes back, when running show slaves status
1. After a period of wait (where last_master_timestamp=0)
   do NOT restore the last_master_timestamp to the timestamp
   of the last executed event (which would mean we've just
   executed it, and we're that much behind the master).

2. Update last_master_timestamp before executing the event,
   not after.

Take the approach from the this commit (but with a different test
case that actually makes sense):

commit 0c75ab453fb8c5439576af8fe5add7a1b89f1569
Author: Luis Soares <luis.soares@sun.com>
Date:   Thu Apr 15 17:39:31 2010 +0100

    BUG#52166: Seconds_Behind_Master spikes after long idle period
2015-05-03 11:21:55 +02:00
Vicențiu Ciorbaru
6c55e52b10 MDEV-7774: Crash when dropping user within rebuild_role_grants
The issue comes from not taking all possibilities to match an entry
within the roles_mapping HASH, when updating the data structure.
2015-05-03 11:49:49 +03:00
Nirbhay Choubey
320240be1d Merge test for bug#72594 from upstream 2015-04-30 10:23:36 -04:00
Sergei Golubchik
4c87f72773 Merge branch '5.5' into bb-5.5-serg 2015-04-29 16:24:52 +02:00
Kristian Nielsen
9cdf5c2bfd Merge branch '10.0' into 10.1 2015-04-29 11:30:26 +02:00
Kristian Nielsen
9088f26f20 MDEV-7802: group commit status variable addition
Backport into 10.0
2015-04-29 11:29:25 +02:00
Jan Lindström
4c174fcb4a MDEV-8020: innodb.innodb-mdev-7055 produces valgrind warnings in buildbot
Fixed by reverting incorrect fix of MDEC-7055 (reopened) and removing the
test case (because it now crashes).
2015-04-28 15:29:46 +03:00
Kristian Nielsen
ed701c6a23 MDEV-7864: Slave SQL: stopping on non-last RBR event with annotations results in SEGV (signal 11)
The slave SQL thread was clearing serial_rgi->thd before deleting
serial_rgi, which could cause access to NULL THD.

The clearing was introduced in commit
2e100cc5a4 and is just plain wrong. So revert
that part (single line) of that commit.

Thanks to Daniel Black for bug analysis and test case.
2015-04-28 11:56:54 +02:00
Sergei Golubchik
0f12ada6b6 Merge remote-tracking branch 'mysql/5.5' into 5.5 2015-04-27 21:04:06 +02:00
Sergei Golubchik
e26b2071be MDEV-7938 MariaDB Crashes Suddenly while writing binlogs
on disconnect THD must clean user_var_events array before
dropping temporary tables. Otherwise when binlogging a DROP,
it'll access user_var_events, but they were allocated
in the already freed memroot.
2015-04-27 15:42:12 +02:00
V S Murthy Sidagam
7797ef4dec Merge branch 'mysql-5.1' into mysql-5.5 2015-04-27 14:46:40 +05:30
V S Murthy Sidagam
c655515d1b Bug #20683237 BACKPORT 19817663 TO 5.1 and 5.5
Restrict when user table hashes can be viewed. Require SUPER privileges.
2015-04-27 14:33:25 +05:30
Sergei Golubchik
f8320210e7 MDEV-7126 replication slave - deadlock in terminate_slave_thread with stop slave and show variables of replication filters and show global status
Three-way deadlock:

  T1: SHOW GLOBAL STATUS
      -> acquire LOCK_status
  T2: STOP SLAVE
      -> acquire LOCK_active_mi
      -> terminate_slave_thread()
      -> -> cond_timedwait for handle_slave_sql to stop
  T3: sql slave thread (same applies to io thread)
      -> handle_slave_sql(), when exiting
      -> -> THD::add_status_to_global()
      -> -> -> wait for LOCK_status...
  T1: SHOW GLOBAL STATUS
      -> for "Slave_heartbeat_period" status variable
      -> -> show_heartbeat_period()
      -> -> -> wait for LOCK_active_mi

cherry-pick from 5.6:

  commit fc8b395898f40387b3468122bd0dae31e29a6fde
  Author: Venkatesh Duggirala <venkatesh.duggirala@oracle.com>
  Date:   Wed Jun 12 21:41:05 2013 +0530

    BUG#16904035-SHOW STATUS - EXCESSIVE LOCKING ON LOCK_ACTIVE_MI AND
    ACTIVE_MI->RLI->DATA_LOCK

    Problem: Excessive locking on lock_active_mi and rli->data_lock
    while executing any `show status like 'X'` command.

    Analysis: SHOW_FUNCs for Slave_running, Slave_retried_transactions,
    Slave_heartbeat_period, Slave_received_heartbeats,
    Slave_last_heartbeat are acquiring lock_active_mi and rli->data_lock
    to show their variable value. It is ok to show stale data while showing
    the status variables i.e., even if they miss one update, it will
    not cause any great trouble.

    Fix: Remove the locks from the above mentioned SHOW_FUNC functions.

Add a test case
2015-04-26 22:05:33 +02:00
f4rnham
060ec5b6b9 MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout
Changed also arg_count check for connection_name to prevent same bug
if fifth argument is introduced in future
2015-04-24 13:08:27 +02:00
Kristian Nielsen
c2dd88ac85 Merge MDEV-8031 into 10.1 2015-04-23 14:40:10 +02:00
Kristian Nielsen
b616991a68 MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill)
There was a rare race, where a deadlock error might not be correctly
handled, causing the slave to stop with something like this in the error
log:

150423 14:04:10 [ERROR] Slave SQL: Connection was killed, Gtid 0-1-2, Internal MariaDB error code: 1927
150423 14:04:10 [Warning] Slave: Connection was killed Error_code: 1927
150423 14:04:10 [Warning] Slave: Deadlock found when trying to get lock; try restarting transaction Error_code: 1213
150423 14:04:10 [Warning] Slave: Connection was killed Error_code: 1927
150423 14:04:10 [Warning] Slave: Connection was killed Error_code: 1927
150423 14:04:10 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-bin.000001 position 1234

The problem was incorrect error handling. When a deadlock is detected, it
causes a KILL CONNECTION on the offending thread. This error is then later
converted to a deadlock error, and the transaction is retried.

However, the deadlock error was not cleared at the start of the retry, nor
was the lingering kill signal. So it was possible to get another deadlock
kill early during retry. If this happened with particular thread
scheduling/timing, it was possible that the new KILL CONNECTION error was
masked by the earlier deadlock error, so that the second kill was not
properly converted into a deadlock error and retry.

This patch adds code that clears the old error and killed flag before
starting the retry. It also adds code to handle a deadlock kill caught in a
couple of places where it was not handled before.
2015-04-23 14:09:15 +02:00
Nirbhay Choubey
581b49dd3d MDEV-7995 : DMLs not getting replicated with log-bin=OFF & binlog-format != ROW
This bug is a side-effect of fix for MDEV-6924, where we completely
stopped a statement-based event from getting into the binlog cache when
binary logging is not enabled (and thus, wsrep_emulate_binlog mode = 1).
As a result, the SBR events were not replicated.

Fixed by allowing the SBR events to be written into the binlog cache.

Note: Only DMLs were affected as DDLs are replicated via TOI.

Merged galera_create_trigger.test from github.com/codership/mysql-wsrep.
2015-04-22 18:13:30 -04:00
Kristian Nielsen
e7a7ea7ec1 Merge branch '10.0' into 10.1 2015-04-21 10:31:39 +02:00
Kristian Nielsen
4760528754 MDEV-8029: test failure in rpl.rpl_parallel_temptable
Fix a silly typo that caused the test to occasionally fail.
2015-04-21 10:16:14 +02:00
Kristian Nielsen
a15a4d674d Merge MDEV-7802 into 10.1 2015-04-20 13:22:51 +02:00
Kristian Nielsen
791b0ab5db Merge 10.0 -> 10.1 2015-04-20 13:21:58 +02:00
Kristian Nielsen
519ad0f7e3 MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS
This was a regression from the patch for MDEV-7668.

A test was incorrect, so the slave would not properly handle re-using
temporary tables, which lead to replication failure in this case.
2015-04-20 12:59:46 +02:00
Kristian Nielsen
167332597f Merge 10.0 -> 10.1.
Conflicts:
	mysql-test/suite/multi_source/multisource.result
	sql/sql_base.cc
2015-04-17 15:18:44 +02:00
Kristian Nielsen
14d15785d1 MDEV-7802: Omit one test which could fail on very loaded host. 2015-04-17 12:45:55 +02:00
Nirbhay Choubey
0095697784 MDEV-7996 : CURRENT_USER definer does not replicate for triggers
THD's lex->definer initially holds "*current_user" for CURRENT_USER().
As a result when wsrep tries to create the trigger query, it incorrectly
uses "*current_user". Fixed by calling get_current_user() to get the
real current user.

Merged galera_create_trigger.test from github.com/codership/mysql-wsrep.
2015-04-16 16:29:02 -04:00
Alexander Barkov
201c985be5 MDEV-7886 CREATE VIEW IF NOT EXISTS produces a wrong warning 2015-04-13 22:36:49 +04:00
Kristian Nielsen
ed34927065 MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode
Additional 10.1-specific test case.
2015-04-13 14:38:25 +02:00
Kristian Nielsen
2de8db6296 Merge MDEV-7936 into 10.1 2015-04-13 14:28:07 +02:00
Kristian Nielsen
17aff4b17b Merge MDEV-7936 into 10.0.
Conflicts:
	sql/sql_base.cc
2015-04-13 14:27:25 +02:00
Kristian Nielsen
60d094aeac MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode
Make sure that in parallel replication, we execute wait_for_prior_commit()
before setting table->in_use for a temporary table. Otherwise we can end up
with two parallel replication worker threads competing with each other for
use of a temporary table.

Re-factor the use of find_temporary_table() to be able to handle errors
in the caller (as wait_for_prior_commit() can return error in case of
deadlock kill).
2015-04-13 14:24:18 +02:00
Kristian Nielsen
c47fe0e9db MDEV-7668: Intermediate master groups CREATE TEMPORARY with INSERT, causing parallel replication failure
[This commit cherry-picked to be able to merge MDEV-7936, of which it
is a pre-requisite, into both 10.0 and 10.1.]

Parallel replication depends on locking (table locks, row locks, etc.) to
prevent two conflicting transactions from running and committing in parallel.
But temporary tables are designed to be visible only to one thread, and have
no such locking.

In the concrete issue, an intermediate master could commit a CREATE TEMPORARY
TABLE in the same group commit as in INSERT into that table. Thus, a
lower-level master could attempt to run them in parallel and get an error.

More generally, we need protection from parallel replication trying to run
transactions in parallel that access a common temporary table.

This patch simply causes use of a temporary table from parallel replication
to wait for all previous transactions to commit, serialising the replication
at that point.

(A more fine-grained locking could be added later, possibly. However,
using temporary tables in statement-based replication is in any case
normally undesirable; for example a restart of the server will lose
temporary tables and can break replication).

Note that row-based replication is not affected, as it does not do any
temporary tables on the slave-side.

This patch also cleans up the locking around protecting the list of
temporary tables in Relay_log_info. This used to take the
rli->data_lock at the end of every statement, which is very bad for
concurrency. With this patch, the lock is not taken unless temporary
tables (with statement-based binlogging) are in use on the slave.
2015-04-13 14:08:57 +02:00
Sergei Golubchik
d214c83b5e mtr: make search_pattern_in_file.inc more verbose
report when a pattern is found
do not abort, but merely report when a pattern is not found
2015-04-11 10:22:26 +02:00
Sergei Golubchik
a73676b2e6 Merge branch '10.1' into bb-10.1-serg 2015-04-10 19:32:14 +02:00
Sergei Golubchik
87b46dcdc9 disable scrubbing tests on windows
unportable, use grep
2015-04-10 13:30:12 +02:00
Sergei Golubchik
966b236612 add support for --innodb-encrypt-tables=FORCE
this will prevent user from creating tables with ENCRYPTED=OFF
2015-04-10 02:53:32 +02:00
Sergei Golubchik
da06baa11f mtr: *.opt files, always enable innodb-encrypt-log
because one is supposed always to use it with innodb-encrypt-tables
2015-04-10 02:51:35 +02:00
Sergei Golubchik
bc9f118e29 rename table attribute ENCRYPTION=ON/OFF to ENCRYPTED=YES/NO 2015-04-10 02:51:01 +02:00
Sergei Golubchik
ea764f5f52 s/innodb_default_encryption_key/innodb_default_encryption_key_id/
and make it a session variable, not global, as any decent
default sysvar for a table attribute should be
2015-04-10 02:40:10 +02:00
Sergei Golubchik
92ff523619 change ENCRYPTION_KEY_ID to be HA_TOPTION_SYSVAR
instead of manually implenting "default from a sysvar" in the code
2015-04-10 02:39:36 +02:00
Sergei Golubchik
dd8f931957 be less annoying about sysvar-based table attributes
do not *always* add them to the create table definition,
but only when a sysvar value is different from a default.

also, when adding them - don't quote numbers
2015-04-10 02:36:54 +02:00
Sergei Golubchik
5dffda3ccc Merge branch 'bb-10.1-jan-encryption' into bb-10.1-serg
With changes:

* update tests to pass (new encryption/encryption_key_id syntax).
* not merged the code that makes engine aware of the encryption mode
  (CRYPT_SCHEME_1_CBC, CRYPT_SCHEME_1_CTR, storing it on disk, etc),
  because now the encryption plugin is handling it.
* compression+encryption did not work in either branch before the
  merge - and it does not work after the merge. it might be more
  broken after the merge though - some of that code was not merged.
* page checksumming code was not moved (moving of page checksumming
  from fil_space_encrypt() to fil_space_decrypt was not merged).
* restored deleted lines in buf_page_get_frame(), otherwise
  innodb_scrub test failed.
2015-04-09 19:27:40 +02:00
Sergei Golubchik
3a2ec3fca6 make innodb_encryption_debug test more robust 2015-04-09 18:43:36 +02:00
Sergei Golubchik
f130da7b00 clarify/simplify new innodb sysvars: help texts 2015-04-09 18:42:45 +02:00
Sergei Golubchik
87cf86519e clarify/simplify new innodb sysvars: innodb-scrub-force-testing
rename to innodb-debug-force-scrubbing
2015-04-09 18:42:45 +02:00
Sergei Golubchik
19e76814b7 clarify/simplify new innodb sysvars: innodb-scrub-log-interval
rename to innodb-scrub-log-speed
2015-04-09 18:42:45 +02:00
Sergei Golubchik
bb1b61b312 encryption plugin controls the encryption
* no --encryption-algorithm option anymore
* encrypt/decrypt methods in the encryption plugin
* ecnrypt/decrypt methods in the encryption_km service
* file_km plugin has --file-key-management-encryption-algorithm
* debug_km always uses aes_cbc
* example_km changes between aes_cbc and aes_ecb for different key versions
2015-04-09 18:42:43 +02:00
Sergei Golubchik
9ccafffc29 rename "encryption key management plugin" to "encryption plugin"
because it's going to do more than just key management
2015-04-09 18:42:43 +02:00
Marko Mäkelä
a3e80aeac8 Bug#20816223 test fix.
Embedded server does not support restarting and needs to skip the test.
2015-04-09 16:43:33 +03:00
Kristian Nielsen
50d98e9cbd Merge MDEV-7940 into 10.0 2015-04-09 10:13:17 +02:00
Kristian Nielsen
abba4184e6 Merge MDEV-7940 into 10.1 2015-04-09 10:05:27 +02:00
Kristian Nielsen
15a2b5aab1 MDEV-7940: Sporadic failure in rpl.rpl_gtid_until
Fix a race in the test case. When we do start_slave.inc immediately
followed by stop_slave.inc, it is possible to kill the IO thread while
it is still running inside get_master_version_and_clock(), and this
gives warnings in the error log that cause the test to fail.
2015-04-09 10:03:59 +02:00
Marko Mäkelä
25323de2a4 Bug#20816223 InnoDB crash on shutdown
if XA PREPARE transactions hold explicit locks.

innobase_shutdown_for_mysql(): Call trx_sys_close() before lock_sys_close()
(and dict_close()) so that trx_free_prepared() will see all locks intact.

RB: 8561
Reviewed-by: Vasil Dimov <vasil.dimov@oracle.com>
2015-04-09 08:13:07 +03:00
Kristian Nielsen
82b9eb5e3a Merge MDEV-7910 into 10.1 2015-04-08 15:11:44 +02:00
Kristian Nielsen
670d4dd84f Merge MDEV-7910' into 10.0 2015-04-08 15:10:22 +02:00
Kristian Nielsen
b3c7c8cde8 MDEV-7910: innodb.binlog_consistent fails sporadically in buildbot
The test case was missing --source include/wait_for_binlog_checkpoint.inc.
So it could occasionally fail if the checkpoint managed to occur just at the
right point in time between fetching the two binlog positions to compare.
2015-04-08 15:08:53 +02:00
Kristian Nielsen
accdabd668 Merge MDEV-7888 and MDEV-7929 into 10.0. 2015-04-08 13:19:22 +02:00
Kristian Nielsen
7ee1a41ce1 MDEV-7888, MDEV-7929: Parallel replication hangs sometimes on ANALYZE TABLE or DDL
Follow-up patch with 10.1-specific changes.

Add test cases that more closely resembles the original bug report (which uses
the 10.1-specific --slave-parallel-mode=optimistic).

Also fix the code so that ANALYZE statements are now marked as DDL, and will
not be attempted to speculatively run in parallel with other transactions.
2015-04-08 13:15:04 +02:00
Kristian Nielsen
48c10fb5f7 Merge MDEV-7888 and MDEV-7929 into 10.1. 2015-04-08 11:04:24 +02:00
Kristian Nielsen
3b961347db MDEV-7888, MDEV-7929: Parallel replication hangs sometimes on ANALYZE TABLE or DDL
The hangs occur when the group_commit_orderer object is freed before the last
mark_start_commit() call on it - this loses the wakeup to other waiting worker
threads, causing them to hang until killed manually.

The object was freed because wakeup_subsequent_commits() was called two early
in two places. For MDEV-7888, during ANALYZE TABLE, and for MDEV-7929 during
record_gtid() after processing a DDL event. The group_commit_orderer object
can be freed when its last transaction has called wait_for_prior_commit().

Fix by implementing a suspend/resume mechanism for wakeup_subsequent_commits()
that can be used in places where a transaction is committed without this being
the commit of the actual replication event group.

Also add a protection mechanism (that asserts in debug builds) which can
prevent the too-early free and hang if other similar bugs should remain in
other parts of the code.
2015-04-08 11:01:18 +02:00
Sergei Golubchik
c91e3260e2 tests for file_key_management plugin key file parser 2015-04-08 10:58:50 +02:00
Sergei Golubchik
88632726e8 rename plugins to remove "_plugin" from the plugin name 2015-04-08 10:58:48 +02:00
Sergei Golubchik
c238e68d96 move debug_use_static_encryption_keys and debug_encryption_key_version to a plugin 2015-04-08 10:58:46 +02:00
Jan Lindström
d2b87801b6 Fix test failure on these scrub tests. 2015-04-07 23:44:57 +02:00
Jan Lindström
4865fd105a InnoDB/XtraDB Encryption cleanup
Step 5:
-- Rename encryption_key -> encryption_key_id
-- Remove unnecessary code
-- Fix few bugs found
-- Fix test cases and results files
2015-04-07 23:44:57 +02:00
Jan Lindström
71ec0463af Encryption cleanup
Step 3:

-- Make encrytion_algorithm changeable by SUPER
-- Remove AES_ECB method from encryption_algorithms
-- Support AES method change by storing used method on InnoDB/XtraDB objects
-- Store used AES method to crypt_data as different crypt types
-- Store used AES method to redo/undo logs and checkpoint
-- Store used AES method on every encrypted page after key_version
-- Add test
2015-04-07 23:44:57 +02:00
aditya
1950628835 Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE WRONG FOR PARTITIONED TABLES
Posty push fix for test case
2015-04-07 09:56:28 +05:30
Rik Prohaska
c2bfc5b2d9 DB-832 add start time to tokudb_trx information schema table 2015-04-06 16:17:09 -04:00
Jan Lindström
e9c10f9916 MDEV-7908: assertion in innobase_release_savepoint
Problem was that in XA prepared state we should still be able to
release a savepoint, but assertions were too strict.
2015-04-06 17:38:51 +03:00
Rik Prohaska
e1dc36248c DB-811 run tests on mariadb 2015-04-05 15:15:40 -04:00
Alexander Barkov
7f613ebdb6 MDEV-7284 INDEX: CREATE OR REPLACE 2015-04-03 15:43:55 +04:00
Jan Lindström
118fc5c688 Adjust test timeout to let long semaphore wait signaling to happen. 2015-04-03 08:50:59 +03:00
Daniel Black
0695fdd9df mdev-7802-binlog_groupcommit_stats
Update the description of each test case as to why it is
counted in the correct binlog_group_commit_trigger_* variable.

Updated rpl_parallel_multilevel2.test to identify that 3 groups
occur in statement and mixed replication and one group in row based
replication.
2015-04-03 01:34:30 +11:00
Daniel Black
1d5220d112 binlog_group_commit_* status variables update
remove group_commit_reason_immediate
rename group_commit_reason_transaction to group_commit_trigger_lock_wait
rename group_commit_reason_usec to group_commit_trigger_timeout
rename group_commit_reason_count to group_commit_triggger_count
2015-04-01 22:47:36 +11:00
Alexey Botchkov
cc84ac3be4 MDEV-7596 audit plugin - record full query / document line length / make buffer configurable.
The serve_audit_query_log_limit variable implemented.
        Also QUERY_DCL filter added.
2015-03-31 13:10:43 +05:00
Jan Lindström
ca2f2b7151 Adjust test wait timeout. 2015-03-31 09:54:40 +03:00
Jan Lindström
b53bcd438f MDEV-7367: Updating a virtual column corrupts table which crashes server
Analysis: MySQL table definition contains also virtual columns. Similarly,
index fielnr references MySQL table fields. However, InnoDB table definition
does not contain virtual columns. Therefore, when matching MySQL key fieldnr
we need to use actual column name to find out referenced InnoDB dictionary
column name.

Fix: Add new function to match MySQL index key columns to InnoDB dictionary.
2015-03-31 09:16:48 +03:00
Jan Lindström
0563f49ba3 MDEV-7754: innodb assert "array->n_elems < array->max_elems" on a huge blob update
Replace static array of thread sync levels with std::vector.
2015-03-31 09:16:48 +03:00
Kristian Nielsen
f573b65e41 Merge MDEV-7847 and MDEV-7882 into 10.0.
Conflicts:
	mysql-test/suite/rpl/r/rpl_parallel.result
	sql/rpl_parallel.cc
2015-03-30 15:10:29 +02:00
Kristian Nielsen
c41e4d3b49 Merge MDEV-7847 and MDEV-7882 into 10.0.
Conflicts:
	mysql-test/suite/rpl/r/rpl_parallel.result
	mysql-test/suite/rpl/t/rpl_parallel.test
2015-03-30 14:51:25 +02:00
Kristian Nielsen
880f2273fd MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging
This patch fixes a bug in the error handling in parallel replication, when one
worker thread gets a failure and other worker threads processing later
transactions have to rollback and abort.

The problem was with the lifetime of group_commit_orderer objects (GCOs).
A GCO is freed when we register that its last event group has committed. This
relies on register_wait_for_prior_commit() and wait_for_prior_commit() to
ensure that the fact that T2 has committed implies that any earlier T1 has
also committed, and can thus no longer execute mark_start_commit().

However, in the error case, the code was skipping the
register_wait_for_prior_commit() and wait_for_prior_commit() calls. Thus
commit ordering was not guaranteed, and a GCO could be freed too early. Then a
later mark_start_commit() would reference deallocated GCO, which could lead to
lost wakeup (causing slave threads to hang) or other corruption.

This patch makes also the error case respect commit order. This way, also the
error case gets the GCO lifetime correct, and the hang no longer occurs.
2015-03-30 14:33:44 +02:00
Nirbhay Choubey
84a4db263a Merge branch '5.5-galera' into 10.0-galera 2015-03-28 17:29:10 -04:00
Nirbhay Choubey
d7445ea6df MDEV-7194: galera fails to replicate DDL queries when using binlog_checksum
Restore fix for MDEV-4328 (revno: 3391) that got accidentally
overwritten while merging :
http://bazaar.launchpad.net/~codership/codership-mysql/5.5-23/revision/3900

Added a test case.
2015-03-27 20:35:37 -04:00
Rik Prohaska
b576414189 DB-829 ignore read uncommitted errors when querying tokudb_fractal_tree_info 2015-03-25 17:16:57 -04:00
Sergei Petrunia
e15d792697 Trivial test results updates 2015-03-25 21:21:01 +03:00
Alexander Barkov
651a142ad0 MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND) 2015-03-25 13:06:04 +04:00
Nirbhay Choubey
6a204546ef MDEV-7798: mysql.server init script can't stop mysqld when WSREP is turned off
wsrep threads should be always be checked for existence & stopped on
server shutdown.
2015-03-24 16:41:04 -04:00
Nirbhay Choubey
ce0427a622 Update galera.global_suppressions with galera warnings. 2015-03-19 20:41:57 -04:00
Vicențiu Ciorbaru
1a32993537 MDEV-5214 Status variables for number of global/db/table/column/role grants
Implemented the status variables for use with the feedback plugin.
2015-03-19 22:41:43 +02:00
Alexey Botchkov
5e20df2ff9 MDEV-7641 Server crash on set global server_audit_incl_users=null.
plugin_variable_update() can get NULL as a value for a string parameter.
Needs to be checked and handled properly.
2015-03-19 19:46:08 +04:00
Jon Olav Hauglid
120907c0a2 Merge branch 'mysql-5.1' into mysql-5.5
Conflicts:
	mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result
	mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result
	mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test
	mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test
	sql/mysqld.cc
2015-03-19 12:50:16 +01:00
Daniel Black
41c337a171 add group_commit_reason_immediate to binlog_commit_wait test 2015-03-19 21:47:51 +11:00
Jon Olav Hauglid
c7581bb5a1 Bug#20730053: BACKPORT BUG#19770858 TO 5.1
Backport from mysql-5.5 to mysql-5.1 of:

Bug19770858: MYSQLD CAN BE DRIVEN TO OOM WITH TWO SIMPLE SESSION VARS

The problem was that the maximum value of the transaction_prealloc_size
session system variable was ULONG_MAX which meant that it was possible
to cause the server to allocate excessive amounts of memory.

This patch fixes the problem by reducing the maxmimum value of
transaction_prealloc_size and transaction_alloc_block_size down
to 128K.

Note that transactions will still be able to allocate more than
128K if needed, this patch just reduces the amount that can be
preallocated - as well as the maximum size of the incremental
allocation blocks.

(cherry picked from commit 540c9f7ebb428bbf9ec028feabe1f7f919fdefd9)

Conflicts:
	mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result
	mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
	mysql-test/suite/sys_vars/t/disabled.def
	mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test
	sql/sys_vars.cc
2015-03-19 11:29:13 +01:00
Daniel Black
f3eb1d0e27 rpl_parallel_multilevel2 can be 1 or 3 binlog groups 2015-03-19 19:21:22 +11:00
Daniel Black
54287adc27 MDEV-7802 Add status binlog_group_commit_reason_*
The following global status variables where added:
* binlog_group_commit_reason_count
* binlog_group_commit_reason_usec
* binlog_group_commit_reason_transaction
* binlog_group_commit_reason_immediate

binlog_group_commit_reason_count corresponds to group commits made by
virtue of the binlog_commit_wait_count variable.

binlog_group_commit_reason_usec corresponds to the binlog_commit_wait_usec
variable.

binlog_group_commit_reason_transaction is a result of ordered
transaction that need to occur in the same order on the slave and can't
be parallelised.

binlog_group_commit_reason_immediate is caused to prevent stalls with
row locks as described in log.cc:binlog_report_wait_for. This immediate
count is also counted a second time in binlog_group_commit_reason_transaction.

Overall binlog_group_commits = binlog_group_commit_reason_count +
binlog_group_commit_reason_usec + binlog_group_commit_reason_transaction

This work was funded thanks to Open Source Developers Club Australia.
2015-03-19 15:26:58 +11:00
Alexander Barkov
e28a241907 MDEV-7661 Unexpected result for: CAST(0xHHHH AS CHAR CHARACTER SET xxx)
for incorrect byte sequences
2015-03-18 17:10:48 +04:00
Sergey Vojtovich
a471b7098f Fixed innodb and innodb_bug59641 failures on PPC64.
innodb_buffer_pool_pages_total depends on page size. On Power8 it is 65k
compared to 4k on Intel. As we round allocations on page size we may get
slightly more memory for buffer pool.

Sort XA RECOVER as rows order depend on endianness.
2015-03-18 15:25:34 +04:00
Kristian Nielsen
3d4850158f Fix embarrassing bug in test case that caused sporadic test failures. 2015-03-17 10:36:38 +01:00
Kristian Nielsen
4ba16ea4bc Merge MDEV-6981 and MDEV-6981 (from danblack) into MariaDB 10.1 2015-03-17 09:24:22 +01:00
Jan Lindström
a3e68b4a55 MDEV-7772: SIGSEGV on my_aes_encrypt_cbc when -DWITH_SSL=bundled
Two problems:
- Read/Write outside of buffer at memcpy() because of incorrect parameters
. OPENSSL_assert(EVP_CIPHER_CTX_iv_length(&ctx.ctx) == iv_length); // ECB does not use IV, thus incorrect assertion

Added:
  mysql-test/include/encryption_algorithms.combinations to run tests with methods cbc, ecb and ctr in
  those systems where they are available (see suite.pm).
2015-03-17 07:00:14 +02:00
Oleksandr Byelkin
0d7bc1edf3 32 bit test fix 2015-03-16 21:01:58 +01:00
Sergey Vojtovich
6bd24deab4 MDEV-7728 - Improve xid cache scalability by using lock-free hash
XID cache is now based on lock-free hash.
Also fixed lf_hash_destroy() to call alloc destructor.

Note that previous implementation had race condition when thread was accessing
XA owned by different thread. This new implementation doesn't fix it either.
2015-03-16 19:07:51 +04:00
Kristian Nielsen
1f8efee584 Merge MDEV-7198: status variable for Slave_skipped_errors 2015-03-16 14:54:16 +01:00
Kristian Nielsen
ef4d8db5ec MDEV-6981: feature request MASTER_GTID_WAIT status variables
Review fixes:
 - Coding style
 - Fix bad .result file
 - Fix test to be tolerant of different timing.
 - Fix test to give better info in case of unexpected timing.
2015-03-16 14:40:29 +01:00
Kristian Nielsen
0e717c5bf4 Merge branch 'mdev-6981-master_gtid_wait-status-variables' of https://github.com/openquery/mariadb-server into danblack
Conflicts:
	sql/mysqld.cc
2015-03-16 13:41:11 +01:00
Daniel Black
9362dd43ff additional slave_skip_errors status 2015-03-16 23:15:36 +11:00
Daniel Black
51ea3939b4 Complete test for status slave_skipped_errors 2015-03-16 23:06:30 +11:00
Kristian Nielsen
2e82a8233c MDEV-7785: errorneous -> erroneous spelling mistake 2015-03-16 10:54:47 +01:00
Alexey Botchkov
10554ca6cb Test results fixed. 2015-03-16 12:02:21 +04:00
Oleksandr Byelkin
a21ef88d2a MDEV-6954: SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0
The variables now return real values. They can't be made usual variables because they do not have DEFAULT value.
2015-03-14 08:41:43 +01:00
Kristian Nielsen
184f718fef MDEV-7249: Performance problem in parallel replication with multi-level slaves
Parallel replication (in 10.0 / "conservative" mode) relies on binlog group
commits to group transactions that can be safely run in parallel on the
slave. The --binlog-commit-wait-count and --binlog-commit-wait-usec options
exist to increase the number of commits per group. But in case of conflicts
between transactions, this can cause unnecessary delay and reduced througput,
especially on a slave where commit order is fixed.

This patch adds a heuristics to reduce this problem. When transaction T1 goes
to commit, it will first wait for N transactions to queue up for a group
commit. However, if we detect that another transaction T2 is waiting for a row
lock held by T1, then we will skip the wait and let T1 commit immediately,
releasing locks and let T2 continue.

On a slave, this avoids the unfortunate situation where T1 is waiting for T2
to join the group commit, but T2 is waiting for T1 to release locks, causing
no work to be done for the duration of the --binlog-commit-wait-usec timeout.

(The heuristic seems reasonable on the master as well, so it is enabled for
all transactions, not just replication transactions).
2015-03-13 14:01:52 +01:00
Alexander Barkov
197afb413f MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion 2015-03-13 16:51:36 +04:00
Venkatesh Duggirala
59142d9a27 Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS
BINLOGGED INCORRECTLY - BREAKS A SLAVE

Submitted a incomplete patch with my previous push,
re submitting the extra changes the required to make
the patch complete.
2015-03-13 13:13:48 +05:30