Commit graph

183371 commits

Author SHA1 Message Date
Marko Mäkelä
fc58c17216 MDEV-21336 Memory leaks related to innodb_debug_sync
This essentially reverts commit b393e2cb0c.

The leak might have been fixed, but because the
DEBUG_SYNC instrumentation for InnoDB purge threads was reverted
in 10.5 commit 5e62b6a5e0
as part of introducing a thread pool, it is easiest to revert
the entire change.
2020-05-14 13:36:11 +03:00
Marko Mäkelä
a12aed0398 Fix GCC 9.3.0 -Wunused-but-set-variable 2020-05-14 13:36:11 +03:00
Marko Mäkelä
7d51c35988 Fix GCC -Wnonnull 2020-05-14 13:36:10 +03:00
Marko Mäkelä
11147bea20 Fix GCC -Wstringop-truncation 2020-05-14 13:36:10 +03:00
Marko Mäkelä
3c773cd855 MDEV-19622: Fix a TokuDB result 2020-05-14 13:36:10 +03:00
Alexander Barkov
4dc690dc28 Merge remote-tracking branch 'origin/10.1' into 10.2 2020-05-14 11:57:47 +04:00
Alexander Barkov
31f34b20f3 MDEV-22502 MDB crashes in CREATE TABLE AS SELECT when the precision of returning type = 0.
TRUNCATE(decimal_5_5) erroneously tried to create a DECIMAL(0,0) column.
Creating a DECIMAL(1,0) column instead.
2020-05-14 11:41:27 +04:00
Alexander Barkov
f827ba3b84 Merge remote-tracking branch 'origin/10.1' into 10.2 2020-05-14 08:44:34 +04:00
Alexander Barkov
910c31928e MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
The DECIMAL data type branch in Item_func_int_val::fix_length_and_dec()
incorrectly used DOUBLE-style length calculation, which resulted in
a smaller data type than the actual result of FLOOR()/CEIL() needs.
2020-05-14 08:40:46 +04:00
Monty
edbf124515 Ensure that auto_increment fields are marked properly on update
MDEV-19622 Assertion failures in
ha_partition::set_auto_increment_if_higher upon UPDATE on Aria
table
2020-05-13 23:30:34 +03:00
Marko Mäkelä
6bc4444d7c Merge 10.1 into 10.2 2020-05-13 11:12:31 +03:00
Vlad Lesin
218d20ffe3 MDEV-22398: mariabackup.innodb_xa_rollback fails on repeat
Flush LSN to system tablespace on innodb shutdown if XA is rolled back by
mariabackup.
2020-05-12 18:44:36 +03:00
Marko Mäkelä
0e6a5786d4 Cleanup: Remove InnoDB wrappers of thd_charset(), thd_query_safe()
innobase_get_charset(), innobase_get_stmt_safe(): Remove.
It is more efficient and readable to invoke thd_charset()
and thd_query_safe() directly, without a non-inlined wrapper function.
2020-05-12 10:15:44 +03:00
Marko Mäkelä
a2560b0077 MDEV-22529 thd_query_safe() isn’t, causing InnoDB to hang
The function thd_query_safe() is used in the implementation of the
following INFORMATION_SCHEMA views:

    information_schema.innodb_trx
    information_schema.innodb_locks
    information_schema.innodb_lock_waits
    information_schema.rocksdb_trx

The implementation of the InnoDB views is in trx_i_s_common_fill_table().
This function invokes trx_i_s_possibly_fetch_data_into_cache(),
which will acquire lock_sys->mutex and trx_sys->mutex in order to
protect the set of active transactions and explicit locks.
While holding those mutexes, it will traverse the collection of
InnoDB transactions. For each transaction, thd_query_safe() will be
invoked.

When called via trx_i_s_common_fill_table(), thd_query_safe()
is acquiring THD::LOCK_thd_data while holding the InnoDB locks.
This will cause a deadlock with THD::awake() (such as executing
KILL QUERY), because THD::awake() could invoke lock_trx_handle_wait(),
which attempts to acquire lock_sys->mutex while already holding
THD::lock_thd_data.

thd_query_safe(): Invoke mysql_mutex_trylock() instead of
mysql_mutex_lock(). Return the empty string if the mutex
cannot be acquired without waiting.
2020-05-12 10:15:44 +03:00
Oleksandr Byelkin
b57c6cb394 Merge branch '10.2-release' into 10.2 2020-05-11 19:53:35 +02:00
Oleksandr Byelkin
23d3d180ca Merge branch '10.1-release' into 10.1 2020-05-11 19:09:46 +02:00
Daniel Bartholomew
37759b262f
bump the VERSION 2020-05-11 12:55:06 -04:00
Daniel Bartholomew
a0778860af
bump the VERSION 2020-05-11 12:52:53 -04:00
Marko Mäkelä
ba3d58ad4c MDEV-22523 index->rtr_ssn.mutex is wasting memory
As part of the SPATIAL INDEX implementation in InnoDB,
dict_index_t was expanded by a rtr_ssn_t field. There are only
3 operations for this field, all protected by rtr_ssn_t::mutex:

* btr_cur_search_to_nth_level() stores the least significant 32 bits
of the 64-bit value that is stored in the index root page.
(This would better be done when the table is opened for the
very first time.)
* rtr_get_new_ssn_id() increments the value by 1.
* rtr_get_current_ssn_id() reads the current value.

All these operations can be implemented equally safely by using
atomic memory access operations.
2020-05-11 14:23:37 +03:00
Petr Vaněk
4ae778bbec innodb: add space between thread name and "to exit" text 2020-05-09 15:33:57 +02:00
Jan Lindström
faf6f8c6a4 Add global suppression for connectivity problems. 2020-05-08 16:40:28 +03:00
Sergei Golubchik
0b218df072 MDEV-22483 mysql_upgrade does not use current user as default for connecting to server
correct the help text
2020-05-08 14:13:19 +02:00
Oleksandr Byelkin
985f63cce1 Merge branch '10.1' into 10.2 2020-05-08 13:38:36 +02:00
Oleksandr Byelkin
e84c62d59b MDEV-22504: Session tracking return incorrectly long traking data
When we move data we should fix buffer string length
2020-05-08 13:07:24 +02:00
Marko Mäkelä
1887b5ae87 MDEV-22501 Various issues when using --innodb-data-file-size-debug=-1
Let us limit the maximum value of the debug parameter
innodb_data_file_size to 256 MiB. It is only being used
in the test innodb.log_data_file_size, and the size
of the system tablespace should never exceed some 70 MiB
in ./mtr. Thus, 256 MiB should be a reasonable limit.

The fact that negative values that are passed to unsigned parameters
wrap around to the maximum value appears to be a regression due to
commit 18ef02b04d
and has been filed as bug MDEV-22219.
2020-05-08 13:27:57 +03:00
Sergei Golubchik
1d1fb13e59 update C/C 2020-05-08 12:26:56 +02:00
Jan Lindström
748fb55093 MDEV-21483 : Galera MTR tests failed: galera.MW-328A galera.MW-328B
Enable tests with additional galera output to find out actual
reason for test failures.
2020-05-08 11:35:15 +03:00
Sergei Golubchik
530da97c65 cleanup: foreign-keys.test vs foreign_key.test 2020-05-08 09:19:44 +02:00
Sergei Golubchik
6b521ac003 MDEV-22180 Planner opens unnecessary tables when updated table is referenced by foreign keys
under LOCK TABLES we still have to open everything, otherwise DML
prelocking will try to take an MDL on a table that wasn't in the
LOCK TABLES list.
2020-05-08 09:19:44 +02:00
Jan Lindström
40d0b64167 MDEV-21421 : Galera test sporadic failure on galera.galera_as_slave_gtid_myisam: Result length mismatch
Add wait_condition so that drop table has time to replicate to
Galera cluster.
2020-05-08 09:13:47 +03:00
Marko Mäkelä
0dee57c6f5 MDEV-19344 innodb.innodb-change-buffer-recovery fails
The test was incompatible with ./mtr --repeat=2 until
commit 2d6719d7ee
fixed that.

It turns out that the failing assertion that we disabled in
commit 3db94d2403
is bogus and can fail when the change buffer is emptied
during the last batch of crash recovery. The reason for this
is the condition around the page_create_empty() call in
page_cur_delete_rec(). The condition was removed in MariaDB
Server 10.5 as part of MDEV-12353, in
commit 7ae21b18a6 and
commit f8a9f90667.

The bug that the assertion aimed to catch is MDEV-22497, which
was fixed in commit 26aab96ecf.
2020-05-07 21:01:22 +03:00
Marko Mäkelä
26aab96ecf MDEV-22497 [ERROR] InnoDB: Unable to purge a record
The InnoDB insert buffer was upgraded in MySQL 5.5 into a change
buffer that also covers delete-mark and delete (purge) operations.

There is an important constraint for delete operations: a B-tree
leaf page must not become empty unless the entire tree becomes empty,
consisting of an empty root page. Because change buffer merges only
occur on a single leaf page at a time, delete operations must not be
buffered if it is possible that the last record of the page could be
deleted. (In that case, we would refuse to use the change buffer, and
if we really delete the last record, we would shrink the index tree.)

The function ibuf_get_volume_buffered_hash() is part of our insurance
that the page would not become empty. It is supposed to map each
buffered INSERT or DELETE_MARK record payload into a hash value.
We will only count each such record as a distinct key if there is no
hash collision. DELETE operations will always decrement the predicted
number fo records in the page.

Due to a bug in the function, we would actually compute the hash value
not only on the record payload, but also on some following bytes,
in case the record contains NULL values. In MySQL Bug #61104, we had
some examples of this dating back to 2012. But back then, we failed to
reproduce the bug, and in commit d84c95579b
we simply demoted the hard assertion to a message printout and a debug
assertion failure.

ibuf_get_volume_buffered_hash(): Correctly compute the hash value
of the payload bytes only. Note: we will consider
('foo','bar'),(NULL,'foobar'),('foob','ar') to be equal, but this
is not a problem, because in case of a hash collision, we could
also consider ('boo','far') to be equal, and underestimate the number
of records in the page, leading to refusing to buffer a DELETE.
2020-05-07 20:44:33 +03:00
Vladislav Vaintroub
8c4b526121 Windows, mtr : Fix "Subroutine HAVE_WIN32_CONSOLE redefined at (eval 25) line 1." 2020-05-07 00:40:48 +02:00
Sergei Golubchik
0fcc3abf4a MDEV-22180 Planner opens unnecessary tables when updated table is referenced by foreign keys
only MDL-prelock but do not open FK child tables for read-only (RESTRICT)
FK actions.

Tables still needs to be opened for CASCADE actions, see 9180e8666b
2020-05-06 20:24:48 +02:00
Sergei Golubchik
10aaa77509 Merge branch '5.5' into 10.1 2020-05-06 20:24:08 +02:00
Anel Husakovic
f7ba675555 MDEV-22344: Fix typos in comments 2020-05-06 18:15:32 +02:00
Jan Lindström
e6301d8f67 MDEV-21515 : Galera test sporadic failure on galera.galera_wsrep_new_cluster: Result content mismatch
Test starts two servers and we do not know order they really start,
thus wsrep_local_index can be 1 or 2.
2020-05-06 17:32:08 +03:00
Jan Lindström
2907ff2c2d MDEV-19741 : Galera test failure on galera.galera_sst_mariabackup_table_options
Test seems to work.
2020-05-06 17:32:08 +03:00
Marko Mäkelä
f20c63264a MDEV-21462: Actually test for the original bug
We must ensure that the NUL will not terminate the query string.
2020-05-06 13:47:55 +03:00
Marko Mäkelä
459e8619f2 MDEV-21462 main.processlist_notembedded fails to clean up
Replace the 30-second sleep in the test with proper
DEBUG_SYNC interlocking.
2020-05-06 11:51:44 +03:00
Sergei Golubchik
9c5d06a6d3 MDEV-21437 MariaDB's SUSE/SLES packages don't "provide" all of the same capabilities as the platform's default packages 2020-05-05 19:37:01 +02:00
Elena Stepanova
5666f333a7 List of unstable tests for 10.2.32 release 2020-05-05 18:54:35 +03:00
Vladislav Vaintroub
1af74d523a postfix after e3f5789ac0 - var/log/stdout.log contains escape sequences. 2020-05-05 12:49:29 +02:00
Varun Gupta
06b245f768 MDEV-13266: Race condition in ANALYZE TABLE / statistics collection
Fixing a race condition while collecting the engine independent statistics.

Thread1>
1) start running "ANALYZE TABLE t PERISTENT FOR COLUMNS (..) INDEXES ($list)"
2) Walk through $list and save it in TABLE::keys_in_use_for_query
3) Close/re-open tables

Thread2>
1) Make some use of table t. This involves taking table t from
   the table cache, and putting it back (with TABLE::keys_in_use_for_query reset to 0)

Thread1>
continue collecting EITS stats. Since TABLE::keys_in_use_for_query is set to 0 we
will not collect statistics for indexes in $list.
2020-05-05 15:35:58 +05:30
Marko Mäkelä
b9f177f66a MDEV-11254 cleanup: Remove buf_page_t::write_size
commit 6495806e59 removed all reads
of buf_page_t::write_size. Let us remove the field altogether.
2020-05-05 08:54:33 +03:00
Elena Stepanova
ccb58b955e List of unstable tests for 10.1.45 release 2020-05-05 01:46:25 +03:00
Marko Mäkelä
1cccd3c7cc MDEV-7962: Fix cmake WITH_WSREP=OFF
commit d467bb7e5e accidentally
broke the build without WSREP, by misplacing an #endif.
2020-05-04 22:01:26 +03:00
Marko Mäkelä
3f65ce5781 Merge 10.1 into 10.2 2020-05-04 19:00:21 +03:00
Marko Mäkelä
d467bb7e5e MDEV-7962 post-push fixes
This is a partial backport of
commit 5e7e7153b4 from 10.4.

assert_trx_is_free(): Assert !is_wsrep().

trx_init(): Do not initialize trx->wsrep, because it must have been
initialized already.

trx_commit_in_memory(): Invoke wsrep_commit_ordered(). This call
was being skipped, because the transaction object had already been
freed to the pool.

trx_rollback_for_mysql(), innobase_commit_low(),
innobase_rollback_trx(): Always reset trx->wsrep.
2020-05-04 18:57:55 +03:00
Rasmus Johansson
95fa7bc89d MDEV-22273 jUnit patch: xml test result differs from MTR output in case if retry 2020-05-04 15:53:04 +00:00