Commit graph

194550 commits

Author SHA1 Message Date
Marko Mäkelä
7ee612c912 MDEV-21174 fixup: Remove mtr_t::release_page()
mtr_t::release_page(): Remove. The function became unused in
commit 56f6dab1d0
when the call was replaced with a call to mtr_t::memo_release().
2022-11-10 12:50:44 +02:00
asklavou
7aa8b209df MDEV-29866: Add RESET MASTER to clear possible remaining binlog from previous test 2022-11-09 17:36:42 +00:00
asklavou
e616c9a0ef MDEV-28970: Add RESET MASTER to clear possible remaining binlog from previous test 2022-11-09 11:59:28 +00:00
Marko Mäkelä
3278c57917 Merge 10.4 into 10.5 2022-11-09 09:30:37 +02:00
Marko Mäkelä
20969aa412 Merge 10.3 into 10.4 2022-11-09 09:28:39 +02:00
Marko Mäkelä
6b91792a08 MDEV-29883 Deadlock between InnoDB statistics update and BLOB insert
This is a backport of commit 8b6a308e46
from MariaDB Server 10.6.11. No attempt to reproduce the hang
in earlier an earlier version of MariaDB Server than 10.6 was made.

In each caller of fseg_n_reserved_pages() except ibuf_init_at_db_start()
which is a special case for ibuf.index at database startup, we must hold
an index latch that prevents concurrent allocation or freeing of index
pages.

Any operation that allocates or free pages that belong to an index tree
must first acquire an index latch in non-shared mode, and while
holding that, acquire an index root page latch in non-shared mode.

btr_get_size(), btr_get_size_and_reserved(): Assert that a strong enough
index latch is being held.

dict_stats_update_transient_for_index(),
dict_stats_analyze_index(): Acquire a strong enough index latch.

These operations had followed the same order of acquiring latches in
every InnoDB version since the very beginning
(commit c533308a15).

The hang was introduced in
commit 2e814d4702 which imported
mysql/mysql-server@ac74632293
which failed to strengthen the locking requirements of the function
btr_get_size().
2022-11-09 09:23:18 +02:00
Marko Mäkelä
b955f4eff7 MDEV-22512: Re-enable the tests on 10.5 2022-11-08 18:21:39 +02:00
Andrew Hutchings
fda5846704
MDEV-29397 CONNECT engine: Fix note turning into error (#2325)
* MDEV-29397 Fix note turning into error

ODBC Rewind triggered an error with no SQL, but this is sometimes a
valid condition (as can be seen with other classes). Setting this to a 0
return stops errors firing when they shouldn't.

Also fixes ASAN hits from in MDEV-29687 tabext.cpp.
2022-11-08 15:49:52 +00:00
Marko Mäkelä
a732d5e2ba Merge 10.4 into 10.5 2022-11-08 17:01:28 +02:00
Marko Mäkelä
8fb176c3c1 MDEV-27121 fixup: mariabackup.mdev-14447,full_crc32 2022-11-08 16:59:36 +02:00
Marko Mäkelä
12f20c154d Work around MDEV-24813 in main.rowid_filter_innodb_debug
Let us avoid excessive allocation of explicit record locks.
2022-11-08 16:04:16 +02:00
Marko Mäkelä
93b4f84ab2 Merge 10.3 into 10.4 2022-11-08 16:04:01 +02:00
Marko Mäkelä
2ef2e2322a MDEV-29856 heap-use-after-poison in row_merge_spatial_rows() w/ column prefix
spatial_index_info: Replaces index_tuple_info_t. Always take
a memory heap as a parameter to the member functions.
Remove pointer indirection for m_dtuple_vec.

spatial_index_info::add(): Duplicate any PRIMARY KEY fields that would
point to within ext->buf because that buffer will be allocated in
a shorter-lifetime memory heap.
2022-11-08 15:26:34 +02:00
Marko Mäkelä
b737d09dbc MDEV-29905 Change buffer operations fail to check for log file overflow
Every operation that is going to write redo log is supposed to
invoke log_free_check() before acquiring any latches. If there
is a risk of log buffer overrun, a log checkpoint would be
triggered by that call.

ibuf_merge_space(), ibuf_merge_in_background(),
ibuf_delete_for_discarded_space(): Invoke log_free_check()
when the current thread is not holding any page latches.

Unfortunately, in lower-level code called from ibuf_insert()
or ibuf_merge_or_delete_for_page(), some page latches may be
held and a call to log_free_check() could hang.

ibuf_set_bitmap_for_bulk_load(): Use the caller's mini-transaction.
The caller should have invoked log_free_check() while not holding
any page latches.
2022-11-08 11:37:43 +02:00
Marko Mäkelä
49a0ad695b MDEV-23371: Crash in _db_doprnt_ via que_thr_step()
Something appears to be broken in the DBUG subsystem.
Let us remove frequent calls to it from the InnoDB internal SQL interpreter
that is used in the purge of transaction history.

The DBUG_PRINT in que_eval_sql() can remain for now, because those
operations are much less frequent.
2022-11-08 11:24:49 +02:00
Marko Mäkelä
1e8189fcee MDEV-13564 follow-up: Correct a bogus comment
This fixes up commit e3c39c0be8
2022-11-08 10:55:22 +02:00
Marko Mäkelä
9ac8be4e29 Include some advice in the crash-upgrade message 2022-11-08 10:39:29 +02:00
Marko Mäkelä
95e2595d8d MDEV-22512: Disable frequently failing tests
InnoDB crash recovery can run out of memory before
commit 50324ce624 in
MariaDB Server 10.5.

Let us disable some frequently failing recovery tests
in earlier versions.
2022-11-08 10:30:03 +02:00
Marko Mäkelä
314ed9f5ec Work around MDEV-24813 in some tests
Not creating explicit record locks will speed up the test.

Also, disable the use of InnoDB persistent statistics in the test of
MDEV-27270 to avoid intermittent failures in 10.6 or later
(after commit 9608773f75)
due to the nondeterministic scheduling of STATS_AUTO_PERSISTENT.
2022-11-08 09:00:58 +02:00
Marko Mäkelä
456d4a508c Remove an unused file
The file plugin_exports became unused in
commit fec844aca8
2022-11-08 08:54:07 +02:00
Marko Mäkelä
eabb3b35d5 MDEV-27121 fixup: mariabackup.mdev-14447 fault injection 2022-11-08 08:53:49 +02:00
Oleksandr Byelkin
fe330b63fe Merge branch '10.5' into bb-10.5-release 2022-11-07 16:14:35 +01:00
Oleksandr Byelkin
e9dc39572f Merge branch '10.4' into bb-10.4-release 2022-11-07 15:49:14 +01:00
Oleksandr Byelkin
01ac7455e2 Merge branch '10.3' into bb-10.3-release 2022-11-07 15:32:35 +01:00
Daniel Bartholomew
9201cda37c
bump the VERSION 2022-11-07 09:18:20 -05:00
Daniel Bartholomew
625fff0d8f
bump the VERSION 2022-11-07 08:35:15 -05:00
Daniel Bartholomew
baa6b052a2
bump the VERSION 2022-11-07 08:08:55 -05:00
Thirunarayanan Balathandayuthapani
f7e6198c02 MDEV-27121 mariabackup incompatible with disabled dedicated undo log tablespaces
- mariabackup fails to assign srv_undo_space_id_start when the
dedicated undo tablespaces are disabled
2022-11-07 17:36:08 +05:30
Sachin
10132ad261 MDEV-23264 Unique blobs allow duplicate values upon UPDATE
Problem:-
  We are able to insert duplicate value in table because cmp_binary_offset
  is not able to differentiate between NULL and empty string. So
  check_duplicate_long_entry_key is never called and we don't check for
  duplicate.
Solution
  Added a if condition with is_null() on field which can differentiate
  between NULL and empty string.
2022-11-07 09:50:59 +01:00
Vladislav Vaintroub
92be8d2048 MDEV-29951 server hang in crash handler
When trying to output stacktrace, and addr2line is not installed, the
child process forked by start_addr2line_fork() will fail to do exec(),
and finish with exit(1).

There is a problem with exit() though - it runs exit handlers,
and for the forked copy of crashing process, it is a bad idea.

In 10.5+ code for example, exit handlers include
tpool::task_group static destructors, and it will hang infinitely
waiting for completion of the outstanding tasks.

The fix is to use _exit() instead, which skips the execution of exit
handlers
2022-11-05 18:36:43 +01:00
Ian Gilfillan
e7be2d3142 Fix duplicate entry in mysqld_safe man page 2022-11-03 12:25:38 +11:00
Oleksandr Byelkin
177d858e38 Merge branch '10.4' into 10.5 2022-11-02 13:14:54 +01:00
Oleksandr Byelkin
0946c99e7d Merge branch '10.3' into 10.4 2022-11-02 13:13:45 +01:00
Oleksandr Byelkin
3303748fd1 MDEV-29926: ASAN heap-use-after-free in Explain_query::~Explain_query
Make sure that EXPLAIN object allocated on runtime arena.
2022-11-02 12:49:24 +01:00
Sergei Golubchik
1a3859fff0 MDEV-29924 Assertion `(((nr) % (1LL << 24)) % (int) log_10_int[6 - dec]) == 0' failed in my_time_packed_to_binary on SELECT when using TIME field
when assigning the cached item to the Item_cache for the first time
make sure to use Item_cache::setup(), not Item_cache::store().
Because the former copies the metadata (and allocates memory, in case
of Item_cache_row), and Item_cache::decimal must be set for
comparisons to work correctly.
2022-11-01 13:22:34 +01:00
Oleg Smirnov
0d927a57d2 MDEV-29624 MDEV-29655 Fix ASAN errors on pushdown of derived table
Deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived
was performed in multiple places if code. This not only made the code
more difficult to maintain but also led to memory leaks and
ASAN heap-use-after-free errors.
This commit puts deallocation of TABLE_LIST::dt_handler and
TABLE_LIST::pushdown_derived to the single point - JOIN::cleanup()
2022-10-31 19:20:17 +04:00
Brad Smith
7d96cb4703 Fix warning with signal typedef for *BSD
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/mysys/my_lock.c:183:7: warning: incompatible function pointer types assigning to 'sig_return' (aka 'void (*)(void)') from 'void (*)(int)' [-Wincompatible-function-pointer-types]
      ALARM_INIT;
      ^~~~~~~~~~
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/include/my_alarm.h:43:16: note: expanded from macro 'ALARM_INIT'
                        alarm_signal=signal(SIGALRM,my_set_alarm_variable);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/mysys/my_lock.c:189:7: warning: incompatible function pointer types passing 'sig_return' (aka 'void (*)(void)') to parameter of type 'void (*)(int)' [-Wincompatible-function-pointer-types]
      ALARM_END;
      ^~~~~~~~~
/usr/ports/pobj/mariadb-10.9.3/mariadb-10.9.3/include/my_alarm.h:44:41: note: expanded from macro 'ALARM_END'
                                              ^~~~~~~~~~~~
/usr/include/sys/signal.h:199:27: note: passing argument to parameter here
void    (*signal(int, void (*)(int)))(int);
                             ^
2 warnings generated.

The prototype is the same for all of the *BSD's.

void
(*signal(int sigcatch, void (*func)(int sigraised)))(int);
2022-10-31 09:28:17 +11:00
Daniel Black
4ebc8d8c27
MDEV-29847: Wrong warning on rlimit capping of max_open_files (#2315)
Per the code my_set_max_open_files 3 lines earlier, we attempt
to set the nofile (number of open files), rlimit to max_open_files.

We should use this in the warning because wanted_files may not
be the number.
2022-10-28 09:59:35 +01:00
Alexander Barkov
ce443c8554 MDEV-29495 Generalize can_convert_xxx() hook engine API to cover any arbitrary data type 2022-10-27 11:48:46 +04:00
Brad Smith
ab81aefef6 Fix building my_gethwaddr() on OpenBSD - part for 10.5 and newer 2022-10-27 11:58:29 +11:00
Brad Smith
899cedb33c Fix building my_gethwaddr() on OpenBSD 2022-10-27 11:30:45 +11:00
Sergei Golubchik
b4a58581fd columnstore 5.6.8-1 2022-10-26 19:29:46 +02:00
Oleksandr Byelkin
4519b42e61 Merge branch '10.4' into 10.5 2022-10-26 15:26:06 +02:00
Oleksandr Byelkin
29633dc0c0 Merge branch '10.3' into 10.4 2022-10-26 14:55:47 +02:00
Oleksandr Byelkin
278fbe61d8 Add skipped changes to oracle mode parser. 2022-10-26 10:14:34 +02:00
Andrew Hutchings
fa5f26b422 MDEV-29578 Fix CONNECT build warnings
Fix a couple of build warnings that fire with CONNECT engine.
2022-10-26 16:50:46 +11:00
Alexander Barkov
f90d9c347f MDEV-28822 Table from older version requires table rebuild when adding column to table with multi-column index
This problem was earlier fixed in 10.4 by the patch for MDEV-29481.

Adding MTR tests only.
2022-10-26 09:34:28 +04:00
Brad Smith
055cb3fcd1 Rocksdb: Add initial OpenBSD support 2022-10-26 15:33:10 +11:00
Oleg Smirnov
5f296f3a18 MDEV-29640 FederatedX does not properly handle pushdown in case of difference in local and remote table names
FederatedX table may refer to a table with a different name on the
remote server:
  test> CREATE TABLE t2 (...) ENGINE="FEDERATEDX"
  CONNECTION="mysql://user:pass@192.168.1.111:9308/federatedx/t1";
  test> select * from t2 where ...;
This could cause an issue with federated_pushdown=1, because FederatedX
pushes the query (or derived table's) text to the remote server. The remote
server will try to read from table t2 (while it should read from t1).

Solution: do not allow pushing down queries with tables that have different
db_name.table name on the local and remote server.

This patch also fixes:
MDEV-29863 Server crashes in federatedx_txn::acquire after select from the
FederatedX table with partitions

Solution: disallow pushdown when partitioned FederatedX tables are used.
2022-10-26 10:52:38 +07:00
Alexey Botchkov
77951dd710 MDEV-26161 crash in Gis_point::calculate_haversine
More checks for bad geometry data added.
2022-10-26 00:20:40 +04:00