Commit graph

187545 commits

Author SHA1 Message Date
Daniel Bartholomew
4548e74bcc
bump the VERSION 2020-11-03 10:58:05 -05:00
Jan Lindström
2391582ec3 Merge remote-tracking branch 10.2 into 10.3 2020-11-03 09:00:23 +02:00
Jan Lindström
94859d985e Clean up wsrep.variables 2020-11-03 08:49:10 +02:00
Monty
a876121d24 MDEV-23824 SIGSEGV in end_io_cache on REPAIR LOCAL TABLE for Aria table
Bugs fixed:
- prepare_for_repair() didn't close all open files if table opened failed
  because of out-of-memory
- If dd_recreate_table() failed, the data file was not properly restored
  from it's temporary name
- Aria repair initializing code didn't properly clear all used structs
  before calling error, which caused crashed in memory-free calls.
- maria_delete_table() didn't register if table open failed. This could
  calls my_error() to be called without returning 1 to the caller, which
  cased failures in my_ok()

Note when merging to 10.5:
- Remove the #if MYSQL_VERSION from sql_admin.cc
2020-11-02 17:15:36 +02:00
Marko Mäkelä
e6290a8270 Merge 10.2 into 10.3 2020-11-02 16:02:16 +02:00
Marko Mäkelä
3fe306c891 fixup a593e03d58: nullptr
C++11 is allowed only starting with MariaDB Server 10.4.
2020-11-02 16:01:32 +02:00
Marko Mäkelä
c7f322c91f Merge 10.2 into 10.3 2020-11-02 15:48:47 +02:00
Marko Mäkelä
8036d0a359 MDEV-22387: Do not violate __attribute__((nonnull))
This follows up commit
commit 94a520ddbe and
commit 7c5519c12d.

After these changes, the default test suites on a
cmake -DWITH_UBSAN=ON build no longer fail due to passing
null pointers as parameters that are declared to never be null,
but plenty of other runtime errors remain.
2020-11-02 14:19:21 +02:00
Marko Mäkelä
d2fab68667 Merge bb-10.2-release into 10.2 2020-11-02 14:17:15 +02:00
Marko Mäkelä
ff0b6122a1 MDEV-23630 fixup: main.mysqldump result
This was missed in commit d6ea03fa94.
2020-11-02 14:17:09 +02:00
Sergei Petrunia
a593e03d58 Add dbug_print_sel_arg() debugging help function 2020-11-01 14:33:57 +03:00
Elena Stepanova
d5ce782444 List of unstable tests for 10.3.26 release 2020-11-01 02:56:29 +02:00
Daniel Black
d6ea03fa94 MDEV-23630: mysqldump logically dump system table information
Add --system={all, users, plugins, udfs, servers, stats, timezones}

This will dump system information from the server in
a logical form like:
* CREATE USER
* GRANT
* SET DEFAULT ROLE
* CREATE ROLE
* CREATE SERVER
* INSTALL PLUGIN
* CREATE FUNCTION

"stats" is the innodb statistics tables or EITS and
these are dumped as INSERT/REPLACE INTO statements
without recreating the table.

"timezones" is the collection of timezone tables
which are important to transfer to generate identical
results on restoration.

Two other options have an effect on the SQL generated by
--system=all. These are mutually exclusive of each other.
* --replace
* --insert-ignore

--replace will include "OR REPLACE" into the logical form
like:
* CREATE OR REPLACE USER ...
* DROP ROLE IF EXISTS (MySQL-8.0+)
* CREATE OR REPLACE ROLE ...
* UNINSTALL PLUGIN IF EXISTS (10.4+) ... (before INSTALL PLUGIN)
* DROP FUNCTION IF EXISTS (MySQL-5.7+)
* CREATE OR REPLACE [AGGREGATE] FUNCTION
* CREATE OR REPLACE SERVER

--insert-ignore uses the construct " IF NOT EXISTS" where
supported in the logical syntax.

'CREATE OR REPLACE USER' includes protection against
being run as the same user that is importing the mysqldump.

Includes experimental support for dumping mysql-5.7/8.0
system tables and exporting logical SQL compatible with MySQL.

Updates mysqldump man page, including this information and
(removing obsolute bug reference)

Reviewed-by: anel@mariadb.org
2020-11-01 08:04:36 +11:00
Elena Stepanova
6d3792a9a2 List of unstable tests for 10.2.35 release 2020-10-31 19:49:24 +02:00
Oleksandr Byelkin
794f665139 Merge branch '10.2' into 10.3 2020-10-30 17:23:53 +01:00
Marko Mäkelä
72eea39d4c MDEV-23991 fixup: Initialize the memory
This regression was introduced in
commit afc9d00c66.
This is a partial backport of
commit 199863d72b from 10.4.
2020-10-30 12:58:16 +02:00
Marko Mäkelä
fbcd7c0c06 Update Connector/C 2020-10-30 12:22:23 +02:00
Varun Gupta
5a0c34e4c2 MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare
The issue here was the system variable max_sort_length was being applied
to decimals and it was truncating the value for decimals to the number
of bytes set by max_sort_length.
This was leading to a buffer overflow as the values were written
to the buffer without truncation and then we moved the offset to
the number of bytes(set by max_sort_length), that are needed for comparison.

The fix is to not apply max_sort_length for fixed size types like INT,
DECIMALS and only apply max_sort_length for CHAR, VARCHARS, TEXT and
BLOBS.
2020-10-30 12:22:01 +02:00
Sergei Golubchik
c790218612 Fix RPM packaging on cmake 3.18+
cmake has caught up and since version 3.18 it started supporting
CPACK_RPM_POST_TRANS_SCRIPT_FILE, something we've supported for
two years and cmake 2.8.11. Both implementation add %posttrans tag
and rpmbuild gets confused.

Disable our implementation for cmake 3.18+
2020-10-30 10:32:59 +01:00
Jan Lindström
5482d62760 Fix sporadic test failure on galera_parallel_apply_3nodes.
Test itself is not deterministic.
2020-10-30 09:19:29 +02:00
Oleksandr Byelkin
a90b15837c MDEV-19838: fix of error messages 2020-10-29 22:20:21 +01:00
Oleksandr Byelkin
f9b0ee07ef MDEV-19838: followup, fix for PS & embedded
Use 9 byte (min length packet)
2020-10-29 22:19:32 +01:00
Monty
14d43f4fa6 MDEV-23222 SIGSEG in maria_create() because of double free
The crash happens because a double free in the case CREATE TABLE fails
because there is a conflicting tables on disk.

Fixed by ensuring that the double free can't happen.
2020-10-29 18:34:26 +02:00
Monty
4c99e3e948 Fixed bug in detection of getgrouplist parameters.
On my system, OpenSuse, I got a compilation error that some arguments
to getgrouplist() where not initialized
2020-10-29 17:36:49 +02:00
Monty
14798d3cd1 MDEV-23159 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2'...
The problem was that opt_sum_query() was, as part of MIN/MAX optimization,
doing read operations on constant tables that where already closed

Fixed by ensuring we don't try to read from tables that are closed.
2020-10-29 16:22:30 +02:00
Oleksandr Byelkin
2e5450af05 Merge branch '10.1' into 10.2 2020-10-29 15:16:53 +01:00
Sergei Golubchik
17cf27f5b6 remove non-working debug assert
and restore the test modified in the same commit
(the non-replication related deadlock will be reported separately)
2020-10-29 09:35:39 +01:00
Sergei Golubchik
d6302c9a47 MDEV-23702 calculating(auto rounding) issue
Implement a different fix for
"MDEV-19232: Floating point precision / value comparison problem"

Instead of truncating decimal values after every division,
truncate them for comparison purposes.

This reverts commit 62d73df6b2 but keeps the test.
2020-10-29 09:27:56 +01:00
Sergei Golubchik
313cf9de2c update result files after backport
followup for 3e807d255e and eae10a87ff
2020-10-29 09:27:05 +01:00
Oleksandr Byelkin
eae10a87ff Move result files at the correct place. 2020-10-29 08:29:03 +01:00
Lawrin Novitsky
4b854d4795 MDEV-19838 Wrong direxec param data caused crash
In case of direct execution(stmtid=-1, mariadb_stmt_execute_direct in C
API) application is in control of how many parameters client sends to
the server. In case this number is not equal to actual query parameters
number, the server may start to interprete packet data incorrectly, e.g.
starting from the size of null bitmap. And that could cause it to crash
at some point. The commit introduces some additional COM_STMT_EXECUTE
packet sanity checks:
- checking that "types sent" byte is set, and the value is equal to 1.
  if it's not direct execution, then that value is 0 or 1.
- checking that parameter type value is a valid type, and parameter
  flags value is 0 or only "unsigned" bit is set
- added more checks that read does not go beyond the end of the packet
2020-10-29 08:04:32 +01:00
Vlad Lesin
6cb88685c4 MDEV-24026: InnoDB: Failing assertion: os_total_large_mem_allocated >= size upon incremental backup
mariabackup deallocated uninitialized
write_filt_ctxt.u.wf_incremental_ctxt in xtrabackup_copy_datafile() when
some table should be skipped due to parsed DDL redo log record.
2020-10-29 07:39:43 +01:00
Oleksandr Byelkin
9e3e4c0e04 new CC 2020-10-29 07:39:43 +01:00
Marko Mäkelä
1e778a3b56 MDEV-21201 fixup: GCC 10.2.0 -Wparentheses
An assertion inadvertently contained an assignment and an implicit
comparison to zero. The intention was to test equality.
2020-10-29 08:02:33 +02:00
Marko Mäkelä
dee6902922 After-merge fix: sys_vars.sysvars_innodb,32bit 2020-10-28 18:48:14 +02:00
Vladislav Vaintroub
cb04c1bc64 MDEV-24040 - fix appveyor build
Old SDK is missing #define SECURITY_MAX_SID_STRING_CHARACTERS
2020-10-28 13:37:49 +01:00
Jan Lindström
d5c9f84dfc MDEV-22707 : galera got stuck after flush tables
Remove unnecessary condition and add necessary include
for non debug Galera library.
2020-10-28 14:00:37 +02:00
Oleksandr Byelkin
65e26bc1ba Merge branch '10.1' into 10.2 2020-10-28 10:56:38 +01:00
Marko Mäkelä
2b6f804490 Merge 10.2 into 10.3 2020-10-28 10:44:40 +02:00
Marko Mäkelä
a8de8f261d Merge 10.2 into 10.3 2020-10-28 10:01:50 +02:00
Marko Mäkelä
cc5f4428b8 MDEV-23693 fixup: Remove unused btr_search_t::withdraw_clock 2020-10-28 08:13:06 +02:00
Marko Mäkelä
527ade2590 MDEV-23163 Merge new release of InnoDB 5.7.32 to 10.2
All relevant InnoDB changes from MySQL 5.7.32 have been applied
in preceding commits.
2020-10-28 07:27:18 +02:00
Vladislav Vaintroub
3829b408d6 MDEV-24040 Named pipe permission issue
Tighten access control - deny FILE_CREATE_PIPE_INSTANCE permission to
everyone except current user (the one that runs mysqld)
2020-10-27 22:39:21 +01:00
Eugene Kosov
afc9d00c66 MDEV-23991 dict_table_stats_lock() has unnecessarily long scope
Patch removes dict_index_t::stats_latch. Table/index statistics now
protected with dict_sys->mutex. That way statistics computation can
happen in parallel in several threads and dict_sys->mutex will be locked
only for a short period of time.

This patch is a joint work with Marko Mäkelä

dict_index_t:🔒 make mutable which allows to pass const pointer
when only lock is touched in an object

btr_height_get()
btr_get_size(): make index argument const for better type safety

btr_estimate_number_of_different_key_vals(): now returns computed values
instead of setting fields in dict_index_t directly

remove everything related to dict_index_t::stats_latch

dict_stats_index_set_n_diff(): now returns computed values instead
of setting fields in dict_index_t directly

dict_stats_analyze_index():  now returns computed values instead
of setting fields in dict_index_t directly

Reviewed by: Marko Mäkelä
2020-10-27 19:09:20 +03:00
Anel Husakovic
e183aec1d7 MDEV-24018: SIGSEGV in Item_func_nextval::update_table on SELECT SETVAL
Reviewed-by: wlad@mariadb.com
2020-10-27 15:17:54 +01:00
Marko Mäkelä
42e1815ad8 MDEV-16952 Introduce SET GLOBAL innodb_max_purge_lag_wait
Let us introduce a dummy variable innodb_max_purge_lag_wait
for waiting that the InnoDB history list length is below
the user-specified limit. Specifically,

SET GLOBAL innodb_max_purge_lag_wait=0;

should wait for all history to be purged. This could be useful
when upgrading from an older version to MariaDB 10.3 or later,
to avoid hitting MDEV-15912.

Note: the history cannot be purged if there exist transactions
that may see old versions.

Reviewed by: Vladislav Vaintroub
2020-10-27 15:47:18 +02:00
Alexey Botchkov
8761571a71 MDEV-22524 SIGABRT in safe_mutex_unlock with
session_track_system_variables and max_relay_log_size.

lock LOCK_global_system_variables around the get_one_variable() call
in the Session_sysvars_tracker::store_variable().
2020-10-27 16:44:11 +04:00
Thirunarayanan Balathandayuthapani
bc540b8706 MDEV-23693 Failing assertion: my_atomic_load32_explicit(&lock->lock_word, MY_MEMORY_ORDER_RELAXED) == X_LOCK_DECR
InnoDB frees the block lock during buffer pool shrinking when other
thread is yet to release the block lock.  While shrinking the
buffer pool, InnoDB allows the page to be freed unless it is buffer
fixed. In some cases, InnoDB releases the latch after unfixing the
block.

Fix:
====
- InnoDB should unfix the block after releases the latch.

- Add more assertion to check buffer fix while accessing the page.

- Introduced block_hint structure to store buf_block_t pointer
and allow accessing the buf_block_t pointer only by passing a
functor. It returns original buf_block_t* pointer if it is valid
or nullptr if the pointer become stale.

- Replace buf_block_is_uncompressed() with
buf_pool_t::is_block_pointer()

This change is motivated by a change in mysql-5.7.32:
mysql/mysql-server@46e60de444
Bug #31036301 ASSERTION FAILURE: SYNC0RW.IC:429:LOCK->LOCK_WORD
2020-10-27 18:30:00 +05:30
mkaruza
6a614d6934 MDEV-22707: galera got stuck after flush tables
Deadlock is possible between applier thread and local committing thread with active FLUSH TABLE.
Applier thread should skip table share checks and locks when opening table.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2020-10-27 11:28:45 +02:00
Sergei Golubchik
d03ea82759 test case for BUG#31650096 2020-10-27 09:24:15 +01:00