Commit graph

189614 commits

Author SHA1 Message Date
Etienne Guesnet
8de323f81a MDEV-24099: sql/sql_insert ip_len issue on AIX
ip_len has a different meaning on AIX so we use a
different variable name here not to conflict.

Backport from MDEV-20178 2f5d372444
2020-12-16 08:46:58 +11:00
Daniel Black
2c4761ccc1 MDEV-24172: innodb stats table last_update is TIMESTAMP
The last_updated column of innodb_table_stats and innodb_index_stats
hasn't been DATA_FIXBINARY for many years.

Innodb represents TIMESTAMP as INT of length 4. Let's test it with this
and stop hiding the result in mysql_upgrade test.

Reviewer: Marko
2020-12-16 08:18:19 +11:00
Stepan Patryshev
dc62a67ed3 MDEV-24414 Update and enable galera.galera_defaults 2020-12-15 18:05:59 +02:00
Stepan Patryshev
71806bf37c MDEV-24414 Update and enable galera.galera_defaults 2020-12-15 18:05:56 +02:00
Sergei Petrunia
066212d16c MDEV-21958: Query having many NOT-IN clauses running forever
Basic variant of the fix: do not consider conditions in form

  unique_key NOT IN (c1,c2...)

to be sargable. If there are only a few constants, the condition
is not selective. If there are a lot constants, the overhead of
processing such a huge range list is not worth it.

(Backport to 10.2)
2020-12-15 14:38:30 +03:00
Vladislav Vaintroub
ac9c6f53a5 MDEV-24034 Policy CMP0075 is not set during compile
The policy is not set for 10.2
If it is set, CMake would complain about bundled zlib for which the policy
is not set.

Fix:
- Set policy for 10.2 for the top level project.
For 10.3+ it was already set

- Cleanup zlib to remove unneeded stuff. It is an internal static library,
it needs none of PROJECT, library versioning, RC file on Windows.
The name of the library on Unix does not make any difference, since it is
static and compiled in.
2020-12-15 12:27:13 +01:00
Rucha Deodhar
74223c33d1 MDEV-23209: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'
failed in Diagnostics_area::set_ok_status on INSERT

Analysis: Error is not returned when strict mode is enabled and value is
truncated because double is outside range.
Fix: Return HA_ERR_AUTOINC_ERANGE if the error was reported when double is
outside range.
2020-12-15 13:00:24 +05:30
Rucha Deodhar
5f4d351d7f MDEV-22422: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status
Analysis: The error is not returned when the statement can't be used.
And so we still go on to search for keywords.
Fix: Return the error state.
2020-12-15 13:00:24 +05:30
Daniel Black
d4c35fb21b MDEV-24207: recognise mysql forms of invalid password for mysql_native_password
The main goal of this patch is to prevent MariaDB's native_password_plugin
from "parsing" the hex (or non hex) authentication_string. Due to how the
current code is written, we convert any string (within native_password_get_salt)
that has the appropriate length to a "binary" representation, that can
potentially match a real password.

More specifically,
"*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE" produces the same results as
"*d13c3c78dafa52d9bce09bdd1adcb7befced1ebe".

The length indicator is the main indicator of an invalid password. We use
use same trick with "invalid" to change its internal representation.

The "parsing" mentioned is by get_salt_from_password down to char_val()
and because if where it is, its effectively a static plugin API that cannot
change.

In supporting these, we support the SHOW CREATE USER from MySQL may have the
hashed password string: *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE.

Obviously this isn't a hash because it contains non-hex characters.

After this patch we do however recognise the pattern;

 [any char, notionally *]{40 chars not all are hex}

as a pattern for an invalid password. This was determined to be the general
pattern that MySQL used.

Reviewers: Sergei G, Vicentiu
2020-12-15 15:15:29 +11:00
Daniel Black
384f107ae5 MDEV-21646: postfix - my_addr_resolve: static Dl_info info
Encountered the linker failure on Debug build in 10.4:

[53/585] Linking CXX executable unittest/sql/mf_iocache-t
FAILED: unittest/sql/mf_iocache-t
: && /usr/bin/c++  -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -fPIC -g -DENABLED_DEBUG_SYNC -ggdb3 -DSAFE_MUTEX -DSAFEMALLOC -DTRASH_FREED_MEMORY -Wall -Wextra -Wno-format-truncation -Wno-init-self -Wno-nonnull-compare -Wno-unused-parameter -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -Werror  -Wl,-z,relro,-z,now unittest/sql/CMakeFiles/mf_iocache-t.dir/mf_iocache-t.cc.o unittest/sql/CMakeFiles/mf_iocache-t.dir/__/__/sql/mf_iocache_encr.cc.o  -o unittest/sql/mf_iocache-t  -lpthread  mysys/libmysys.a  unittest/mytap/libmytap.a  mysys_ssl/libmysys_ssl.a  mysys/libmysys.a  dbug/libdbug.a  mysys/libmysys.a  dbug/libdbug.a  -lz  -lm  strings/libstrings.a  -lpthread  -lssl  -lcrypto  -ldl && :
/usr/bin/ld: mysys/libmysys.a(my_addr_resolve.c.o):/home/dan/repos/mariadb-server-10.4/mysys/my_addr_resolve.c:173: multiple definition of `info'; unittest/sql/CMakeFiles/mf_iocache-t.dir/mf_iocache-t.cc.o:/home/dan/repos/mariadb-server-10.4/unittest/sql/mf_iocache-t.cc:99: first defined here

We make Dl_info static as in MDEV-21646 moving it out of the function
was the main goal and having it scope limited by static doesn't affect
the function.
2020-12-15 14:47:16 +11:00
Stepan Patryshev
0ea650022d MDEV-23659 Update Galera disabled.def file 2020-12-14 19:50:48 +02:00
Varun Gupta
e5d88e03be MDEV-22740: UBSAN: sql/opt_split.cc:1150:28: runtime error: shift exponent 61 is too large for 32-bit type 'int' (on optimized builds)
Use a ulonglong instead of uint when left shifting to calculate the table map for all the tables in a query
2020-12-14 16:51:30 +05:30
Sergei Golubchik
e9d86d80be issue ER_USER_IS_BLOCKED also for non-existent users
following the same masquerading logic
2020-12-12 13:07:03 +01:00
Sergei Golubchik
18256bce23 remove the test for MDEV-22485 that doesn't test MDEV-22485
This reverts commit bc2dc83cb5.
2020-12-12 12:21:41 +01:00
Sergei Petrunia
dcc7f93965 MDEV-21958: Query having many NOT-IN clauses running forever, part 3
Add the new file
2020-12-11 22:45:54 +03:00
Sergei Petrunia
502bc77f23 MDEV-21958: Query having many NOT-IN clauses running forever, part 2
Move the testcase into a separate file: embedded server
doesn't have optimizer trace.
2020-12-11 22:44:13 +03:00
Sergei Golubchik
121582647c MDEV-24279 Segfault after 1 day and 5 minutes uptime
feedback plugin now fakes a SHOW command to force
create_schema_table() to instantiate the table at once,
not lazily.

The test from plugins.feedback_plugin_send applies.

Caused by e64084d5a3
2020-12-11 20:36:06 +01:00
Sergei Golubchik
4fa44c584c MDEV-24331 mysqldump fails with "Got error: 1356" if the database contains a view with a subquery
detect derived tables differently. TABLE_LIST::is_derived()
only works after mysql_derived_init()
2020-12-11 19:35:38 +01:00
Sergei Petrunia
4addd31531 MDEV-21958: Query having many NOT-IN clauses running forever
Basic variant of the fix: do not consider conditions in form

  unique_key NOT IN (c1,c2...)

to be sargable. If there are only a few constants, the condition
is not selective. If there are a lot constants, the overhead of
processing such a huge range list is not worth it.
2020-12-11 18:54:21 +03:00
Sergei Petrunia
0adbf27f00 Run innodb.innodb_stats test with EITS disabled.
- There is no reason to collect EITS statistics
- The test is sporadically failing on some platforms. I believe the
  issue is in InnoDB. Let's rule out EITS code as a possible source
  of the issue.
2020-12-11 17:33:44 +03:00
Sergei Golubchik
79fd338e6c MDEV-23942 mariadb-10.5.6/storage/connect/plugutil.cpp:380: bad width ?
cppcheck warnings
2020-12-10 15:25:14 +01:00
Sergei Golubchik
493c7d34cb MDEV-24194 View definition corruption
fix parsing of "1 IS NULL = 2"
2020-12-10 08:45:20 +01:00
Sergei Golubchik
f6e91552f0 MDEV-4677 GROUP_CONCAT not showing any output with group_concat_max_len >= 4Gb
don't allow group_concat_max_len values >= 4Gb
(they never worked anyway)
2020-12-10 08:45:20 +01:00
Sergei Golubchik
e189faf0b3 document that a fulltext parser plugin can replace mysql_add_word callback 2020-12-10 08:45:20 +01:00
Sergei Golubchik
aeb561cf3e tests for YEAR(N) 2020-12-10 08:45:20 +01:00
Sergei Golubchik
ba33d4753e cleanup: type_year test formatting 2020-12-10 08:45:20 +01:00
Sergei Golubchik
589479b3ec MDEV-14836 Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
Make the test case more robust. We only care that the query returns
no rows and that the server doesn't crash.
2020-12-10 08:45:20 +01:00
Sergei Golubchik
b31912fd35 MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare
don't allow too small max_sort_length values
2020-12-10 08:45:20 +01:00
Sergei Golubchik
59bbe873d4 Revert "MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare"
This reverts commit 5a0c34e4c2.
but keeps the test case
2020-12-10 08:45:20 +01:00
Aleksey Midenkov
f99abb45c5 MDEV-17573 Assertion in federatedx on multi-update
Cause: shared federatedx_io cannot store table-specific data.

Fix: move current row reference `federatedx_io_mysql::current` to
ha_federatedx.

FederatedX connection (represented by federatedx_io) is stored into
federatedx_txn::txn_list of per-server connections (see
federatedx_txn::acquire()). federatedx_txn object is stored into THD
(see ha_federatedx::external_lock()). When multiple handlers acquire
FederatedX connection they get single federatedx_io instance. Multiple
handlers do their operation via federatedx_io_mysql::mark_position()
and federatedx_io_mysql::fetch_row() in arbitrarty manner. They access
the same federatedx_io_mysql instance and same MYSQL_ROWS *current
pointer, so one handler disrupts the work of the other.

Related to "MDEV-14551 Can't find record in table on multi-table update
with ORDER BY".
2020-12-09 20:15:29 +03:00
Oleksandr Byelkin
86fc37b668 MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks
Early report error in case of DROP SEQUENCE <non-sequence>

Do not use error variable for other purposes except error.
2020-12-09 12:31:12 +01:00
Igor Babaev
a3f7f2334a MDEV-24019 Assertion is hit for query using recursive CTE with no default DB
When the query using a recursive CTE whose definition contained wildcard
symbols in the recursive part was processed at the prepare stage an
assertion was hit if the query was executed without any default database
set. The failure happened when the function insert_fields() tried to check
column privileges for the temporary table created for a recursive
reference to the CTE. No acl checks are needed for any CTE. That's why this
check should be blocked as well. The patch formulates a stricter condition
at which this check is to be blocked that covers the case when a query
using recursive CTEs is executed with no default database set.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2020-12-08 11:13:36 -08:00
Sujatha
e007fcf59d MDEV-19716: ASAN use-after-poison in Query_log_event::Query_log_event / THD::log_events_and_free_tmp_shares
Post push fix to address test failure.

Problem:
=======
rpl.rpl_drop_temp_table_invaid_lex added as part bug fix has occasional
failures in build bot.

MTR's internal check of the test case
'rpl.rpl_drop_temp_table_invaid_lex' failed.

 Variable_name    Value
-Slave_open_temp_tables    0
+Slave_open_temp_tables    1

Analysis:
=========
The reason for the failure is that the DROP TEMPORARY TABLE command which
gets generated on connection disconnect might not have reached the slave
and hence the temp table remains on the slave.

Fix:
===
On master, upon disconnect, wait till connection is completely gone.  Then
ensure that DROP TEMPORARY table statement is available in the binary log.
Sync the slave with master and check that temporary table count is zero on
slave. Fixed a typo in test name.
2020-12-08 11:59:58 +05:30
Igor Babaev
2db6eb1429 MDEV-22781 CREATE VIEW containing WITH clause Signal 11
For table references to CTEs the field TABLE_LIST::db must be set to
an empty string as it's done for table references to derived tables in
order CTEs to be processed similar to how derived tables are processed.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2020-12-07 09:26:40 -08:00
Anel Husakovic
bc2dc83cb5 MDEV-22485: add the test case
Closes PR #1649
2020-12-07 10:21:38 +01:00
Dan Solodko
47c4caf1bf mdev-22485 mysqlslap does not use current user as default 2020-12-07 10:21:38 +01:00
Anel Husakovic
f924a3bd6c MDEV-24139: CHECK_CLAUSE field in INFORMATION_SCHEMA.CHECK_CONSTRAINTS truncate check constraints expressions
- Reviewed by: daniel@mariadb.org
2020-12-07 09:56:06 +01:00
Anel Husakovic
eb7b14ec9a MDEV-21367: mysqld_safe log don't log to err.log
Introduced with 6b7918d524 in `10.2` just check for helper and handle
it if exist.

Reviewed by: cvicentiu@mariadb.org
2020-12-07 09:56:06 +01:00
Anel Husakovic
a82209ca31 MDEV-24177 && MDEV-24178
- MDEV-24177: main.sp2 test fails: Result length mismatch
- MDEV-24178: main.upgrade_MDEV-19650 test fails: Result length mismatch

Reviewed by: serg@mariadb.com
2020-12-07 09:56:06 +01:00
Igor Babaev
50d7eddc3d MDEV-24314 Unexpected error message when selecting from view that uses
mergeable derived table

Do not check privileges for derived tables/CTEs and their fields.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2020-12-04 08:53:40 -08:00
Marko Mäkelä
1eb59c307d MDEV-24340 Unique final message of InnoDB during shutdown
innobase_space_shutdown(): Remove. We want this step to be executed
before the message "InnoDB: Shutdown completed; log sequence number "
is output by innodb_shutdown(). It used to be executed after that step.

innodb_shutdown(): Duplicate the code that used to live in
innobase_space_shutdown().

innobase_init_abort(): Merge with innobase_space_shutdown().
2020-12-04 11:46:47 +02:00
Eugene Kosov
a50cb4867a MDEV-24334 make monitor_set_tbl global variable thread-safe
Atomic_relaxed<T>: add fetch_or() and fetch_and()

innodb_init(): rely on a zero-initialization of a global variable

monitor_set_tbl: make Atomic_relaxed<ulint> array and use proper operations
for setting bit, unsetting bit and reading bit

Reviewed by: Marko Mäkelä
2020-12-03 11:55:36 +03:00
Eugene Kosov
fccd810404 MDEV-24333 Data race in os_file_pread at os/os0file.cc:3308 on os_n_file_reads
os_n_file_reads: make Atomic_counter and correct the semantics of an imprecise
counter.

Reviewed by: Marko Mäkelä
2020-12-03 11:55:21 +03:00
Varun Gupta
b6ce493d53 Fixing compile failure on kvm full-text 2020-12-03 03:28:52 +05:30
Marko Mäkelä
24ec8eaf66 MDEV-15532 after-merge fixes from Monty
The Galera tests were massively failing with debug assertions.
2020-12-02 16:16:29 +02:00
Marko Mäkelä
589cf8dbf3 Merge 10.3 into 10.4 2020-12-01 19:51:14 +02:00
Vlad Lesin
e30a05f454 MDEV-22929 MariaBackup option to report and/or continue when corruption is encountered
Post-push Windows compilation errors fix.
2020-12-01 18:33:10 +03:00
Monty
7edfed6305 After merge fixes
Change thd->mdl_context.release_transactional_locks() to
thd->mdl_release_transactional_locks()
2020-12-01 16:23:28 +02:00
Marko Mäkelä
73f34336e3 MDEV-24323 Crash on recovery after kill during instant ADD COLUMN
row_undo_ins_parse_undo_rec(): Do not try to read non-existing
virtual column information for the metadata record.
2020-12-01 15:24:49 +02:00
Marko Mäkelä
81ab9ea63f Merge 10.2 into 10.3 2020-12-01 14:55:46 +02:00