Commit graph

12169 commits

Author SHA1 Message Date
Oleksandr Byelkin
ef7cb0a0b5 Merge branch '10.1' into 10.2 2020-08-02 11:05:29 +02:00
Thirunarayanan Balathandayuthapani
a6066e230e MDEV-22511 innodb.truncate_foreign failed in buildbot with wrong error code
- Adding lock_wait_timeout value as 1 make sure that truncate table
fails instead of making MDL timeout.
2020-07-31 15:07:43 +05:30
Marko Mäkelä
f35d172103 MDEV-23198 Crash in REPLACE
row_vers_impl_x_locked_low(): clust_offsets may point to memory
that is allocated by mem_heap_alloc() and may have been freed.
For initializing clust_offsets, try to use the stack-allocated
buffer instead of a pointer that may point to freed memory.

This fixes a regression that was introduced in
commit f0aa073f2b (MDEV-20950).
2020-07-31 11:54:35 +03:00
Nikita Malyavin
fd0abc890f MDEV-18042 Server crashes upon adding a non-null date column under NO_ZERO_DATE with ALGORITHM=INPLACE
accept table_name and db_name instead of table_share in make_truncated_value_warning
2020-07-31 17:38:41 +10:00
Nikita Malyavin
91ebf1844f MDEV-19338 InnoDB: Failing assertion: !cursor->index->is_committed()
Call mark_columns_per_binlog_row_image before find_row() to set up table->vcol_set early,
so the virtual column value will be updated after record read (ha_rnd_pos/ha_index_next/etc)
by table->update_virtual_fields() call
2020-07-31 17:32:29 +10:00
Sergei Golubchik
09ec8e2e22 improve the error message for a dropped current role 2020-07-30 23:50:56 +02:00
Sergei Golubchik
4635218cb0 MDEV-22521 Server crashes in traverse_role_graph_up or Assertion `user' fails in traverse_role_graph_impl 2020-07-30 23:50:56 +02:00
Marko Mäkelä
4860fe244b XtraDB 5.6.49-89.0
The only change between Percona XtraDB Server 5.6.48-88.0
and 5.6.49-89.0 (apart from the version number change) was
percona/percona-server@25ec240920
which we had already addressed in
commit 7c03edf2fe and
commit c0fca2863b.
2020-07-30 11:06:46 +03:00
Marko Mäkelä
c5d4dd2533 MDEV-23339 innodb_force_recovery=2 may still abort the rollback of recovered transactions
trx_rollback_active(), trx_rollback_resurrected(): Replace
an incorrect condition that we failed to replace in
commit b68f1d847f (MDEV-21217).
2020-07-30 09:24:36 +03:00
Sergei Golubchik
77b7f793f9 MDEV-18496 Crash when Aria encryption is enabled but plugin not available
fix uninitialized struct member
2020-07-29 14:56:24 +02:00
Sergei Golubchik
88cbe2f081 MDEV-18496 Crash when Aria encryption is enabled but plugin not available
wait_while_table_is_used() should return an error if handler::extra() fails
2020-07-29 14:56:24 +02:00
Oleksandr Byelkin
2107e3bb9c MDEV-21258: Can't uninstall plugin if the library file doesn't exist
Removing plugin from the mysql.plugin even if the plugin is not loaded
2020-07-29 12:34:53 +02:00
Marko Mäkelä
6307b17aa1 MDEV-20142 encryption.innodb_encrypt_temporary_tables failed in buildbot with wrong result
Let us read both encrypted temporary tables to increase the changes of
page flushing and eviction.
2020-07-28 13:00:59 +03:00
Jan Lindström
b4c742108f Enable fixed test case. 2020-07-27 14:34:24 +03:00
Alexander Barkov
29851b677e MDEV-23282 FLOAT(53,0) badly handles out-of-range values
truncate_double() did not take into account the max_value
limit in case when dec<NOT_FIXED_DEC.
2020-07-27 08:03:23 +04:00
mkaruza
a3a249c72f MDEV-15236: galera_ist_progress fails when trying to read transfer status
Fixed by new  recording test recording
2020-07-24 12:43:08 +03:00
sjaakola
c9928cc0fb MDEV-20928 mtr test galera.galera_var_innodb_disallow_writes test failure
The sporadic test hangs happen because of mutex dealock between innodb
background threads and two test connection executions.
The test sets variable innodb_disallow_writes, which blocks all writes
to filesyste. The test logic is to execute an INSERT, which should hang
because of filesytstem writes are blocked, and through another session
verify by SELECT that this hanging happens. The SELECT session will then
release innodb_disallow_writes blocking.

However, filesystem write  blocking affects also innodb background threads
and they may hang while keeping some other resources locked.
As an example, in one test hang situation, buffer pool access was blocked.
And, if buffer pool is blocked, the test connections will be blocked as well,
and the SELECT session will not be able to continue to release the
innodb_disallow_writes.

The fix in this commit is refactoring of the test logic.
The test will now set first innodb_disallow_writes blocking, and then record
a hash of data directory's filesystem contents. This works as checksum of the
state of data on the datadirectory.

Then some SQL load is tried on both nodes, these sessions will be blocking
due to frozen file system state. The test will have a short sleep to allow
innodb background threads to loop and possibly encounter innodb_disallow_writes
blocking as well.

After the sleep, the test will record file system checksun for the second time,
and then release the innodb_disallow-writes blocking.

Finally, the two checksums are compared, they should be identical to verify that
nothing was written on datadirectory during the test execution.

The checksum is implemented by md5sum hash over all files found in datadirectory
by find command. all these file hashes are hashed together by one more md5sum.

The test therefore depends on md5sum and find. find may work differently with some
OS distributions, e.g. freebsd may be problematic.
2020-07-24 12:21:47 +03:00
Jan Lindström
ba23e6d76f MDEV-18177 : Galera test failure on galera_autoinc_sst_mariabackup
Add wait_condition
2020-07-24 08:19:54 +03:00
Sujatha
b3dd95e035 MDEV-14203: rpl.rpl_extra_col_master_myisam, rpl.rpl_slave_load_tmpdir_not_exist failed in buildbot with a warning
Problem:
=======
rpl.rpl_slave_load_tmpdir_not_exist 'stmt' w3 [ fail ]  Found warnings/errors
in server log file!

Test ended at 2017-09-27 20:34:55
[Warning] Master is configured to log replication events with checksum, but
will not send such events to slaves that cannot process them
^ Found warnings in /mnt/buildbot/build/mariadb-10.2.10/mysql-test/var/3/log/mysqld.1.err
ok
Analysis:
========
When slave tries to connect to master 'get_master_version_and_clock' function
is invoked to perform elaborated slave-master handshake. During this process
slave server queries master server, to know if it is checksum aware and at the
same time master is notified about its CRC-awareness. The master's side
instant value of @@global.binlog_checksum is stored in the dump thread's
uservar area as well as cached locally to become known in consensus by master
and slave.

Post hand-shake slave requests master for binlog dump. It sends
'COM_BINLOG_DUMP'. This command is sent to master by 'cli_advanced_command'
call. If there is some temporary network failure during this request_dump
call, 'end_server' is invoked to close the current connection between master
and slave. Upon connection close the dump thread on the master gets terminated
and it clears the 'uservar' data it got through master-slave handshake.

The 'COM_BINLOG_DUMP' command is sent once again without master-slave
handshake. Since the checksum data is not available with new dump thread a
warning gets reported.

Fix:
===
Upon network write error donot attempt reconnect, proceed to master-slave
handshake. This ensures that master is aware of slave's capability to use
checksums.
2020-07-23 12:54:40 +05:30
Marko Mäkelä
52ccedd6dd MDEV-23268 SIGSEGV on srv_monitor_event if InnoDB is read-only
The srv_monitor_event and the srv_monitor_thread would not be
created when InnoDB is in read-only mode. Yet, some code would
unconditionally invoke os_event_set(srv_monitor_event).
2020-07-23 09:59:16 +03:00
Varun Gupta
62d73df6b2 MDEV-19232: Floating point precision / value comparison problem
The issue occurs when the subquery_cache is enabled.
When there is a cache miss the division was leading to a value with scale 9.
In the case of cache hit the value returned was of scale 9 and due to the different
values for the scales the where condition evaluated to FALSE, hence the output
was incomplete.

To fix this problem we need to round up the decimal to the limit mentioned in
Item::decimals. This would make sure the values are compared with the same
scale.
2020-07-22 14:44:25 +05:30
Nikita Malyavin
5acd391e8b MDEV-16039 Crash when selecting virtual columns generated using functions with DAYNAME()
* Allocate items on thd->mem_root while refixing vcol exprs
* Make vcol tree changes register and roll them back after the statement is executed.

Explanation:
Due to collation implementation specifics an Item tree could change while fixing.
The tricky thing here is to make it on a proper arena.
It's usually not a problem when a field is deterministic, however, makes a pain vice-versa, during allocation allocating.
A non-deterministic field should be refixed on each statement, since it depends on the environment state.
Changing the tree will be temporary and therefore it should be reverted after the statement execution.
2020-07-21 16:18:00 +10:00
Marko Mäkelä
646a6005e7 Merge 10.1 into 10.2 2020-07-14 15:10:59 +03:00
Marko Mäkelä
67a03b7c94 XtraDB 5.6.48-88.0
The only InnoDB changes between Percona XtraDB Server 5.6.47-87.0
and 5.6.48-88.0 are related to InnoDB changes between MySQL 5.6.47
and MySQL 5.6.48, which we had already applied.
2020-07-14 13:32:32 +03:00
Marko Mäkelä
142f85142a Update the InnoDB version number to 5.6.49
There were no InnoDB changes between MySQL 5.6.48 and MySQL 5.6.49.
2020-07-14 13:25:18 +03:00
Julius Goryavsky
6b6c012f33 Merge branch '10.4-MDEV-18838' of https://github.com/codership/mariadb-server into 10.2-MDEV-18838 2020-07-14 10:45:41 +02:00
Thirunarayanan Balathandayuthapani
e80183dbd5 MDEV-15662 mariabackup.huge_lsn fails sporadically with "log sequence number is in the future"
- Problem is that test case creates iblogfile* files. So existing
ibdata pages could point to future LSN. Fix is that taking the
backup of data before iblogfile* creation and apply it before
exiting the test case.
2020-07-14 13:24:37 +05:30
Rucha Deodhar
0994af43e5 MDEV-22058: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status
Error state is not stored in check_and_do_in_subquery_rewrites() when there is
illegal combination of optimizer switches. So all the functions eventually
return false. Thus the assetion failure.
2020-07-12 20:03:32 +05:30
Marko Mäkelä
be51738465 MDEV-20428 after-merge fix: Stabilize the test 2020-07-01 17:43:44 +03:00
Sergei Golubchik
5a097c5556 MDEV-21222 mariabackup.incremental_backup failed with memory allocation failure
mariabackup tries to allocate a buffer of page_size*page_size/4 size.
for 64k page it means 1Gb, which doesn't work very well on 32-bit builders.

Skip the 64k page test on 32bit.
2020-07-01 17:22:22 +03:00
Marko Mäkelä
ea2bc974dc Merge 10.1 into 10.2 2020-07-01 12:03:55 +03:00
Jan Lindström
9fb8d87d2d Test fixes. 2020-06-24 09:38:54 +03:00
Alexey Yurchenko
8e58eeba78 MTR tests to test Galera fix for node joining over several configuration
changes.

This requires Galera commit 065e484144c5999709ae8fd19844da72bb785073
2020-06-24 08:10:57 +03:00
Jan Lindström
eba9189777 Test case cleanups. 2020-06-23 07:46:35 +03:00
MikkoJaakola
51c8289ed6 MDEV-21759 galera.galera_parallel_autoinc_manytrx sporadic failures.
The galera.galera_parallel_autoinc_manytrx mtr test opens and runs test
scenario through 3 connections to node 1 and one connection to node 2.
In the test initialization phase, the test creates two tables 't1' and 'ten'
and then creates a stored procedure 'p1' to operate on these tables.
These 3 create DDL statements are issued through same connection to node 1.

In the next test phase, the mtr script uses send command to launch the call
for the p1 stored procedure through all 3 connections to node 1 and through
one connection to node 2. As the mtr send command is asynchronous,
this test phase is non blocking and fast operation.
Now, if the replication between nodes is slow, it may happen that the
initialization phase DDL statements have not been received or have not been
fully applied in node 2. Therefore there is no guarantee that the test tables
and the stored procedure have been created in node 2. Yet, the test is trying
to call p1 in node 2.

In the failure case error logs, there is error message
"MTR failed: query 'reap' failed: 1305: PROCEDURE test.p1 does not exist"

The reap command through connection to node 2, is the first place where test
execution may observe that test tables and/or stored procedure are not yet
created in node 2.

The fix in this commit adds a wait condition in connection to node 2, to wait
until the stored procedure is created before calling the stored procedure.
The wait is implemented by looking in information_schema.routines for the p1
stored procedure.
2020-06-23 07:46:35 +03:00
Alexey Yurchenko
3ddb080536 Fix include statements in galera_ipv6_mariabackup_section and
galera_ipv6_mariabackup MTR tests
2020-06-23 07:46:35 +03:00
Jan Lindström
5d7e067cce MDEV-22125 : galera.galera_drop_multi MTR failed: InnoDB: MySQL is trying to drop database fts.`` though there are still open handles
MDEV-22140 galera.galera_drop_database MTR failed: InnoDB: MySQL is trying to drop database `fts`.`` though there are still open handles

Add wait conditions to wait that all operations are done in both
nodes.
2020-06-23 07:46:35 +03:00
Jan Lindström
319886eca7 MDEV-20928 : Galera test failure on galera.galera_var_innodb_disallow_writes: Result length mismatch
Add wait_conditions to force desired execution.
2020-06-23 07:46:35 +03:00
Daniel Black
37c88445e3 mtr: use env for perl
On FreeBSD, perl isn't in /usr/bin, its in /usr/local/bin or
elsewhere in the path.

Like storage/{maria/unittest/,}ma_test_* , we use /usr/bin/env to
find perl and run it.
2020-06-23 03:24:46 +02:00
Thirunarayanan Balathandayuthapani
e30c4cfc7a MDEV-22811 DDL fails to drop and re-create FTS index
Problem:
========
- InnoDB clears the fts resource when last FTS index is being dropped
if the table has user defined FTS_DOC_ID. While creating the new fts
index, InnoDB expects to have FTS resources.

Fix:
===
fts_drop_index(): Removed the fts resource clear.

fts_clear_all(): Clear the fts resource when there are no new fts
index to be added.

commit_cache_norebuild(), row_merge_drop_indexes():
Tries to call fts resource after removing associated fts index
from table object
2020-06-18 15:49:39 +05:30
Jan Lindström
fb0d18e412 Add global ignore for Sending JOIN failed warning. 2020-06-16 12:12:36 +03:00
Sujatha
bf74f7f9ff MDEV-20428: "Start binlog_dump" message doesn't indicate GTID position
Problem:
=======
The "Start binlog_dump" message hasn't been updated to include the slave's
requested GTID position:

20:05:05 139836760311552 [Note] Start binlog_dump to slave_server(2), pos(, 4)

For diagnostic purposes, it would be helpful if the GTID position were
included.

Fix:
===
Imporve "Start binlog_dump" print message to include "using_gtid" and
"GTID position" requested by slave.

Ex:
[Note] Start binlog_dump to slave_server(2), pos(, 4), using_gtid(1),
  gtid('1-1-201,2-2-100')

[Note] Start binlog_dump to slave_server(3), pos('mariadb-bin.004142',
  507988273), using_gtid(0), gtid('')
2020-06-16 11:08:24 +05:30
Jan Lindström
7710f28eec Add missing include as test requires galera debug library 2020-06-15 09:29:17 +03:00
Marko Mäkelä
2cd6afb083 MDEV-22889: Disable innodb.innodb_force_recovery_rollback
The test case that was added for MDEV-21217
(commit b68f1d847f)
should have only two possible outcomes for the locking SELECT statement:

(1) The statement is blocked, and the test will eventually fail
with a lock wait timeout. This is what I observed when the
code fix for MDEV-21217 was missing.

(2) The lock conflict will ensure that the statement will execute
after the rollback has completed, and an empty table will be observed.
This is the expected outcome with the recovery fix.

What occasionally happens (in some of our CI environments only, so far)
is that the locking SELECT will return all 1,000 rows of the table that
had been inserted by the transaction that was never supposed to be
committed. One possibility is that the transaction was unexpectedly
committed when the server was killed.

Let us disable the test until the reason of the failure has been
determined and addressed.
2020-06-14 10:26:42 +03:00
Marko Mäkelä
b68f1d847f MDEV-21217 innodb_force_recovery=2 may wrongly abort rollback
trx_roll_must_shutdown(): Correct the condition that detects
the start of shutdown.
2020-06-13 14:45:52 +03:00
Marko Mäkelä
1bcc5cd9b6 Remove a stale test
The last traces of the special InnoDB table names were removed in
commit 0af52734a7
but we forgot to remove the test case.
2020-06-10 16:14:14 +03:00
Marko Mäkelä
be0c46eb97 MDEV-22817: Skip the test in --embedded 2020-06-06 21:34:21 +03:00
Marko Mäkelä
187b9c924e MDEV-22817: Add a test case 2020-06-06 18:07:13 +03:00
Marko Mäkelä
0df01ccb66 Merge 10.1 into 10.2 2020-06-06 18:07:04 +03:00
Julius Goryavsky
5f55f69e4a Merge 10.1 into 10.2 2020-06-05 18:32:37 +02:00
Marko Mäkelä
efc70da5fd MDEV-22769 Shutdown hang or crash due to XA breaking locks
The background drop table queue in InnoDB is a work-around for
cases where the SQL layer is requesting DDL on tables on which
transactional locks exist.

One such case are XA transactions. Our test case exploits the
fact that the recovery of XA PREPARE transactions will
only resurrect InnoDB table locks, but not MDL that should
block any concurrent DDL.

srv_shutdown_t: Introduce the srv_shutdown_state=SRV_SHUTDOWN_INITIATED
for the initial part of shutdown, to wait for the background drop
table queue to be emptied.

srv_shutdown_bg_undo_sources(): Assign
srv_shutdown_state=SRV_SHUTDOWN_INITIATED
before waiting for the background drop table queue to be emptied.

row_drop_tables_for_mysql_in_background(): On slow shutdown, if
no active transactions exist (excluding ones that are in
XA PREPARE state), skip any tables on which locks exist.

row_drop_table_for_mysql(): Do not unnecessarily attempt to
drop InnoDB persistent statistics for tables that have
already been added to the background drop table queue.

row_mysql_close(): Relax an assertion, and free all memory
even if innodb_force_recovery=2 would prevent the background
drop table queue from being emptied.
2020-06-05 15:22:46 +03:00
Sergey Vojtovich
dce4c0f979 MDEV-22339 - Assertion `str_length < len' failed
When acquiring SNW/SNRW/X MDL lock DDL/admin statements may abort pending
thr lock in concurrent connection with open HANDLER (or delayed insert
thread).

This may lead to a race condition when table->alias is accessed
concurrently by such threads. Either assertion failure or memory leak
is a practical consequence of this race condition.

Specifically HANDLER is opening a table and issuing alias.copy(), while
DDL executing get_lock_data()/alias.c_ptr()/realloc()/realloc_raw().

Fixed by perforimg table->init() before it is published via
thd->open_tables.
2020-06-04 23:52:10 +02:00
Varun Gupta
f30ff10c8d MDEV-22715: SIGSEGV in radixsort_for_str_ptr and in native_compare/my_qsort2 (optimized builds)
For DECIMAL[(M[,D])] datatype max_sort_length was not being honoured which was leading to buffer
overflow while making the sort key. The fix to this problem would be to create sort keys for decimals
with atmost max_sort_key bytes

Important:
The minimum value of max_sort_length has been raised to 8 (previously was 4),
so fixed size datatypes like DOUBLE and BIGINIT are not truncated for
lower values of max_sort_length.
2020-06-05 01:11:03 +05:30
Julius Goryavsky
3f019d1771 Added missing include files to check for debug_sync 2020-06-03 15:34:44 +02:00
sjaakola
8ec0e9111a MDEV-22763 backporting MDEV-20225 fix into 10.1
Backported the support for aborting and replaying stored procedure and fix for trigger
key assigments from 10.4 version.
Backported also two mtr tests: wsrep_sp_bf_abort and MDEV-20225
2020-06-03 15:34:44 +02:00
Marko Mäkelä
d72eebaa3d Merge 10.1 into 10.2 2020-06-01 09:33:03 +03:00
Anel Husakovic
957cb7b7ba MDEV-22312: Bad error message for SET DEFAULT ROLE when user account is not granted the role
- `SET DEFAULT ROLE xxx [FOR yyy]` should say:
  "User yyy has not been granted a role xxx" if:
    - The current user (not the user `yyy` in the FOR clause) can see the
    role xxx. It can see the role if:
      * role exists in `mysql.roles_mappings` (traverse the graph),
      * If the current user has read access on `mysql.user` table - in
    that case, it can see all roles, granted or not.
    - Otherwise it should be "Invalid role specification".

In other words, it should not be possible to use `SET DEFAULT ROLE` to discover whether a specific role exist or not.
2020-05-28 17:08:40 +02:00
Monty
403dacf6a9 Fixed crash in aria recovery when using bulk insert
MDEV-20578 Got error 126 when executing undo undo_key_delete
upon Aria crash recovery

The crash happens in this scenario:
- Table with unique keys and non unique keys
- Batch insert (LOAD DATA or INSERT ... SELECT) with REPLACE
- Some insert succeeds followed by duplicate key error

In the above scenario the table gets corrupted.

The bug was that we don't generate any undo entry for the
failed insert as the whole insert can be ignored by undo.
The code did however not take into account that when bulk
insert is used, we would write cached keys to the file on
failure and undo would wrongly ignore these.

Fixed by moving the writing of the cache keys after we write
the aborted-insert event to the log.
2020-05-26 20:05:17 +03:00
Andrei Elkin
0c1f97b3ab MDEV-15152 Optimistic parallel slave doesnt cope well with START SLAVE UNTIL
The immediate bug was caused by a failure to recognize a correct
position to stop the slave applier run in optimistic parallel mode.
There were the following set of issues that the analysis unveil.
1 incorrect estimate for the event binlog position passed to
  is_until_satisfied
2 wait for workers to complete by the driver thread did not account non-group events
  that could be left unprocessed and thus to mix up the last executed
  binlog group's file and position:
  the file remained old and the position related to the new rotated file
3 incorrect 'slave reached file:pos' by the parallel slave report in the error log
4 relay log UNTIL missed out the parallel slave branch in
  is_until_satisfied.

The patch addresses all of them to simplify logics of log change
notification in either the master and relay-log until case.
P.1 is addressed with passing the event into is_until_satisfied()
for proper analisis by the function.
P.2 is fixed by changes in handle_queued_pos_update().
P.4 required removing relay-log change notification by workers.
Instead the driver thread updates the notion of the current relay-log
fully itself with aid of introduced
bool Relay_log_info::until_relay_log_names_defer.

An extra print out of the requested until file:pos is arranged
with --log-warning=3.
2020-05-26 18:49:43 +03:00
Andrei Elkin
dbe447a789 MDEV-15152 Optimistic parallel slave doesnt cope well with START SLAVE UNTIL
The immediate bug was caused by a failure to recognize a correct
position to stop the slave applier run in optimistic parallel mode.
There were the following set of issues that the analysis unveil.
1 incorrect estimate for the event binlog position passed to
  is_until_satisfied
2 wait for workers to complete by the driver thread did not account non-group events
  that could be left unprocessed and thus to mix up the last executed
  binlog group's file and position:
  the file remained old and the position related to the new rotated file
3 incorrect 'slave reached file:pos' by the parallel slave report in the error log
4 relay log UNTIL missed out the parallel slave branch in
  is_until_satisfied.

The patch addresses all of them to simplify logics of log change
notification in either the master and relay-log until case.
P.1 is addressed with passing the event into is_until_satisfied()
for proper analisis by the function.
P.2 is fixed by changes in handle_queued_pos_update().
P.4 required removing relay-log change notification by workers.
Instead the driver thread updates the notion of the current relay-log
fully itself with aid of introduced
bool Relay_log_info::until_relay_log_names_defer.

An extra print out of the requested until file:pos is arranged
with --log-warning=3.
2020-05-26 18:26:50 +03:00
Aleksey Midenkov
f1f14c2092 MDEV-20015 Assertion `!in_use->is_error()' failed in TABLE::update_virtual_field
update_virtual_field() is called as part of index rebuild in
ha_myisam::repair() (MDEV-5800) which is done on bulk INSERT finish.

Assertion in update_virtual_field() was put as part of MDEV-16222
because update_virtual_field() returns in_use->is_error(). The idea:
wrongly mixed semantics of error status before update_virtual_field()
and the status returned by update_virtual_field(). The former can
falsely influence the latter.
2020-05-26 13:15:45 +03:00
Oleksandr Byelkin
cf52dd174e MDEV-22545: my_vsnprintf behaves not as in C standard
Added parameter %T for string which should be visibly truncated.
2020-05-24 21:27:08 +02:00
Sujatha
450a5b33a2 MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write on CREATE after RESET MASTER
Merge branch '10.1' into 10.2
2020-05-20 20:49:04 +05:30
Sujatha
836d708997 MDEV-22451: SIGSEGV in __memmove_avx_unaligned_erms/memcpy from _my_b_write on CREATE after RESET MASTER
Analysis:
========
RESET MASTER TO # command deletes all binary log files listed in the index
file, resets the binary log index file to be empty, and creates a new binary
log with number #. When the user provided binary log number is greater than
the max allowed value '2147483647' server fails to generate a new binary log.
The RESET MASTER statement marks the binlog closure status as
'LOG_CLOSE_TO_BE_OPENED' and exits. Statements which follow RESET MASTER
try to write to binary log they find the log_state != LOG_CLOSED and
proceed to write to binary log cache and it results in crash.

Fix:
===
During MYSQL_BIN_LOG open, if generation of new binary log name fails then the
"log_state" needs to be marked as "LOG_CLOSED". With this further statements
will find binary log as closed and they will skip writing to the binary log.
2020-05-20 17:42:28 +05:30
Marko Mäkelä
e380f44742 Merge 10.1 into 10.2 2020-05-20 11:13:40 +03:00
Marko Mäkelä
6b2c8cac1b MDEV-22258 Limit innodb_encryption_threads to 255
For no good reason, innodb_encryption_threads was limited to
4,294,967,295. Expectedly, the server would crash if such an
insane value was specified. Let us limit the maximum to 255.

The encryption threads are not doing much useful work.
They are basically only dirtying pages by performing
dummy writes via the redo log. The encryption key rotation
or the in-place addition or removal of encryption
will take place in the page cleaner.

In a quick test on a 20-core CPU (40 threads in total),
the sweet spot on an otherwise idle server seemed to be
innodb_encryption_threads=16 for the test
encryption.encrypt_and_grep. The new limit 255 should be
more than enough for even bigger servers.
2020-05-20 10:33:53 +03:00
Jan Lindström
ad0f85bcd2 MDEV-18838 : galera.galera_toi_truncate: Test failure: mysqltest: query 'reap' succeeded - should have failed with errno 1213
Test cleanup.
2020-05-20 09:34:50 +03:00
Andrei Elkin
7a5ba59e5f MDEV-22472 rpl.rpl_fail_register failed in buildbot with wrong result
This is a new test from upstream that did not expect the correct value
of the command slot of the Dump thread when the latter gets killed.

The test is made to expect "Killed" string as the command
in show-processlist as it is supposed to when a thread gets killed.
2020-05-19 21:57:01 +03:00
Marko Mäkelä
a84060567c Merge 10.1 into 10.2 2020-05-19 10:42:59 +03:00
Andrei Elkin
44c8d84908 MDEV-22520 Assertion gathered_length == thd->lex->comment.length failed in binlog_defragment
The assert was caused by early cleanup of a user variable participant
in BINLOG @var,@var where it plays twice. That was unexpected by the base
code to clear its value prematurely.

Fixed with relocating the user var destruction after operations with
its value is over.
2020-05-18 15:14:16 +03:00
Alexander Barkov
bf8ae81269 Merge remote-tracking branch 'origin/10.1' into 10.2
Also, adding 10.2 related changes for MDEV-22579
2020-05-16 10:52:08 +04:00
Marko Mäkelä
3f12a5968a MDEV-13626: Make test more robust
In commit b1742a5c95 we forgot
FLUSH TABLES, potentially causing errors for MyISAM system tables.
2020-05-15 22:54:05 +03:00
Alexander Barkov
3df297271a MDEV-22579 No error when inserting DEFAULT(non_virtual_column) into a virtual column
The code erroneously allowed both:
INSERT INTO t1 (vcol) VALUES (DEFAULT);
INSERT INTO t1 (vcol) VALUES (DEFAULT(non_virtual_column));

The former is OK, but the latter is not.
Adding a new virtual method in Item:

virtual bool vcol_assignment_allowed_value() const { return false; }

Item_null, Item_param and Item_default_value override it.

Item_default_value overrides it in the way to:
- allow DEFAULT
- disallow DEFAULT(col)
2020-05-15 20:21:54 +04:00
Marko Mäkelä
ad6171b91c MDEV-22456 Dropping the adaptive hash index may cause DDL to lock up InnoDB
If the InnoDB buffer pool contains many pages for a table or index
that is being dropped or rebuilt, and if many of such pages are
pointed to by the adaptive hash index, dropping the adaptive hash index
may consume a lot of time.

The time-consuming operation of dropping the adaptive hash index entries
is being executed while the InnoDB data dictionary cache dict_sys is
exclusively locked.

It is not actually necessary to drop all adaptive hash index entries
at the time a table or index is being dropped or rebuilt. We can let
the LRU replacement policy of the buffer pool take care of this gradually.
For this to work, we must detach the dict_table_t and dict_index_t
objects from the main dict_sys cache, and once the last
adaptive hash index entry for the detached table is removed
(when the garbage page is evicted from the buffer pool) we can free
the dict_table_t and dict_index_t object.

Related to this, in MDEV-16283, we made ALTER TABLE...DISCARD TABLESPACE
skip both the buffer pool eviction and the drop of the adaptive hash index.
We shifted the burden to ALTER TABLE...IMPORT TABLESPACE or DROP TABLE.
We can remove the eviction from DROP TABLE. We must retain the eviction
in the ALTER TABLE...IMPORT TABLESPACE code path, so that in case the
discarded table is being re-imported with the same tablespace identifier,
the fresh data from the imported tablespace will replace any stale pages
in the buffer pool.

rpl.rpl_failed_drop_tbl_binlog: Remove the test. DROP TABLE can
no longer be interrupted inside InnoDB.

fseg_free_page(), fseg_free_step(), fseg_free_step_not_header(),
fseg_free_page_low(), fseg_free_extent(): Remove the parameter
that specifies whether the adaptive hash index should be dropped.

btr_search_lazy_free(): Lazily free an index when the last
reference to it is dropped from the adaptive hash index.

buf_pool_clear_hash_index(): Declare static, and move to the
same compilation unit with the bulk of the adaptive hash index
code.

dict_index_t::clone(), dict_index_t::clone_if_needed():
Clone an index that is being rebuilt while adaptive hash index
entries exist. The original index will be inserted into
dict_table_t::freed_indexes and dict_index_t::set_freed()
will be called.

dict_index_t::set_freed(), dict_index_t::freed(): Note that
or check whether the index has been freed. We will use the
impossible page number 1 to denote this condition.

dict_index_t::n_ahi_pages(): Replaces btr_search_info_get_ref_count().

dict_index_t::detach_columns(): Move the assignment n_fields=0
to ha_innobase_inplace_ctx::clear_added_indexes().
We must have access to the columns when freeing the
adaptive hash index. Note: dict_table_t::v_cols[] will remain
valid. If virtual columns are dropped or added, the table
definition will be reloaded in ha_innobase::commit_inplace_alter_table().

buf_page_mtr_lock(): Drop a stale adaptive hash index if needed.

We will also reduce the number of btr_get_search_latch() calls
and enclose some more code inside #ifdef BTR_CUR_HASH_ADAPT
in order to benefit cmake -DWITH_INNODB_AHI=OFF.
2020-05-15 17:23:08 +03:00
Monty
af784385b4 Fix for using uninitialized memory
MDEV-22073 MSAN use-of-uninitialized-value in
collect_statistics_for_table()

Other things:
innodb.analyze_table was changed to mainly test statistic
collection. Was discussed with Marko.
2020-05-15 15:10:58 +03:00
Monty
277aa85c9b Fixed bugs found by valgrind
Other things:
- Removed innodb_encryption_tables.test from valgrind as it
  takes a REALLY long time
2020-05-15 10:44:05 +03:00
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
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
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
Jan Lindström
faf6f8c6a4 Add global suppression for connectivity problems. 2020-05-08 16:40:28 +03:00
Oleksandr Byelkin
985f63cce1 Merge branch '10.1' into 10.2 2020-05-08 13:38:36 +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
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
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
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ä
3f65ce5781 Merge 10.1 into 10.2 2020-05-04 19:00:21 +03:00
Thirunarayanan Balathandayuthapani
2748c4993c MDEV-19092 Server crash when renaming the column when
FOREIGN_KEY_CHECKS is disabled

- Referenced index can be null While renaming the referenced column name.
In that case, rename the referenced column name in dict_foreign_t and
find the equivalent referenced index.
2020-05-04 14:33:45 +05:30
Oleksandr Byelkin
ca091e6372 Merge branch '10.1' into 10.2 2020-05-02 08:44:17 +02:00
Oleksandr Byelkin
23c6fb3e62 Merge branch '5.5' into 10.1 2020-04-30 17:36:41 +02:00
Sergei Golubchik
6bb28e0bc5 Bug#29915479 RUNNING COM_REGISTER_SLAVE WITHOUT COM_BINLOG_DUMP CAN RESULTS IN SERVER EXIT
in fact, in MariaDB it cannot, but it can show spurious slaves
in SHOW SLAVE HOSTS.

slave was registered in COM_REGISTER_SLAVE and un-registered after
COM_BINLOG_DUMP. If there was no COM_BINLOG_DUMP, it would never
unregister.
2020-04-30 10:13:18 +02:00
Eugene Kosov
28325b0863 add WITH_DBUG_TRACE CMake variable
This is a way do disable DBUG_ENTER()/DBUG_EXIT() stuff which is
needed to dbug trace. Those who doesn't need it may avoid tests
slowdown with -DWITH_DBUG_TRACE=OFF

dbug/tests.c: add define which is neede always in this test

innodb.log_file_name_debug.test: do not depend on DBUG trace stuff
in test

Benchmark results: each test eats less CPU and you can have more
parallel jobs in MTR.

patched:
./mtr -mem -par=8 -suite=innodb  185.34s user 86.85s system 133% cpu 3:23.27 total
./mtr -mem -par=8 -suite=main    80.96s  user 36.01s system 182% cpu 1:04.07 total

main.select                              [ pass ]   1660
main.select                              [ pass ]   1513
main.select                              [ pass ]   1543
main.select                              [ pass ]   1660
main.select                              [ pass ]   1521
main.select                              [ pass ]   1511
main.select                              [ pass ]   1508
main.select                              [ pass ]   1520
main.select                              [ pass ]   1514
main.select                              [ pass ]   1522

vanilla:
./mtr -mem -par=8 -suite=innodb  203.61s user 92.16s system 140% cpu 3:30.16 total
./mtr -mem -par=8 -suite=main    94.11s  user 35.51s system 206% cpu 1:02.69 total

main.select                              [ pass ]   2032
main.select                              [ pass ]   2017
main.select                              [ pass ]   2040
main.select                              [ pass ]   2183
main.select                              [ pass ]   2253
main.select                              [ pass ]   2075
main.select                              [ pass ]   2109
main.select                              [ pass ]   2080
main.select                              [ pass ]   2098
main.select                              [ pass ]   2114
2020-04-29 20:13:14 +03:00
Jan Lindström
7a546650fa MDEV-20916: Galera test failure on galera.galera_parallel_autoinc_largetrx: Result content mismatch
Add wait_condition to make sure that node contains all the rows
expected.
2020-04-29 17:04:10 +03:00
Sergei Golubchik
59880df8cd Bug#28388217 - SERVER CAN FAIL WHILE REPLICATING CONDITIONAL COMMENTS
test case
2020-04-29 14:08:54 +02:00
Marko Mäkelä
547cb280b8 Merge 10.1 into 10.2 2020-04-28 19:39:40 +03:00
Marko Mäkelä
5a1d931529 Speed up innodb_gis.rtree_split
INSERT...SELECT reading from an InnoDB table is slow due to
creating explicit record locks. Use the sequence engine instead.

Also, remove the space before rtr_page_need_second_split
to actually make the debug injection work.
2020-04-28 19:37:07 +03:00
Marko Mäkelä
713e427b2e InnoDB 5.6.48 2020-04-28 16:20:19 +03:00
Marko Mäkelä
7041807476 MDEV-22393 Corruption for SET GLOBAL innodb_ string variables
Several MYSQL_SYSVAR_STR parameters that employ both a validate
function callback fail to copy the string for saving the
validated value. The affected variables include the following:

innodb_ft_aux_table
innodb_ft_server_stopword_table
innodb_ft_user_stopword_table
innodb_buffer_pool_filename

The test case is an enhanced version of
mysql/mysql-server@0b0c30641f
and the code changes are inspired by their fixes.

We are also importing and adjusting the test innodb_fts.stopword
to get coverage for the variable innodb_ft_user_stopword_table.

buf_dump(), buf_load(): Protect srv_buf_dump_filename with
LOCK_global_system_variables.

fts_load_user_stopword(): Minor cleanup

fts_load_stopword(): Remove the parameter global_stopword_table.

innobase_fts_load_stopword(): Protect innodb_server_stopword_table
against concurrent SET GLOBAL.
2020-04-28 16:09:07 +03:00
Vlad Lesin
d0150dc14e MDEV-20230: mariabackup --ftwrl-wait-timeout never times out on explicit
lock

--ftwrl-wait-timeout does not finish mariabackup execution when acquired
backup lock can't be grabbed for the certain amount of time, it just
waits for a long queries finishing before acquiring the lock to avoid
unnecessary locking.

This commit extends --ftwrl-wait-timeout so, that mariabackup execution
is finished if it waits for backup lock during certain amount of time.
2020-04-27 22:10:50 +03:00
Marko Mäkelä
c06845d6f0 Merge 10.1 into 10.2 2020-04-27 13:28:13 +03:00
Marko Mäkelä
d956175d0d XtraDB 5.6.47-87.0
The only change is a change of the version number.
As noted in commit 02af6278fb
there were no changes to InnoDB between MySQL 5.6.46 and 5.6.47
either.
2020-04-27 11:39:46 +03:00
Marko Mäkelä
6be05ceb05 MDEV-22203: WSREP_ON is unnecessarily expensive to evaluate
This is a backport of the applicable part of
commit 93475aff8d and
commit 2c39f69d34
from 10.4.

Before 10.4 and Galera 4, WSREP_ON is a macro that points to
a global Boolean variable, so it is not that expensive to
evaluate, but we will add an unlikely() hint around it.

WSREP_ON_NEW: Remove. This macro was introduced in
commit c863159c32
when reverting WSREP_ON to its previous definition.

We replace some use of WSREP_ON with WSREP(thd), like it was done
in 93475aff8d. Note: the macro
WSREP() in 10.1 is equivalent to WSREP_NNULL() in 10.4.

Item_func_rand::seed_random(): Avoid invoking current_thd
when WSREP is not enabled.
2020-04-27 09:40:51 +03:00
Marko Mäkelä
9f19dbe0c3 MDEV-22358 Assertion srv_undo_sources || ... in row_prebuilt_free()
row_prebuilt_free(): Do not attempt to drop orphan indexes
that might have been left behind by a failed ADD UNIQUE INDEX.
This avoids the execution of unwanted transactions during shutdown.
2020-04-23 19:33:55 +03:00
Jan Lindström
8760ba6521 MDEV-21807 : galera.galera_slave_replay MTR failed: WSREP: Unknown parameter 'dbug
Test do we have galera debug library with debug_sync functionality
needs to be earlier.
2020-04-22 09:21:39 +03:00
Jan Lindström
a6a8774d47 MDEV-22181 : galera.galera_sst_mysqldump_with_key MTR failed: INSERT failed: 1146: Table 'test.t1' doesn't exist
Add wait condition to make sure table test.t1 is replicated
to node_2 before we insert to it.
2020-04-22 07:35:41 +03:00
Vlad Lesin
0efe1971c6 MDEV-19347: Mariabackup does not honor ignore_db_dirs from server
config.

The solution is to read the system variable value on startup and to fill
databases_exclude_hash.

xb_load_list_string() became non-static and was reformatted. The system
variable value is read and processed in get_mysql_vars(), which was also
reformatted.
2020-04-21 10:34:37 +03:00
Vicențiu Ciorbaru
613bc18a36 sysvars_server_* tests need to have performance schema enabled
Tests will fail otherwise. Backport change from:
867809f23a
2020-04-13 14:22:58 +03:00
Sergey Vojtovich
06219c2ad4 MDEV-21599 - plugins.server_audit fails sporadically in buildbot
Fixed a couple of race conditions in the test case to ensure stable order
of events. Also removed all sleeps. Test execution time is down from 18s
to 0.15s.

On disconnect audit event is triggered after control is returned to
mysqltest client. Which means mysqltest may issue more commands
concurrently before disconnect is actually logged.

Similar problem happens with regular query execution: an event is
triggered after control is returner to the client. Which may end
up with unstable order of events in different connections.

Delayed insert rows are enqueued separately and can either be combined
into single event or go as separate events. Reduced number of inserted
rows to 1 to stabilize result.

Also backported 2b3f6ab from 10.5.
2020-04-10 19:35:53 +04:00
Vlad Lesin
5836191c8f MDEV-21168: Active XA transactions stop slave from working after backup
was restored.

Optionally rollback prepared XA's on "mariabackup --prepare".

The fix MUST NOT be ported on 10.5+, as MDEV-742 fix solves the issue for
slaves.
2020-04-07 15:05:38 +03:00
Oleksandr Byelkin
cb4da5da74 MDEV-20604: Duplicate key value is silently truncated to 64 characters in print_keydup_error
Added indication of truncated string for "s" and "M" formats
2020-04-01 11:34:32 +02:00
Marko Mäkelä
bc862c4ebe Merge 10.1 into 10.2 2020-04-01 09:19:37 +03:00
Marko Mäkelä
b1742a5c95 MDEV-13626: Improve innodb.xa_recovery_debug
Improve the test that was imported and adapted for MariaDB in
commit fb217449dc.

row_undo_step(): Move the DEBUG_SYNC point from trx_rollback_for_mysql().
This DEBUG_SYNC point is executed after rolling back one row.

trx_rollback_for_mysql(): Clarify the comments that describe the scenario,
and remove the DEBUG_SYNC point.

If the statement "if (trx->has_logged_persistent())" and its body are
removed from trx_rollback_for_mysql(), then the test
innodb.xa_recovery_debug will fail because the transaction would still
exist in the XA PREPARE state. If we allow the XA COMMIT statement
to succeed in the test, we would observe an incorrect state of the
XA transaction where the table would contain row (1,NULL). Depending
on whether the XA transaction was committed, the table should either
be empty or contain the record (1,1). The intermediate state of
(1,NULL) should never be observed after completed recovery.
2020-04-01 09:13:01 +03:00
Marko Mäkelä
fb217449dc MDEV-13626: Import and adapt innodb.xa_recovery_debug
Adapt the test that was added in
mysql/mysql-server@6b65d9032c
but omitted in commit 2e814d4702.

Instead of triggering a log checkpoint, we will only trigger
a redo log flush before killing the server.
Note: the mtr.commit() call in trx_rollback_for_mysql()
will not actually make the undo log header page state change durable.
A call to log_write_up_to(mtr.commit_lsn(), true) would do that.

It is unclear what the originally reported bug scenario was.
As long as innobase_rollback_by_xid() will not return without
ensuring that the redo log has been durably written, we should be safe.
2020-03-31 15:10:54 +03:00
mkaruza
2d16452a31 MDEV-22021: Galera database could get inconsistent with rollback to savepoint
When binlog is disabled, WSREP will not behave correctly when
SAVEPOINT ROLLBACK is executed since we don't register handlers for such case.
Fixed by registering WSREP handlerton for SAVEPOINT related commands.
2020-03-31 09:59:37 +03:00
Thirunarayanan Balathandayuthapani
1f7be88141 MDEV-19092 Server crash when renaming the column when
FOREIGN_KEY_CHECKS is disabled

- dict_foreign_find_index() can return NULL if InnoDB already dropped
the foreign index when FOREIGN_KEY_CHECKS is disabled.
2020-03-25 17:10:36 +05:30
Thirunarayanan Balathandayuthapani
6697135c6d MDEV-21572 buf_page_get_gen() should apply buffered page initialized
redo log during recovery

- InnoDB unnecessarily reads the page even though it has fully initialized
buffered redo log records. Allow the page initialization redo log to
apply for the page in buf_page_get_gen() during recovery.
- Renamed buf_page_get_gen() to buf_page_get_low()
- Newly added buf_page_get_gen() will check for buffered redo log for
the particular page id during recovery
- Added new function buf_page_mtr_lock() which basically latches the page
for the given latch type.
- recv_recovery_create_page() is inline function which creates a page
if it has page initialization redo log records.
2020-03-23 16:41:48 +05:30
Alice Sherepa
ad6e421bd2 MDEV-21360 restore debud_dbug through a session variable instead of '-d,..' 2020-03-23 10:57:21 +01:00
Marko Mäkelä
b034d708c8 MDEV-21549: Clean up the import/export tests
Remove CREATE/DROP database.

Remove some unnecessary suppressions, replacements, and
SQL statements.

Populate tables via have_sequence.inc to avoid the creation of
explicit InnoDB record locks in INSERT...SELECT. This will remove
some gaps in AUTO_INCREMENT values.
2020-03-20 16:34:15 +02:00
Marko Mäkelä
6960e9ed24 MDEV-21983: Crash on DROP/RENAME TABLE after DISCARD TABLESPACE
fil_delete_tablespace(): Remove the unused parameter drop_ahi,
and add the parameter if_exists=false. We want to suppress
error messages if we know that the tablespace has been discarded.

dict_table_rename_in_cache(): Pass the new parameter to
fil_delete_tablespace(), that is, do not complain about
missing tablespace if the tablespace has been discarded.

row_make_new_pathname(): Declare as static.

row_drop_table_for_mysql(): Tolerate !table->data_dir_path
when the tablespace has been discarded.

row_rename_table_for_mysql(): Skip part of the RENAME TABLE
when fil_space_get_first_path() returns NULL.
2020-03-19 14:23:47 +02:00
Marko Mäkelä
9fd692aeca MDEV-13626: Clean up the buffer pool resizing tests from MySQL 5.7
buf_pool_resize(): Simplify the fault injection
for innodb.buf_pool_resize_oom.

innodb.buf_pool_resize_oom: Use a small buffer pool.

innodb.innodb_buffer_pool_load_now: Make use of the sequence engine,
to avoid creating explicit InnoDB record locks. Clean up the
accesses to information_schema.innodb_buffer_page_lru.
2020-03-19 13:01:20 +02:00
Marko Mäkelä
bfb5e1c3f0 MDEV-13626: Import and adjust buffer pool resizing tests from MySQL 5.7 2020-03-19 07:48:17 +02:00
Marko Mäkelä
e28b4b68d3 MDEV-14057: Fix some tests 2020-03-19 06:58:49 +02:00
Alexey Botchkov
a0ce62f804 MDEV-14057 InnoDB GIS tests fail.
Tests fixed.
MBR::Within() function fixed.
2020-03-18 13:55:21 +04:00
Marko Mäkelä
ab0034a789 MDEV-20370 Crash after OPTIMIZE TABLE on TEMPORARY TABLE
Temporary tables are typically short-lived, and temporary tables
are assumed to be accessed only by the thread that is handling
the owning connection. Hence, they must not be subject to
defragmenting.

ha_innobase::optimize(): Do not add temporary tables to
the defragment_table() queue.
2020-03-17 16:28:16 +02:00
Thirunarayanan Balathandayuthapani
e61b99073f MDEV-14808 innodb_fts.sync fails in buildbot with wrong result
AUTO_INCREMENT values are nondeterministic after crash recovery.
While MDEV-6076 guarantees that the AUTO_INCREMENT values of committed
transactions will not roll back, it is possible that the AUTO_INCREMENT
values will be durably incremented for incomplete transactions. So
changing the test case to avoid showing the result of AUTO_INCREMENT value.
2020-03-17 19:40:13 +05:30
Alexey Botchkov
e64a3df4dc MDEV-21959 GIS error message doesn't show the wrong value, just the type.
Error message now shows the whole value.
2020-03-17 13:11:46 +04:00
Jan Lindström
069bad5e6b Add galera debug sync to galera_slave_replay test. 2020-03-11 12:10:49 +02:00
Stepan Patryshev
91aae18cc4 Enable galera.galera_ist_mariabackup and galera.mysql-wsrep#33. 2020-03-06 13:46:19 +02:00
seppo
4618c974e4
MDEV-21723 Async slave thread BF abort and replaying fixes (#1448)
If async replication slave thread conflicts with cluster replication,
then the async slave transaction should be BF aborted, and depending on the
state of async slave transaction execution, potentially also replayed.
There were problems in such BF abort implementation and the replaying was not
started.
This pull request contains fixes which make sure that if async slave thread is
marked to abort and replay, it will complete carry out the rollback and
release all locks and resources before starting the replaying. After replaying,
async slave transactions is treated as successful, so the slave thread will
continue as usual, handling next replication event.

There is also new mtr test: galera.galera_slave_replay, which stresses both a
certification failure for async slave thread and a successful BF abort
followed by replaying.
2020-02-23 10:29:42 +02:00
Thirunarayanan Balathandayuthapani
3ce49a0a52 MDEV-21563 FTS thread aborts during shutdown
- Add warning suppression in misc_debug2 test.
2020-02-20 14:04:27 +05:30
Jan Lindström
959fc0c0cc MDEV-21591 : galera.galera_rsu_add_pk MTR failed: Result content mismatch
Add missing wait condition before we check the end database state.
2020-02-17 14:01:16 +02:00
Jan Lindström
93dc3e2652 MDEV-21488 : Galera test sporadic failure on galera.galera_var_notify_cmd
Add wait condition and cleanup.
2020-02-14 08:49:18 +02:00
Jan Lindström
ed10a8cd97 MDEV-21515 : Galera test sporadic failure on galera.galera_wsrep_new_cluster: Result content mismatch
Use correct configuration and wait for nodes to reach correct state
with wait conditions.
2020-02-13 12:51:50 +02:00
Jan Lindström
6c1e0c0493 MDEV-21421 : Galera test sporadic failure on galera.galera_as_slave_gtid_myisam: Result length mismatch
In Galera 3 nodes 2 and 3 are galera nodes and node_1 should be
    non galera.
2020-02-13 10:30:40 +02:00
Jan Lindström
a6b92690e6 MDEV-21556 : galera.lp1376747-4 MTR failed: Result length mismatch
Add proper wait condition instead of sleeps.
2020-02-12 10:32:30 +02:00
Oleksandr Byelkin
594282a534 Merge branch '10.1' into 10.2 2020-02-10 14:31:39 +01:00
Jan Lindström
6fc72ce169 MDEV-21667 : Galera test failure on MW-336
Problem seems to be the fact that we did not enforce correct
applier thread numbers after every command that effects them.
Test changes only.
2020-02-09 08:55:26 +02:00
Jan Lindström
0ea8894e52 MDEV-21601 : Cleanup Galera disabled tests
* Remove those tests that will not be supported on that release.
* Make sure that correct tests are disabled and have MDEVs
* Sort test names

This should not be merged upwards.
2020-02-09 08:55:26 +02:00
Thirunarayanan Balathandayuthapani
3be751d5b9 MDEV-21608 Assertion `n_ext == dtuple_get_n_ext(dtuple)' failed during updation of PK
- n_ext value may be less than dtuple_get_n_ext(dtuple) when PK is being
updated and new record inherits the externally stored fields from
delete mark old record.
2020-02-07 16:01:31 +05:30
Thirunarayanan Balathandayuthapani
80da232576 MDEV-21563 FTS thread aborts during shutdown
- Added the test case in innodb_fts suite
- Updated copyright year in row0mysql.cc
2020-02-07 15:22:23 +05:30
Oleksandr Byelkin
a241d41195 MDEV-18027: Running out of file descriptors and eventual crash
For automatic number of opened files limit take into account number of table instances for table cache
2020-02-05 15:34:02 +01:00
Thirunarayanan Balathandayuthapani
a134ec3736 MDEV-21550 Assertion `!table->fts->in_queue' failed in fts_optimize_remove_table
Problem:
=======
  The problem is that InnoDB doesn't add the table in fts slots if drop table fails. InnoDB marks the table is in fts slots while processing sync message. So the consecutive alter statement assumes that table is in queue and tries to remove it. But InnoDB can't find the table in fts_slots.

Solution:
=========
  i)  Removal of in_queue in fts_t while processing the fts sync message.
  ii) Add the table to fts_slots when drop table fails.
2020-01-28 18:21:00 +05:30
Marko Mäkelä
ac3e3e12ad MDEV-21509: Work around occasional lost DEBUG_SYNC 2020-01-24 14:43:19 +02:00
Vlad Lesin
7c166e68aa MDEV-14183: aria_pack segfaults in compress_maria_file
Post-push fix. aria_pack_mdev14183 test is unstable.

The fix is the following:
1. Disable the test for embedded server.
2. Create non-"transactional" Aria table in the test, as aria_pack does not
support "transactional" Aria tables.
2020-01-23 14:20:57 +03:00
Vlad Lesin
4e7f3fb833 MDEV-14183: aria_pack segfaults in compress_maria_file
Column definition order in st_maria_share::columndef can differ from
order of fields in record(see also st_maria_share::column_nr,
st_maria_columndef::column_nr, _ma_column_nr_write(),
_ma_column_nr_read()). This was not taken into account in aria_pack
tool.

The fix is to initialize elements of HUFF_COUNTS array in the correct
order.
2020-01-21 17:06:31 +03:00
Alice Sherepa
90e7e6783b MDEV-21360 save/restore debud_dbug instead of total reset at the end of the test 2020-01-21 11:22:47 +01:00
Alice Sherepa
10a5e1eccb MDEV-21360 save/restore debud_dbug instead of total reset at the end of the test 2020-01-21 11:22:47 +01:00
Oleksandr Byelkin
3a1716a7e7 Merge branch '10.1' into 10.2 2020-01-20 16:15:05 +01:00
Jan Lindström
90d39f2f91 MDEV-21532 : galera.galera_rsu_drop_pk MTR failed: Result content mismatch
Add wait conditions to make sure correct number of rows have
been replicated.
2020-01-20 13:46:44 +02:00
Marko Mäkelä
ceffabc421 Enable tests for --embedded 2020-01-20 08:41:13 +02:00
Marko Mäkelä
e47b780286 MDEV-13626: Work around DEBUG_SYNC timeouts 2020-01-20 08:41:13 +02:00
Oleksandr Byelkin
10eacd5ff7 Merge branch 'merge-perfschema-5.6' into 10.1 2020-01-19 13:11:45 +01:00
Oleksandr Byelkin
3aff3f3679 5.6.47 2020-01-19 12:52:07 +01:00
Marko Mäkelä
02af6278fb InnoDB 5.6.47 and XtraDB 5.6.46-86.2
The only change is a change of the version number.
In MySQL 5.6.46, the copyright comments in a number of files were changed
in mysql/mysql-server@f1a006ece7
but there was no functional change to InnoDB code.
This was also reflected by XtraDB. We are not changing the copyright
comments in MariaDB Server for now.

Between MySQL 5.6.46 and 5.6.47, InnoDB was not changed at all.

Actually, we had forgotten to update the InnoDB version number to
5.6.46. With this change, we are updating InnoDB
from 5.6.45 to 5.6.47 and XtraDB from 5.6.45-86.1 to 5.6.46-86.2.
2020-01-17 17:39:20 +02:00
Marko Mäkelä
3e38d15585 MDEV-21509 Possible hang during purge of history, or rollback
WL#6326 in MariaDB 10.2.2 introduced a potential hang on purge or rollback
when an index tree is being shrunk by multiple levels.

This fix is based on
mysql/mysql-server@f2c5852630
with the main difference that our version of the test case uses
DEBUG_SYNC instrumentation on ROLLBACK, not on purge.

btr_cur_will_modify_tree(): Simplify the check further.
This is the actual bug fix.

row_undo_mod_remove_clust_low(), row_undo_mod_clust(): Add DEBUG_SYNC
instrumentation for the test case.
2020-01-17 14:27:28 +02:00
Marko Mäkelä
9cae7bdcc0 MDEV-13626: Add the WL#6326 tests 2020-01-17 14:27:28 +02:00
Jan Lindström
c4195305b2 MDEV-17062 : Test failure on galera.MW-336
Add mutex protection while we calculate required slave
thread change and create them. Add error handling.
2020-01-17 12:51:18 +02:00
Jan Lindström
bb8226deab MDEV-21492 : Galera test sporadic failure on galera.galera_events2
Add wait condition for event creation.
2020-01-16 12:00:59 +02:00
Alice Sherepa
0f0c284ec0 fix for rpl_slave_load_remove_tmpfile.test 2020-01-16 10:25:01 +01:00
Jan Lindström
a382f69e24 MDEV-21498 : wsrep.binlog_format test failed on Azure
Waiting wsrep_ready is possible only if wsrep_on=ON.
2020-01-16 08:46:45 +02:00
Alice Sherepa
60d7011c5f MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
Alice Sherepa
b7fb30e930 MDEV-21360 global debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
Alice Sherepa
451573fab1 MDEV-21360 debug_dbug pre-test value restoration issues 2020-01-15 18:06:24 +01:00
Jan Lindström
800d1f3010 Disable usually failing Galera tests until a real fix is found. 2020-01-15 14:55:42 +02:00
Daniele Sciascia
7d31321464 MDEV-19803 Long semaphore wait error on galera.MW-388
The long semaphore wait appeared to be the caused by the following
pattern in the MTR test:

```
SET DEBUG_SYNC = "now SIGNAL wsrep_after_certification_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb;
```

Raising two signals, one right after another, caused one signal to
overwrite the other, before the signal was consumed by the thread.
This caused one thread to be stuck until the debug sync point would
timeout.
2020-01-14 09:11:35 +02:00
Eugene Kosov
56529a7d7f MDEV-21454 Show actual mismatching values in mismatch error messages from row_import::match_table_columns()
Patch by Hartmut Holzgraefe
2020-01-10 22:50:19 +07:00
Sujatha
41cde4fe22 MDEV-18514: Assertion `!writer.checksum_len || writer.remains == 0' failed
Analysis:
========
'max_binlog_cache_size' is configured and a huge transaction is executed. When
the transaction specific events size exceeds 'max_binlog_cache_size' the event
cannot be written to the binary log cache and cache write error is raised.
Upon cache write error the statement is rolled back and the transaction cache
should be truncated to a previous statement specific position.  The truncate
operation should reset the cache to earlier valid positions and flush the new
changes. Even though the flush is successful the cache write error is still in
marked state. The truncate code interprets the cache write error as cache flush
failure and returns abruptly without modifying the write cache parameters.
Hence cache is in a invalid state. When a COMMIT statement is executed in this
session it tries to flush the contents of transaction cache to binary log.
Since cache has partial events the cache write operation will report
'writer.remains' assert.

Fix:
===
Binlog truncate function resets the cache to a specified size. As a first step
of truncation, clear the cache write error flag that was raised during earlier
execution. With this new errors that surface during cache truncation can be
clearly identified.
2020-01-09 12:45:05 +05:30
Sujatha
8317f77ccc Merge branch '10.1' into 10.2
MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events

Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following assert when ASAN is enabled.

uint32 binlog_get_uncompress_len(const char*):
  Assertion `(buf[0] & 0xe0) == 0x80' failed

Fix:
===
**Part11: Converted debug assert to error handler code**
2020-01-07 21:29:07 +05:30
Sujatha
a6dd827a4d MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> causes a variety of failures, some of which are
listed below. It is not a race condition issue, but there is some
non-determinism in it.

Analysis:
========
"show binlog events from <pos>" code considers the user given position as a
valid event start position. The code starts reading data from this event start
position onwards and tries to map it to a set of known events. Each event has
a specific event structure and asserts have been added to ensure that read
event data satisfies the event specific requirements. When a random position
is supplied to "show binlog events command" the event structure specific
checks will fail and they result in assert.

Fix:
====
The fix is split into different parts. Each part addresses either an ASAN
issue or an assert/crash.

**Part1: Checksum based position validation when checksum is enabled**


Using checksum validate the very first event read at the user specified
position. If there is a checksum mismatch report an appropriate error for the
invalid event.
2020-01-07 18:27:05 +05:30
Marko Mäkelä
82187a1221 MDEV-21429 TRUNCATE and OPTIMIZE are being refused due to "row size too large"
By default (innodb_strict_mode=ON), InnoDB attempts to guarantee
at DDL time that any INSERT to the table can succeed.
MDEV-19292 recently revised the "row size too large" check in InnoDB.
The check still is somewhat inaccurate;
that should be addressed in MDEV-20194.

Note: If a table contains multiple long string columns so that each column
is part of a column prefix index, then an UPDATE that attempts to modify
all those columns at once may fail, because the undo log record might
not fit in a single undo log page (of innodb_page_size). In the worst case,
the undo log record would grow by about 3KiB of for each updated column.

The DDL-time check (since the InnoDB Plugin for MySQL 5.1) is optional
in the sense that when the maximum B-tree record size or undo log
record size would be exceeded, the DML operation will fail and the
transaction will be properly rolled back.

create_table_info_t::row_size_is_acceptable(): Add the parameter
'bool strict' so that innodb_strict_mode=ON can be overridden during
TRUNCATE, OPTIMIZE and ALTER TABLE...FORCE (when the storage format
is not changing).

create_table_info_t::create_table(): Perform a sloppy check for
TRUNCATE TABLE (create_fk=false).

prepare_inplace_alter_table_dict(): Perform a sloppy check for
simple operations.

trx_is_strict(): Remove. The function became unused in
commit 98694ab0cb (MDEV-20949).
2020-01-07 11:02:12 +02:00
Jan Lindström
5824e9f8df MDEV-13569: wsrep_info.plugin failed in buildbot with "no nodes coming from prim view
Modify configuration so that all nodes are part of galera cluster
i.e. wsrep_on=ON. Add missing wait conditions.

test changes only.
2020-01-07 08:57:30 +02:00
Jan Lindström
17b1b8118a MDEV-21189 : Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION sql_log_bin = 0' cases the galera node to hang
Test cleanup. Best practice for using RSU, is to isolate the node
up-front, so this test did not reflect real world scenario
2019-12-23 12:57:22 +02:00
Marko Mäkelä
73985d8301 Merge 10.1 into 10.2 2019-12-23 07:14:51 +02:00
Jan Lindström
c3824766c5 Fortify galera_partition test. 2019-12-18 10:02:57 +02:00
Jan Lindström
e9259d50f0 MDEV-21335 : Galera test failure on suite wsrep
Problem was that wsrep_on was OFF.
2019-12-18 10:02:57 +02:00
Anel Husakovic
8129ff1440 PR #1127 and PR #1150
PR#1127: Fix is_check_constraints.result to be compatibile with 10.3

The patch is done according to the original patch for MDEV-14474
1edd09c325 and not one which is merged on server
d526679efd.
This patch includes:
- Rename from `is_check_constraint` to `is_check_constraints` to tests
and results
- Per review, change the order of fields in IS check_constraints table by adding
the column `table_name` before `constraint_name`. According to the standard
2006 there is no `table_name` column.
- Original patch and one in `10.3` supports embedded server this patch doesn't
support. After the merge `10.3` will not support also.
- Don't use patch c8b8b01b61 to change the length of `CHECK_CLAUSE` field

PR#1150: MDEV-18440: Information_schema.check_constraints possible data leak

This patch is extension of PR 1127 and includes:
- Check for table grants
- Additional test according to the MDEV specification

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2019-12-13 16:38:14 +02:00
Vlad Lesin
beec9c0e19 MDEV-21255: Deadlock of parallel slave and mariabackup (with failed log
copy thread)

mariabackup hangs waiting until innodb redo log thread read log till certain
LSN, and it waits under FTWRL. If there is redo log read error in the thread,
it is finished, and main thread knows nothing about it, what leads to hanging.
As it hangs under FTWRL, slave threads on server side can be blocked due
to MDL lock conflict.

The fix is to finish mariabackup with error message on innodb redo log read
failure.
2019-12-12 13:28:30 +03:00
Marko Mäkelä
f2d3b2eede Cleanup test sys_vars.innodb_buffer_pool_size_basic
When using huge pages, the innodb_buffer_pool_size cannot necessarily
be restored. Simplify things by restarting the server.
2019-12-10 17:01:36 +02:00
Marko Mäkelä
41e6a154ec MDEV-14482 - Cache line contention on ut_rnd_interval()
InnoDB RNG maintains global state, causing otherwise unnecessary bus
traffic. Even worse, this is cross-mutex traffic. That is, different
mutexes suffer from contention.

Fixed delay of 4 was verified to give best throughput by OLTP update
index and read-write benchmarks on Intel Broadwell (2/20/40) and
ARM (1/46/46).

This is a backport of ce04790065 from
MariaDB Server 10.3.
2019-12-10 17:01:36 +02:00
Marko Mäkelä
b1f2d3a8c8 MDEV-21256: Replace the 64-bit LCG with a 32-bit Galois LFSR
We should not need anywhere near 32 bits of entropy, so we might
just limit ourselves to a 32-bit random number generator.

Also, it might be cheaper to use exclusive-or, bit shifting and
conditional jumps, instead of multiplication and addition.

We use relaxed atomic operations on the global random number generator
state in order in an attempt to silence any warnings about race conditions.
There is an obvious race condition between the load and store in
ut_rnd_gen(), but we do not think that it matters much that the
state of the random number generator could 'stutter'.

This change seems makes the 'uncompress_ops' nondeterministic
in innodb_zip.cmp_per_index after the restart. It looks like
there is an inherent race condition in the test, because the
table could be opened for InnoDB statistics recalculation
already before innodb_cmp_per_index_enabled was set. We might
end up having uncompress_ops anywhere between 0 and 9, or perhaps
even more. Let us remove that part of the test.
2019-12-10 16:59:34 +02:00
Jan Lindström
59e14b9684 MDEV-21189: Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION sql_log_bin = 0' cases the galera node to hang
Found two bugs

(1) have_committing_connections was missing mutex unlock on one
exit case. As this function is called on a loop it caused mutex
lock when we already owned the mutex. This could cause hang.

(2) wsrep_RSU_begin did set up error code when partition to
be dropped could not be MDL-locked because of concurrent
operations but wrong error code was propagated to upper layer
causing error to be ignored. This could have also caused
the hang.
2019-12-09 08:14:39 +02:00
Jan Lindström
2b7e461cc0 MDEV-21209 : mysql_tzinfo_to_sql's Galera checks do not work
wsrep_on parameter can be visible even when wsrep_on is set OFF
so we need to check variable_value from I_S also.
2019-12-05 12:41:13 +02:00
Jan Lindström
c9b9eb3315 MDEV-18497 : CTAS async replication from mariadb master crashes galera nodes (#1410)
In MariaDB 10.2 master could have been configured so that there
is extra annotate events. When we peak next event type for CTAS we
need to skip annotate events.
2019-12-04 11:46:37 +02:00
Oleksandr Byelkin
f7d35ffc76 Galera test fix after merge. 2019-12-03 20:39:16 +01:00
Oleksandr Byelkin
f8b5e147da Merge branch '10.1' into 10.2 2019-12-03 14:45:06 +01:00
Jan Lindström
88073dae79 MDEV-21198 : Galera test failure on galera_var_notify_cmd
Add proper wsrep sync wait.
2019-12-03 08:04:46 +02:00
Jan Lindström
c6ed37b88a MDEV-21182: Galera test failure on MW-284
galera_2nodes.cnf did not contain wsrep_on=1 on correct places. Fixed
restart options to use correct configuration.
2019-11-30 13:52:49 +02:00
HF
3fb0fe400c MENT-510 Failing test(s): perfschema.threads_insert_delayed.
orig_test_id should be set properly.
Also fixed sporadic test failure.
2019-11-29 21:25:52 +00:00
Vlad Lesin
bd11bd63cc MDEV-18310: Aria engine: Undo phase failed with "Got error 121 when
executing undo undo_key_delete" upon startup on datadir restored from
incremental backup

aria_log* files were not copied on --prepare --incremental-dir step from
incremental to destination backup directory.
2019-11-29 17:01:12 +03:00
Alexey Botchkov
bfa6db38cd MENT-510 Failing test(s): perfschema.threads_insert_delayed.
The thread_id of the INSERT DELAYED thread should not be set to 0.
2019-11-27 09:31:47 +04:00
Alexey Botchkov
0e403db2c8 MENT-237 Audit to show INSERT DELAYED for the executing user.
Add notifications about the user and connection that actually
did the DELAYED insert.
2019-11-27 09:23:00 +04:00
seppo
38839854b7 MDEV-19572 async slave node fails to apply MyISAM only writes (#1418)
The problem happens when MariaDB master replicates writes for only non InnoDB
tables (e.g. writes to MyISAM table(s)). Async slave node, in Galera cluster,
can apply these writes successfully, but it will, in the end, write gtid position in
mysql.gtid_slave_pos table. mysql.gtid_slave_pos table is InnoDB engine, and
this write makes innodb handlerton part of the replicated "transaction".
Note that wsrep patch identifies that write to gtid_slave_pos should not be replicated
and skips appending wsrep keys for these writes. However, as InnoDB was present
in the transaction, and there are replication events (for MyISAM table) in transaction
cache, but there are no appended keys, wsrep raises an error, and this makes the söave
thread to stop.

The fix is simply to not treat it as an error if async slave tries to replicate a write
set with binlog events, but no keys. We just skip wsrep replication and return successfully.

This commit contains also a mtr test which forces mysql.gtid_slave_pos table isto be
of InnoDB engine, and executes MyISAM only write through asyn replication.

There is additional fix for declaring IO and background slave threads as non wsrep.
These threads should not write anything for wsrep replication, and this is just a safeguard
to make sure nothing leaks into cluster from these slave threads.
2019-11-26 08:49:50 +02:00
Eugene Kosov
899c5bd5aa MDEV-20832 Don't print "row size too large" warnings in error log if innodb_strict_mode=OFF and log_warnings<=2
create_table_info_t::row_size_is_acceptable(): add condition for log writing
2019-11-20 19:48:03 +07:00
Marko Mäkelä
b80df9eba2 MDEV-21069 Crash on DROP TABLE if the data file is corrupted
buf_read_ibuf_merge_pages(): Discard any page numbers that are
outside the current bounds of the tablespace, by invoking the
function ibuf_delete_recs() that was introduced in MDEV-20934.
This could avoid an infinite change buffer merge loop on
innodb_fast_shutdown=0, because normally the change buffer merge
would only be attempted if a page was successfully loaded into
the buffer pool.

dict_drop_index_tree(): Add the parameter trx_t*.
To prevent the DROP TABLE crash, do not invoke btr_free_if_exists()
if the entire .ibd file will be dropped. Thus, we will avoid a crash
if the BTR_SEG_LEAF or BTR_SEG_TOP of the index is corrupted,
and we will also avoid unnecessarily accessing the to-be-dropped
tablespace via the buffer pool.

In MariaDB 10.2, we disable the DROP TABLE fix if innodb_safe_truncate=0,
because the backup-unsafe MySQL 5.7 WL#6501 form of TRUNCATE TABLE
requires that the individual pages be freed inside the tablespace.
2019-11-19 00:07:06 +02:00
Jan Lindström
c6b097ab37 Remove excessive sleep from test. 2019-11-18 15:22:01 +02:00