Commit graph

184166 commits

Author SHA1 Message Date
Kristian Nielsen
34f11b06e6 Move deletion of old GTID rows to slave background thread
This patch changes how old rows in mysql.gtid_slave_pos* tables are deleted.
Instead of doing it as part of every replicated transaction in
record_gtid(), it is done periodically (every @@gtid_cleanup_batch_size
transaction) in the slave background thread.

This removes the deletion step from the replication process in SQL or worker
threads, which could speed up replication with many small transactions. It
also decreases contention on the global mutex LOCK_slave_state. And it
simplifies the logic, eg. when a replicated transaction fails after having
deleted old rows.

With this patch, the deletion of old GTID rows happens asynchroneously and
slightly non-deterministic. Thus the number of old rows in
mysql.gtid_slave_pos can temporarily exceed @@gtid_cleanup_batch_size. But
all old rows will be deleted eventually after sufficiently many new GTIDs
have been replicated.
2018-12-07 07:10:40 +01:00
Vladislav Vaintroub
24a45d3bd7 Fix windows build : re-record .result file 2018-12-06 21:51:38 +01:00
Vladislav Vaintroub
50c850c9b1 Windows : create a minimalistic MTR test for mysql_install_db.exe
only --datadir option is tested in this test.
Other options (notably --password and --service) would need another,
more comprehensive test.
2018-12-06 15:09:17 +01:00
Vladislav Vaintroub
f77895ebf3 MDEV-15649 Speedup search in acl_users and acl_dbs array,
sorting them by usernames first, and then by get_sort() value.


Search functions now use binary search to find the the first entry with
given name. Then, linear search is done, until the first match.
2018-12-06 09:52:31 +01:00
Alexander Barkov
bb9b4182e4 MDEV-17906 Class Binary_string 2018-12-05 15:28:08 +04:00
Alexander Barkov
24d6ec8db8 MDEV-17907 Class Static_binary_string 2018-12-05 11:03:46 +04:00
Alexander Barkov
d6a00d9b18 MDEV-17905 Add class Charset 2018-12-05 08:18:15 +04:00
Anel Husakovic
470e9a9fb6 Add CONTRIBUTING file and modify README file about live QA regarding new contributors 2018-12-04 23:15:33 +04:00
Alexander Barkov
1c37ac84ef MDEV-8894 Inserting fractional seconds into MySQL 5.6 master breaks consistency on MariaDB 10 slave
The previous patch 269da4bf19 was
actually for MDEV-8894 (not for MDEV-5377). It was erroneously
pushed with a wrong title.

This patch is a small cleanup for MDEV-8894.
CREATE TABLE is now not a part of binary logs recorded with MySQL,
only INSERT statements are. This will allow to reuse the same binary
logs in combinations with different CREATE TABLE statements,
to tests different data types.
2018-12-04 18:11:45 +04:00
Alexander Barkov
269da4bf19 MDEV-5377 Row-based replication of MariaDB temporal data types with FSP>0 into a different column type 2018-12-04 15:44:14 +04:00
Marko Mäkelä
88a480cecb Merge 10.3 into 10.4 2018-12-04 13:22:26 +02:00
Marko Mäkelä
b6f203984b Merge 10.2 into 10.3 2018-12-04 13:18:14 +02:00
Sergey Vojtovich
0070830cb8 Enable main.connect-abstract 2018-12-04 00:54:14 +04:00
Thirunarayanan Balathandayuthapani
157d3c3bc1 MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY
- Fixed innodb.table_flags test case in release build.
2018-12-03 15:57:21 +05:30
Alexander Barkov
466335a44c MDEV-16707 Add an accessor in Item_func_like class for the negated attribute 2018-12-03 13:29:27 +04:00
Thirunarayanan Balathandayuthapani
f2c7972a3d MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY
- This is a regression of commit b26e603aeb. While dropping
the incompletely created table, InnoDB shouldn't consider that operation as non-atomic one.
2018-12-03 01:12:04 +05:30
Alexander Barkov
f89a27b4e5 MDEV-17319 Assertion `ts_type != MYSQL_TIMESTAMP_TIME' failed upon inserting into TIME field 2018-12-02 18:59:04 +04:00
Igor Babaev
46960365b1 MDEV-17871 Crash when running explain with CTE
When the with clause of a query contains a recursive CTE that is not used
then processing of EXPLAIN for this query does not require optimization
of the unit specifying this CTE. In this case if 'derived' is the
TABLE_LIST object created for this CTE then derived->derived_result is NULL
and any assignment to derived->derived_result->table causes a crash.
After fixing this problem in the code of st_select_lex_unit::prepare()
EXPLAIN for such a query worked without crashes. Yet an execution
plan for the recursive CTE appeared there. The cause of this problem was
an incorrect condition used in JOIN::save_explain_data_intern() that
determined whether CTE was to be optimized or not. A similar condition was
used in select_describe() and this patch has corrected it as well.
2018-12-01 15:06:04 -08:00
Marko Mäkelä
17e371fffe More InnoDB preprocessor cleanup
Remove unnecessary #include.

Remove references to UNIV_MATERIALIZE, UNIV_INLINE_ORIGINAL, UNIV_NONINL
that are never defined.
2018-11-30 21:50:53 +02:00
Marko Mäkelä
3e5162d814 Re-disable a failing test 2018-11-30 15:54:21 +02:00
Marko Mäkelä
757530b83c Merge 10.3 into 10.4 2018-11-30 15:50:45 +02:00
Marko Mäkelä
95f3c142a4 MDEV-17881: Fix a debug assertion
In 10.3, rec_is_metadata() takes a pointer, while in 10.4 it
takes a reference as a parameter. I ported this patch from
10.4 to 10.3, and then only ran a release build, not debug build.
2018-11-30 15:48:33 +02:00
Marko Mäkelä
3afae13b54 Merge 10.3 into 10.4 2018-11-30 12:47:38 +02:00
Marko Mäkelä
e46a3aa42e MDEV-17881 Assertion failure in cmp_dtuple_rec_with_match_bytes after instant ADD COLUMN
The special flag REC_INFO_MIN_REC_FLAG used to be only set on the
first record in the leftmost node pointer page of each level of the tree.
It was never set on leaf pages.

MDEV-11369 Instant ADD COLUMN in MariaDB Server 10.3 repurposed the flag
to identify a hidden metadata record, which is stored in the first record
on the leftmost leaf page.

If the adaptive hash index points to records in the leftmost leaf page
after instant ALTER TABLE, we would have such a metadata record in the
table, an assertion could fail when trying to validate the index record.
In a release build, we might wrongly qualify the hidden metadata record
and thus return garbage results.

cmp_dtuple_rec_with_match_bytes(): If the REC_INFO_MIN_REC_FLAG is
set on the record, assert that this is the first record on the
leftmost page and that the record is a metadata record, and finally
return 1, because by definition, anything is greater than the
minimum record.
2018-11-30 12:40:03 +02:00
Marko Mäkelä
b374246730 Merge 10.3 into 10.4 2018-11-30 11:05:46 +02:00
Marko Mäkelä
0abd2766b1 Merge 10.2 into 10.3
Also, related to MDEV-15522, MDEV-17304, MDEV-17835,
remove the Galera xtrabackup tests, because xtrabackup never worked
with MariaDB Server 10.3 due to InnoDB redo log format changes.
2018-11-30 09:38:56 +02:00
Jan Lindström
7826b9b983 Fix syntax error on galera/disabled.def file 2018-11-29 17:11:19 +02:00
Jan Lindström
33fdb443ea Fix xtrabackup SST tests by using innodb-safe-truncate=OFF.
Disable tests that do not yet pass.
2018-11-29 17:11:19 +02:00
Jan Lindström
b4d102e828 MDEV-17810: Improve error printout when decryption fails or we identify page as both encrypted and unencrypted
fil_space_verify_crypt_checksum
	Print out both stored checksum and calculated checksums
	for encrypted page and unencrypted page asumptions.
2018-11-29 17:11:19 +02:00
Marko Mäkelä
447e493179 Remove some unnecessary InnoDB #include 2018-11-29 12:53:44 +02:00
Marko Mäkelä
be998bfdc5 MDEV-17859: Clean up the FOREIGN KEY handling
dict_create_add_foreigns_to_dictionary(): Do not commit the transaction.
The operation can still fail in dict_load_foreigns(), and we want
to be able to roll back the transaction.

create_table_info_t::create_table(): Never reset m_drop_before_rollback,
and never commit the transaction. We use a single point of rollback
in ha_innobase::create(). Merge the logic from
row_table_add_foreign_constraints().
2018-11-29 09:16:48 +02:00
Marko Mäkelä
3a393f8c84 Merge dict_index_copy_rec_order_prefix() to its only caller
btr_pcur_store_position(): Merge the code from
dict_index_copy_rec_order_prefix().
2018-11-28 20:47:27 +02:00
Marko Mäkelä
3fe0369309 Merge 10.3 into 10.4 2018-11-28 19:54:48 +02:00
Marko Mäkelä
35184902db Merge 10.2 into 10.3 2018-11-28 15:23:23 +02:00
Marko Mäkelä
b26e603aeb MDEV-17859 Operating system errors in file operations after failed CREATE
This is a regression due to MDEV-17816.

When creating a table fails, we must roll back the dictionary
transaction. Because the rollback may rename tables, and because
InnoDB lacks proper undo logging for CREATE operations, we must
drop the incompletely created table before rolling back the
transaction, which could include a RENAME operation.
But, we must not blindly drop the table by name; after all,
the operation could have failed because another table by the
same name already existed.

create_table_info_t::m_drop_before_rollback: A flag that is set
if the table needs to be dropped before transaction rollback.

create_table_info_t::create_table(): Remove some duplicated
error handling.

ha_innobase::create(): On error, only drop the table if it was
actually created.
2018-11-28 15:17:56 +02:00
Sergei Petrunia
0485e51935 MDEV-13155: XA recovery not supported for RocksDB
Added a testcase
2018-11-28 12:39:36 +03:00
Alexander Barkov
218c75eb1d Making the test for MDEV-17854 independent from the host time zone 2018-11-28 10:46:19 +04:00
Alexander Barkov
d6bcf3a4c8 MDEV-17854 Assertion `decimals <= 6' failed in my_time_fraction_remainder on SELECT with NULLIF and FROM_UNIXTIME on incorrect time 2018-11-28 06:18:05 +04:00
Marko Mäkelä
926b04e550 Merge 10.3 into 10.4 2018-11-28 01:18:30 +02:00
Marko Mäkelä
babb000a36 Merge 10.2 into 10.3 2018-11-28 01:02:46 +02:00
Marko Mäkelä
4a92165ff0 Remove unused mem_heap_allocator
The code became unused in commit 10590dd39c.
2018-11-28 00:52:30 +02:00
Oleksandr Byelkin
555921a9c3 MDEV-15073: Generic UDAF parser code in server for windows functions
Added support for usual agreggate UDF (UDAF)
Added remove() call support for more efficient window function processing
Added example of aggregate UDF with efficient windows function support
2018-11-27 14:33:39 +01:00
Jan Lindström
4b88d5ee51 MDEV-17771: Add Galera ist and sst tests using mariabackup
Add check that file key management plugin is found.
2018-11-27 15:26:18 +02:00
Marko Mäkelä
e82e216e37 MDEV-17849 Undo tablespace truncation recovery fails to shrink file
fil_space_t::add(): Replaces fil_node_create(), fil_node_create_low().
Let the caller pass fil_node_t::handle, to avoid having to close and
re-open files.

fil_node_t::read_page0(): Refactored from fil_node_open_file().
Read the first page of a data file.

fil_node_open_file(): Open the file only once.

srv_undo_tablespace_open(): Set the file handle for the opened
undo tablespace. This should ensure that ut_ad(file->is_open())
no longer fails in recv_add_trim().

xtrabackup_backup_func(): Remove some dead code.

xb_fil_cur_open(): Open files only if needed. Undo tablespaces
should already have been opened.
2018-11-27 14:49:39 +02:00
Marko Mäkelä
eb6364619f Remove the redundant variable fil_n_file_opened 2018-11-27 14:30:39 +02:00
Marko Mäkelä
b9824074a6 MDEV-17851 Assertion failure srv_undo_tablespaces > 1
trx_assign_rseg_low(): Skip dedicated undo tablespaces if
innodb_undo_tablespaces=0 has been set after the database was created.
2018-11-27 14:02:24 +02:00
Alexander Barkov
a956260d82 MDEV-16715 Add accessors for Item_sum and Item_func_group_concat classes 2018-11-27 14:21:30 +04:00
Alexander Barkov
19a6a018e8 MDEV-16705 Add two accessors for multi_delete class 2018-11-27 14:21:19 +04:00
Alexander Barkov
e963b0d12f MDEV-16725 Add accessor methods for classes in item_timefunc.h 2018-11-27 14:08:03 +04:00
Alexander Barkov
2dd6cd5f15 Fixing embedded tests for MDEV-16991 2018-11-27 08:06:10 +04:00