Commit graph

188369 commits

Author SHA1 Message Date
Olivier Bertrand
85f2217cc8 - Update grant tests for new MariaDB version 10.1.44
modified:   storage/connect/mysql-test/connect/disabled.def
  modified:   storage/connect/mysql-test/connect/r/grant.result
  modified:   storage/connect/mysql-test/connect/r/ini_grant.result
  modified:   storage/connect/mysql-test/connect/r/mysql_grant.result
  modified:   storage/connect/mysql-test/connect/r/xml2_grant.result
  modified:   storage/connect/mysql-test/connect/r/xml_grant.result
  modified:   storage/connect/mysql-test/connect/t/grant.inc
  modified:   storage/connect/mysql-test/connect/t/grant.test
  modified:   storage/connect/mysql-test/connect/t/grant2.test
  modified:   storage/connect/mysql-test/connect/t/ini_grant.test
  modified:   storage/connect/mysql-test/connect/t/mysql_grant.test
2020-01-12 00:52:46 +01:00
Olivier Bertrand
54449161f8 Merge with last MariaDB version 2020-01-11 18:34:57 +01:00
Olivier Bertrand
98f70fa26b - Fix MDEV-21450
Failed compile when XML table type is not supported.
  Was because XMLDEF was unconditionally called from REST table.
  modified:   storage/connect/tabrest.cpp
2020-01-11 16:05:39 +01:00
Marko Mäkelä
90002480e9 MDEV-18115: Remove OS_AIO_LOG and IORequest::LOG 2020-01-10 19:08:46 +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
Marko Mäkelä
f7da495a78 MDEV-18115: Remove some redundant comparisons
Now that FIL_TYPE_LOG no longer exists, let us remove some redundant
comparisons of fil_space_t::purpose.

fil_flush_low(): Do not distinguish FIL_TYPE_TEMPORARY.

fil_space_get_space(): Assume that space->purpose is valid.
2020-01-10 15:12:07 +02:00
Eugene Kosov
314a14f20d MDEV-18115 redo log is not affected by srv_file_flush_method anymore 2020-01-09 22:45:46 +07:00
Olivier Bertrand
0b624debdf Update to version 1.07 (as for MariaDB 10.2) 2020-01-09 16:10:25 +01:00
Eugene Kosov
3a3605f4b1 MDEV-21382 fix compilation without perfschema plugin 2020-01-09 16:57:15 +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
Marko Mäkelä
9cd6b230ac MDEV-20839: Re-enable the test
The merge commit 68fe5f534c missed this.
2020-01-09 09:03:30 +02:00
Marko Mäkelä
c62efb083c MDEV-21174: Remove a bogus comment 2020-01-08 18:23:55 +02:00
Vladislav Vaintroub
983163209d MDEV-21444 : Fix socket leak if AcceptEx() return WSAECONNRESET.
Also, ignore/retry on ERROR_NETNAME_DELETED in addition to
WSAECONNRESET.
This is how golang handles failing AcceptEx(), see
c7ef348bad
2020-01-08 16:53:09 +01:00
Eugene Kosov
cba9ed1279 fix compilation 2020-01-08 20:18:50 +07:00
Marko Mäkelä
c4de197a0a MDEV-21174: Optimize page_set_autoinc()
page_set_autoinc(): Check if any change would take place,
and omit the mtr_t::OPT parameter. This should avoid
unnecessarily redo log writes for ROW_FORMAT=COMPRESSED pages.
2020-01-08 14:08:00 +02:00
Sujatha
a0eefdf32e After-merge fix: Actually apply the changes
The merge a8ed0f77a3
was accidentally a null-merge.

MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
2020-01-08 17:09:31 +05:30
Sujatha
a8ed0f77a3 Merge branch '10.4' into 10.5 2020-01-08 16:37:59 +05:30
Sujatha
4032fc1d68 Merge branch '10.3' into 10.4 2020-01-08 13:53:03 +05:30
Sujatha
b365b6e7d8 Merge branch '10.2' into 10.3 2020-01-08 13:44:06 +05:30
Eugene Kosov
3d9759a9b5 MDEV-18115 fix counter 2020-01-08 00:02:00 +07:00
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
cb204e11ea MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following ASAN error.

AddressSanitizer: heap-buffer-overflow on address
READ of size 1 at 0x60e00009cf71 thread T28
#0 0x55e37e034ae2 in net_field_length

Fix:
===
**Part10: Avoid reading out of buffer**
2020-01-07 18:27:06 +05:30
Sujatha
d05c511d34 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.

Query_log_event::Query_log_event(const char*, uint,
    const Format_description_log_event*, Log_event_type):
  Assertion `(pos) + (6) <= (end)' failed

Fix:
===
**Part9: Removed additional DBUG_ASSERT**
2020-01-07 18:27:06 +05:30
Sujatha
bac3353361 MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following ASAN error

AddressSanitizer: SEGV on unknown address
The signal is caused by a READ memory access.
User_var_log_event::User_var_log_event(char const*, unsigned int,
    Format_description_log_event const*)

Implemented part of upstream patch.
commit: mysql/mysql-server@a3a497ccf7

Fix:
===
**Part8: added checks to avoid reading out of buffer limits**
2020-01-07 18:27:05 +05:30
Sujatha
2187f1c2ca MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following ASAN error
"heap-buffer-overflow on address" and some times it asserts.

Table_map_log_event::Table_map_log_event(const char*, uint,
    const Format_description_log_event*)
Assertion `m_field_metadata_size <= (m_colcnt * 2)' failed.

Fix:
===
**Part7: Avoid reading out of buffer**


Converted debug assert to error handler code.
2020-01-07 18:27:05 +05:30
Sujatha
d6fa69e4be MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following ASAN error

AddressSanitizer: heap-buffer-overflow on address 0x60400002acb8
Load_log_event::copy_log_event(char const*, unsigned long, int,
    Format_description_log_event const*)

Fix:
===
**Part6: Moved the event_len validation to the begin of copy_log_event function**
2020-01-07 18:27:05 +05:30
Sujatha
15781283eb MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following ASAN error

AddressSanitizer: heap-buffer-overflow on address
String::append(char const*, unsigned int)
Query_log_event::pack_info(Protocol*)

Fix:
===
**Part5: Added check to catch buffer overflow**
2020-01-07 18:27:05 +05:30
Sujatha
a42ef10815 MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following ASAN error

heap-buffer-overflow within "my_strndup" in Rotate_log_event

my_strndup /mysys/my_malloc.c:254
Rotate_log_event::Rotate_log_event(char const*, unsigned int,
    Format_description_log_event const*)

Fix:
===
**Part4: Improved the check for event_len validation**
2020-01-07 18:27:05 +05:30
Sujatha
5a54e84e5d MDEV-18046: Assortment of crashes, assertion failures and ASAN errors in mysql_show_binlog_events
Problem:
========
SHOW BINLOG EVENTS FROM <pos> reports following crash when ASAN is enabled.

SEGV on unknown address
in inline_mysql_mutex_destroy
in my_bitmap_free
in Update_rows_log_event::~Update_rows_log_event()

Fix:
===
**Part3: Initialize m_cols_ai.bitmap to NULL**
2020-01-07 18:27:05 +05:30
Sujatha
913f405d95 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.

Rows_log_event::Rows_log_event(const char*, uint,
    const Format_description_log_event*):
Assertion `var_header_len >= 2'

Implemented part of upstream patch.
commit: mysql/mysql-server@a3a497ccf7

Fix:
===
**Part2: Avoid reading out of buffer limits**
2020-01-07 18:27:05 +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ä
0b4ae6724f Fixup MDEV-21429: Correct a definition
INNOBASE_ALTER_NOVALIDATE: Remove the set of operations
INNOBASE_ONLINE_CREATE that was accidentally included in the
definition.

In the merge of 82187a1221 to 10.3
(in commit eda719793a) the flags
were defined correctly.

This bug was caught by the test innodb_zip.index_large_prefix.
2020-01-07 14:38:21 +02:00
Marko Mäkelä
68fe5f534c Merge 10.4 into 10.5 2020-01-07 14:10:15 +02:00
Marko Mäkelä
d2697dfbc6 MDEV-20839 encryption.innodb-redo-badkey sporadically fails on buildbot with page dump
The test encryption.innodb-redo-badkey will by design cause access
to pages that appear corrupted (due to incorrect encryption key).
Let us disable the page dumps by requiring the test to be run on
a debug server. Page dumps on debug builds were already disabled
in MDEV-19766.
2020-01-07 13:35:32 +02:00
Elena Stepanova
d3e52ff24d MDEV-21288 innodb.full_crc32_import fails due to the use of optional compression algorithm 2020-01-07 13:26:08 +02:00
Marko Mäkelä
d60dcabd0f Merge 10.3 into 10.4 2020-01-07 13:23:41 +02:00
Thirunarayanan Balathandayuthapani
1488de674c MDEV-21344 Valgrind uninitialised value warnings in dict_acquire_mdl_shared
- For partition table, tbl_name_len is calculated wrongly. So it leads to
this uninitialised value warnings
2020-01-07 16:38:14 +05:30
Marko Mäkelä
eda719793a Merge 10.2 into 10.3 2020-01-07 12:14:35 +02:00
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
Marko Mäkelä
e99ba4ba51 Merge 10.1 into 10.2 2020-01-07 07:44:37 +02:00
Monty
8a6863002c Fixed that mtr --extern works again 2020-01-06 11:33:57 +02:00
Eugene Kosov
6f2e228529 MDEV-21382 use fdatasync() for redo log where appropriate
log_t::files::fdatasync(): syncs only data for every log file

os_file_flush_data()
pfs_os_file_flush_data_func(): syncs only data for a given file
2020-01-05 16:08:44 +07:00
Eugene Kosov
fd899b3bbd Lets add another intrusive double linked list!
Features:
* STL-like interface
* Fast modification: no branches on insertion or deletion
* Fast iteration: one pointer dereference and one pointer comparison
* Your class can be a part of several lists

Modeled after std::list<T> but currently has fewer methods (not complete yet)

For even more performance it's possible to customize list with templates so
it won't have size counter variable or won't NULLify unlinked node.

How existing lists differ?

No existing lists support STL-like interface.

I_List:
* slower iteration (one more branch on iteration)
* element can't be a part of two lists simultaneously

I_P_List:
* slower modification (branches, except for the fastest push_back() case)
* slower iteration (one more branch on iteration)

UT_LIST_BASE_NODE_T:
* slower modification (branches)

Three UT_LISTs were replaced: two in fil_system_t and one in dyn_buf_t.
2020-01-04 13:39:14 +07:00
Varun Gupta
1adc559370 Making group_by test stable 2020-01-03 22:54:28 +05:30
Eugene Kosov
d9789718b9 bling windows build fix 2020-01-04 00:23:26 +07:00
Marko Mäkelä
ccd87d34a4 MDEV-16678: Ignore #sql-ib tables in main.partition_alter
We missed this in commit 89633995e4.
2020-01-03 17:54:12 +02:00
Marko Mäkelä
ca8c3be47d Merge 10.4 into 10.5 2020-01-03 16:15:40 +02:00
Oleksandr Byelkin
9d036f840a Merge branch '10.3' into 10.4 2020-01-03 15:05:50 +01:00
Oleksandr Byelkin
7753a29064 Merge branch '10.2' into 10.3 2020-01-03 13:44:16 +01:00