Commit graph

193352 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
f069aa1dc2 Update debian packaging for 10.7
Conflicts/Replaces mariadb-client-core mariadb-client, cover 10.6
Also update salsa-ci to appropriately name tests as upgrades to 10.7
2021-07-19 14:27:44 +03:00
Monty
b1d81974b2 Added support to MEM_ROOT for write protected memory
This is useful for thing like Item_true and Item_false that we
allocated and initalize once and want to ensure that nothing can
change them

Main changes:
- Memory protection is achived by allocating memory with mmap() and
  protect it from write with mprotect()
- init_alloc_root(...,MY_ROOT_USE_MPROTECT) will create a
  memroot that one can later use with protect_root() to turn it
  read only or turn it back to read-write. All allocations to this
  memroot is done with mmap() to ensure page alligned allocations.
- alloc_root() code was rearranged to combine normal and valgrind code.
- init_alloc_root() now changes block size to be power of 2's, to get less
  memory fragmentation.
- Changed MEM_ROOT structure to make it smaller. Also renamed
  MEM_ROOT m_psi_key to psi_key.
- Moved MY_THREAD_SPECIFIC marker in MEM_ROOT from block size (old hack)
  to flags.
- Added global variable my_system_page_size. This is initialized at
  startup.
2021-07-18 19:59:35 +03:00
Monty
d378a466a5 Change Item_true and Item_false to pointers
This is a prerequisite for moving them to a readonly segment.
2021-07-18 19:59:35 +03:00
Vicențiu Ciorbaru
b32b1f2b19 Merge remote-tracking branch '10.6' into 10.7
Update debian changes to 10.7 to enable debian packaging to work again.
2021-07-18 19:58:43 +03:00
Vladislav Vaintroub
74f5aa164e MDEV-19237 - Fix assertion in should_send_column_info
COM_STMT_BULK_EXECUTE, just like COM_STMT_EXECUTE can also skip result set
metadata, if bulk is used with statement that returns result set, i.e
INSERT/DELETE RETURNING.
2021-07-16 23:28:39 +02:00
Vladislav Vaintroub
e7f4daf88c merge 10.5 to 10.6 2021-07-16 22:12:09 +02:00
Vladislav Vaintroub
fc2ec25733 MDEV-26166 replace log_write_up_to(LSN_MAX,...) with log_buffer_flush_to_disk()
Also, remove comparison lsn > flush/write lsn, prior to calling
log_write_up_to. The checks and early returns are part of this function.
2021-07-16 18:44:58 +02:00
Dmitry Shulga
461cac8901 MDEV-26150: The test main.opt_trace fails in case it is run in PS mode
In case the test main.opt_trace is run with the option --ps-protocol
it fails since querying from the table INFORMATION_SCHEMA.OPTIMIZER_TRACE
produces an output that differed from the expected one in the following way:
  @@ -2829,14 +2829,6 @@
                     }
                   },
                   {
  -                  "transformation": {
  -                    "select_id": 2,
  -                    "from": "IN (SELECT)",
  -                    "to": "semijoin",
  -                    "chosen": true
  -                  }
  -                },
  -                {
                     "expanded_query": "/* select#2 */ select t10.pk from t10"
                   }

The table INFORMATION_SCHEMA.OPTIMIZER_TRACE is filled when optimizer_trace is on.
The reason of missing above mentioned pieces in query result set is that
the C++ macros
  OPT_TRACE_TRANSFORM(thd, trace_wrapper, trace_transform,
                      select_lex->select_number,
                      "IN (SELECT)", "semijoin");
located in the standalone function check_and_do_in_subquery_rewrites()
is executed twice in case the statement
  explain extended select * from t1 where a in (select pk from t10);
is run in PS mode. The first time it is executed on PREPARE phase and
the second time on EXECUTE phase. The output produced by this macros on
EXECUTE phase rewrites the output produced on PREPARE phase.
In result test failed in case it was run in PS mode.

To make test output uniform regardless the test is run in PS or normal
mode the operator '--source include/protocol.inc' has been added to
the file opt_trace.test and extra opt_trace,ps.rdiff file has been added.

Additionally, added operators
  --enable_prepared_warnings/--disable_prepared_warnings
in order to store warnings in result file that received on PREPARE phase
during running the statemement 'SELECT INTO'.
2021-07-16 09:30:36 +07:00
Oleksandr Byelkin
a7d880f0b0 MDEV-21916: COM_STMT_BULK_EXECUTE with RETURNING insert wrong values
The problem is that array binding uses net buffer to read parameters for each
execution while each execiting with RETURNING write in the same buffer.

Solution is to allocate new net buffer to avoid changing buffer we are reading
from.
2021-07-15 16:28:13 +02:00
Rucha Deodhar
826eab3f9b Revert "MDEV-24248: my_print_defaults is not taking all the values when using -e"
This reverts commit f88d130e71.
2021-07-15 17:07:22 +05:30
Dmitry Shulga
429382c29f MDEV-26142: Fix failures of the tests main.features and sys_vars.stored_program_cache_func when they are run in PS mode
These tests produced different results in case they were run
with the option --ps-protocol.

These tests produced different result sets since a value of
Feature_subquery and handler_read_key status system variables
are updated one time more for ps-protocol (the first time it is updated
on Prepare phase and the second time on Execute phase of PS protocol)
So different result sets are expected for both tests. To make tests
successfully runnable both for case it is run with and without
the option --ps-protocol the new protocol combination [ps, nm]
and protocol specific result files have been added.

Moreover, the perl script mysql-test/mariadb-test-run.pl
has been updated to make the variable opt_ps_protocol visible
outside perl file containing this variable.
2021-07-15 16:27:31 +07:00
Dmitry Shulga
ff0d3bb8dd MDEV-26146: The test main.limit_rows_examined fails in case it is run in PS mode.
Test failed by firing assert in append_warnings() when it is called
from run_query_stmt() and there are more results from server.

Obviously, append_warnings() should be called after the last packet
received from server. So, to fix the assertion failure the function
mysql_more_results() has to be called to check that now more results
does exist and invokes append_warnings() in case the condition satisfied.
2021-07-14 22:25:44 +07:00
Otto Kekäläinen
04369f9cee Implement simple Gitlab-CI pipeline for MariaDB with RPM builds
As Travis-CI has stopped offering free testing for open source projects,
and they don't seem to have any plans to revert their new restrictions,
MariaDB no longer has a good CI system outside contributors could run
independently for basic validation before submitting Pull Requests.

Implement a simple Gitlab-CI pipeline that runs basic RPM builds on
one old, one less old and one very new distro release and then do some
basic tests on the RPM packages to validate they installed and the
server actually runs.
2021-07-14 10:37:11 +03:00
Sergei Golubchik
edcab6366f simplify myskel.m4 and make it work when a path contains '@' 2021-07-13 16:10:02 +02:00
Rucha Deodhar
f88d130e71 MDEV-24248: my_print_defaults is not taking all the values when using -e
option which is called from mysql.server (extra_args).

Fix: change mysql.server script to use --defaults-extra-file instead of -e
2021-07-12 16:07:08 +05:30
Oli Sennhauser
2c4d1fb544 Typo fix in extrabackup.cc and innobackupex.cc
Thanks to @shinguz for helping with this.
2021-07-12 13:29:55 +03:00
Anel Husakovic
f7216fa63d MDEV-12914: Engine for temporary tables which are implicitly created as RocksDB is substituted silently
- There should be no substitution if engine exists, only when doesn't
exist
- Handling of an error when sys_var `default_tmp_storage_engine` is
assigned to unsupported engine.
- rocksdb doesn't support embedded server ebfc4e6ad0 so is excluded

Closes PR #774
Reviewed by: serg@mariadb.com
             vicentiu@mariadb.org
2021-07-10 08:50:53 +02:00
Sergei Golubchik
57f14eab20 Merge branch '10.6' into 10.7 2021-07-07 19:24:08 +02:00
Sergei Golubchik
fe7971fab8 update ColumnStore for 10.7 2021-07-07 18:55:09 +02:00
Sergei Golubchik
d88b443446 debian update for 10.7 2021-07-07 18:55:09 +02:00
Sergei Petrunia
35294053b2 MDEV-26106: [ERROR] InnoDB: Unlock row could not find a 2 mode lock on the record
Port the following patch from MySQL:

  commit 1b2e8ea269c80cb93cc79d8be934c40b1c58e947
  Author: Kailasnath Nagarkar <kailasnath.nagarkar@oracle.com>
  Date:   Fri Nov 30 16:43:13 2018 +0530

    Bug #20939184: INNODB: UNLOCK ROW COULD NOT FIND A 2 MODE
                   LOCK ON THE RECORD

    Issue:
    ------
    Consdier tables t1 and t2 such that t1 has multiple rows
    and join condition for t1 left join t2 results in only
    single row from t2.

    In this case, access to table t2 is const since there
    is a single row that qualifies the join condition.

    However, while executing the query, attempt is made to
    unlock t2's row multiple times.

    The current algorithm to fetch rows approximates to:
    1) Retrieve the row for t1.
    2) Retrieve the row for t2.
    3) Apply the join conditions.
       a) If condition evaluates to true:
          Project the row to the result.
       b) If condition evaluates to false:
          i) If t2's qep_tab->not_null_complement is true,
             unlock t2's row.
          ii) Null-complement the row by calling
              "evaluate_null_complemented_join_record()". In
              this function qep_tab->not_null_complement is
              set to false.

    The t2's only one row, that qualifies join condition,
    is unlocked in Step i) when t1's row is evaluated to
    false.
    When t1's next row is also evaluated to false, another
    attempt is made to unlock t2's already unlocked row.

    This results in following error being logged in error.log:

    "[ERROR] InnoDB: Unlock row could not find a 3 mode lock on
    the record. Current statement:
    select * from t1 left join t2 ......"

    Solution:
    ---------
    When a table's access method is "const", set record unlock
    method for this table to do no operation.
2021-07-07 18:54:00 +03:00
Sergei Golubchik
b836f84b31 update test results 2021-07-06 16:38:16 +02:00
Daniel Bartholomew
a8410693dc
bump the VERSION 2021-07-06 09:50:41 -04:00
Daniel Black
c262ccac02 mtr: aix disable mysqld--defaults-file
AIX grep doesn't support the grep -A syntax used
in the test case.
2021-07-06 17:59:32 +10:00
Daniel Black
e8e7dde3b6 mtr: aix fix mysqld--help - no thread-pool 2021-07-06 17:56:47 +10:00
Daniel Black
f84b3b8807 mtr: aix has no thread_pool 2021-07-06 15:50:58 +10:00
Daniel Black
a8136d13b2 mtr: aix - no pool of threads 2021-07-06 15:29:00 +10:00
Daniel Black
2e3230a5fc mtr: fix innodb_bug53756 on aix
--skip-stack-trace isn't there on AIX.
2021-07-06 15:29:00 +10:00
Julius Goryavsky
e7d40e2b54 MDEV-25978: minor post-merge fix for .result file 2021-07-06 03:03:16 +02:00
Sergei Golubchik
94c508dd4f MDEV-22709 Assertion `store.length() <= (256L*256L*256L-1)' failed in net_send_ok
add a test case (commented, as user var tracker is disabled)
2021-07-06 00:07:30 +02:00
Sergei Golubchik
1f2ccc6db8 update C/C to 3.2.3 2021-07-05 12:44:09 +02:00
Sergei Golubchik
6fa72fb1f2 mtr: report full command line of mysqld that failed to start 2021-07-04 12:11:09 +02:00
Marko Mäkelä
789a2a363a fixup 0a67b15a9d
trx_t::free(): Declare xid as fully initialized in order to
avoid tripping the subsequent MEM_CHECK_DEFINED
(in WITH_MSAN and WITH_VALGRIND builds).
2021-07-03 20:35:29 +03:00
Marko Mäkelä
b797f217a3 Merge 10.5 into 10.6 2021-07-03 14:54:46 +03:00
Marko Mäkelä
f0f47cbca1 MDEV-26017 fixup
buf_flush_relocate_on_flush_list(): Use dpage->physical_size()
because bpage->zip.ssize may already have been zeroed in
page_zip_set_size() invoked by buf_pool_t::realloc().

This would cause occasional failures of the test
innodb.innodb_buffer_pool_resize, which creates a
ROW_FORMAT=COMPRESSED table.
2021-07-03 14:52:04 +03:00
Marko Mäkelä
bd5a6403ca MDEV-26033: Race condition between buf_pool.page_hash and resize()
The replacement of buf_pool.page_hash with a different type of
hash table in commit 5155a300fa (MDEV-22871)
introduced a race condition with buffer pool resizing.

We have an execution trace where buf_pool.page_hash.array is changed
to point to something else while page_hash_latch::read_lock() is
executing. The same should also affect page_hash_latch::write_lock().

We fix the race condition by never resizing (and reallocating) the
buf_pool.page_hash. We assume that resizing the buffer pool is
a rare operation. Yes, there might be a performance regression if a
server is first started up with a tiny buffer pool, which is later
enlarged. In that case, the tiny buf_pool.page_hash.array could cause
increased use of the hash bucket lists. That problem can be worked
around by initially starting up the server with a larger buffer pool
and then shrinking that, until changing to a larger size again.

buf_pool_t::resize_hash(): Remove.

buf_pool_t::page_hash_table::lock(): Do not attempt to deal with
hash table resizing. If we really wanted that in a safe manner,
we would probably have to introduce a global rw-lock around the
operation, or at the very least, poll buf_pool.resizing, both of
which would be detrimental to performance.
2021-07-03 13:58:38 +03:00
Sergei Golubchik
9ec3cd9af0 gamma -> stable 2021-07-02 23:52:55 +02:00
Sergei Golubchik
028d611832 update test result
followup for  bfedf1eb4b
2021-07-02 20:36:37 +02:00
Sergei Golubchik
59bc063d26 main.lock_kill fails in embedded
when killing a query in a parallel connection, disable warnings.
Because --error doesn't apply to automatically sent SHOW WARNINGS,
so if KILL arrives at the right moment the test will fail with

mysqltest: At line 41: Error running query "SHOW WARNINGS": Server has gone away
2021-07-02 16:44:00 +02:00
Sergei Golubchik
4145ebf99a MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra 2021-07-02 16:44:00 +02:00
Sergei Golubchik
164a64baa3 MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views.
privilege checks for tables flushed via views
2021-07-02 16:44:00 +02:00
Sergei Golubchik
b5f50e2de8 errors after altering a table has finished aren't fatal
We cannot revert the ALTER, so anything happening after
the point of no return should not be treated as an error. A
very unfortunate condition that a user needs to be warned about - yes,
but we cannot say "ALTER TABLE has failed" if the table was successfully
altered.
2021-07-02 16:44:00 +02:00
Marko Mäkelä
0ad8a825a8 Merge 10.5 into 10.6 2021-07-02 17:00:05 +03:00
Sergei Golubchik
779262842e MDEV-23004 When using GROUP BY with JSON_ARRAYAGG with joint table, the square brackets are not included
make test results stable

followup for 98c7916f0f
2021-07-02 16:23:48 +03:00
Marko Mäkelä
8c029d426a Merge 10.4 into 10.5 2021-07-02 16:19:25 +03:00
Marko Mäkelä
a635588b56 MDEV-25236 Online log apply fails for ROW_FORMAT=REDUNDANT tables
In other ROW_FORMAT than REDUNDANT, the InnoDB record header
size calculation depends on dict_index_t::n_core_null_bytes.

In ROW_FORMAT=REDUNDANT, the record header always is 6 bytes
plus n_fields or 2*n_fields bytes, depending on the maximum
record size. But, during online ALTER TABLE, the log records
in the temporary file always use a format similar to
ROW_FORMAT=DYNAMIC, even omitting the 5-byte fixed-length part
of the header.

While creating a temporary file record for a ROW_FORMAT=REDUNDANT
table, InnoDB must refer to dict_index_t::n_nullable.
The field dict_index_t::n_core_null_bytes is only valid for
other than ROW_FORMAT=REDUNDANT tables.

The bug does not affect MariaDB 10.3, because only
commit 7a27db778e (MDEV-15563)
allowed an ALGORITHM=INSTANT change of a NOT NULL column to
NULL in a ROW_FORMAT=REDUNDANT table.

The fix was developed by Thirunarayanan Balathandayuthapani
and tested by Matthias Leich. The test case was simplified by me.
2021-07-02 16:11:01 +03:00
Marko Mäkelä
372ea88264 Merge 10.3 into 10.4 2021-07-02 14:55:52 +03:00
Marko Mäkelä
f9194d02da Merge 10.2 into 10.3 2021-07-02 14:41:41 +03:00
Marko Mäkelä
a6adefad4b Fixup 586870f9ef
One more result was affected by merging
768c51880a.
2021-07-02 14:41:32 +03:00
Eugene Kosov
ffe744e77d submodules.cmake: add missing --depth=1 2021-07-02 13:25:20 +03:00