Commit graph

178469 commits

Author SHA1 Message Date
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
d233fd14a3 Merge branch 'merge-pcre' into 10.1 2020-04-30 21:27:32 +02:00
Oleksandr Byelkin
4fc8961d49 Merge remote-tracking branch 'connect/10.1' into 10.1 2020-04-30 18:57:45 +02:00
Oleksandr Byelkin
da1fbcb665 Merge branch 'merge-tokudb-5.6' into 10.1 2020-04-30 18:56:55 +02:00
Oleksandr Byelkin
c1291d7a6b 8.44 2020-04-30 18:40:02 +02:00
Oleksandr Byelkin
15db581ecb 5.6.47-87.0 2020-04-30 18:29:36 +02:00
Oleksandr Byelkin
23c6fb3e62 Merge branch '5.5' into 10.1 2020-04-30 17:36:41 +02:00
Sergei Golubchik
6a31aea5a1 BUG#30301356 - SOME EVENTS ARE DELAYED AFTER DROPPING EVENT
queues.c cleanup and refactoring.

Restore old version of _downhead() (from before cd483c5520)
that works well in an average case. Use it for queue_fix().

Move existing specialized version of _downhead() to queue_replace()
where it'll be handling the case it was specifically optimized for
(moving the element to the end of the queue).
And correct it to fix the heap not only down, but also up
(this fixes BUG#30301356).

Add unit tests.

Collateral cosmetic fixes.
2020-04-30 10:13:21 +02:00
Sergei Golubchik
69bd73173d correct off-by-one error in CONCAT
CONCAT_WS didn't have it
2020-04-30 10:13:21 +02:00
Anushree Prakash B
e8e67bd4a4 Bug#30689251 - BACKPORT TO MYSQL-5.6, BUG#29597896 - NULL POINTER DEREFERENCE IN LIBMYSQL
DESCRIPTION:
============
There can be issues if the packets sent by the server
are not proper. Certain checks should be performed at the
client side while unpacking fields data.

FIX:
====
Check for the appropriate fields data and error out if it
is not present.

RB: 23601
2020-04-30 10:13:21 +02:00
Sivert Sorumgard
39c60116e8 Bug#30628268: OUT OF MEMORY CRASH
The event scheduler has a THD which is used for e.g. keeping track
of the timing of the events. Thus, each scheduling of an event will
make use of this THD, which in turn allocates memory in the THD's
mem root. However, the mem root was never cleared, and hence, the
memory occupied would monotonically increase throughout the life
time of the server.

The root cause was found by Jon Olav Hauglid, and this fix clears the
THD's mem root for each event being scheduled.

Change-Id: I462d2b9fd9658c9f33ab5080f7cd0e0ea28382df
2020-04-30 10:13:21 +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
Daniel Black
de8c9b538f
mysql-test-run.pl - fix strict subs in HAVE_WIN32_CONSOLE (#1521)
Fix mtr error:

Bareword "HAVE_WIN32_CONSOLE" not allowed while "strict subs" in use at mysql-test-run.pl line 387.
Execution of mysql-test-run.pl aborted due to compilation errors.

Added in e3f5789ac0
2020-04-30 04:03:24 +02:00
Vladislav Vaintroub
9b744ea0d3 MDEV-22419 update windows timezone data from using newest ICU source
Also fix the link to unicode.org repo, it is now on github.
2020-04-30 01:21:44 +02:00
Vladislav Vaintroub
e3f5789ac0 mysql-test-run.pl - show remaining test count and estimated time on Windows
Port this functionality from to Windows.
It requires Win32::Console module, which is already included into
Strawberry perl
2020-04-29 22:39:44 +02:00
Sergei Golubchik
8c534bdeb8 cleanup: remove dbug keywords that are never used 2020-04-29 18:17:08 +02:00
Sergei Golubchik
59880df8cd Bug#28388217 - SERVER CAN FAIL WHILE REPLICATING CONDITIONAL COMMENTS
test case
2020-04-29 14:08:54 +02:00
Maheedhar PV
4d1de554bb Bug#28388217 - SERVER CAN FAIL WHILE REPLICATING CONDITIONAL COMMENTS
Cause:
In case of version based condtional comments, if the condition evaluates
to false, it is converted to a regular comment for replication by
replacing "!"  by " ".

Nested comment in a conditional comment is replicated as is. Nested
comments are supported only in case of conditional comments and when a
the comment on slave is no more a conditional comment, the statement
execution fails on the slave.

Fix:
Convert the nested comment, start from "/*" to "(*" and comment end from
"*/" to "*)" for replication.

Change-Id: I1a8e385a267b2370529eade094f0258fa96886c0
2020-04-29 14:08:54 +02:00
Sergei Golubchik
a13157a561 don't enable -Werror in ft-index 2020-04-29 14:08:54 +02:00
Daniel Black
946c879521 vio: typo on sock{et}_errno in comment 2020-04-29 09:51:11 +02: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
Marko Mäkelä
cce1b6e245 MDEV-22392 Race condition on SET GLOBAL innodb_buffer_pool_evict='uncompressed'
innodb_buffer_pool_evict_uncompressed(): Restart the loop when
prev_block might not enjoy mutex protection.

This is based on
mysql/mysql-server@eccaecac07
2020-04-28 11:46:29 +03:00
Marko Mäkelä
cf64d27bad Remove a duplicated copyright message 2020-04-28 11:40:04 +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ä
edbdfc2f99 MDEV-7962 wsrep_on() takes 0.14% in OLTP RO
The function wsrep_on() was being called rather frequently
in InnoDB and XtraDB. Let us cache it in trx_t and invoke
trx_t::is_wsrep() instead.

innobase_trx_init(): Cache trx->wsrep = wsrep_on(thd).

ha_innobase::write_row(): Replace many repeated calls to current_thd,
and test the cheapest condition first.
2020-04-27 11:18:11 +03:00
Sergei Golubchik
dd4124c224 MDEV-22271 Excessive stack memory usage due to WSREP_LOG
fix embedded innodb_plugin tests

followup for 7198c6ab2d
2020-04-27 09:13:02 +02:00
Sergei Golubchik
f462fbac61 MDEV-22078 MariaDB-compat missing from MariaDB 10.4 CentOS 8 Yum Repo
Backport INSALL_SYMLINK cmake macro from 10.3.
It'll make libmysqlclient_r.* symlinks to link to the actual
shared library file, not to another symlink.

As a bonus it'll fix cmake warning about deprecated LOCATION property
2020-04-27 09:11:29 +02: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ä
758fbec6e3 Fix clang 10 warnings
_ma_fetch_keypage(): Correct an assertion that used to always hold.
Thanks to clang -Wint-in-bool-context for flagging this.

double_to_datetime_with_warn(): Suppress -Wimplicit-int-float-conversion
by adding a cast. LONGLONG_MAX converted to double will actually be
LONGLONG_MAX+1.
2020-04-27 09:40:34 +03:00
Marko Mäkelä
6a3fc1101c Aria: Avoid unused variables in embedded server 2020-04-27 09:40:10 +03:00
Marko Mäkelä
d28ee189b7 MDEV-22271: Follow-up fix of --embedded
Since commit 7198c6ab2d
the ./mtr --embedded tests would fail to start innodb_plugin
because of an undefined reference to the symbol wsrep_log().

Let us define a stub for that function. The embedded server
is never built WITH_WSREP, but there are no separate storage
engine builds for the embedded server. Hence, by default,
the dynamic InnoDB storage engine plugin would be built WITH_WSREP
and it would fail to load into the embedded server library due to
a reference to the undefined symbol.
2020-04-27 09:36:31 +03:00
Marko Mäkelä
ac2604f923 Correct the name of a contributor
The name was correctly encoded in UTF-8 before
commit 0ce12f70ed.
2020-04-25 14:22:54 +03:00
Anel Husakovic
bc1be39972 Fix failure for ipv6 not enabled
In case of ipv6 not enabled tests like `main.ipv6, rpl.rpl_ipv6` failed on
aarch buildbot.
Fix it by following commits 70dcb46e98 and 0bae1957dd for
`10.2`.
2020-04-24 14:05:42 +02:00
Elena Stepanova
5d856760fb MDEV-22349 MTR re-bootstrap modifies environment variable MYSQLD_BOOTSTRAP_CMD 2020-04-23 18:54:36 +03:00
Igor Babaev
29cdd50822 MDEV-21932 Another attempt to fix the bug .
The first patch for the bug was erroneous: it did not take into account
the fact that the modified function get_key_scans_params() was called in
different contexts. As a result the patch caused a regression bug MDEV-22191.
The patch for this bug introduced an extra parameter. Actually we can
do without this parameter and use the fourth parameter for the same
puropose - to differentiate between the calls of the function for range
access and for index merge access.

Also removed the call of get_key_scans_params() in the code of the function
merge_same_index_scans() as not needed.
2020-04-17 20:58:55 -07:00
Marko Mäkelä
ad4b70562b Fix GCC 10 -Woverflow
maria_page_crc_check_index(): Do not attempt to convert
HA_ERR_WRONG_CRC (176) to my_bool (char).
On platforms where char is signed, the 176 will be converted to -80.

It turns out that the callers only care whether the result is zero.
Let us return 1 in this case, like we do in all other error cases.
2020-04-17 12:02:22 +03:00
Marko Mäkelä
7198c6ab2d MDEV-22271 Excessive stack memory usage due to WSREP_LOG
Several tests that involve stored procedures fail on 10.4 kvm-asan
(clang 10) due to stack overrun. The main contributor to this stack
overrun is mysql_execute_command(), which is invoked recursively
during stored procedure execution.

Rebuilding with cmake -DWITH_WSREP=OFF shrunk the stack frame size
of mysql_execute_command() by more than 10 kilobytes in a
WITH_ASAN=ON, CMAKE_BUILD_TYPE=Debug build. The culprit
turned out to be the macro WSREP_LOG, which is allocating a
separate 1KiB buffer for every occurrence.

We replace the macro with a function, so that the stack will be
allocated only when the function is actually invoked. In this way,
no stack space will be wasted by default (when WSREP and Galera
are disabled).

This backports commit b6c5657ef2
from MariaDB 10.3.1.

Without ASAN, compilers can be smarter and optimize the stack usage.
The original commit message mentions that 1KiB was saved on GCC 5.4,
and 4KiB on Mac OS X Lion, which presumably uses a clang-based compiler.
2020-04-17 10:54:56 +03:00
Disconnect3d
280b158501 Fix wrong argument size passed to --parent-pid strncmp check
This PR fixes wrong size argument passed in `strncmp(arg, "--parent-pid", 10)` as the `"--parent-pid"` string has length of 12.

Closes #1502
2020-04-16 13:47:35 +02:00
Varun Gupta
18656797de Merge branch '5.5' into 10.1 2020-04-16 14:46:16 +05:30
Varun Gupta
b7cfd19759 Minor fixup to MDEV-22191 2020-04-16 13:11:30 +05:30
Marko Mäkelä
f8166a05af MDEV-21549 IMPORT TABLESPACE fails to adjust all tablespace ID in root pages
After MDEV-12353, the consistency check that I originally added for
commit 1b9fe0bbac
(InnoDB Plugin for MySQL 5.1) started randomly failing.

It turns out that the IMPORT TABLESPACE code was always incorrect:
it did not update the (redundantly stored) tablespace ID
in index tree root pages. It only does that for page headers
and BLOB pointers.

PageConverter::update_index_page(): Update the tablespace ID
in the BTR_SEG_TOP and BTR_SEG_LEAF of index root pages.

This is a backport of commit b8b3edff13.
2020-04-15 14:51:49 +03:00
Marko Mäkelä
a215e2132d mbstream: Remove duplicate definition of datasink_buffer
For some reason, when mbstream is compiled with GCC 10,
ld will fail to link it due to a multiple definition of
datasink_buffer. The code appears to have been like that
since the very beginning.

Let us remove the duplicate dummy definition.
2020-04-15 14:50:17 +03:00
Daniel Black
ae688808fa mtr: Only old windows patch-2.5.9 needs --binary
Windows GNU patch 2.7.6 is ok without it.

So account for the old buildbot version for now.

Linux works without it.

--binary fails on FreeBSD-12.0:

$ patch --version
patch 2.0-12u11 FreeBSD
$ patch --binary
patch: unrecognized option `--binary'
2020-04-14 16:58:53 +03:00
Marko Mäkelä
26f0cd8afc Merge 5.5 into 10.1 2020-04-14 15:43:12 +03:00
Vicențiu Ciorbaru
0b7a79c6b0 Revert "mtr: remove --binary from patch args"
This reverts commit 1749a68968.

The reason why we need --binary for patch is because of a bug in
patch.exe 2.5.9. We need to supply binary otherwise the patch program
crashes.
2020-04-13 16:25:32 +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
Daniel Black
7937fed917 appveyor: config backport from 10.2
Include CMAKE_C{XX,}_FLAGS=/W0 as 10k warnings
exist in 10.1 branch which cause the build to fail.
2020-04-13 13:49:41 +03:00
Daniel Black
1749a68968 mtr: remove --binary from patch args
This causes problems on FreeBSD which doesn't have a patch
that supports this.

Linux and Windows don't require it either.

Was added in c39877071a without
explaination.
2020-04-13 13:49:39 +03:00
Varun Gupta
c1394ab6b5 MDEV-22191: Range access is not picked when index_merge_sort_union is turned off
When index_merge_sort_union is turned off only ror scans were considered for range
scans, which is wrong.
To fix the problem ensure both ror scans and non ror scans are considered for range
access
2020-04-08 23:47:03 +05:30