Commit graph

193,649 commits

Author SHA1 Message Date
Vladislav Vaintroub
f725020ff7 Fix cmake warning caused by 751ebe44fd
CMake Warning (dev) at cmake/plugin.cmake:288 (GET_TARGET_PROPERTY):
  Policy CMP0045 is not set: Error on non-existent target...

Also, fix condition argument in ADD_FEATURE_INFO. It is not a string
but boolean
2021-08-09 18:00:22 +02:00
Vladislav Vaintroub
78c7d50e4f Fix cmake warning caused by 751ebe44fd
CMake Warning (dev) at cmake/plugin.cmake:288 (GET_TARGET_PROPERTY):
  Policy CMP0045 is not set: Error on non-existent target...

Also, fix condition argument in ADD_FEATURE_INFO. It is not a string
but boolean
2021-08-09 11:52:03 +02:00
Vladislav Vaintroub
1add892e6d Merge branch '10.6' of https://github.com/mariadb/server into 10.6 2021-08-09 11:24:25 +02:00
Jan Lindström
74cb160992 Fix test failure on galera_as_slave_replay by adding wait_conditions 2021-08-06 10:08:20 +03:00
Dmitry Shulga
e38b372e7c MDEV-26180: follow-up patch to temporary disable the test main.func_group in PS mode.
This test fails in case both embedded and PS mode are on.
2021-08-06 10:26:16 +07:00
Aleksey Midenkov
160d97a4aa MDEV-18734 ASAN heap-use-after-free upon sorting by blob column from partitioned table
ha_partition stores records in array of m_ordered_rec_buffer and uses
it for prio queue in ordered index scan. When the records are restored
from the array the blob buffers may be already freed or rewritten.

The solution is to take temporary ownership of cached blob buffers via
String::swap(). When the record is restored from m_ordered_rec_buffer
the ownership is returned to table fields.

Cleanups:

init_record_priority_queue(): removed needless !m_ordered_rec_buffer
check as there is same assertion few lines before.

dbug_print_row() for arbitrary row pointer
2021-08-05 23:48:02 +03:00
Daniel Bartholomew
fbadc87fce
bump the VERSION 2021-08-05 10:42:39 -04:00
Daniel Bartholomew
20a9f0b511
bump the VERSION 2021-08-05 10:18:19 -04:00
Daniel Bartholomew
527be044d5
bump the VERSION 2021-08-05 09:59:21 -04:00
Daniel Bartholomew
d9526ae608
bump the VERSION 2021-08-05 09:35:44 -04:00
Daniel Bartholomew
b8deb02859
bump the VERSION 2021-08-05 09:11:46 -04:00
Vladislav Vaintroub
3cc23c9973 MDEV-25602 Eliminate the rest of __WIN__ in Connect 2021-08-05 11:32:41 +02:00
nia
7308e009c9 auth_socket: Add SO_PEERCRED definitions for NetBSD
A getsockopt level of 0 is requied on NetBSD when using
Unix-domain socket LOCAL_* options, SOL_SOCKET will not
work.
2021-08-05 17:51:51 +10:00
Yongxin Xu
fa6eaead21
MDEV-24523 Execution of JSON_REPLACE failed on Spider
JSON_REPLACE() function executed with an error on Spider SE.
This patch fixes the problem, and it also fixes the MDEV-24541.

The problem is that Item_func_json_insert::func_name() returns
the wrong function name "json_update". 
The Spider SE reconstructs a query based on the return value
in some cases. Thus, if the return value is wrong, the Spider SE
may generate a wrong query.
2021-08-05 12:21:59 +09:00
Oleksandr Byelkin
2db692f5b4 MDEV-26180: Enable test main.sp-row after the 10.5 merge mariadb-10.6.4 2021-08-03 15:44:09 +02:00
Oleksandr Byelkin
7ae6ef5236 Merge branch '10.5' into 10.6 2021-08-03 11:21:22 +02:00
Sergei Golubchik
175c9fe1d5 cleanup: specifying plugin dependencies in CMakeLists.txt
1. rename option DEPENDENCIES in MYSQL_ADD_PLUGIN() to DEPENDS
   to be consistent with other cmake commands and macros

2. use this DEPENDS option in plugins

3. add dependencies to the plugin embedded target too

4. plugins don't need to add GenError dependency explicitly,
   all plugins depend on it automatically
2021-08-03 10:10:00 +02:00
Oleksandr Byelkin
b5569b6240 Update columnstore mariadb-10.5.12 2021-08-02 20:45:40 +02:00
Oleksandr Byelkin
42bf65177a update PCRE2 2021-08-02 20:45:40 +02:00
Oleksandr Byelkin
850b2ba15d Merge branch '10.4' into 10.5 2021-08-02 16:53:37 +02:00
Oleksandr Byelkin
4902b0fdc9 Merge branch '10.3' into 10.4 mariadb-10.4.21 2021-08-02 16:50:28 +02:00
Marko Mäkelä
89cc633853 MDEV-13564 fixup: Remove unused function fts_check_corrupt()
The call to the function fts_check_corrupt() was removed
in commit 09af00cbde already.
2021-08-02 16:39:08 +03:00
Oleksandr Byelkin
7f264997dd Merge branch '10.2' into 10.3 mariadb-10.3.31 2021-08-02 11:41:00 +02:00
Nikita Malyavin
b549af6913 MDEV-26220 Server crashes with indexed by prefix virtual column mariadb-10.2.40
Server crashes in Field::register_field_in_read_map upon select from
partitioned table with indexed by prefix virtual column.

After several read-mark fixes a problem has surfaced:
Since KEY (c(10),a) uses only a prefix of c, a new field is created,
duplicated from table->field[3], with a new length. However,
vcol_inco->expr is not copied.

Therefore, (*key_info)->key_part[i].field->vcol_info->expr was left NULL
in ha_partition::index_init().

Solution: copy vcol_info from table field when it's set up.
2021-08-02 10:31:22 +02:00
Oleksandr Byelkin
8b6c8a6ce9 Revert "MDEV-26220 Server crashes with indexed by prefix virtual column"
This reverts commit 9b8e207ce0.
2021-08-02 10:30:18 +02:00
Oleksandr Byelkin
a4482cdbed new columnstore 2021-08-02 10:18:35 +02:00
Oleksandr Byelkin
6efb5e9f5e Merge branch '10.5' into 10.6 2021-08-02 10:11:41 +02:00
Sergei Golubchik
ec8882b9dd suppress galera error "Failed to report last committed"
according to MDEV-17550 it's informational, not fatal.
"last committed" is part of the certification index purge process.

depending on what tests and in what order are run it can be triggered
at unspecified times during the testing. If the test is happen to
shut down the server at this very time, the log will have:

[Warning] WSREP: Failed to report last committed XXXYYYZZZ, -77 (File descriptor in bad state)
2021-08-01 18:28:59 +02:00
Oleksandr Byelkin
ae6bdc6769 Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
Oleksandr Byelkin
7841a7eb09 Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
Sergei Golubchik
2cdf8a9327 MDEV-23752 SHOW EXPLAIN FOR thd waits for sleep
fix main.processlist_notembedded test

* before EXPLAINing `select sleep` wait for select to start
  (fixes "Target is not running an EXPLAINable command")
* after killing sleep, wait for it to die
  (fixes test failures on --repeat when old sleep shows on a test rerun)

* unify with 10.3, copy minor changes from there
  (`--echo End of 5.5` vs `--echo # End of 5.5`, etc)
2021-07-31 09:27:53 +02:00
Sergei Golubchik
07674e6a74 MDEV-26165 Failed to upgrade from 10.4 to 10.6
It shouldn't be possible to install an old MariaDB-common
with a new MariaDB-server or vice versa.
2021-07-30 07:51:58 +02:00
Sergei Golubchik
c314fd8c1a compilation failure on clang 11.1.0
returning NULL (a.k.a. nullptr) from a bool function.

followup for add782a13e
2021-07-30 07:51:58 +02:00
Sergei Golubchik
3b052f8187 don't use *.in for test data
because INSTALL_MYSQL_TEST() cmake macro has

      PATTERN "*.in" EXCLUDE
2021-07-30 07:51:58 +02:00
Sergei Golubchik
3e4fa50571 die verbosely in main.mysql_install_db_win 2021-07-30 07:51:58 +02:00
Marko Mäkelä
ac56a6c1c4 fixup e305493b1c -DWITH_DBUG_TRACE=ON
ha_innobase::can_switch_engines(): Use DBUG_RETURN instead of return
to match the DBUG_ENTER. This fixes a bootstrap failure of debug builds
using the default setting -DWITH_DBUG_TRACE=ON.
2021-07-30 08:05:28 +03:00
Oleksandr Byelkin
1423cf5e3d fix MDEV-16026 MDEV-16481 embedded server results and rests 2021-07-29 17:16:52 +02:00
Marko Mäkelä
0aa2bc7a94 MDEV-19445/MDEV-16678 fixup: Acquire proper MDL on innodb_ft_aux_table
In commit 2647fd101d (MDEV-19445)
we fixed a race condition around the INFORMATION_SCHEMA tables
that access the table identified by the global variable
innodb_ft_aux_table. Thanks to MDEV-16678 we could fix it
even better by using MDL instead of the InnoDB dict_sys latches.
2021-07-29 16:41:58 +03:00
Marko Mäkelä
e305493b1c MDEV-21175 follow-up: Remove redundant locking; rely on MDL
Before entering DML or DDL execution in the storage engine, the SQL layer
will have acquired metadata lock (MDL) on the current table name as well
as the names of FOREIGN KEY (grand)child tables (that is,
tables whose REFERENCES clauses point to the current table).
The MDL prevents any metadata changes to these tables, such as
RENAME, TRUNCATE, DROP, ALTER.

While the MDL on the current table prevents dict_table_t::foreign_set
from being modified, it does not prevent the table metadata that the
stored pointers are pointing to from being modified.

The MDL on the child tables will prevent both dict_table_t::referenced_set
as well as the pointed child table metadata from being modified.

wsrep_row_upd_index_is_foreign(): Do not unnecessarily acquire the
data dictionary latch if Galera replication is not enabled.

ha_innobase::can_switch_engines(): Rely on MDL. We are not dereferencing
any pointers stored in the sets.

row_mysql_freeze_data_dictionary(), row_mysql_unfreeze_data_dictionary():
Remove.

row_update_for_mysql(): Call init_fts_doc_id_for_ref() only once.

In ALTER TABLE...IMPORT TABLESPACE and FLUSH TABLES...FOR EXPORT
the SQL layer is protecting the current table with MDL. We do not
need InnoDB latches.
2021-07-29 16:38:24 +03:00
Marko Mäkelä
86a1428934 MDEV-23484 Rollback unnecessarily acquires dict_sys.latch
row_undo(): Remove the unnecessary acquisition and release of
dict_sys.latch. This was supposed to prevent the table from being
dropped while the undo log record is being rolled back. But, thanks to
trx_resurrect_table_locks() that was introduced in
mysql/mysql-server@935ba09d52
and commit c291ddfdf7
as well as commit 1bd681c8b3
(MDEV-25506 part 3) tables will be protected against dropping
due to table locks.

This reverts commit 0049d5b515
(which had reverted a previous attempt of fixing this) and addresses
an earlier race condition with the following:

prepare_inplace_alter_table_dict(): If recovered transactions hold
locks on the table while we are executing online ADD INDEX, acquire
a table lock so that the rollback of those recovered transactions will
not interfere with the ADD INDEX.
2021-07-29 16:35:19 +03:00
Marko Mäkelä
15363a4f1b Cleanup: Remove pars_stored_procedure_call()
The InnoDB internal SQL parser never supported this syntax.
2021-07-29 15:37:35 +03:00
Marko Mäkelä
92046ba244 MDEV-25506 fixup: Correct a bogus comment
Since commit 1bd681c8b3 tablespaces are
dropped after the table has been dropped. No dict_sys latch protection
is relevant during the execution of fil_delete_tablespace().
2021-07-29 15:28:05 +03:00
Marko Mäkelä
72764b2f29 Cleanup: Remove a workaround
Since commit 1bd681c8b3
dict_stats_exec_sql() is no longer playing dirty tricks.
We can remove the workaround in lock_release().
2021-07-29 15:27:47 +03:00
Marko Mäkelä
e8ba64262b MDEV-26274 fts_lock_table() attempts to release unreserved dict_sys.mutex
fts_lock_table(): Fix a regression that was introduced in
commit da65cb4d97 (MDEV-25936).
2021-07-29 15:00:38 +03:00
Oleksandr Byelkin
83d7e4faf6 Merge branch '10.2' into 10.3 2021-07-29 13:51:02 +02:00
Nikita Malyavin
22709897b0 MDEV-20154 Assertion len <= col->len | ... failed in row_merge_buf_add
len was containing garbage, since vctempl->mysql_col_offset was
containing old value while calling row_mysql_store_col_in_innobase_format
from innobase_get_computed_value().

It was not updated after the first ALTER TABLE call, because it's INPLACE
logic considered there's nothing to update, and exited immediately from
ha_innobase::inplace_alter_table().

However, vcol metadata needs an update, since vcols structure is changed
in mysql record.

The regression was introduced by 12614af1fe. There, refcount==1 condition
was removed, which turned out to be crucial, though racy. The idea was to
update vc_templ after each (sequencing) ALTER TABLE.

We should do the same another way, and there may be a plenty of solutions,
but the simplest one is to add a following condition:
  if vcol structure is changed, drop vc_templ; it will be recreated on next
  ha_innobase::open() call.

in prepare_inplace_alter_table. It is safe, since innodb inplace changes
require at least HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE, which
guarantee MDL_EXCLUSIVE on this stage.

alter_templ_needs_rebuild() also has to track the columns not indexed, to
keep vc_templ correct.

Note that vc_templ is always kept constructed and available after
ha_innobase::open() call, even on INSERT, though no virtual columns are
evaluated during that statement
inside innodb.

In the test case suplied, it will be recreated on the second ALTER TABLE.
2021-07-29 12:33:05 +03:00
Marko Mäkelä
0e8981ef93 Cleanup: Remove redundant conditions
ha_innobase::prepare_inplace_alter_table(): Remove always-true conditions.
Near the start of the function, we would already have returned if
no ALTER TABLE operation flags were set that would require special
action from InnoDB.

It turns out that the conditions were redundant already when they were
introduced in mysql/mysql-server@241387a2b6
and in commit 068c61978e.

Thanks to Nikita Malyavin for noticing this.
2021-07-29 09:15:03 +03:00
Sergei Golubchik
6152ab7b42 MDEV-24511 null field is created with CREATE..SELECT
When creating fields for UNION results, Field_null is not allowed.
Should create binary(0) instead.
2021-07-29 02:08:23 +03:00
Alexander Barkov
c86f813afe MDEV-9234 Add Type_handler::union_element_finalize() 2021-07-29 02:08:23 +03:00
Nikita Malyavin
9d5967f74b fixup 0bd9f755b MDEV-26062
Pass char* to WSREP_LOG and others, instead of non-POD objects
2021-07-29 02:08:22 +03:00