Commit graph

186196 commits

Author SHA1 Message Date
Oleksandr Byelkin
008ee867a4 Merge branch '10.2' into 10.3 2019-12-04 17:46:28 +01:00
Oleksandr Byelkin
670c9a3a18 Merge remote-tracking branch 'origin/bb-10.3-release' into 10.3 2019-12-04 15:57:09 +01:00
Oleksandr Byelkin
81bf7d3317 Merge branch 'bb-10.3-release' into 10.3 2019-12-04 15:01:54 +01:00
Jan Lindström
c9b9eb3315 MDEV-18497 : CTAS async replication from mariadb master crashes galera nodes (#1410)
In MariaDB 10.2 master could have been configured so that there
is extra annotate events. When we peak next event type for CTAS we
need to skip annotate events.
2019-12-04 11:46:37 +02:00
Aleksey Midenkov
f6d8640d67 MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
Related to 87731177 and Bug#47649.

Don't set Query_arena::STMT_EXECUTED for any error
code. skip_setup_conds() depends on STMT_INITIALIZED_FOR_SP, but
sp_lex_keeper::reset_lex_and_exec_core() sets it to STMT_EXECUTED on
ER_TABLE_NOT_LOCKED_FOR_WRITE. There are other error codes that can
break skip_setup_conds() (ER_IT_IS_A_VIEW, ER_NON_UPDATABLE_TABLE,
etc).
2019-12-04 07:10:41 +03:00
Aleksey Midenkov
477629d2cd MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
Unit prepare prematurely fixed field which must be fixed via
setup_conds() to correctly update table->covering_keys.

Call vers_setup_conds() directly instead, because actually everything
else is not needed.
2019-12-04 07:10:41 +03:00
Oleksandr Byelkin
f7d35ffc76 Galera test fix after merge. 2019-12-03 20:39:16 +01:00
Oleksandr Byelkin
ccc5e57730 vew CC v 3.1 2019-12-03 15:44:41 +01:00
Oleksandr Byelkin
425437b290 Merge remote-tracking branch 'connect/10.2' into 10.2 2019-12-03 15:42:54 +01:00
Oleksandr Byelkin
f8b5e147da Merge branch '10.1' into 10.2 2019-12-03 14:45:06 +01:00
Vicențiu Ciorbaru
8a46b706aa Update innodb_i_s_tables_disabled.result post typo fix 2019-12-03 14:47:55 +02:00
Aleksey Midenkov
bf2f391664 MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
Unit prepare prematurely fixed field which must be fixed via
setup_conds() to correctly update table->covering_keys.

Call vers_setup_conds() directly instead, because actually everything
else is not needed.
2019-12-03 15:46:49 +03:00
Vicențiu Ciorbaru
4670a23957 Re-record sql_sequence.rebuild with sorted_result 2019-12-03 14:37:45 +02:00
Vicențiu Ciorbaru
2daacddf6b Update versioning.alter after typo fix 2019-12-03 14:34:12 +02:00
Aleksey Midenkov
cef2b34f25 MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
Wrong assertion condition. SYSTEM_TIME_ALL indicates that
vers_setup_conds() is done. In case FOR SYSTEM_TIME ALL is specified
in command the assertion passes but not checks anything.
2019-12-03 15:28:41 +03:00
Marko Mäkelä
abbff37eb4 MDEV-13564 follow-up: Harden an assertion
mlog_write_initial_log_record_low(): Do not allow the MLOG_TRUNCATE
record to be written.
2019-12-03 11:58:24 +02:00
Oleksandr Byelkin
117c8146de Merge branch '5.5' into 10.1 2019-12-03 09:39:53 +01:00
Eugene Kosov
543f22a2d0 check parameters of io_submit() and LinuxAIOHandler::reserve_slot()
Ensure that pointer to a buffer which is used for both reads and writes
is properly aligned.

I've intentially put permanent check right before io_submit() call instead
of the time of setting iocb date. I think that'll make check better.

LinuxAIOHandler::resever_slot(): check arguments alignment in debug builds
2019-12-03 14:01:11 +07:00
Jan Lindström
88073dae79 MDEV-21198 : Galera test failure on galera_var_notify_cmd
Add proper wsrep sync wait.
2019-12-03 08:04:46 +02:00
Marko Mäkelä
3ff8fb5141 InnoDB: Remove unused get_wkb_of_default_point()
The function get_wkb_of_default_point() should never have been
added, and the cleanup in commit 56ff6f1b0b
should have removed it.

The unnecessary code was added in
mysql/mysql-server@0a27b72171
and mostly disabled in
mysql/mysql-server@8f11af7734.

In MariaDB, the types DATA_POINT and DATA_VAR_POINT are never used.
Instead, DATA_GEOMETRY continues to be used since 10.2.2, introduced by
mysql/mysql-server@673bad7c7e
in MySQL 5.7.1.
2019-12-03 07:45:04 +02:00
Anel Husakovic
e3d3bbf598 Using variables instead of values in mysqld --help documentation would be more accurate 2019-12-02 21:37:01 +01:00
Faustin Lammler
d930422e9e Fix the line break warning (groff/lintian).
The lintian Debian tool is complaining about:
  'W: mariadb-test: manpage-has-errors-from-man
  usr/share/man/man1/mysql-test-run.pl.1.gz 246: warning [p 2, 6.0i, div
  '3tbd1,1', 0.3i]: can't break line'

See: https://salsa.debian.org/faust-guest/mariadb-10.3/-/jobs/431900

The following command permits to catch the problematic lines:
  $ groff -man -Tascii ./mysql-test-run.pl.1 | less

Closes #1419
2019-12-02 15:36:01 +01:00
Jan Lindström
9d9a2253c6 Merge remote-tracking branch 10.2 into 10.3
Conflicts:
	mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
	mysql-test/suite/innodb/r/innodb-mdev-7513.result
	mysql-test/suite/innodb/t/innodb-mdev-7513.test
	mysql-test/suite/wsrep/disabled.def
	storage/innobase/ibuf/ibuf0ibuf.cc
2019-12-02 14:35:10 +02:00
Robert Bindar
8d2a57b4b7 MDEV-15977 Assertion !thd->in_sub_stmt failed in trans_commit_stmt 2019-12-02 13:43:16 +02:00
Faustin Lammler
7e917bba5d Sourced script should be 644 not 755
The script is intented to be sourced by other SST script so it should
not be executable (or should have a script header).
This is causing a warning on Debian Lintian tool, see:
https://salsa.debian.org/faust-guest/mariadb-10.3/-/jobs/431900
2019-12-02 12:54:31 +02:00
Faustin Lammler
2df2238cb8 Lintian complains on spelling error
The lintian check complains on spelling error:
https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
2019-12-02 12:41:13 +02:00
Aleksey Midenkov
db32d9457e MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
Don't do skip_setup_conds() unless all errors are checked.

Fixes following errors:
      ER_PERIOD_NOT_FOUND
      ER_VERS_QUERY_IN_PARTITION
      ER_VERS_ENGINE_UNSUPPORTED
      ER_VERS_NOT_VERSIONED
2019-12-02 11:48:37 +03:00
Aleksey Midenkov
a7cf0db3d8 MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
LIMIT history partitions cannot be checked by existing algorithm of
check_misplaced_rows() because working history partition is
incremented each time another one is filled. The existing algorithm
gets record and tries to decide partition id for it by
get_partition_id(). For LIMIT history it will just get first
non-filled partition.

To fix such partitions it is required to do REBUILD instead of REPAIR.
2019-12-02 11:48:37 +03:00
Aleksey Midenkov
6dd41e008e MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
When view is merged by DT_MERGE_FOR_INSERT it is then skipped from
processing and doesn't update WHERE clause with
vers_setup_conds(). Note that view itself cannot work in
vers_setup_conds() because it doesn't have row_start, row_end
fields. Thus it is required to descend down to material TABLE_LIST
through calls of mysql_derived_prepare() and run vers_setup_conds()
from there. Luckily, all views (views of views, views of views of
views, etc.) are linked in one list through next_global pointer, so we
can skip all views of views and get straight to non-view TABLE_LIST by
checking its merge_underlying_list property for zero value (it is
assigned by DT_MERGE_FOR_INSERT for merged derived tables).

We have to do that only for UPDATE and DELETE. Other DML commands
don't use WHERE clause.

MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA

LOAD DATA does not use WHERE and the above call of vers_setup_conds()
is not needed. unit->prepare() led to wrongly locked temporary table.
2019-12-02 11:48:37 +03:00
Aleksey Midenkov
97aa07abf5 MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
"write set" for replication finally got its correct place
(mark_columns_per_binlog_row_image()). When done generally in
mark_columns_needed_for_update() it affects optimization
algorithm. used_key_is_modified, query_plan.using_io_buffer are
wrongly set and that leads to wrong prepare_for_keyread() which limits
read_set.
2019-12-02 11:48:37 +03:00
Aleksey Midenkov
498a96a478 MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
Turn read cache off for update and multi-update for versioned
table. no_cache is reinited on each TABLE open because it is
applicable for specific algorithms.

As a side fix vers_insert_history_row() honors vers_write setting.

Aria with row_format=fixed uses IO_CACHE of type READ_CACHE for
sequential read in update loop. When history row is inserted inside
this loop the cache misses it and fails with error.

TODO:

Currently maria_extra() does not support SEQ_READ_APPEND. Probably it
might be possible to use this type of cache.
2019-12-02 11:48:37 +03:00
Jan Lindström
c6ed37b88a MDEV-21182: Galera test failure on MW-284
galera_2nodes.cnf did not contain wsrep_on=1 on correct places. Fixed
restart options to use correct configuration.
2019-11-30 13:52:49 +02:00
Eugene Kosov
33cf4da183 cleanup: replace exit(1) with abort() 2019-11-30 18:19:20 +07:00
Eugene Kosov
6fe2aae3ce InnoDB: log unsuccessful calls to pthread_attr_init() and pthread_create() before crash 2019-11-30 12:14:00 +07:00
HF
3fb0fe400c MENT-510 Failing test(s): perfschema.threads_insert_delayed.
orig_test_id should be set properly.
Also fixed sporadic test failure.
2019-11-29 21:25:52 +00:00
Anel Husakovic
3cb60ec2c3 Update stracer description in mtr. strace-client is not used 2019-11-29 15:50:50 +01:00
Daniel Black
866e5c250e MDEV-15503: mtr fix --strace
$glob_mysql_test_dir was the wrong directory for strace output as
it was for in-tree builds only so failed for:
* out of tree builds
* --parallel; and
* --mem

strace output wasn't saved.

strace-option never replaced existing arguments (so ammended
documentation).

strace-client didn't accept an argument as described.

Replaced specification of client with this with 'stracer' to be
consistent with --debugger option.

For consistency with debugger options, --client-strace was added to
execute the strace on the mysqltest.

Example: Running one test

$ ./mtr --strace --client-strace funcs_1.is_table_constraints
Logging: ./mtr  --strace --client-strace funcs_1.is_table_constraints
vardir: /home/anel/mariadb/5.5/mysql-test/var
Checking leftover processes...
Removing old var directory...
 - WARNING: Using the 'mysql-test/var' symlink
Creating var directory '/home/anel/mariadb/5.5/mysql-test/var'...
Checking supported features...
MariaDB Version 5.5.67-MariaDB-debug
Installing system database...
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...

==============================================================================

TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
funcs_1.is_table_constraints             [ pass ]   1270
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 1.270 of 3 seconds executing testcases

Completed: All 1 tests were successful

$ find -L . -name \*strace -ls
      653     56 -rw-r--r--   1 anel     anel        57147 Nov 29 15:08 ./var/log/mysqltest.strace
      646   1768 -rw-r--r--   1 anel     anel      1809855 Nov 29 15:08 ./var/log/mysqld.1.strace

Example: Running test in parallel

$ mysql-test/mtr --strace --client-strace  --mem --parallel=3  main.select
Logging: /home/dan/software_projects/mariadb-server/mysql-test/mysql-test-run.pl  --strace --client-strace --mem --parallel=3 main.select
vardir: /home/dan/software_projects/build-mariadb-10.3/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/dan/software_projects/build-mariadb-10.3/mysql-test/var'...
 - symlinking 'var' to '/dev/shm/var_auto_0v2E'
Checking supported features...
MariaDB Version 5.5.67-MariaDB
 - SSL connections supported
Collecting tests...
Installing system database...

==============================================================================

TEST                                  WORKER RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
worker[3]  - 'localhost:16040' was not free
worker[2] Using MTR_BUILD_THREAD 301, with reserved ports 16020..16039
worker[3] Using MTR_BUILD_THREAD 303, with reserved ports 16060..16079
main.select                              w1 [ pass ]   7310
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 7.310 of 11 seconds executing testcases

Completed: All 1 tests were successful.

$ find mysql-test/var/ -name \*strace -ls
  5213766   1212 -rw-r--r--   1  dan      dan       1237817 May 20 16:47 mysql-test/var/1/log/mysqltest.strace
  5214733  13016 -rw-r--r--   1  dan      dan      13328335 May 20 16:47 mysql-test/var/1/log/mysqld.1.strace

$ mysql-test/mtr --strace --client-strace --strace-option='-e' --strace-option='trace=openat'  --mem --parallel=3  main.select
...
$ find mysql-test/var/ -name \*strace -ls
  5220790      8 -rw-r--r--   1  dan      dan          6291 May 20 17:02 mysql-test/var/3/log/mysqltest.strace
  5224140    308 -rw-r--r--   1  dan      dan        314356 May 20 17:02 mysql-test/var/3/log/mysqld.1.strace
$ more mysql-test/var/3/mysqltest.strace
1692  openat(AT_FDCWD, "/home/dan/software_projects/mariadb-server/libmysql/.libs/tls/x86_64/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) =
-1 ENOENT (No such file or directory)
1692  openat(AT_FDCWD, "/home/dan/software_projects/mariadb-server/libmysql/.libs/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOE
NT (No such file or directory)

Closes #600
2019-11-29 15:33:49 +01:00
Vlad Lesin
bd11bd63cc MDEV-18310: Aria engine: Undo phase failed with "Got error 121 when
executing undo undo_key_delete" upon startup on datadir restored from
incremental backup

aria_log* files were not copied on --prepare --incremental-dir step from
incremental to destination backup directory.
2019-11-29 17:01:12 +03:00
Sergei Golubchik
57cab7cd51 fix ssl_crl test failures on newer OpenSSL
generalize the replacement
2019-11-29 09:08:52 +01:00
Sergei Golubchik
95898ac9bd Revert "Fix upgrade errors on eoan"
This reverts commit 0d345ec2e3.

Upgrades from 8.0 don't work yet, one has to dump/restore
manually to get the metadata out of the data dictionary.
2019-11-29 09:08:52 +01:00
Vladislav Vaintroub
32ce5301a9 Update libmariadb 2019-11-28 22:50:46 +01:00
Sergei Golubchik
0d345ec2e3 Fix upgrade errors on eoan
mariadb packages conflict with mysql-8.0
2019-11-28 16:01:02 +01:00
Sergei Golubchik
dc7d0b5030 RPM packaging fixes for FC31
Obsoletes: cannot contain (x86-64) anymore

Python shebang must be specific
2019-11-28 16:01:02 +01:00
Vladislav Vaintroub
ba95c303e3 MDEV-21167 LF_PINS::stack_ends_here inaccurate, leading to alloca() larger than stack
Use my_thread_var::stack_ends_here inside lf_pinbox_real_free() for address
where thread stack ends.

Remove LF_PINS::stack_ends_here.
It is not safe to assume that mysys_var that was used during pin allocation,
remains correct during free. E.g with binlog group commit in Innodb,
that frees pins for multiple Innodb transactions, it does not work
correctly.
2019-11-28 10:48:09 +01:00
Eugene Kosov
2855edf9ee try to fix data races in DBUG
init_settings.keywords and it's pointee are shared data. Protect them
with mutex too.
2019-11-28 11:59:27 +07:00
Vladislav Vaintroub
584ffa02f1 MDEV-19669 - fix matching CIDR address for proxy protocol.
Prior to this fix, when matching addresses using mask,
extra bits could be used for  comparison, e.g to
match with "a.b.c.d/24" , 27 bits were compared rather than 24.

The patch fixes the calculation.
2019-11-27 20:50:06 +01:00
Marko Mäkelä
3fc1f6260f MDEV-21158 trx_undo_seg_free() is never redo-logged
As part of commit 3c09f148f3
trx_undo_commit_cleanup() was always invoked with noredo=true.

The impact of this should be that some undo log pages may not be
correctly freed if the server is killed and crash recovery will be
performed. Similarly, if mariabackup --backup is being executed
concurrently with user transaction commits, it could happen that some
undo log pages in the backup will never be marked as free for reuse.

It seems that this bug should not have any user-visible
impact other than some undo pages being wasted.
2019-11-27 14:00:01 +02:00
Alexey Botchkov
bfa6db38cd MENT-510 Failing test(s): perfschema.threads_insert_delayed.
The thread_id of the INSERT DELAYED thread should not be set to 0.
2019-11-27 09:31:47 +04:00
Alexey Botchkov
0e403db2c8 MENT-237 Audit to show INSERT DELAYED for the executing user.
Add notifications about the user and connection that actually
did the DELAYED insert.
2019-11-27 09:23:00 +04:00
Vicențiu Ciorbaru
6218bf1b41 cracklib-runtime needs a comma after to parse properly 2019-11-26 21:48:41 +02:00