Commit graph

197993 commits

Author SHA1 Message Date
Vladislav Vaintroub
493f2bca76 Add more workaround atop existing WolfSSL 5.5.4 workaround to compile ASAN on buildbot
The -D flag was not passed to asm compiler, despite SET_PROPERTY(COMPILE_OPTIONS)
The exact reason for that remains unknown.  It was not seen with gcc, as
nor was be reproduced on newer CMake.
2023-02-08 11:32:06 +01:00
Tuukka Pasanen
a9eb272f91 MDEV-30534: Remove EOL Debian version 9 (stretch) from autobake-deb.sh
Debian 9 has EOL July 6th, 2020. This commit cleans it up
from debian/autobake-deb.sh which is used to build official
versions of MariaDB
2023-02-08 15:31:59 +11:00
Daniel Black
785386c807 innodb: cmake - sched_getcpu removed - not used 2023-02-08 13:11:37 +11:00
Daniel Black
2b494ccc15 MDEV-30572: my_large_malloc will only retry on ENOMEM
Correct error in to only say "continuing to smaller size" if it really
is.
2023-02-07 21:26:52 +11:00
Daniel Black
17423c6c51 MDEV-30554 RockDB libatomic linking on riscv64
The existing storage/rocksdb/CMakeCache.txt defined
ATOMIC_EXTRA_LIBS when atomics where required. This was
determined by the toplevel configure.cmake test
(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC).

As build_rocksdb.cmake is included after ATOMIC_EXTRA_LIBS
was set, we just need to use it. As such no riscv64
specific macro is needed in build_rocksdb.cmake.

As highlighted by Gianfranco Costamagna (@LocutusOfBorg)
in #2472 overwriting SYSTEM_LIBS was problematic.
This is corrected in case in future SYSTEM_LIBS is changed
elsewhere.

Closes #2472.
2023-02-07 21:19:40 +11:00
Daniel Black
ecc93c9824 MDEV-30492 Crash when use mariabackup.exe with config 'innodb_flush_method=async_unbuffered'
Normalize innodb_flush_method, the same as the service, before
attempting to print it.
2023-02-07 20:14:26 +11:00
Daniel Black
ce4a289f1c MDEV-30448 No deprecation message shown for mysql_fix_extensions 2023-02-07 20:11:37 +11:00
Daniel Black
762fe015c1 MDEV-30558: ER_KILL_{,QUERY_}DENIED_ERROR - normalize id type
The error string from ER_KILL_QUERY_DENIED_ERROR took a different
type to ER_KILL_DENIED_ERROR for the thread id. This shows
up in differences on 32 big endian arches like powerpc (Deb notation).

Normalize the passing of the THD->id to its real type of my_thread_id,
and cast to (long long) on output. As such normalize the
ER_KILL_QUERY_DENIED_ERROR to that convention too.

Note for upwards merge, convert the type to %lld on new translations
of ER_KILL_QUERY_DENIED_ERROR.
2023-02-07 19:28:18 +11:00
Christian Gonzalez
3622644836 MDEV-30498 Rename mysql_upgrade state file to mariadb_upgrade
Renames the upgrade state file, and ensures the old
file is properly removed when `mariadb-upgrade` tool is executed.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer
Amazon Web Services, Inc.
2023-02-07 07:29:04 +00:00
Oleksandr Byelkin
25a8bdda08 Merge branch '10.10.3' into 10.10 2023-02-06 20:49:51 +01:00
Oleksandr Byelkin
37a46e2181 Merge branch '10.9.5' into 10.9 2023-02-06 20:48:18 +01:00
Oleksandr Byelkin
29cd17e8d9 Merge branch '10.8.7' into 10.8 2023-02-06 20:46:33 +01:00
Oleksandr Byelkin
70a515df43 Merge branch '10.6.12' into 10.6 2023-02-06 20:18:44 +01:00
Oleksandr Byelkin
40adf52d1c Merge branch '10.4.28' into 10.4 2023-02-06 20:12:55 +01:00
Marko Mäkelä
acd23da4c2 MDEV-30479 optimization: Invoke recv_sys_t::trim() earlier
recv_sys_t::parse(): Discard old page-level redo log when parsing
a TRIM_PAGES record.

recv_sys_t::apply(): trim() was invoked in parse() already.

recv_sys_t::truncated_undo_spaces[]: Only store the size, no LSN.
2023-02-06 20:29:42 +02:00
Marko Mäkelä
461402a564 MDEV-30479 OPT_PAGE_CHECKSUM mismatch after innodb_undo_log_truncate=ON
page_recv_t::trim(): Do remove log records for mini-transactions
that end right at the threshold LSN. This will avoid an inconsistency
where a dirty page had been evicted from the buffer pool during
undo tablespace truncation, and recovery would attempt to apply
log records for which the last available copy in the data file is
too new. These changes would be discarded anyway.
2023-02-06 20:29:29 +02:00
Marko Mäkelä
ff12a5b897 MariaDB 10.5.19 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmPhCNUACgkQ8WVvJMdM
 0dhMnA//cGJYi+Pj8kfy6lpETErEtX0LPIji6ZMivzZqsdhQhF2pqeN3D4dAPXwf
 +K8ktPlViqJN8XLsM8EGxyL4kGfrCIh6BMkqx+dS3G2n8xvke7myw2lu4j4iH25C
 xl9m90dDKQTl/UBZUSuwiPVnIeuLT3zIfnJWUSPPmFjsww2JsG5zKS0xi9/Oh0/h
 qu99r1imGaK01mXh1At5/jwniCEUYESNpzhADyrYFikhzYjNZBLuih8uVw2Orj0M
 /8SO6XEBv3iVMAsxsXWruLMn5QFisNZh0VMi+9FjTfVPEaGwcCU81iCK4rlVUfzD
 QYEOYbOHrCJa7OnO6++6J800XEOLlgHTM9JsVlIJlB78NUqs73xMwW8LNFtoF1qV
 U2GCae8stank0CJ7JVg89HGExI4r/pmfGJWv9gkwniYjQYONFLnCOOGAz2BATHRS
 oEcZNMeydg1Uuatj804og+mYMfR/Sd6zP4/fLalUOt2td7ELi6siA3QjyvucAKte
 HcfadLTbekBiTlBC1tfG4qL6zCa4CfpfKNGLzlAV2cBRJdwhlKawsY+1w8wmhZSK
 16KtuyE8bzpj3+M/Gy6q5TOpma8Rl4kVJk5JxhZlDP8amtoQOZej95IwJJWcNFog
 JnAk+pwqzzY6kvjxXztdQj7iwG96EFWnZLf1e3qWaInmQApDK6U=
 =8Ff5
 -----END PGP SIGNATURE-----

Merge mariadb-10.5.19 into 10.5
2023-02-06 17:55:01 +02:00
Daniel Bartholomew
dcd93d019a
bump the VERSION 2023-02-06 10:51:40 -05:00
Daniel Bartholomew
93c827150d
bump the VERSION 2023-02-06 10:50:17 -05:00
Daniel Bartholomew
d3b84ef458
bump the VERSION 2023-02-06 10:49:10 -05:00
Daniel Bartholomew
80ae69c8bc
bump the VERSION 2023-02-06 10:24:21 -05:00
Daniel Bartholomew
f6da6b249e
bump the VERSION 2023-02-06 09:59:18 -05:00
Daniel Bartholomew
d8c7dc2813
bump the VERSION 2023-02-06 09:34:19 -05:00
Sergei Golubchik
d6e3d89c80 MDEV-29668 SUPER should not allow actions that have fine-grained dedicated privileges
SUPER privilege used to allow various actions that were alternatively
allowed by one of BINLOG ADMIN, BINLOG MONITOR, BINLOG REPLAY,
CONNECTION ADMIN, FEDERATED ADMIN, REPL MASTER ADMIN, REPL SLAVE ADMIN,
SET USER, SLAVE MONITOR.

Now SUPER no longer does that, one has to grant one of the fine-grained
privileges above to be to perform corresponding actions.

On upgrade from MariaDB versions 10.11 and below all the privileges
above are granted automatically if the user has SUPER.

As a side-effect, such an upgrade will allow SUPER-user to run SHOW
BINLOG EVENTS, SHOW RELAYLOG EVENTS, SHOW SLAVE HOSTS, even if he wasn't
able to do it before the upgrade.
2023-02-06 14:31:48 +01:00
Daniel Black
f4b900e6fa MDEV-24301 [Warning] Aborted connection (This connection closed normally)
Warning on a normal graceful disconnnect is excessive, so lets not do
it.

MDEV-19282 restructed the code from 10.3 so applying this as a 10.4+
fix.
2023-02-06 22:23:52 +11:00
Daniel Black
29b4bd4ea9 MDEV-30573 Server doesn't build with GCOV by GCC 11+
__gcov_flush was never an external symbol in the documentation.

It was removed in gcc-11. The correct function to use is __gcov_dump
which is defined in the gcov.h header.
2023-02-06 21:25:02 +11:00
Sergei Golubchik
0ac5132505 MDEV-29227 deprecate explicit_defaults_for_timestamp=0 2023-02-05 22:02:30 +01:00
Sergei Golubchik
760d149067 MDEV-30128 remove support for 5.1- replication events
including patches from Andrei Elkin
2023-02-05 22:02:30 +01:00
Igor Babaev
bef20b5f36 MDEV-30538 Plans for SELECT and multi-table UPDATE/DELETE unexpectedly differ
This patch allowed transformation of EXISTS subqueries into equivalent
IN predicands at the top level of WHERE conditions for multi-table UPDATE
and DELETE statements. There was no reason to prohibit the transformation
for such statements. The transformation provides more opportunities of
using semi-join optimizations.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2023-02-03 11:17:03 -08:00
Vicențiu Ciorbaru
9f16d15357 debug_sync: Print all current active signals within the trace file during wait
When running with DBUG trace enabled, print all current active signals.

The output looks like this with the signals present in curr:
T@6 ... debug_sync_exec: wait for 'nothing'  at: 'now', curr: 'something,from_function,from_myvar'
2023-02-03 16:27:16 +02:00
Vicențiu Ciorbaru
2a08b2c15c sql_hset.h - include what you use uchar comes from my_global.h 2023-02-03 16:27:16 +02:00
Vicențiu Ciorbaru
addcf08d0f Revert test changes from "Fixed debug_sync timeout in deadlock_drop_table"
After introducing multiple signals possible for debug_sync, the test
changes are no longer necessary. Revert them to the original state.
2023-02-03 16:27:16 +02:00
Vicențiu Ciorbaru
8ff0a7f893 Implement DEBUG_SYNC multiple signal firing capability
One can now do:
set DEBUG_SYNC='... SIGNAL s1,s2,s3...'

Multiple signals can be fired, they need to be split by commas.
2023-02-03 16:27:16 +02:00
Vicențiu Ciorbaru
c115559b66 Extend Binary_string::strstr to also take in a const char pointer
One shouldn't have to instantiate a Binary_string every time a strstr
call is needed.
2023-02-03 16:27:16 +02:00
Vicențiu Ciorbaru
cd873c8688 debug_sync: Implement NO_CLEAR_EVENT syntax
When waiting on a signal, NO_CLEAR_EVENT allows one to not clear the
signal, effectively allowing other threads to wait for the same signal.
2023-02-03 16:27:16 +02:00
Vicențiu Ciorbaru
8885225de6 Implement multiple-signal debug_sync
The patch is inspired from MySQL. Instead of using a single String to
hold the current active debug_sync signal, use a Hash_set to store
LEX_STRINGS. This patch ensures that a signal can not be lost, by being
overwritten by another thread via set DEBUG_SYNC = '... SIGNAL ...';

All signals are kepts "alive" until they are consumed by a wait event.

This requires updating test cases that assume the GLOBAL signal is never
consumed.

Follow-up work needed:
Port the additional syntax that allows one to set multiple signals
and also conditionally deactivate signals when waiting.
2023-02-03 16:27:16 +02:00
Alexander Barkov
0845bce0d9 MDEV-30556 UPPER() returns an empty string for U+0251 in Unicode-5.2.0+ collations for utf8 2023-02-03 18:18:32 +04:00
Vicențiu Ciorbaru
cc08872c16 Initialize the Hash_set during creation
If the Hash_set is not initialized, one can not call find() on it before
at least one element has been inserted into it.
2023-02-03 15:33:05 +02:00
Monty
b5df077e85 Fixed wrong selectivity calculation in table_after_join_selectivity()
The old code counted selectivity double in case of queries like:
WHERE key_part1=1 and key_part2 < 100
if the optimizer would decide to use a REF access on key_part1.

The new code in best_access_path() that changes REF access to RANGE
if the RANGE key is longer makes this issue less likely to happen.

I was not able to create a test case for 11.0, however if one ports this
patch to a MariaDB version without the change of REF to RANGE, the
selectivity will be counted double.
2023-02-03 14:38:45 +03:00
Monty
ed0a723566 Cache file->index_flags(index, 0, 1) in table->key_info[index].index_flags
The reason for this is that we call file->index_flags(index, 0, 1)
multiple times in best_access_patch()when optimizing a table.
For example, in InnoDB, the calls is not trivial (4 if's and 2 assignments)
Now the function is inlined and is just a memory reference.

Other things:
- handler::is_clustering_key() and pk_is_clustering_key() are now inline.
- Added TABLE::can_use_rowid_filter() to simplify some code.
- Test if we should use a rowid_filter only if can_use_rowid_filter() is
  true.
- Added TABLE::is_clustering_key() to avoid a memory reference.
- Simplify some code using the fact that HA_KEYREAD_ONLY is true implies
  that HA_CLUSTERED_INDEX is false.
- Added DBUG_ASSERT to TABLE::best_range_rowid_filter() to ensure we
  do not call it with a clustering key.
- Reorginized elements in struct st_key to get better memory alignment.
- Updated ha_innobase::index_flags() to not have
  HA_DO_RANGE_FILTER_PUSHDOWN for clustered index
2023-02-03 14:38:26 +03:00
Monty
5e0832e132 Updated some tests for --valgrind
- Increased timeout for binlog_mysqlbinlog_raw_flush.test.
  The old timeout was not enough when running with --valgrind
- Disabled ssl_timeout for --valgrind as it times out
- Disabled binlog_truncate_multi_engine for --valgrind as it does restarts
2023-02-03 14:33:37 +03:00
Monty
43dc42334d Fixed 'undefined variable' error in mtr
This could happen if mtr_grab_file() returned empty (happened to me)
2023-02-03 14:33:32 +03:00
Sergei Petrunia
e4fbec1463 Make tests work with --view-protocol 2023-02-03 14:33:18 +03:00
Sergei Petrunia
1529881595 Stabilize rocksdb.rocksdb test. 2023-02-03 14:31:21 +03:00
Sergei Petrunia
cbd99688af MDEV-21095: Make Optimizer Trace support Index Condition Pushdown
Fixes over previous patches: do tracing of attached conditions
close to where we generate them.

Fix the tracing code to print the right conditions.
2023-02-03 14:28:34 +03:00
Rex
07f21cfb14 MDEV-21092,MDEV-21095,MDEV-29997: Optimizer Trace for index condition pushdown, partition pruning, exists-to-in
Add Optimizer Tracing for:
        - Index Condition Pushdown
        - Partition Pruning
        - Exists-to-IN optimization
2023-02-03 14:28:08 +03:00
Vicențiu Ciorbaru
b482e87f26 Silence gcc-11 warnings 2023-02-03 13:09:48 +02:00
Sergei Petrunia
dba78f3c32 Stabilize engines/iuds.type_bit_iuds test
Make sure the queries use the intended query plan
2023-02-03 13:26:21 +03:00
Sergei Petrunia
0fcc32f864 Remove mysql-test/suite/versioning/r/select,trx_id.rdiff which is empty
This seems to confuse windows.
2023-02-03 13:26:08 +03:00
Sergei Petrunia
6ca762c846 Update columnstore to include the patch to compile with the new cost model APIs 2023-02-03 13:26:02 +03:00