Commit graph

197284 commits

Author SHA1 Message Date
Monty
d0cd49497f MDEV-30118 exception in ha_maria::extra
I have not been able to repeat the problem, but the stack trace indicates
that ha_maria::extra() is called with a null file pointer.

This indicates the table has either never been opened or opened and closed,
with file pointer set to NULL, but ha_maria::extra() is still called.

In JOIN::partial_cleanup() we are only checking of table->is_created(),
which will fail if table was created and later closed.

Fixed by clearing table->created if table is dropped.

I added an assert to is_created() to catch the case that the create
flag does not match 'file'.
2022-12-15 19:36:30 +02:00
Marko Mäkelä
0a67daad06 MDEV-30235 InnoDB crash on table-rebuilding DDL when the statistics tables are corrupted
commit_try_rebuild(): Only invoke trx_t::drop_table_statistics()
if both InnoDB statistics tables are accessible (and exclusively
locked by the current transaction). This avoids a crash due to
ut_a(sym_node->table != NULL) in pars_retrieve_table_def().

The crash was repeated on a partial copy of a MariaDB 10.3 data
directory that lacked the *.ibd files for the statistics tables.
2022-12-15 16:18:43 +02:00
Marko Mäkelä
4f6830255c Merge 10.5 into 10.6 2022-12-15 16:18:28 +02:00
Marko Mäkelä
92ff7bb63f MDEV-30227 [ERROR] [FATAL] InnoDB: fdatasync() returned 9
fil_space_t::flush<false>(): If the CLOSING flag is set,
the file may already have been closed, resulting in EBADF
being returned by fdatasync(). In any case, the
thread that had set the flag should take care of invoking
os_file_flush_func().

The crash occurred during the execution of FLUSH TABLES...FOR EXPORT.

Tested by: Matthias Leich
2022-12-15 12:45:26 +02:00
Marko Mäkelä
c562ccf796 MDEV-30233 DROP DATABASE test fails: Directory not empty
Some tests drop the default mtr database "test". This may fail due
to the directory not being empty. InnoDB may not delete all tables
immediately, due to the "background drop table queue" or its
replacement in commit 1bd681c8b3
(the purge of history would clean up after a DDL operation during
which the server was killed).

Let us try to avoid "drop database test" whenever it is easily possible.
Where it is not, SET GLOBAL innodb_max_purge_lag_wait=0 will ensure
that the replacement of the "background drop table queue" will have
completed its job.
2022-12-15 11:14:23 +02:00
Daniel Black
4ca5a0ec98 MDEV-30172: galera mtr disables 2022-12-15 19:05:08 +11:00
Daniel Black
fa01ffb08e Merge branch '10.5' into 10.6 2022-12-15 18:27:11 +11:00
Daniel Black
03fee585c1 mtr: more galera disables - linked in MDEV-30172 2022-12-15 18:19:11 +11:00
Daniel Black
7df06dcbc3 Merge branch 10.5 into 10.6 2022-12-15 09:32:54 +11:00
Daniel Black
97c6cd9798 Deb: debian-start.inc - do not quote exe variables 2022-12-15 08:48:48 +11:00
Daniel Black
069eb169b3 Merge branch '10.8' into 10.9 2022-12-15 08:39:46 +11:00
Daniel Black
89480340ba Merge commit 10.7 into 10.8 2022-12-15 08:37:57 +11:00
Daniel Black
6524551bcf Merge branch 10.6 into 10.7 2022-12-15 08:33:20 +11:00
Daniel Black
930ee43507 Merge branch '10.5' into 10.6 2022-12-15 08:30:51 +11:00
Daniel Black
0f351b620a rpm: server-post - use mariadb-install-db 2022-12-14 20:52:06 +00:00
Daniel Black
9ee055a27f Deb: mariadb-server.postinst to use mariadb-install-db 2022-12-14 20:52:06 +00:00
Daniel Black
40b62a93c6 mariadb-install-db: use mariadb names
Also refer to the service file for startup.
2022-12-14 20:52:06 +00:00
Daniel Black
952af4a179 Deb: MariaDB names as default for deb scripts
Also include the ftp.mariadb.org script rather than old name.
2022-12-14 20:52:06 +00:00
Marko Mäkelä
3faa68d15b Add missing error suppression 2022-12-14 10:18:37 +02:00
Marko Mäkelä
2f959a6910 Merge 10.8 into 10.9 2022-12-14 08:26:53 +02:00
Marko Mäkelä
757ae11688 Merge 10.7 into 10.8 2022-12-14 08:18:24 +02:00
Marko Mäkelä
98181a7c58 Merge 10.6 into 10.7 2022-12-14 06:57:04 +02:00
Marko Mäkelä
9be5973edd After-merge fix
This fixes up 25b91c3f13
2022-12-14 06:56:51 +02:00
Marko Mäkelä
f97f6955bd Merge 10.3 into 10.4 2022-12-14 06:20:04 +02:00
Daniel Black
4b2e7616f8 Merge branch '10.5' into 10.6 2022-12-14 12:25:57 +11:00
Daniel Black
687657c270 MDEV-30172 re-disable galera tests
galera_sr.GCF-1060 'innodb'              w2 [ fail ]  timeout after 900 seconds

galera_3nodes.galera_ssl_reload At line 50: mysql_shutdown failed
galera_3nodes.galera_ssl_reload : MDEV-30172 At line 50: mysql_shutdown failed
galera_3nodes.GCF-354 : mysqltest: At line 39: query 'DROP TABLE test.t1' failed: 1047: WSREP has not yet prepared node for application use
galera_3nodes.GCF-354 : mysqltest: At line 30: query 'INSERT INTO test.t1 values (1)' failed: 1180: Got error 6 "No such device or address"

galera_wan : [ERROR] WSREP: /home/buildbot/buildbot/build/gcs/src/gcs_state_msg.cpp:gcs_state_msg_get_quorum():947: Failed to establish quorum.
2022-12-14 11:25:47 +11:00
Daniel Black
697dbd15e0 MDEV-21187: log_slow_filter="" logs queries not using indexes
Consistent with MDEV-4206 and empty log_slow_filter still means
no explict filtering. Since 21518ab2e4 however the
log_queries_not_using_indexes became stored in the same variable.

As we need to test for the absense of log_queries_not_using_indexes
the SERVER_QUERY_NO_INDEX USED part of log_slow_statement, the empty
criteria resulted in an always true to log queries not using indexes if
log_slow_filter was set to empty.

Adjusted the log_slow.test for MDEV-4206 as slow_log_query has been
global and session for a while and it was relying on the MDEV-21187
buggy behavior to detect a slow query.

Reviewer: Monty
2022-12-14 10:15:32 +11:00
Marko Mäkelä
b7914f562d Merge 10.8 into 10.9 2022-12-13 18:24:51 +02:00
Marko Mäkelä
d7a4ce3c80 Merge 10.7 into 10.8 2022-12-13 18:11:24 +02:00
Marko Mäkelä
25b91c3f13 Merge 10.6 into 10.7 2022-12-13 18:01:49 +02:00
Marko Mäkelä
a8a5c8a1b8 Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
Daniel Black
acfaa04587
MDEV-18591: mysql_install_db - pass --log-error to mysqld in install (#2363)
Previously we parsed it out in mysql_install_db for use in the error
message, but failed to pass it to mysqld in the bootstrap.

Also match log_error as it might appear in the .cnf files.

Thanks Michal Schorm for the test case.

Reviewed by: Faustin Lammler
2022-12-13 15:17:44 +01:00
Marko Mäkelä
1dc2f35598 Merge 10.4 into 10.5 2022-12-13 14:39:18 +02:00
Sergei Golubchik
da5d349935 fix error on reading 5.5 tables with generated columns 2022-12-13 14:38:48 +02:00
Sergei Petrunia
87eccd78a7 MDEV-30218: Incorrect optimization for rowid_filtering
(Patch from Monty, slightly amended)

Fix rowid filtering optimization in best_access_path():

== Ref access + rowid filtering ==
The cost computations compare #records and index-only scan cost
(keyread_tmp) to find out the per-record advantage one will get if
they skip reading full table record.

The computations produce wrong result when:

- the #records are "clipped down" with s->worst_seeks or
  thd->variables.max_seeks_for_key. keyread_tmp is not clipped
  this way so the numbers are not comparable.

- access_factor is negative. This means index_only read is
  cheaper than non-index-only read.

This patch makes the optimizer not to consider Rowid Filtering in
such cases.
The decision is logged in the Optimizer Trace using
"rowid_filter_skipped" name.

== Range access + rowid filtering ==
when considering to use Rowid Filter with range access, do multiply
keyread_tmp by record_count. That way, it is comparable with the
range access's estimate, which is multiplied by record_count.
2022-12-13 13:45:54 +02:00
Marko Mäkelä
fdf43b5c78 Merge 10.3 into 10.4 2022-12-13 11:37:33 +02:00
Daniel Black
04efe13501 Merge branch '10.5' into 10.6
Merge Jan's bb-10.6-merge-jan branch:

MDEV-30172 Galera test case cleanup

    * Delete tests that are not supported and not going to be supported
      any time soon
    * Fix result set on tests that are not run on bb
    * Fix tests that fail because of auto increment offset
    * Make sure that disabled tests have open bug report
2022-12-13 13:00:30 +11:00
Jan Lindström
cc78cd7d15 MDEV-30172 galera 10.5 test cleanup
galera.galera_bf_abort_at_after_statement disabled by Daniel Black
2022-12-13 12:49:13 +11:00
Daniel Black
3b249a6e56 Merge branch '10.5' into 10.6
Adjust galera/galera_3nodes disabled tests.
2022-12-13 11:12:24 +11:00
Daniel Black
58fecbebce mtr: galera/galera_3node disable failed tests 2022-12-13 11:09:32 +11:00
Daniel Black
72f1384c3a Merge branch 10.4 into 10.5 2022-12-13 09:57:19 +11:00
Daniel Black
382e85fe70 MDEV-30065: mariadb-install-db allow for --enforce-storage-engine=InnoDB
Hide the errors related to missing innodb stats tables in bootstrap mode
on the assumption that because we are in bootstrap mode they are going
to be created.
2022-12-13 08:47:48 +11:00
Marko Mäkelä
1862273c43 MDEV-30209 Race condition between fil_node_open_file() and renaming files
mtr_t::commit_file(): Protect the rename operation with fil_system.mutex
like we used to do before commit 2e43af69e3
in order to prevent fil_node_open_file() from running concurrently.
In other words, fil_system.mutex will protect the consistency of
fil_node_t::name and the file name in the file system.

This race condition should be very hard to trigger. We would need
a low value of innodb_open_files or table_cache limit so that
fil_space_t::try_to_close() will be invoked frequently. Simultaneously
with a RENAME operation, something (such as a write of a data page)
would have to try to open the file.
2022-12-12 11:41:12 +02:00
Marko Mäkelä
21ef68d52e Merge 10.8 into 10.9 2022-12-12 08:09:55 +02:00
Marko Mäkelä
57737258be Merge 10.7 into 10.8 2022-12-12 08:09:27 +02:00
Marko Mäkelä
dbcbee1017 Merge 10.6 into 10.7 2022-12-12 08:08:44 +02:00
Marko Mäkelä
cf437f6be9 Fix GCC -Og -Wmaybe-uninitialized
This fixes up commit dd5f4b3625
2022-12-12 08:07:47 +02:00
Marko Mäkelä
c4d7939989 MDEV-30180 Server hang with innodb_undo_log_truncate=ON
trx_purge_truncate_history(): In case of an apparent conflict with
buf_pool_t::release_freed_page(), always momentarily acquire
buf_pool.mutex, to let the thread that is holding it and waiting for
buf_pool.flush_list_mutex to proceed.

The fix in commit c410f7aaea was
insufficient, because simple yielding would not necessarily let
the conflicting thread to acquire buf_pool.flush_list_mutex.

This hang was reported and the fix tested by Axel Schwenke.
2022-12-12 07:54:38 +02:00
Daniel Black
c1cc6e8496 Correct DBUG_ENTER for Pushdown_derived::execute 2022-12-12 11:24:07 +11:00
Julius Goryavsky
a491400833 MDEV-29814: galera_var_notify_ssl_ipv6 causes testing system to hang
This commit fixes the test system hanging due to
the galera_var_notify_ssl_ipv6 test and also brings
the wsrep_notify[_ssl].sh files in line with each other
between the user template and the mtr suite.

Quotes are also added here to avoid problems if the
user specifies the value of one of the variables at the
beginning of the file containing shell-specific characters,
for example, if the password or username specified in the
PSWD and USER variables will contain the "$" character.

Also fixed an issue with automatic --ssl-verify-server-cert
option substitution when the corresponding value is set
by the user to "1" or "on".

Also fixed some tests here to avoid joining one of the nodes
to another cluster when the nodes are restarted from the mtr
side, which can lead to random failures when testing with
buildbot.
2022-12-10 01:11:55 +01:00