Commit graph

67793 commits

Author SHA1 Message Date
Varun Gupta
76f4ae8295 MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next
Initialize the parameter PARAM::max_key_part when we iterate over the ranges to get estimates
from EITS.
2020-05-26 01:57:00 +05:30
Alexander Barkov
cb9c49a9b2 MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
The code incorrectly assumed in multiple places that TYPELIB
values cannot have 0x00 bytes inside. In fact they can:

  CREATE TABLE t1 (a ENUM(0x61, 0x0062) CHARACTER SET BINARY);

Note, the TYPELIB value encoding used in FRM is ambiguous about 0x00.

So this fix is partial.

It fixes 0x00 bytes in many (but not all) places:

- In the middle or in the end of a value:
    CREATE TABLE t1 (a ENUM(0x6100) ...);
    CREATE TABLE t1 (a ENUM(0x610062) ...);

- In the beginning of the first value:
    CREATE TABLE t1 (a ENUM(0x0061));
    CREATE TABLE t1 (a ENUM(0x0061), b ENUM('b'));

- In the beginning of the second (and following) value of the *last* ENUM/SET
  in the table:

    CREATE TABLE t1 (a ENUM('a',0x0061));
    CREATE TABLE t1 (a ENUM('a'), b ENUM('b',0x0061));

However, it does not fix 0x00 when:

- 0x00 byte is in the beginning of a value of a non-last ENUM/SET
  causes an error:

   CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
   ERROR 1033 (HY000): Incorrect information in file: './test/t1.frm'

  This is an ambuguous case and will be fixed separately.
  We need a new TYPELIB encoding to fix this.

Details:

- unireg.cc

  The function pack_header() incorrectly used strlen() to detect
  a TYPELIB value length. Adding a new function typelib_values_packed_length()
  which uses TYPELIB::type_lengths[n] to detect the n-th value length,
  and reusing the new function in pack_header() and packed_fields_length()

- table.cc
  fix_type_pointers() assumed in multiple places that values cannot have
  0x00 inside and used strlen(TYPELIB::type_names[n]) to set
  the corresponding TYPELIB::type_lengths[n].

  Also, fix_type_pointers() did not check the encoded data for consistency.

  Rewriting fix_type_pointers() code to populate TYPELIB::type_names[n] and
  TYPELIB::type_lengths[n] at the same time, so no additional loop
  with strlen() is needed any more.

  Adding many data consistency tests.

  Fixing the main loop in fix_type_pointers() to use memchr() instead of
  strchr() to handle 0x00 properly.

  Fixing create_key_infos() to return the result in a LEX_STRING rather
  that in a char*.
2020-05-22 07:47:49 +04:00
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
Rasmus Johansson
a6b4d4beff MDEV-22631 fix 2020-05-20 09:59:49 +00: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
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
Rasmus Johansson
395ed66b3b MDEV-22636 XML output for mtr doesn't work with valgrind option 2020-05-19 15:23:29 +00:00
Rasmus Johansson
e9a33a5392 MDEV-22631 some test causes MTR interruption without generating summary and XML 2020-05-19 10:51:28 +00: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
Daniel Black
7baa40dffa
MDEV-21976: mtr main.udf - broaden localhost (#1543)
Localhost, depending on the platform can return any
127.0.0.1/8 address.
2020-05-18 09:37:51 +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
Varun Gupta
efd68f5e31 MDEV-22498: SIGSEGV in Bitmap<64u>::merge on SELECT
For the case when the optimizer does the IN-EXISTS transformation,
the equality condition is injected in the WHERE OR HAVING clause of
the subquery. If the select list of the subquery has a reference to
the parent select make sure to use the reference and not the original
item.
2020-05-14 23:24:10 +05:30
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
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
Oleksandr Byelkin
23d3d180ca Merge branch '10.1-release' into 10.1 2020-05-11 19:09:46 +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
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
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
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
Vladislav Vaintroub
1af74d523a postfix after e3f5789ac0 - var/log/stdout.log contains escape sequences. 2020-05-05 12:49:29 +02:00
Elena Stepanova
ccb58b955e List of unstable tests for 10.1.45 release 2020-05-05 01:46:25 +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
Rasmus Johansson
dc2a858bed MDEV-22270 JUnit patch: test name contains classname 2020-05-04 15:53:04 +00: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
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
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
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
59880df8cd Bug#28388217 - SERVER CAN FAIL WHILE REPLICATING CONDITIONAL COMMENTS
test case
2020-04-29 14:08:54 +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ä
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
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
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
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
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
Rasmus Johansson
5720db2b43 MDEV-22176 Add JUnit support to MTR to generate XML test result
A new parameter has been added called xml-report, with which the
filename of the XML file is given to which the XML result is
written. There is also xml-package for adding a package value in
the XML output. Example usage:
./mysql-test-run.pl main.events_bugs innodb.count_distinct
main.explain_json innodb.file_format_defaults json.json_no_table
--suite=main,innodb,json --force --xml-report=build123456789.xml
--xml-package=simpletestrun
2020-04-07 09:27:51 +00:00
Marko Mäkelä
f813131c7b Merge 5.5 into 10.1 2020-04-01 10:24:36 +03:00
Oleksandr Byelkin
f9639c2d1a MDEV-22037: Add ability to skip content of some tables (work around for MDEV-20939)
--ignore-table-data parameter added.
2020-03-25 16:03:22 +01:00