Commit graph

197588 commits

Author SHA1 Message Date
Daniel Black
072b3668ca MDEV-28206: SIGSEGV in Item_field::fix_fields when using LEAD...OVER
thd->lex->in_sum_func->max_arg_level cannot be set to a
bigger value of select->nest_level if select is null.
2022-12-02 17:22:04 +11:00
Alexander Barkov
b91b4e0b97 MDEV-28696 View created as "select b''; " references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them 2022-12-02 08:14:00 +04:00
Aleksey Midenkov
cc86360f4a MDEV-30112 ASAN errors in Item_ident::print / generate_partition_syntax
Like in MDEV-16110 we must release items allocated on thd->mem_root by
reopening the table.

MDEV-16290 relocated MDEV-16110 fix in 10.5 so it works for MDEV-28576
as well. 10.3 without MDEV-16290 now duplicates this fix.
2022-12-01 16:34:17 +03:00
Marko Mäkelä
7487c313bc Merge 10.4 into 10.5
This fixes up 4eb8e51c26
which missed a second parent.
2022-12-01 11:04:58 +02:00
Vicențiu Ciorbaru
b527bfe823 MDEV-30023 Revoking Privilege on the Column Yields the Error
The change from MDEV-29465 exposed a flaw in replace_column_table
where again we were not properly updating the column-level bits.

replace_table_table was changed in MDEV-29465 to properly update
grant_table->init_cols, however replace_column_table still only
modified grant_column->rights when the GRANT_COLUMN already existed.

This lead to a missmatch between GRANT_COLUMN::init_rights and
GRANT_COLUMN::rights, *if* the GRANT_COLUMN already existed.

As an example:

GRANT SELECT (col1) ...
Here:
For col1
GRANT_COLUMN::init_rights and GRANT_COLUMN::rights are set to 1 (SELECT) in
replace_column_table.

GRANT INSERT (col1) ...
Here, without this patch GRANT_COLUMN::init_rights is still 1 and
GRANT_COLUMN::rights is 3 (SELECT_PRIV | INSERT_PRIV)

Finally, if before this patch, one does:

REVOKE SELECT (col1) ...

replace_table_table will see that init_rights loses bit 1 thus it
considers there are no more rights granted on that particular table.

This prompts the whole GRANT_TABLE to be removed via the first revoke,
when the GRANT_COLUMN corresponding to it should still have init_rights == 2.

By also updating replace_column_table to keep init_rights in sync
properly, the issue is resolved.

Reviewed by <serg@mariadb.com>
2022-11-30 22:33:20 +02:00
Jan Lindström
4eb8e51c26 Merge 10.4 into 10.5 2022-11-30 13:10:52 +02:00
Marko Mäkelä
b81b194393 Merge 10.10 into 10.11 2022-11-30 12:59:57 +02:00
Marko Mäkelä
a27bfb2a87 Merge 10.9 into 10.10 2022-11-30 12:34:45 +02:00
Marko Mäkelä
3ba8828396 Merge 10.8 into 10.9 2022-11-30 12:21:10 +02:00
Marko Mäkelä
0751bfbcaf Merge 10.7 into 10.8 2022-11-30 12:12:07 +02:00
Marko Mäkelä
b7ae4d442a Merge 10.6 into 10.7 2022-11-30 12:09:01 +02:00
Marko Mäkelä
4783f37cf7 MDEV-30069 fixup: Do not truncate files on recovery
recv_sys_t::recover_deferred(): If the file has been determined
to be large enough, skip the call to os_file_set_size(), which
would use the current value of FSP_SIZE, which during a multi-batch
recovery can be smaller than the actual file size.

os_file_io(): Also display the file offset in the warning message about
partial I/O.
2022-11-30 12:06:52 +02:00
Marko Mäkelä
15ab2e122d MDEV-30132 Crash after recovery, with InnoDB: Tried to read ...
os_file_read(): Merged with os_file_read_no_error_handling().
Crashing on a partial page read is as unhelpful as crashing on a
corrupted page read (commit 0b47c126e3).
Report the file name if it is available via IORequest.
2022-11-30 10:54:03 +02:00
Marko Mäkelä
fc1403d3a9 Cleanup: Remove fil_space_t::is_deferred()
The public data member can be checked directly by the only caller.
2022-11-30 10:41:11 +02:00
Marko Mäkelä
1188ef4ade MDEV-30132 Crash after recovery, with InnoDB: Tried to read ... bytes at offset
fil_space_t::prepare_acquired(): Do not attempt to extend (or shrink)
files that will be processed by recv_sys_t::recover_deferred().
2022-11-30 10:35:40 +02:00
Marko Mäkelä
d32b2e7e8e Merge 10.5 into 10.6 2022-11-30 08:32:57 +02:00
Marko Mäkelä
1181564131 MDEV-24412: Disable the test on ./mtr --embedded 2022-11-30 08:32:05 +02:00
Marko Mäkelä
c59985fcf5 Merge 10.5 into 10.6 2022-11-30 07:06:41 +02:00
Marko Mäkelä
846112ce36 MDEV-24412: Create a separate test
Some builders in our CI, most notably FreeBSD and IBM AIX, do not support
sparse files. Also, Microsoft Windows requires special means for creating
sparse files. Since these platforms do not run ./mtr --big-test, we will
for now simply move the test to a separate file that requires that option.
2022-11-30 06:57:32 +02:00
Anel Husakovic
6c973be2e9 MDEV-28299: Server crashes in XINDXS::Range/CntIndexRange (Connect engine)
- Bug happens only in case when the range function on empty key single
column index (XINDEXS) is used.
- Solution is to return with empty result in this scenario.

Reviewed by: <>
2022-11-29 19:44:18 +00:00
Thirunarayanan Balathandayuthapani
bb29712b45 MDEV-30119 INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION.NAME is NULL for undo tablespaces
- Information_schema.innodb_tablespaces_encryption should print
undo tablespace name as innodb_undo001, innodb_undo002 and soon.

- Encryption test should include undo tablespaces count when
the tests are waiting for the condition to check whether all
tables are encrypted or decrypted.
2022-11-29 19:49:53 +05:30
Robin Newhouse
9a95838a96
[MDEV-30002] Skip bad_startup_options test when running as root (#2344)
Commit 32158be added a new test `bad_startup_options`. This test fails
if run as root, which is common on many CI systems.

This test should include `not_as_root.inc` so it is skipped, just
like all other similar tests in MariaDB.

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.
2022-11-29 13:27:56 +00:00
anson1014
c1de3776a6
Extend GitLab CI with build and test jobs for sanitizers (#2174)
Add a build and test job for each of ASAN, MSAN, TSAN, and UBSAN to the
GitLab pipeline such that current vulnerabilities will be more easily
visible and on each new commit, we can ensure that there are no
additional errors introduced. Furthermore, sanitizer test runs are run
separate from the existing mysql-test-run to isolate sanitizer error
from functional errors.

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.
2022-11-29 13:08:14 +00:00
Thirunarayanan Balathandayuthapani
b18241e059 MDEV-30122 mariabackup.skip_innodb crashes when innodb_undo_tablespaces > 0
- Assign srv_undo_space_id_start when InnoDB opens extra unused
InnoDB undo tablespaces in srv_all_undo_tablespaces_open().
Mariabackup can detect the undo tablespaces using
srv_undo_space_id_start variable
2022-11-29 16:28:40 +05:30
Marko Mäkelä
499ef7bf23 Add a global suppression for O_DIRECT failures
Fixes up commit b8ad6fbd95
2022-11-29 11:06:29 +02:00
sjaakola
07a06022c4 MDEV-29512 deadlock between commit monitor and THD::LOCK_thd_data mutex
This commit contains only a mtr test for reproducing the issue in MDEV-29512
The actual fix will be pushed in wsrep-lib repository

The hanging in MDEV-29512 happens when binlog purging is attempted, and there is
one local BF aborted transaction waiting for commit monitor.

The test will launch two node cluster and enable binlogging with expire log days,
to force binlog purging to happen.
A local transaction is executed so that will become BF abort victim, and has advanced
to replication stage waiting for commit monitor for final cleanup (to mark position in innodb)
after that, applier is released to complete the BF abort and due to binlog configuration,
starting the binlog purging. This is where the hanging would occur, if code is buggy

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2022-11-29 08:44:23 +02:00
Daniele Sciascia
283efe2680 MDEV-29878 Galera test failure on MDEV-26575
Test MDEV-26575 fails when it runs after MDEV-25389. This is because
the latter simulates a failure while an applier thread is
created in `start_wsrep_THD()`. The failure was not handled correctly
and would not cleanup the created THD from the global
`server_threads`. A subsequent shutdown would hang and eventually fail
trying to close this THD.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2022-11-29 08:44:17 +02:00
Daniele Sciascia
97d9bf98b2 Restore auto increment offset in test galera_join_with_cc_A
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2022-11-29 07:09:52 +02:00
Daniele Sciascia
c2fc5266ad MDEV-29880 Galera test failure on GCF-336
Fix `wsrep_table_accessible_when_detached()` so that commands that
access no tables are rejected while a node is disconnected from a
cluster.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2022-11-29 07:02:35 +02:00
Jan Lindström
c77459f89c Update wsrep-lib submodule 2022-11-29 06:49:17 +02:00
Monty
b8ad6fbd95 Fixed warning from innodb.create_isl_with_direct if have_symlink is disabled 2022-11-29 03:34:35 +02:00
Monty
f208f6fb6f Safety fix
Ensure that all memory allocated by TABLE_LIST::change_refs_to_fields() is
in the same memory root!
2022-11-29 03:34:35 +02:00
Monty
f9c418c67d Fixed the BUILD scripts to work outside of a git repository 2022-11-29 03:34:35 +02:00
Monty
5b275b41aa Enable valgrind for replication test
The following tests are disabled when running --valgrding without --big:
- rpl.rpl_ssl
- rpl.rpl_semi_sync_event
- All encryption test (which includes have_file_key_management.inc)
2022-11-29 03:34:35 +02:00
Christian Gonzalez
112870d7b4 MDEV-16735 Ensure mysql_upgrade works when changing alter_algorithm
MDEV-16735 describes how mysql_upgrade fails when alter_algorithm
is set to a value different than 'DEFAULT'/'COPY'. It was marked as
fixed by 0ee0868, but the fix didn't covered the possibility of having
the global value of alter_algorithm set to something different than
'DEFAULT'/'COPY'. To ensure that the upgrade process works properly
regardless the global value of alter_altorithm, this commit force it's
value to 'DEFAULT' (note the quotes) for the mysql_upgrade session.

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.
2022-11-29 10:55:17 +11:00
Daniel Black
7b44d0ba57
MDEV-23230 wsrep files installed when built without WSREP (#2334)
Prevent wsrep files from being installed if WITH_WSREP=OFF.

Reviewed by Daniel Black
Additionally excluded #include wsrep files and galera* files
along with galera/wsrep tests.

mysql-test/include/have_wsrep.inc remainds as its used by
a few isolated tests.

Co-authored-by: Chris Ross <cross2@cisco.com>
2022-11-28 18:21:03 +00:00
Anel Husakovic
3d5ce0430b MDEV-29348 rpl.rpl_rewrt_db test fails with [gdb,manual-gdb] with wrong parsing
Reviewer: <serg@mariadb.com>
Closes PR #2244
2022-11-28 15:10:30 +01:00
Marko Mäkelä
936436ef43 Merge 10.10 into 10.11 2022-11-28 13:44:42 +02:00
Marko Mäkelä
9e65287042 Merge 10.9 into 10.10 2022-11-28 13:43:41 +02:00
Marko Mäkelä
9abd70e390 Merge 10.8 into 10.9 2022-11-28 13:43:13 +02:00
Marko Mäkelä
6f854d7cfe Merge 10.7 into 10.8 2022-11-28 13:11:43 +02:00
Marko Mäkelä
f124d71ab7 Merge 10.6 into 10.7 2022-11-28 12:22:12 +02:00
Marko Mäkelä
fdc582fd98 Merge 10.5 into 10.6 2022-11-28 12:20:17 +02:00
Marko Mäkelä
bd694bb7b2 MDEV-24412 InnoDB: Upgrade after a crash is not supported
recv_log_recover_10_4(): Widen the operand of bitwise and to 64 bits,
so that the upgrade check will work when the redo log record is located
more than 4 gigabytes from the start of the first file.
2022-11-28 11:56:09 +02:00
Marko Mäkelä
db14eb16f9 MDEV-30106 InnoDB fails to validate the change buffer on startup
ibuf_init_at_db_start(): Validate the change buffer root page.
A later version may stop creating a change buffer, and this
validation check will prevent a downgrade from such later versions.

ibuf_max_size_update(): If the change buffer was not loaded, do nothing.

dict_boot(): Merge the local variable "error" to "err". Ignore
failures of ibuf_init_at_db_start() if innodb_force_recovery>=4.
2022-11-28 11:34:22 +02:00
Marko Mäkelä
e0d672f30b MDEV-30089 Metrics not incremented for 1st iteration in buf_LRU_free_from_common_LRU_list()
In commit a03dd94be8 as well as
mysql/mysql-server@6ef8c34344
the iterations were changed so that the variable "scanned"
would remain 0 when the first list item qualifies for eviction.

buf_LRU_free_from_unzip_LRU_list(), buf_LRU_free_from_common_LRU_list():
Increment "scanned" when a block can be freed.

buf_LRU_free_from_common_LRU_list(): Remove a redundant condition.
Whenever this function is invoked, buf_pool.LRU should be nonempty,
hence something should always be scanned.

Thanks to Jean-François Gagné for reporting this.
2022-11-28 11:34:00 +02:00
Daniel Black
183ca823bb MDEV-25417: Remove innodb buffer pool load throttling
The very lightest of load would decimate any buffer pool loading
to ~1 page per second. As seen in MDEV-29343 this resulting in
a load taking over an hour on a high end system.

Since MDEV-26547 the fetching is asynchronous, however the loading
has equal access to the IO as the SQL queries.
2022-11-28 11:25:47 +02:00
Marko Mäkelä
091ac53349 MDEV-29841 fixup: Correct error message translations
This fixes up 0e6f2757d1 and
6f8fb41f21 which corrupted the
Chinese and Spanish translations of the changed error message
ER_PARTITION_WRONG_TYPE.
2022-11-28 09:40:52 +02:00
Nayuta Yanagisawa
4e9206736c MDEV-28996 ASAN errors in String::q_append / spider_string::q_append / spider_db_mbase_util::open_item_func
The server crashed due to the stack-use-after-scope on tmp_str.
tmp_str will be used later so should not point to the local buffer.
2022-11-28 04:38:18 +09:00
Weijun-H
8535189f32 reformat the test 2022-11-27 05:11:39 +10:00