Commit graph

179856 commits

Author SHA1 Message Date
Sachin Setiya
efae12680e MDEV-15611 Due to the failure of foreign key detection, Galera...
slave node killed himself.

Problem:- If we try to delete table with foreign key and table whom it is
referring with wsrep_slave_threads>1 then galera tries to execute both
Delete_rows_log-event in parallel, which should not happen.

Solution:- This is happening because we do not have foreign key info in
write set. Upto version 10.2.7 it used to work fine. Actually it happening
because of issue in commit 2f342c4. wsrep_must_process_fk has changed to
make it similar to original condition.
2018-04-19 16:33:49 +05:30
Thirunarayanan Balathandayuthapani
66c14d3a8d MDEV-14377 innodb_zip.cmp_per_index failed in buildbot, result length mismatch
- If select query chooses the index 'b' over clustered index then the issue
can happen. Changed the test case to use primary index for the select
query.
2018-04-18 13:52:30 +05:30
Thirunarayanan Balathandayuthapani
341edddc3d MDEV-15826 Purge attempts to free BLOB page after BEGIN;INSERT;UPDATE;ROLLBACK
- During rollback, redo segments priorities over no-redo rollback
segments and it leads to failure of redo rollback segment undo
logs truncation.
2018-04-18 12:39:39 +05:30
Igor Babaev
1d98333ad9 MDEV-15894 Error, while using aggregated functions/window functions in anchor part
Usage of aggregate/window functions in non-recursive parts of recursive CTEs
is allowed. Error messages complaining about this were reported by mistake.
2018-04-17 10:35:55 -07:00
Igor Babaev
e34d3184fd MDEV-15556 MariaDB crash with big_tables=1 and CTE
This bug manifested itself when the optimizer chose an execution plan with
an access of the recursive CTE in a recursive query by key and ARIA/MYISAM
temporary tables were used to store recursive tables.
The problem appeared due to passing an incorrect parameter to the call of
instantiate_tmp_table() in the function With_element::instantiate_tmp_tables().
2018-04-16 10:31:30 -07:00
Igor Babaev
612850782d MDEV-15571 Wrong results with big_tables=1 and CTE
The cause of this bug was the same as for the bug mdev-15575.
Fixed by the patch for the latter.
2018-04-16 08:55:15 -07:00
Igor Babaev
224f7af911 MDEV-15575 different results when using CTE and big_tables=1.
This bug happened due to a defect of the implementation of the handler
function ha_delete_all_rows() for the ARIA engine.
The function maria_delete_all_rows() truncated the table, but it didn't
touch the write cache, so the cache's write offset was not reset.
In the scenario like in the function st_select_lex_unit::exec_recursive
when first all records were deleted from the table and then several new
records were added some metadata became inconsistent with the state of
the cache. As a result the table scan function could not read records
at the end of the table.
The same defect could be found in the implementation of ha_delete_all_rows()
for the MYISAM engine mi_delete_all_rows().

Additionally made late instantiation for the temporary table used to store
rows that were used for each new iteration when executing a recursive CTE.
2018-04-16 07:22:26 -07:00
Sergei Golubchik
87af52d7dd MDEV-15866 Mysql CRASH : Json connect + MariaDB 10.3.4
revert incorrect change
2018-04-16 14:45:47 +02:00
Jan Lindström
29d4ac2ceb
Merge pull request #665 from codership/10.2-fix-mtr-wait
Fix mtr to be able to wait for >1 exited mysqld
2018-04-16 14:19:09 +03:00
Vladislav Vaintroub
47ea2227e5 fix typo, amend last commit 2018-04-14 23:59:59 +01:00
Vladislav Vaintroub
043a9b4e1b Windows, innodb : reduce noise from os_file_get_block_size()
if volume can't be opened due to permissions, or
IOCTL_STORAGE_QUERY_PROPERTY fails with not implemented, do not report it.
Those errors happen, there is nothing user can do.

This patch amends fix for MDEV-12948.
2018-04-14 23:53:11 +01:00
Jan Lindström
4ea636d5e7 MDEV-15672: encryption.innodb_encryption_filekeys - typo in I_S column name: ENCRYPTION_SHCEME
Fixed typo on select that is executed only when something unexpected
happens.
2018-04-13 14:03:12 +03:00
Jan Lindström
f638c37abe MDEV-12632: Source and destination overlap in memcpy, encryption.innodb-discard-import-change fails in buildbot with valgrind
Use block->page.offset for checking page number.
2018-04-13 09:44:28 +03:00
Jan Lindström
e341da4711 MDEV-15580: Assertion `!lex->explain' failed in lex_start(THD*):
Problem was that we did not delete explain information
when Galera must replay a query.

Could not find easily repeatable test case that would not
cause other problems.
2018-04-13 07:35:55 +03:00
Sergei Petrunia
d13e3547e4 MDEV-14460: Memory leak with only SELECT statements
Cherry-pick this fix from the upstream:
commit 6ddedd8f1e0ddcbc24e8f9a005636c5463799ab7
Author: Sergei Petrunia <psergey@askmonty.org>
Date:   Tue Apr 10 11:43:01 2018 -0700

    [mysql-5.6][PR] Issue #802: MyRocks: Statement rollback doesnt work correctly for nes…

    Summary:
    …ted statements

    Variant #1: When the statement fails, we should roll back to the latest
    savepoint taken at the top level.
    Closes https://github.com/facebook/mysql-5.6/pull/804

    Differential Revision: D7509380

    Pulled By: hermanlee

    fbshipit-source-id: 9a6f414
2018-04-13 01:56:01 +03:00
Jacob Mathew
12e2d03948 MDEV-15692: install_spider.sql can fail with some collations
The error occurs because of how the character set and collation are chosen for
stored procedure parameters that have a character data type.  If the character
set and collation are not explicitly stated in the declaration, the server
chooses the database character set and collation in effect at routine creation
time.

To fix the problem, I added explicit character set and collation attributes
for the stored procedure parameters in the install_spider.sql script.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Cherry-Picked:
  Commit ff0bf451db on bb-10.3-MDEV-15692
2018-04-12 12:14:12 -07:00
Jan Lindström
36c0116720 MDEV-12632: Source and destination overlap in memcpy, encryption.innodb-discard-import-change fails in buildbot with valgrind
Problem was that if tablespace was encrypted we try to copy
also page 0 from read buffer to write buffer that are in
that case the same memory area.

fil_iterate
	When tablespace is encrypted or compressed its
        first page (i.e. page 0) is not encrypted or
	compressed and there is no need to copy buffer.
2018-04-12 11:19:27 +03:00
Jan Lindström
2f1f160979 MDEV-12903: encryption.innodb_encryption_discard_import fails in buildbot with FOUND vs NOT FOUND
Wait until rotation has ended and shutdown before grep to make sure
that dirty pages are on datafiles.
2018-04-12 08:39:19 +03:00
Vicențiu Ciorbaru
93aded05ea Use same connection convention of specifying IPs
If we use hostnames, it will fail during name resolution on UNIX systems
2018-04-12 03:26:39 +03:00
Vicentiu Ciorbaru
990283b65c Fix perfschema.hostcache_ipv4_max_con
Also fix perfschema.hostcache_ipv6_max_con.
The test case makes use of a debug switch to execute some special code.
The code does hostname replacement. Every hostname sent during connect
phase becomes santa.claus.ipv4.example.com (or ipv6). This causes a
connection from root@localhost to fail, as root is not registered as
santa claus user. The failure is only apparent on Windows as Unix
systems make use of sockets, which bypass the name resolution check
entirely.
2018-04-12 02:39:28 +03:00
Vladislav Vaintroub
4c7a1a1b9e MDEV-15780 : mariabackup does not handle absolute names in for system tablespaces
Fix 10.2-specific bug - copy-back is not prepared to handle system
tablespaces with absolute path.
2018-04-11 23:25:45 +01:00
Igor Babaev
740fc2ae08 Fixed mdev-15765 BETWEEN not working in certain cases
The implementations of the convert_to_basic_const_item() virtual
function for the Item_cache classes should call cache_value() when
value_cached == NULL.
2018-04-10 18:07:29 -07:00
Vicențiu Ciorbaru
45e6d0aebf Merge branch '10.1' into 10.2 2018-04-10 17:43:18 +03:00
Vicențiu Ciorbaru
2e91eb7547 Fix warnings in InnoDB & XtraDB post MDEV-14705
There was a missing argument to service_manager_extend_timeout call
and the signness of arguments did not match.
2018-04-10 17:34:56 +03:00
Alexander Barkov
f5cb66fb97 Test cleanup for MDEV-15833 (uncommenting forgotten tests) 2018-04-10 14:27:18 +04:00
Jan Lindström
1fd07d21a7 MDEV-15823: Test failure on galera.galera_var_slave_threads
Wait drop table to be replicated before continuing.
2018-04-10 13:25:19 +03:00
Alexander Barkov
4d9c5844b8 MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
The code in Type_handler_blob****::make_conversion_table_field()
erroneously assumed that row format replication uses
MYSQL_TYPE_TINYBLOB, MYSQL_TYPE_BLOB, MYSQL_TYPE_MEDIUMBLOB,
MYSQL_TYPE_LONGBLOB type codes to tranfer BLOB variations.

In fact, all BLOB variations use MYSQL_TYPE_BLOB as the type
code, while the BLOB packlength (1,2,3 or 4) it tranferred
in metadata.

The bug was introduced by  aee068085d
(MDEV-9238 Wrap create_virtual_tmp_table() into a class, split into different steps)
2018-04-10 13:15:57 +04:00
Marko Mäkelä
f932d3f879 MDEV-14705: Extend timeout for waiting for transactions
If innodb_fast_shutdown<2, all transactions of active connections
will be rolled back on shutdown. This can take a long time, and
the systemd shutdown timeout should be extended during the wait.

logs_empty_and_mark_files_at_shutdown(): Extend the timeout when
waiting for other threads to complete.
2018-04-10 08:55:21 +03:00
Marko Mäkelä
8eff803a1b Revert "MDEV-14705: Do not rollback on InnoDB shutdown"
This reverts commit 76ec37f522.

This behaviour change will be done separately in:
MDEV-15832 With innodb_fast_shutdown=3, skip the rollback
of connected transactions
2018-04-10 08:55:20 +03:00
Marko Mäkelä
141592cedb Clean up a test 2018-04-10 02:07:31 +03:00
Vladislav Vaintroub
ecf6675cfc MDEV-15713 mariabackup: throw warning, if --stream is used without --backup 2018-04-09 19:16:50 +01:00
Vladislav Vaintroub
37f24806fc MDEV-15825 Mariabackup help mentions Percona and PXC but not MariaDB 2018-04-09 16:22:15 +01:00
Vicențiu Ciorbaru
8ff897265a Update test cases post MDEV-10286
Table_open_cache gets adjusted on server startup to prevent an out of
file descriptor error. However this means that when we reset its value
to default, it does not get re-adjusted. This leads to the mtr
consistency check to fail with different server status at the end of the
test case as opposed to when it started.

To fix the problem, do not make use of the DEFAULT keyword to set the
variable back, instead save the value before any modifications and
restore it from there.
2018-04-09 16:49:41 +03:00
Jan Lindström
803ded5148 MDEV-13549: Galera test failures
Disable occasionally failing test case galera.galera_var_slave_threads.
2018-04-09 14:43:32 +03:00
Jan Lindström
fe61e287e9 MDEV-15810: Test failure on galera.lp1376747 and galera.lp1376747-2
Wait until create table is replicated before continuing.
2018-04-09 07:49:00 +03:00
Jan Lindström
767d6ce38c MDEV-15807: Test failure on galera.galera_lock_table
Wait until create tables are replicated to the slave before trying
lock table.
2018-04-09 07:28:13 +03:00
Vladislav Vaintroub
7b16291c36 MDEV-15707 : deadlock in Innodb IO code, caused by change buffering.
In async IO completion code, after reading a page,Innodb can wait for
completion of other bufferpool reads.
This is for example what happens if change-buffering is active.

Innodb on Windows could deadlock, as it did not have dedicated threads
for processing change buffer asynchronous reads.

The fix for that is to have windows now has the same background threads,
including dedicated thread for ibuf, and log AIOs.

The ibuf/read completions are now dispatched to their threads with
PostQueuedCompletionStatus(), the write and log completions are processed
in thread where they arrive.
2018-04-08 21:32:02 +00:00
Jan Lindström
8bb40f2404 MDEV-13549: Galera test failures
Disable more occasionally failing test cases.
	galera.galera_lock_table
	galera.galera_gra_log
	galera.MW-44
	galera.lp1376747
	galera.lp1376747-2
	galera.galera_pc_ignore_sb
2018-04-08 13:04:38 +03:00
Jan Lindström
1568950a7d MDEV-15806: Test failure on galera.galera_parallel_simple
Make sure DDL's (create tables) are replicated before continuing to
lock table.
2018-04-08 09:03:55 +03:00
Jan Lindström
c4b1a57b13 MDEV-13549: Galera test failures
Disable occasionally failing test cases
	pxc-421
	query_cache
	galera_parallel_simple
2018-04-08 08:24:36 +03:00
Marko Mäkelä
d9c85ee45a MDEV-15752 Possible race between DDL and accessing I_S.INNODB_TABLESPACES_ENCRYPTION
fil_crypt_read_crypt_data(): Do not attempt to read the tablespace
if the file is unaccessible due to a pending DDL operation, such as
renaming the file or DROP TABLE or TRUNCATE TABLE. This is only
reducing the probability of the race condition, not completely
preventing it.
2018-04-07 19:52:35 +03:00
Vicențiu Ciorbaru
4c89cff558 Merge branch '10.0' into 10.1 2018-04-07 17:11:22 +03:00
Sergei Petrunia
b4c2ceb214 MDEV-15769: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed
Adjust the fix for MDEV-15472:
In close_cached_tables(), locked_tables_list.reopen_tables(...) call
might be made when a previous call to some function has already returned
error.
In this scenario, the function should return 0, even if reopen_tables(...)
call has succeeded.
2018-04-07 15:03:15 +03:00
Sergei Petrunia
1cb2e0333d MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || ...
When "FLUSH TABLE ... FOR EXPORT" fails, the SQL layer should rollback
the statement. Otherwise we hit an assert when we try to close the
tables while having a non-empty list of statement transaction participants.
2018-04-07 14:05:28 +03:00
Jan Lindström
4ede2fec4c Disable galera_var_auto_inc_control_on test. 2018-04-07 08:52:24 +03:00
Jan Lindström
3756e27aa7
Merge pull request #694 from codership/MDEV-13549-fixes-for-galera_wsrep_desync_wsrep_on
MDEV-13549 Fix test galera.galera_wsrep_desync_wsrep_on
2018-04-07 08:51:33 +03:00
Jan Lindström
c0b781d25e Disable test galera_var_auto_inc_control_on as it fails. 2018-04-06 16:33:41 +03:00
Daniele Sciascia
7925cdff6b MDEV-13549 Fix test galera.galera_wsrep_desync_wsrep_on
The test tends to fail if many parallel instances of it are executed:

```
mysqltest: At line 23: query 'ALTER TABLE t1 ADD PRIMARY KEY (f1)' failed:
1317: Query execution was interrupted
```

The `ALTER` fails because it is BF aborted due to an earlier `INSERT SELECT`
that is being applied:

```
INSERT INTO t1 (f1) SELECT ...

--connection node_2
SET GLOBAL wsrep_desync = TRUE;
SET SESSION wsrep_on = FALSE;

ALTER TABLE t1 ADD PRIMARY KEY (f1);

SET SESSION wsrep_on = TRUE;
SET GLOBAL wsrep_desync = FALSE;
```

And because the `ALTER` is executed with `wsrep_on = OFF`, it does not
run in total order isolation.
To avoid the problem it must be ensured that the `ALTER` only after the
large `INSERT SELECT` is done. To do so it is sufficient to issue
`SELECT COUNT(*) FROM t1;` from `node_2` before turning off wsrep.
The `SELECT` will trigger `wsrep_sync_wait` and proceed only after the
`INSERT SELECT` from node_1 is done.
2018-04-06 15:15:44 +02:00
Marko Mäkelä
8325d71f6c Fix a compilation error 2018-04-06 13:10:01 +03:00
Jan Lindström
81075d45c6 MDEV-15566: System tablespace does not easily key rotate to unencrypted
Problem was that key rotation from encrypted to unecrypted was skipped
when encryption is disabled (i.e. set global innodb-encrypt-tables=OFF).

fil_crypt_needs_rotation
        If encryption is disabled (i.e. innodb-encrypt-tables=off)
	and there is tablespaces using default encryption (e.g.
	system tablespace) that are still encrypted state we need
	to rotate them from encrypted state to unencrypted state.
2018-04-06 12:59:43 +03:00