Commit graph

189377 commits

Author SHA1 Message Date
Marko Mäkelä
4e24b3187c MDEV-19951 followup: Remove unused st_handler_tablename, tablename_compare 2020-11-10 14:19:33 +02:00
Daniel Black
f5d2d455a6 MDEV-24098 (Oracle mode) CREATE USER/ALTER USER PASSWORD EXPIRE/LOCK in either order
tested with:

$ mysql-test/mtr --mem --mysqld=--sql-mode=ORACLE main.lock_user

Observed Oracle syntax quoting difference in `SHOW CREATE USER`
output only.

Omission in syntax noticed by Robert Bindar.

Identical to previous patch except in sql_yacc_ora.yy
2020-11-09 09:33:08 +11:00
Daniel Black
add6782636 MDEV-24098 CREATE USER/ALTER USER PASSWORD EXPIRE/LOCK in either order
Reviewed-by: vicentiu@mariadb.org
2020-11-04 22:17:05 +11:00
Daniel Black
fd7569ea6b MDEV-24098: SHOW CREATE USER invalid for both PASSWORD and LOCKED
The parser of CREATE USER accepts ACCOUNT LOCK before PASSWORD
EXPIRE but not the other way around.

This just changes the SHOW CREATE USER to output a sql syntax that
is valid.

Thanks to Robert Bindar for analysis.
2020-11-04 22:17:04 +11:00
Nayuta Yanagisawa
b13fe8e51b MDEV-18842: Unfortunate error message when the same column is used for application period start and end
An application-time period must be composed of two different columns.
We added a check that ensures that the above condition is met.
2020-11-04 12:33:13 +03:00
Jan Lindström
0f04f61395 Need more information about mysql-wsrep#198 sporadic test failure. 2020-11-04 09:28:02 +02:00
Daniele Sciascia
1f1fa07cd5 MDEV-24063 Assertion during graceful shutdown with wsrep_on=OFF
During graceful shutdowns, client connections are closed and
eventually and THD::awake() acquires LOCK_thd_data mutex which is
required later on in wsrep_thd_is_aborting(). Make sure LOCK_thd_data
is acquired, even if global wsrep_on is disabled.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2020-11-03 19:47:17 +02:00
sjaakola
4d6c661144 MDEV-21577 MDL BF-BF conflict
Some DDL statements appear to acquire MDL locks for a table referenced by
foreign key constraint from the actual affected table of the DDL statement.
OPTIMIZE, REPAIR and ALTER TABLE belong to this class of DDL statements.

Earlier MariaDB version did not take this in consideration, and appended
only affected table in the certification key list in write set.
Because of missing certification information, it could happen that e.g.
OPTIMIZE table for FK child table could be allowed to apply in parallel
with DML operating on the foreign key parent table, and this could lead to
unhandled MDL lock conflicts between two high priority appliers (BF).

The fix in this patch, changes the TOI replication for OPTIMIZE, REPAIR and
ALTER TABLE statements so that before the execution of respective DDL
statement, there is foreign key parent search round. This FK parent search
contains following steps:
* open and lock the affected table (with permissive shared locks)
* iterate over foreign key contstraints and collect and array of Fk parent
  table names
* close all tables open for the THD and release MDL locks
* do the actual TOI replication with the affected table and FK parent
  table names as key values

The patch contains also new mtr test for verifying that the above mentioned
DDL statements replicate without problems when operating on FK child table.
The mtr test scenario #1, which can be used to check if some other DDL
(on top of OPTIMIZE, REPAIR and ALTER) could cause similar excessive FK
parent table locking.

Reviewed-by: Aleksey Midenkov <aleksey.midenkov@mariadb.com>
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2020-11-03 19:40:06 +02:00
Daniel Bartholomew
5739c7702d
bump the VERSION 2020-11-03 10:59:26 -05:00
Marko Mäkelä
533a13af06 Merge 10.3 into 10.4 2020-11-03 14:49:17 +02:00
Marko Mäkelä
4b3690b504 fixup 67cb7ea22a 2020-11-03 14:48:08 +02:00
Jan Lindström
67cb7ea22a Clean up wsrep.variables 2020-11-03 09:12:06 +02:00
Teemu Ollakka
4489b66afb MDEV-23872 Crash in galera::TrxHandle::state()
Prepared statements which were run over binary protocol crashed
a server if the statement did not have CF_PS_ARRAY_BINDING_OPTIMIZED
flag and the statement was executed in bulk mode and a BF abort occrurred.
This was because the bulk execution resulted in several statements without
calling wsrep_after_statement() between, which confused wsrep transaction
state tracking.

As a fix, call wsrep_after_statement() in bulk loop after each execution
if CF_PS_ARRAY_BINDING_OPTIMIZED is not set.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2020-11-03 09:11:04 +02:00
Marko Mäkelä
9e14a2df8c MDEV-24072 Assertion 'ib_table.n_v_cols' failed in instant_alter_column_possible()
instant_alter_column_possible(): Relax a too strict debug assertion.
The existence of an index stub or a corrupted index on virtual columns
does not imply that virtual columns exist.
2020-11-02 16:07:06 +02:00
Marko Mäkelä
e6290a8270 Merge 10.2 into 10.3 2020-11-02 16:02:16 +02:00
Marko Mäkelä
3fe306c891 fixup a593e03d58: nullptr
C++11 is allowed only starting with MariaDB Server 10.4.
2020-11-02 16:01:32 +02:00
Marko Mäkelä
c7f322c91f Merge 10.2 into 10.3 2020-11-02 15:48:47 +02:00
Marko Mäkelä
8036d0a359 MDEV-22387: Do not violate __attribute__((nonnull))
This follows up commit
commit 94a520ddbe and
commit 7c5519c12d.

After these changes, the default test suites on a
cmake -DWITH_UBSAN=ON build no longer fail due to passing
null pointers as parameters that are declared to never be null,
but plenty of other runtime errors remain.
2020-11-02 14:19:21 +02:00
Marko Mäkelä
d2fab68667 Merge bb-10.2-release into 10.2 2020-11-02 14:17:15 +02:00
Marko Mäkelä
ff0b6122a1 MDEV-23630 fixup: main.mysqldump result
This was missed in commit d6ea03fa94.
2020-11-02 14:17:09 +02:00
Sergei Petrunia
a593e03d58 Add dbug_print_sel_arg() debugging help function 2020-11-01 14:33:57 +03:00
Elena Stepanova
d5ce782444 List of unstable tests for 10.3.26 release 2020-11-01 02:56:29 +02:00
Daniel Black
d6ea03fa94 MDEV-23630: mysqldump logically dump system table information
Add --system={all, users, plugins, udfs, servers, stats, timezones}

This will dump system information from the server in
a logical form like:
* CREATE USER
* GRANT
* SET DEFAULT ROLE
* CREATE ROLE
* CREATE SERVER
* INSTALL PLUGIN
* CREATE FUNCTION

"stats" is the innodb statistics tables or EITS and
these are dumped as INSERT/REPLACE INTO statements
without recreating the table.

"timezones" is the collection of timezone tables
which are important to transfer to generate identical
results on restoration.

Two other options have an effect on the SQL generated by
--system=all. These are mutually exclusive of each other.
* --replace
* --insert-ignore

--replace will include "OR REPLACE" into the logical form
like:
* CREATE OR REPLACE USER ...
* DROP ROLE IF EXISTS (MySQL-8.0+)
* CREATE OR REPLACE ROLE ...
* UNINSTALL PLUGIN IF EXISTS (10.4+) ... (before INSTALL PLUGIN)
* DROP FUNCTION IF EXISTS (MySQL-5.7+)
* CREATE OR REPLACE [AGGREGATE] FUNCTION
* CREATE OR REPLACE SERVER

--insert-ignore uses the construct " IF NOT EXISTS" where
supported in the logical syntax.

'CREATE OR REPLACE USER' includes protection against
being run as the same user that is importing the mysqldump.

Includes experimental support for dumping mysql-5.7/8.0
system tables and exporting logical SQL compatible with MySQL.

Updates mysqldump man page, including this information and
(removing obsolute bug reference)

Reviewed-by: anel@mariadb.org
2020-11-01 08:04:36 +11:00
Elena Stepanova
6d3792a9a2 List of unstable tests for 10.2.35 release 2020-10-31 19:49:24 +02:00
Daniel Black
5b779c220d MDEV-22974: mysql_native_password make "invalid" valid
Per b9f3f06857, mysql_system_tables_data.sql creates
a mysql_native_password with a salted hash of "invalid" so that `set password`
will detect a native password can be applied:.

SHOW CREATE USER; diligently uses this value in its output
generating the SQL:

   MariaDB [(none)]> show create user;

   +---------------------------------------------------------------------------------------------------+
   | CREATE USER for dan@localhost                                                                     |
   +---------------------------------------------------------------------------------------------------+
   | CREATE USER `dan`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket |
   +---------------------------------------------------------------------------------------------------+

Attempting to execute this before this patch results in:

  MariaDB [(none)]>  CREATE USER `dan2`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket;
  ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

As such, deep the implementation of mysql_native_password we make "invalid" valid (pun intended)
such that the above create user will succeed. We do this by storing
"*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE" (credit: Oracle MySQL), that is of an INCORRECT
length for a scramble.

In native_password_authenticate we check the length of this cached value
and immediately fail if it is anything other than the scramble length.

native_password_get_salt is only called in the context of set_user_salt, so all setting of native
passwords to hashed content of 'invalid', quite literally create an invalid password.

So other forms of "invalid" are valid SQL in creating invalid passwords:

   MariaDB [(none)]> set password = 'invalid';
   Query OK, 0 rows affected (0.001 sec)

   MariaDB [(none)]> alter user dan@localhost IDENTIFIED BY PASSWORD 'invalid';
   Query OK, 0 rows affected (0.000 sec)

closes #1628

Reviewer: serg@mariadb.com
2020-10-31 09:14:37 +11:00
Oleksandr Byelkin
794f665139 Merge branch '10.2' into 10.3 2020-10-30 17:23:53 +01:00
Marko Mäkelä
1fddccf676 Update Connector/C 2020-10-30 13:47:56 +02:00
Marko Mäkelä
5b3be9e1c6 Try to stabilize main.innodb_ext_key,off
Thanks to Varun Gupta for suggesting this. This seems to
make main.innodb_ext_key,off more stable.
2020-10-30 13:47:56 +02:00
Marko Mäkelä
cb253b8687 MDEV-22387: Static_binary_string::q_append() invokes memcpy on NULL
Invoking memcpy() on a NULL pointer is undefined behaviour
(even if the length is 0) and gives the compiler permission to
assume that the pointer is nonnull. Recent versions of GCC
(starting with version 8) are more aggressively optimizing away
checks for NULL pointers. This undefined behaviour would cause
a SIGSEGV in the test main.func_encrypt on an optimized debug build
on GCC 10.2.0.
2020-10-30 13:07:42 +02:00
Marko Mäkelä
72eea39d4c MDEV-23991 fixup: Initialize the memory
This regression was introduced in
commit afc9d00c66.
This is a partial backport of
commit 199863d72b from 10.4.
2020-10-30 12:58:16 +02:00
Marko Mäkelä
fbcd7c0c06 Update Connector/C 2020-10-30 12:22:23 +02:00
Varun Gupta
5a0c34e4c2 MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare
The issue here was the system variable max_sort_length was being applied
to decimals and it was truncating the value for decimals to the number
of bytes set by max_sort_length.
This was leading to a buffer overflow as the values were written
to the buffer without truncation and then we moved the offset to
the number of bytes(set by max_sort_length), that are needed for comparison.

The fix is to not apply max_sort_length for fixed size types like INT,
DECIMALS and only apply max_sort_length for CHAR, VARCHARS, TEXT and
BLOBS.
2020-10-30 12:22:01 +02:00
Sergei Golubchik
c790218612 Fix RPM packaging on cmake 3.18+
cmake has caught up and since version 3.18 it started supporting
CPACK_RPM_POST_TRANS_SCRIPT_FILE, something we've supported for
two years and cmake 2.8.11. Both implementation add %posttrans tag
and rpmbuild gets confused.

Disable our implementation for cmake 3.18+
2020-10-30 10:32:59 +01:00
Marko Mäkelä
199863d72b MDEV-23991 fixup: Initialize the memory
Also, revert the work-around for the test that was attempted in
commit 85613a3247.

This issue was caught by MemorySanitizer as well as on the
Microsoft Windows debug builds, thanks to /MD being used
starting with 10.4.

The code fix will also be applied to 10.2 because the regression
was introduced in commit afc9d00c66.
2020-10-30 11:04:16 +02:00
Jan Lindström
5482d62760 Fix sporadic test failure on galera_parallel_apply_3nodes.
Test itself is not deterministic.
2020-10-30 09:19:29 +02:00
Jan Lindström
9936235985 MDEV-23659: Update Galera disabled.def file
Disable galera_var_replicate_myisam until fixed on 10.4
2020-10-30 08:54:05 +02:00
Jan Lindström
5485671474 Remove test that does not apply for 10.4. 2020-10-30 08:52:10 +02:00
Oleksandr Byelkin
a90b15837c MDEV-19838: fix of error messages 2020-10-29 22:20:21 +01:00
Oleksandr Byelkin
f9b0ee07ef MDEV-19838: followup, fix for PS & embedded
Use 9 byte (min length packet)
2020-10-29 22:19:32 +01:00
Monty
eb38e7ef60 MDEV-22879 SIGSEGV (or hang) in free/my_free
This bug was already fixed in a previous commit.
Added test case from the MDEV to prove it's fixed.
2020-10-29 19:20:10 +02:00
Monty
14d43f4fa6 MDEV-23222 SIGSEG in maria_create() because of double free
The crash happens because a double free in the case CREATE TABLE fails
because there is a conflicting tables on disk.

Fixed by ensuring that the double free can't happen.
2020-10-29 18:34:26 +02:00
Monty
4c99e3e948 Fixed bug in detection of getgrouplist parameters.
On my system, OpenSuse, I got a compilation error that some arguments
to getgrouplist() where not initialized
2020-10-29 17:36:49 +02:00
Marko Mäkelä
85613a3247 After-merge fix: main,innodb_ext_key,off
For some reason, in the test main,innodb_ext_key,off
we frequently get unexpected EXPLAIN output, in particular
on Microsoft Windows debug builders. Let us comment out that
EXPLAIN statement for now.
2020-10-29 16:27:04 +02:00
Monty
14798d3cd1 MDEV-23159 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2'...
The problem was that opt_sum_query() was, as part of MIN/MAX optimization,
doing read operations on constant tables that where already closed

Fixed by ensuring we don't try to read from tables that are closed.
2020-10-29 16:22:30 +02:00
Oleksandr Byelkin
2e5450af05 Merge branch '10.1' into 10.2 2020-10-29 15:16:53 +01:00
Marko Mäkelä
7b2bb67113 Merge 10.3 into 10.4 2020-10-29 13:38:38 +02:00
Aleksey Midenkov
27b762e23d MDEV-22805 SIGSEGV in check_fields on UPDATE
Additional case for PS protocol: UPDATE is converted to multi-update
in mysql_multi_update_prepare().
2020-10-29 13:47:50 +03:00
Sergei Golubchik
17cf27f5b6 remove non-working debug assert
and restore the test modified in the same commit
(the non-replication related deadlock will be reported separately)
2020-10-29 09:35:39 +01:00
Sergei Golubchik
d6302c9a47 MDEV-23702 calculating(auto rounding) issue
Implement a different fix for
"MDEV-19232: Floating point precision / value comparison problem"

Instead of truncating decimal values after every division,
truncate them for comparison purposes.

This reverts commit 62d73df6b2 but keeps the test.
2020-10-29 09:27:56 +01:00
Sergei Golubchik
313cf9de2c update result files after backport
followup for 3e807d255e and eae10a87ff
2020-10-29 09:27:05 +01:00