Commit graph

194725 commits

Author SHA1 Message Date
Vladislav Vaintroub
99e5ae3b1a MDEV-27090 Windows client - ReadConsoleA does not work correctly with UTF8 codepage
Corresponding Windows bug  https://github.com/microsoft/terminal/issues/4551

Use ReadConsoleW instead and convert to console's input codepage, to
workaround.

Also, disable VT sequences in the console output, as we do not knows what
type of data comes with SELECT, we do not want VT escapes there.

Remove my_cgets()
2021-12-15 19:13:57 +01:00
Vladislav Vaintroub
9e9b211f22 MDEV-27089 Windows : incorrect handling of non-ASCIIs in get_tty_password
Prior to patch, get_password would echo multple mask characters '*', for
a single multibyte input character.

Fixed the behavior by using "wide" version of getch, _getwch.
Also take care of possible characters outside of BMP (i.e we do not print
'*' for high surrogates).

The function will now internally construct the "wide" password string,
and conver to the console codepage. Some characters could still be lost
in that conversion, unless the codepage is utf8, but this is not any new
bug.
2021-12-15 19:13:57 +01:00
Monty
607b14c4dc Add --optimizer_trace option to mysqltest
This enables optimizer_trace output for the next SQL command.
Identical as if one would have done:
- Store value of @@optimizer_trace
- Set @optimizer_trace="enabled=on"
- Run query
- SELECT * from OPTIMIZER_TRACE
- Restore value of @@optimizer_trace

This is a great time saver when one wants to quickly check the optimizer
trace for a query in a mtr test.
2021-12-15 19:11:25 +02:00
Jan Lindström
f1ca949f2b Disable following tests from galera_3nodes suite
* galera_pc_bootstrap
* galera_ipv6_mariabackup
* galera_ipv6_mariabackup_section
* galera_ipv6_rsync
* galera_ipv6_rsync_section
* galera_ssl_reload
* galera_toi_vote
* galera_wsrep_schema_init

because MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
2021-12-15 16:58:27 +02:00
Sergei Golubchik
6208228b78 disable galera_3nodes.galera_ipv6_mariabackup
and galera_3nodes.galera_ipv6_mariabackup_section
until their corresponding MDEV's are fixed.

They fail almost everywhere.
2021-12-15 15:43:03 +01:00
Monty
3691cc1575 MDEV-18187 Aria engine: Redo phase failed with "error 192 when executing record redo_index_new_page" upon startup on a restored datadir
The issue is that when recovery is about to create a new data or index
page it check if the page already exits.
If the page does not exists (file is too short) or contains wrong checksum,
then the recovery code will recreate the page.
The bug was that the code that checked if the page existed didn't take
into account encrypted pages.

Fixed by adding a check if page could not be encrypted solved the issue.
I also added some code to silence decryption errors for new pages.

Test case and some inspiration for how to solve this come from
the pull request by alexandr.miloslavsky
2021-12-15 16:28:01 +02:00
Marko Mäkelä
ef9517eb81 MDEV-27268 Failed InnoDB initialization leaves garbage files behind
create_log_files(): Check log_set_capacity() before modifying
or creating any log files.

innobase_start_or_create_for_mysql(): If create_log_files()
fails and we were initializing a new database, delete the
system tablespace files before exiting.
2021-12-15 14:17:55 +02:00
Julius Goryavsky
30bf0bca8f MDEV-27181: Galera SST scripts should use ssl_capath for CA directory
1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA
   directory. The current implementation tries to automatically
   detect the path using the trailing slash in the ssl_ca variable
   value, but this approach is not compatible with the server
   configuration. Now, by analogy with the server, SST scripts
   also use a separate ssl_capath variable. In addition, a similar
   tcapath variable has been added for the old-style configuration
   (in the "sst" section).
2. Openssl utility detection made more reliable.
3. Removed extra spaces in automatically generated command lines -
   to simplify debugging of the SST scripts.
4. In general, the code for detecting the presence or absence of
   auxiliary utilities has been improved - it is made more reliable
   in some configurations (and for shells other than bash).
2021-12-14 13:44:35 +01:00
Julius Goryavsky
03678bcf55 MDEV-27181: Galera SST scripts should use ssl_capath for CA directory
1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA
   directory. The current implementation tries to automatically
   detect the path using the trailing slash in the ssl_ca variable
   value, but this approach is not compatible with the server
   configuration. Now, by analogy with the server, SST scripts
   also use a separate ssl_capath variable. In addition, a similar
   tcapath variable has been added for the old-style configuration
   (in the "sst" section).
2. Openssl utility detection made more reliable.
3. Removed extra spaces in automatically generated command lines -
   to simplify debugging of the SST scripts.
4. In general, the code for detecting the presence or absence of
   auxiliary utilities has been improved - it is made more reliable
   in some configurations (and for shells other than bash).
2021-12-14 13:36:13 +01:00
Marko Mäkelä
4434fb4a75 Merge 10.7 into 10.8 2021-12-14 14:29:04 +02:00
Marko Mäkelä
92a4e76a2c Merge 10.6 into 10.7 2021-12-14 14:27:35 +02:00
Julius Goryavsky
dda0bfaaec MDEV-27181: Galera SST scripts should use ssl_capath for CA directory
1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA
   directory. The current implementation tries to automatically
   detect the path using the trailing slash in the ssl_ca variable
   value, but this approach is not compatible with the server
   configuration. Now, by analogy with the server, SST scripts
   also use a separate ssl_capath variable. In addition, a similar
   tcapath variable has been added for the old-style configuration
   (in the "sst" section).
2. Openssl utility detection made more reliable.
3. Removed extra spaces in automatically generated command lines -
   to simplify debugging of the SST scripts.
4. In general, the code for detecting the presence or absence of
   auxiliary utilities has been improved - it is made more reliable
   in some configurations (and for shells other than bash).
2021-12-14 12:38:24 +01:00
mkaruza
b1d647ae85 MDEV-27001 Galera crashes when converting table to partition
SQL statments could have table entries added in lexer. This entries
should not invalidate `next_global` member.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2021-12-14 09:00:08 +02:00
sjaakola
66b492f3e4 Fix for the test galera.galera_UK_conflict
mtr test galera.galera_UK_conflict, has rather distorted logic in test scenario 2.

The test would fail always with:

CURRENT_TEST: galera.galera_UK_conflict
mysqltest: In included file "./include/galera_wait_sync_point.inc":
included from /home/seppo/work/wsrep/mariadb-server/mysql-test/suite/galera/t/galera_UK_conflict.test at line 216:
At line 3: query 'SET SESSION wsrep_on = 0' failed: 1179: You are not allowed to execute this command in a transaction

This happens because wait_condition is called in wrong connection (node_1, which is excuting MST transaction)

This test is fixed by using contl connection for wait contdition check, and new result is recorded as well
2021-12-14 08:25:31 +02:00
Julius Goryavsky
7bc629a5ce MDEV-27181: Galera SST scripts should use ssl_capath for CA directory
1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA
   directory. The current implementation tries to automatically
   detect the path using the trailing slash in the ssl_ca variable
   value, but this approach is not compatible with the server
   configuration. Now, by analogy with the server, SST scripts
   also use a separate ssl_capath variable. In addition, a similar
   tcapath variable has been added for the old-style configuration
   (in the "sst" section).
2. Openssl utility detection made more reliable.
3. Removed extra spaces in automatically generated command lines -
   to simplify debugging of the SST scripts.
4. In general, the code for detecting the presence or absence of
   auxiliary utilities has been improved - it is made more reliable
   in some configurations (and for shells other than bash).
2021-12-14 03:32:35 +01:00
Julius Goryavsky
8bb5563369 MDEV-27181: Galera SST scripts should use ssl_capath for CA directory
1. Galera SST scripts should use ssl_capath (not ssl_ca) for CA
   directory. The current implementation tries to automatically
   detect the path using the trailing slash in the ssl_ca variable
   value, but this approach is not compatible with the server
   configuration. Now, by analogy with the server, SST scripts
   also use a separate ssl_capath variable. In addition, a similar
   tcapath variable has been added for the old-style configuration
   (in the "sst" section).
2. Openssl utility detection made more reliable.
3. Removed extra spaces in automatically generated command lines -
   to simplify debugging of the SST scripts.
4. In general, the code for detecting the presence or absence of
   auxiliary utilities has been improved - it is made more reliable
   in some configurations (and for shells other than bash).
2021-12-14 03:25:19 +01:00
Marko Mäkelä
6b066ec332 MDEV-27235: Crash on SET GLOBAL innodb_encrypt_tables
fil_crypt_set_encrypt_tables(): If no encryption threads have been
initialized, do nothing.
2021-12-13 08:04:45 +02:00
Thirunarayanan Balathandayuthapani
660cfe4782 MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
- Addressing the format issue in deferred_dblwr() and changed the
function comment.
2021-12-12 15:09:59 +05:30
Thirunarayanan Balathandayuthapani
18c335a39e MDEV-27111 atomic.rename_table test case fails
InnoDB fails to identify the deferred tablespace after recovery.
Problem is that InnoDB fails to rename the tablespace present
in recovered tablespace. Fix is that InnoDB should try to rename the
recovered tablespace when tablespace is being deferred
2021-12-12 09:58:54 +05:30
Thirunarayanan Balathandayuthapani
be5990d0c8 MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
This patch reverts the commit cab8f4b552.
InnoDB fails to restore page0 from doublewrite buffer when the
tablespace is being deferred. In that case, InnoDB doesn't find
INIT_PAGE redo log record for page0 and it leads to failure.
InnoDB should recovery page0 from doublewrite buffer for the
deferred tablespace before applying the redo log records.

Added deferred_dblwr() to restore page0 of deferred tablespace
from doublewrite buffer
2021-12-12 09:58:54 +05:30
Marko Mäkelä
88b339805d Fix a test for cmake -DPLUGIN_PERFSCHEMA=NO 2021-12-11 15:27:14 +02:00
Sergei Krivonos
ea94895369 MDEV-27206: [ERROR] Duplicated key: cause, Assertion `is_uniq_key' failed with optimizer trace 2021-12-10 22:12:01 +02:00
Marko Mäkelä
ccdf5711a8 Merge 10.7 into 10.8 2021-12-10 13:05:06 +02:00
Marko Mäkelä
979b23d5bf Add forgotten changes to the parent commit 2021-12-10 13:04:46 +02:00
Marko Mäkelä
978116d991 Merge 10.7 into 10.8 2021-12-10 12:29:14 +02:00
Marko Mäkelä
28b27b96d0 Cleanup: Remove some ib::logger in recovery messages 2021-12-10 12:26:26 +02:00
sjaakola
74b3d4252a MDEV-27218 mtr test galera.MDEV-20793 has sporadic false positive failures
Fixes to make the galera.MDEV-20793 test deterministic.
Specifically, after --send COMMIT, there is now a sync point to catch a known state of the COMMIT execution
2021-12-10 12:10:42 +02:00
Marko Mäkelä
26fdbd7632 Merge 10.6 into 10.7 2021-12-10 11:32:49 +02:00
Marko Mäkelä
50ed0bd891 MDEV-27219 Some error messages might report table names incorrectly on LLP64
In commit 49e2c8f0a6 (MDEV-25743)
some more use of the printf-style format "%.*s" was added.
The length parameter is of type int, not size_t.
On 64-bit platforms that follow the LLP64 convention (such as
64-bit Microsoft Windows), sizeof(int)==4 and sizeof(size_t)==8.

Let us explicitly cast the lengths to the correct type in order
to avoid any trouble.
2021-12-10 11:29:06 +02:00
Sergei Golubchik
0745db7179 don't use buffered_option_error_reporter without perfschema
it's not printed, not cleaned up without perfschema,
so isn't supposed to be written into either

this fixes "Memory not freed" warnings when early command line
options produce warnings in non-perfschema builds
2021-12-10 09:40:50 +01:00
forkfun
eafa2a1411 enable partition_open_files_limit test 2021-12-09 16:29:22 +01:00
Sergei Petrunia
c88e37ff85 MDEV-27204: [ERROR] Json_writer: a member name was expected, Assertion `got_name
[Adjusting Sergei Krivonos's patch]

"duplicates_removal" may contain multiple elements inside it and
so should have a JSON array as a value (and not object).
2021-12-09 16:49:40 +03:00
forkfun
a9b5f59989 enable rpl_parallel2 test, as MDEV-23089 is fixed 2021-12-08 15:16:57 +01:00
Sergei Golubchik
f502ae8226 SUMMARY/DESCRIPTION for compression provider RPMs 2021-12-08 14:57:37 +01:00
forkfun
5e8148819e minor cleanup of backup_lock_binlog.test, so that test passes also with statement binlog format 2021-12-08 14:28:42 +01:00
Alexey Yurchenko
5c8e628dda wsrep-lib update: bugfixes, cleanups, event API, state transition cleanups
Don't switch state to DONOR in `wsrep_sst_donate()` - wsrep-lib does it now
2021-12-08 13:16:23 +02:00
Sergei Golubchik
ef77c05126 Merge branch '10.6' into 10.7 2021-12-08 10:33:36 +01:00
Sergei Golubchik
60d565e66a cmake: detect lz4 version, require >= 1.6 2021-12-08 10:31:00 +01:00
Sergei Golubchik
186c1fa250 Merge branch '10.5' into 10.6 2021-12-07 22:11:30 +01:00
Sergei Golubchik
62ea1b4407 BUG#31761802 STATISTICS ANY QUERIES USING VIEWS ARE SUMMARIZED TOGETHER WITH THE VIEW DEFINITION SELECT
test case only
2021-12-07 21:31:27 +01:00
Sergei Golubchik
e27b1c3137 require system pcre2 in rpms
now when SLES12.3 is gone, we can enforce it
2021-12-07 21:31:13 +01:00
Sergei Golubchik
88ac91c7cc ColumnStore and S3 SUMMARY/DESCRIPTION for RPM 2021-12-07 21:31:00 +01:00
Sergei Golubchik
de70f921ce Merge branch '10.4' into 10.5 2021-12-07 21:30:27 +01:00
Sergei Krivonos
f974062c51 MDEV-19129: Fixed configure for Xcode, CMake generate
CMake Error in wsrep-lib/CMakeLists.txt:
  The custom command generating

    /Users/name/build/mariadb-server/sql/lex_token.h

  is attached to multiple targets:

    GenServerSource
    sql

  but none of these is a common dependency of the other(s).  This is not
  allowed by the Xcode "new build system".
2021-12-07 20:29:25 +01:00
Vladislav Vaintroub
f13c2107b3 Don't beep in mysql_upgrade_service.exe
This beep looks especially strange, as mysqladmin output is redirected to
the log file
2021-12-07 17:46:29 +01:00
Vladislav Vaintroub
8dd1f01d09 MDEV-27191 MariaDB client - "system" command does not work on Windows
- define USE_POPEN, like it is done elsewhere.
- use Notepad as default editor on Windows for the "edit" command.
2021-12-07 17:42:47 +01:00
Marko Mäkelä
cfcfdc65df MDEV-27190 InnoDB upgrade from 10.2, 10.3, 10.4 is not crash-safe
During startup, InnoDB must write a FILE_CHECKPOINT record.
However, before MDEV-12353 (in MariaDB Server 10.2, 10.3, 10.4)
the corresponding record MLOG_CHECKPOINT was encoded in a different way.

When we are upgrading from a logically empty 10.2, 10.3, or 10.4 redo log,
we must not write anything to the old log file, because if the server were
killed during the upgrade, we would end up with a corrupted log file, and
both the old and the new server would refuse to start up.

On upgrade, we must simply create a new logically empty log file
and replace the old ib_logfile0 with that.
2021-12-07 17:00:46 +02:00
forkfun
375ae890c7 enable rpl_semi_sync_after_sync and rpl_semi_sync_slave_compressed_protocol tests 2021-12-07 15:25:43 +01:00
Eugene Kosov
890c55177d MDEV-27183 optimize std::map lookup in during crash recovery
This is a low hanging fruit. Before this patch std::map::emplace() was
a ~50% of the whole recv_sys_t::parse() operation in by test.
After the fix it's only ~20%.

recv_sys_t::parse() recv_sys_t::pages is a collection of all pages
to recovery. Often, there are multiple changes for a single page.
Often, they go in a row and for such cases let's avoid
lookup in a std::map. cached_pages_it serves as a cache
of size 1.

recv_sys_t::add(): replace page_id argument with a std::map::iterator
2021-12-07 15:50:00 +06:00
Sergei Golubchik
1e8bcbd0a0 Revert "MDEV-27036: re-enable my_json_writer-t unit test"
This reverts commit 2d21917e7d.

No explainations, lots of code moved, wrong cmake changes
2021-12-07 09:57:51 +01:00