Commit graph

190811 commits

Author SHA1 Message Date
Sujatha
25ede13611 Merge branch '10.4' into 10.5 2020-09-29 16:59:36 +05:30
Igor Babaev
79e32e47a1 MDEV-23778 Derived table handler looses data on conversion from HEAP to Aria
This bug happened when the HEAP temporary table used for the derived table
created for a derived handler of a remote engine of the federated type
became full and was converted to an Area table. For this conversion
the tmp_table_param parameter must be always taken from the select_unit
object created for the result of the derived table.
2020-09-28 15:16:28 -07:00
Sujatha
ce845b7a2f Merge branch '10.3' into 10.4 2020-09-28 17:55:39 +05:30
Sujatha
6cbbd6bd96 Merge branch '10.2' into 10.3 2020-09-28 17:27:42 +05:30
Jan Lindström
842616532a MDEV-23659 : Update Galera disabled.def file
Fix typo.
2020-09-28 14:40:00 +03:00
Daniele Sciascia
7edfb72eff Fix MTR test wsrep.variables
Require galera_have_debug_sync.inc and re-record to include new
variables exposed by latest galera library.
2020-09-28 12:17:05 +03:00
Sujatha
3a5e719e00 Merge branch '10.1' into 10.2 2020-09-28 14:03:46 +05:30
Jan Lindström
c078f55f47 MDEV-23659 : Update Galera disabled.def file
This will update galera_3nodes/disabled.def.
2020-09-28 11:05:09 +03:00
Vladislav Vaintroub
a6987d9fb9 MDEV-23823 Crash in SELECT NEXT VALUE on locked view
Make open_table() fail if sequence should be opened, but it turns out to
be locked view.
2020-09-28 09:49:46 +02:00
Sujatha
15cd919535 MDEV-22330: mysqlbinlog stops with an error Don't know how to handle column type: 255 meta: 4 (0004)
Analysis:
========
"mysqlbinlog -v" option will reconstruct row events and display them as
commented SQL statements. If this option is given twice, the output includes
comments to indicate column data types and some metadata.
`log_event_print_value` is the function reponsible for printing values and
their types. This function doesn't handle GEOMETRY type. Hence the above error
gets printed.

Fix:
===
Add support for GEOMETRY datatype.
2020-09-28 12:52:09 +05:30
Alexander Barkov
080522dcd7 MDEV-23825 Join select_handler and Pushdown_select + XPand changes 2020-09-27 10:30:23 +04:00
Vladislav Vaintroub
d111e6ae0c Fix clang-cl build 2020-09-27 01:02:22 +02:00
Monty
e0f5e7bc9e Reverted wrong patch for mysql_upgrade
The original code was correct. mysql_upgrade calls the mysql client to
talk with MariaDB. It doesn't call itself!
2020-09-26 08:57:56 +10:00
Thirunarayanan Balathandayuthapani
e8b05ce503 MDEV-23675 Assertion `pos < table->n_def' fails in dict_table_get_nth_col
- During insertion of clustered inde, InnoDB does the check for
foreign key constraints. It rebuild the tuple based on foreign
column names when there is no foreign index. While rebuilding,
InnoDB should ignore the dropped columns.
2020-09-25 21:42:24 +05:30
Marko Mäkelä
d34523faee MDEV-15053 fixup: Remove redundant code
fil_node_t::close_to_free(): Remove some duplicated code that was added in
commit b1ab211dee.
2020-09-25 17:29:33 +03:00
Marko Mäkelä
50c9687013 MDEV-23807 ut_a(n_pending_flushes) failed in fil_node_t::prepare_to_close_or_detach()
Before closing file handles, we really must wait until there are no
pending os_file_flush(). This was missed in
commit b1ab211dee (MDEV-15053)
where we changed the following:

    fil_node_close_to_free(): Wait for n_pending==0. Because we no longer
    do an extra lookup of the tablespace between fil_io() and the
    completion of the operation, we must give fil_node_t::complete_io() a
    chance to decrement the counter.
2020-09-25 17:28:54 +03:00
Monty
6a1376252d Reverted wrong patch for mysql_upgrade
The original code was correct. mysql_upgrade calls the mysql client to
talk with MariaDB. It doesn't call itself!
2020-09-25 15:58:08 +03:00
Monty
71a7b79bcb Added asssert to init_of_queries() to make it more safe
Part of review of 10.4 code by Sergei.

Other things:

- Changed return type if is_active() from my_bool to bool as this is
  only used by C++ code.
2020-09-25 13:38:48 +03:00
Monty
bb2c958132 MDEV-23296 Assertion `block->type == PAGECACHE_EMPTY_PAGE.. with aria_max_sort_file_size=0
When maria_drop_all_indexes() reset the key files, it didn't flush
the page cache. This confused the cache as there where old key blocks
marked with LSN in it and repair tried to overwrite these with PLAIN
blocks which is not allowed.
2020-09-25 13:07:04 +03:00
Monty
92b5a8bb65 MDEV-17665 Assertion `!share and other errors on concurrent Aria operations
Fixes also:
MDEV-22674 Server crash in compare_bin ... restore_table_state_after_repair

The bug was that the 'can_enable_index' variable in MyISAM and Aria was
not properly set and reset for bulk insert.
Because of this, insert...select was trying to recreate indexes while
another thread was using it, causing crashes in page cache.
2020-09-25 13:07:04 +03:00
Monty
8819b5eea5 MDEV-23318 Assertion `cache_empty(keycache)' failed in prepare_resize_simple_key_cache
The reason was that during MyISAM parallel repair two threads used the
same changed TABLE object to compute virtual columns

Fixed by adding a mutex in compute_vcols()
2020-09-25 13:07:04 +03:00
Monty
0b73ef0688 MDEV-21470 ASAN heap-use-after-free in my_hash_sort_bin
The problem was that the server was calling virtual functions on a record
that was not initialized with new data.
This happened when fill_record() was aborted in the middle because an
error in save_val() or save_in_field()
2020-09-25 13:07:04 +03:00
Monty
895e9950b2 Fix for timeout in rpl.rpl_parallel_retry
MDEV-17109 rpl.rpl_parallel_retry fails in buildbot with timeout

I was not able to prove that this fix works, but at least it simplifies
the problem as it removes some possible timing issues.
2020-09-25 13:07:04 +03:00
Monty
16ea692ed4 MDEV-23586 Mariabackup: GTID saved for replication in 10.4.14 is wrong
MDEV-21953 deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
replication

Fixed by partly reverting MDEV-21953 to put back MDL_BACKUP_COMMIT locking
before log_and_order.

The original problem for MDEV-21953 was that while a thread was waiting in
for another threads to commit in 'log_and_order', it had the
MDL_BACKUP_COMMIT lock. The backup thread was waiting to get the
MDL_BACKUP_WAIT_COMMIT lock, which blocks all new MDL_BACKUP_COMMIT locks.
This causes a deadlock as the waited-for thread can never get past the
MDL_BACKUP_COMMIT lock in ha_commit_trans.

The main part of the bug fix is to release the MDL_BACKUP_COMMIT lock while
a thread is waiting for other 'previous' threads to commit. This ensures
that no transactional thread keeps MDL_BACKUP_COMMIT while waiting, which
ensures that there are no deadlocks anymore.
2020-09-25 13:07:03 +03:00
Monty
3cdbaa04bd Fixed BUILD script to make plugin-file_key_management DYNAMIC
This ensures that all tests can be run.
Before this patch some encryption test failed
2020-09-25 12:44:04 +03:00
Monty
920824c24e Backported setting of transcation.on=1 in THD::reset_for_reuse()
This is to ensure code in 10.4 and 10.5 is logically identical for this
variable
2020-09-25 12:44:04 +03:00
Marko Mäkelä
1adb537806 MDEV-23456: After-merge fix
In merge commit 3421223363
buf_page_create() passed the wrong parameter to
one of the buf_LRU_block_free_non_file_page() calls.
2020-09-24 16:16:16 +03:00
Marko Mäkelä
e57c1167ab MDEV-23806 Undo page corruption on recovery
When commit 0fd3def284 removed
the MLOG_UNDO_ERASE_END record in MariaDB 10.3.3 in an attempt
to reduce our redo log volume, it introduced technical debt for
commit 56f6dab1d0 (MDEV-21174) and
commit 7ae21b18a6 (MDEV-12353),
which optimized mtr_t::write() (née mlog_write_ulint()) so
that the initial bytes that are unchanged are not logged.

trx_undo_report_row_operation(): Write a log record for the
memset() operation if the page is not going to be freed.
2020-09-24 14:12:22 +03:00
Vladislav Vaintroub
6736fe92d7 Fix GCC warning: this decimal constant is unsigned only in ISO C90 2020-09-24 13:08:43 +02:00
mkaruza
a50ce94458 MDEV-23559: Galera LeakSanitizer: detected memory leaks in galera.GAL-419
When process is aborted WSREP deinitialization and memory cleanup is not properly handled.  Other reported leaks are in Galera library and should be fixed there.
2020-09-24 12:06:53 +03:00
Daniel Black
1be8ac390d Revert "[MDEV-7978] add show create user"
Appoligies, had a dirty branch before pushing:

This reverts commit 053653a23c.

This reverts commit 0ff897807f.

This reverts commit 85b085972b.

This reverts commit f3f45e46b6.

This reverts commit a470b3570a.

This reverts commit f8b8d202bc.

This reverts commit 6b6f066fdd.

This reverts commit a701e9e6c3.

This reverts commit c169838611.
2020-09-24 13:58:29 +10:00
Daniel Black
3d28d1f3aa MDEV-23697: /usr/bin/perl for debian scripts 2020-09-24 08:16:30 +10:00
Daniel Black
4ddaa571fa MDEV-23697: perl -w -> perl
Leave debian/additions/mysqlreport as #!/usr/bin/perl

Acknowledge that `env perl` is a hack, a complete fix
needs to consider which path perl is at and insert into
these scripts.

The usefulness of these scripts is questionable.
2020-09-24 08:09:56 +10:00
Daniel Black
88c5c319e5 Merge branch '10.1' of https://github.com/MariaDB/server into 10.1 2020-09-24 08:00:41 +10:00
Vladislav Vaintroub
8370a38dc0 Window , MTR : fix lookup for mysql_install_db.exe
Fixes (rare) case when mysql-test is included into "noinstall" ZIP.
2020-09-23 15:42:11 +02:00
Marko Mäkelä
7c5519c12d MDEV-22387: Do not violate __attribute__((nonnull))
Passing a null pointer to a nonnull argument is not only undefined
behaviour, but it also grants the compiler the permission to optimize
away further checks whether the pointer is null. GCC -O2 at least
starting with version 8 may do that, potentially causing SIGSEGV.
2020-09-23 12:47:49 +03:00
Marko Mäkelä
70960bd33d UBSAN: Fix a bit shift overflow
Shifting a 16-bit type by 16 bits is undefined behaviour.
The result is at least 32 bits, so let us cast the shift operand
to a wider type before shifting.
2020-09-23 12:42:30 +03:00
Marko Mäkelä
af40a2b43e Fix GCC 10.2.0 -Og -fsanitize=undefined -Wmaybe-uninitialized
For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
to the compilation flags will cause even more warnings to be emitted.
The warnings do look bogus, but the code can be simplified.
2020-09-23 12:27:56 +03:00
Marko Mäkelä
0448558a0d Fix GCC 10.2.0 -Og -fsanitize=undefined -Wformat-overflow
For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
to the compilation flags will cause even more warnings to be emitted.
The warning was a bogus one:

tests/mysql_client_test.c:8632:22: error: '%d' directive writing between
1 and 11 bytes into a region of size 9 [-Werror=format-overflow=]
 8632 |     sprintf(field, "c%d int", i);
      |                      ^~
tests/mysql_client_test.c:8632:20: note: directive argument
in the range [-2147483648, 999]

The warning does not take into account that the lower bound of the
variable actually is 0. But, we can help the compiler and use an
unsigned variable.
2020-09-23 12:14:05 +03:00
Marko Mäkelä
882ce206db Merge 10.4 into 10.5 2020-09-23 11:32:43 +03:00
Marko Mäkelä
d7c82610c1 Fix the WolfSSL build on FreeBSD
Port some CMake tweaks of commit 4adc1269cc
from 10.5.
2020-09-23 09:29:05 +03:00
Marko Mäkelä
61df98f964 Merge 10.3 into 10.4 2020-09-22 21:29:30 +03:00
Marko Mäkelä
d9d9c30b70 Merge 10.2 into 10.3 2020-09-22 21:12:48 +03:00
Oleksandr Byelkin
594c11fffc Ukrainian error text translations added. 2020-09-22 15:13:17 +02:00
Marko Mäkelä
9d0ee2dcb7 Merge 10.1 into 10.2 2020-09-22 15:21:43 +03:00
Marko Mäkelä
55e48b7722 Merge 10.3 into 10.4 2020-09-22 15:12:59 +03:00
Marko Mäkelä
fde3d895d9 Merge 10.2 into 10.3 2020-09-22 14:33:03 +03:00
Marko Mäkelä
78efa10930 MDEV-22939: Restore an AUTO_INCREMENT check
It turns out that we must check for DISCARD TABLESPACE both
when the table is being rebuilt and when the AUTO_INCREMENT
value of the table is being added.

This was caught by the test innodb.alter_missing_tablespace.
Somehow I failed to run all tests. Sorry!
2020-09-22 13:55:36 +03:00
Marko Mäkelä
3eb81136e1 MDEV-22939 Server crashes in row_make_new_pathname()
The statement ALTER TABLE...DISCARD TABLESPACE is problematic,
because its designed purpose is to break the referential integrity
of the data dictionary and make a table point to nowhere.

ha_innobase::commit_inplace_alter_table(): Check whether the
table has been discarded. (This is a bit late to check it, right
before committing the change.) Previously, we performed this check
only in a specific branch of the function commit_set_autoinc().

Note: We intentionally allow non-rebuilding ALTER TABLE even if
the tablespace has been discarded, to remain compatible with MySQL.
(See the various tests with "wl5522" in the name, such as
innodb.innodb-wl5522.)

The test case would crash starting with 10.3 only, but it does not hurt
to minimize the code and test difference between 10.2 and 10.3.
2020-09-22 13:40:05 +03:00
Marko Mäkelä
e5e83daf32 Make DISCARD TABLESPACE more robust
dict_load_table_low(): Copy the 'discarded' flag to file_unreadable.
This allows to avoid a potentially harmful call to dict_stats_init()
in ha_innobase::open().
2020-09-22 13:09:51 +03:00