Commit graph

188635 commits

Author SHA1 Message Date
Sergei Golubchik
6ded554fc2 perfschema thread instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
0d837e8153 perfschema table io instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
cea187e349 perfschema sysvar instrumentation related changes
incomplete. locking issues
2020-03-10 19:24:23 +01:00
Sergei Golubchik
7ce517c951 perfschema status vars instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
d4605bc90f perfschema statement instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
70e7b5095d perfschema sp instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
d5a0069702 perfschema socket instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
00819d8116 perfschema ps instrumentation related changes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
05779bc6f1 perfschema mdl related instrumentation changes 2020-03-10 19:24:22 +01:00
Sergei Golubchik
22b6d8487a perfschema file instrumentation related changes 2020-03-10 19:24:22 +01:00
Sergei Golubchik
7c58e97bf6 perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
Sergei Golubchik
2ac3121af2 perfschema - various collateral cleanups and small changes 2020-03-10 19:24:22 +01:00
Sergei Golubchik
0ea717f51a P_S 5.7.28 2020-03-10 19:24:22 +01:00
Sergei Golubchik
dfe6e914e5 cleanup: remove TYPE_ENUM_PROXY from enum stored_procedure_type
because it is not
2020-03-10 19:24:22 +01:00
Sergei Golubchik
f3f31eaa8e bugfix: in long uniques don't check for duplicates more than once
in particular, after checking for duplicates in a partitioned table,
do not re-check it for every partition individually
2020-03-10 19:24:22 +01:00
Jon Olav Hauglid
52d7980753 Bug#18913935: REMOVE SUPPORT FOR LINUXTHREADS
This patch removes support for LinuxThreads.
It was superseded by NPTL in Linux 2.6 (2003).
2020-03-10 19:24:21 +01:00
Sergei Golubchik
17ea240f6b make pcre2 builds to work on an old cmake 2020-03-10 19:24:21 +01:00
Varun Gupta
f3e4674a27 Fix a compilation bug for 64 bit windows 2020-03-10 23:19:12 +05:30
Marko Mäkelä
589a21c631 MDEV-21580: Fix clang -Winconsistent-missing-override 2020-03-10 19:02:53 +02:00
Alexander Barkov
e40858a7bd MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY 2020-03-10 20:43:32 +04:00
Varun Gupta
00749980ac Fixing a compilation failure on windows 2020-03-10 19:22:22 +05:30
Sujatha
9ae015878f MDEV-10047: table-based master info repository
Problem:
=======
When we upgrade from "mysql" to "mariadb" if slave is using repositories as
tables their data is completely ignored and no warning is issued in error log.

Fix:
===
"mysql_upgrade" test should check for the presence of data in
"mysql.slave_master_info" and "mysql.slave_relay_log_info" tables. When tables
have some data the upgrade script should report a warning which hints users
that the data in repository tables will be ignored.
2020-03-10 15:55:50 +05:30
Varun Gupta
b753ac066b MDEV-21580: Allow packed sort keys in sort buffer
This task deals with packing the sort key inside the sort buffer, which  would
lead to efficient usage of the memory allocated for the sort buffer.

The changes brought by this feature are
  1) Sort buffers would have sort keys of variable length
  2) The format for sort keys inside the sort buffer would look like
     |<sort_length><null_byte><key_part1><null_byte><key_part2>.......|
      sort_length is the extra bytes that are required to store the variable
      length of a sort key.
  3) When packing of sort key is done we store the ORIGINAL VALUES inside
     the sort buffer and not the STRXFRM form (mem-comparable sort keys).
  4) Special comparison function packed_keys_comparison() is introduced
     to compare 2 sort keys.

This patch also contains contributions from Sergei Petrunia.
2020-03-10 15:09:17 +05:30
Marko Mäkelä
561b5ce364 MDEV-21748 ASAN use-after-poison in PageBulk::insertPage()
PageBulk::insertPage(): Check the array bounds before comparing.
We used to read one byte beyond the end of the 'rec' payload.
The incorrect logic was originally introduced in
commit 7ae21b18a6.
2020-03-10 09:53:29 +01:00
Marko Mäkelä
e2e2f89303 MDEV-15528: Minor cleanup
buf_flush_freed_page(): Reformat in the common style, and
simplify some code. Prefer to request all information from
smaller data structures (buf_page_t) than from fil_space_t
or the global variable srv_immediate_scrub_data_uncompressed.

SysTablespace::open_or_create(): Assert that the temporary
tablespace will not be created in page_compressed format, so that
buf_flush_freed_page() can avoid checking that on every call.

IORequest: Remove duplicated constructors, and do not explicitly
declare a default constructor.
2020-03-10 09:53:23 +01:00
Otto Kekäläinen
e0e5d8c594 Deb: Update Debian packaging to include mytop and all new man pages
Related to MDEV-21769.
2020-03-10 07:53:33 +01:00
Otto Kekäläinen
8607076545 Add a man page for mytop that is in sources
Related to MDEV-21769.
2020-03-10 07:53:33 +01:00
Otto Kekäläinen
c7c0959c19 Use correct reference in man page links
After the '.so' one is supposed to use the directory name, like we have
correctly in all old man pages:
  mysql_client_test_embedded.1:.so man1/mysql_client_test.1
  mysql_embedded.1:.so man1/mysql.1
  mysqltest_embedded.1:.so man1/mysqltest.1

This change adds the 'man1/' component so the link has the correct format.
Actually using man links is a deprecated practice and using symlinks
would be better, but that can be fixed in a later commit.

From https://www.debian.org/doc/debian-policy/ch-docs.html#manual-pages:
> If one man page needs to be accessible via several names it is better
> to use a symbolic link than the .so feature

Detected via Lintian errors:
  E: mariadb-server-10.5: bad-so-link-within-manual-page usr/share/man/man1/mariadb-show.1.gz
  E: mariadb-client-10.5: bad-so-link-within-manual-page usr/share/man/man1/mariadb-binlog.1.gz
  E: mariadb-client-10.5: bad-so-link-within-manual-page usr/share/man/man1/mariadb-plugin.1.gz

Related to MDEV-21769.
2020-03-10 07:53:33 +01:00
Otto Kekäläinen
32fdf81f5c Fix syntax error mysql-test-run in man page
This fixes errors like:

  $ LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 \
    man --warnings -E UTF-8 -l -Tutf8 -Z mysql-test-run.pl.1 > /dev/null

  troff: <standard input>:246: warning [p 2, 6.0i, div '3tbd1,1', 0.3i]: can't break line
  troff: <standard input>:275: warning [p 2, 6.0i, div '3tbd6,1', 0.8i]: can't break line

Related to MDEV-21769.
2020-03-10 07:53:33 +01:00
Otto Kekäläinen
0335af745c Add missing man pages for myrocks_hotbackup
Related to MDEV-21769.
2020-03-10 07:53:33 +01:00
Oleksandr Byelkin
50c0939166 MDEV-20632: Recursive CTE cycle detection using CYCLE clause (nonstandard)
Added CYCLE ... RESTRICT (nonstandard) clause to recursive CTE.
2020-03-10 07:20:49 +01:00
Thirunarayanan Balathandayuthapani
a5584b13d1 MDEV-15528 Punch holes when pages are freed
The following parameters are deprecated:

  innodb-background-scrub-data-uncompressed
  innodb-background-scrub-data-compressed
  innodb-background-scrub-data-interval
  innodb-background-scrub-data-check-interval

Removed scrubbing code completely(btr0scrub.h, btr0scrub.cc)
Removed information_schema.innodb_tablespaces_scrubbing tables
Removed the scrubbing logic from fil_crypt_thread()
2020-03-10 10:51:08 +05:30
Thirunarayanan Balathandayuthapani
a35b4ae898 MDEV-15528 Punch holes when pages are freed
When a InnoDB data file page is freed, its contents becomes garbage,
and any storage allocated in the data file is wasted. During flushing,
InnoDB initializes the page with zeros if scrubbing is enabled. If the
tablespace is compressed then InnoDB should punch a hole else ignore the
flushing of the freed page.

buf_page_t:
- Replaced the variable file_page_was_freed, init_on_flush in buf_page_t
with status enum variable.
- Changed all debug assert of file_page_was_freed to DBUG_ASSERT
of buf_page_t::status

Removed buf_page_set_file_page_was_freed(),
buf_page_reset_file_page_was_freed().

buf_page_free(): Newly added function which takes X-lock on the page
before marking the status as FREED. So that InnoDB flush handler can
avoid concurrent flush of the freed page. Also while flushing the page,
InnoDB make sure that redo log which does freeing of the page also written
to the disk. Currently, this function only marks the page as FREED if
it is in buffer pool

buf_flush_freed_page(): Newly added function which initializes zeros
asynchorously if innodb_immediate_scrub_data_uncompressed is enabled.
Punch a hole to the file synchorously if page_compressed is enabled.
Reset the io_fix to NORMAL. Release the block from flush list and
associated mutex before writing zeros or punch a hole to the file.

buf_flush_page(): Removed the unnecessary usage of temporary
variable "flush"

fil_io(): Introduce new parameter called punch_hole. It allows fil_io()
to punch the hole to the file for the given offset.

buf_page_create(): Let the callers assign buf_page_t::status.
Every caller should eventually invoke mtr_t::init().

fsp_page_create(): Remove the unused mtr_t parameter.

In all other callers of buf_page_create() except fsp_page_create(),
before invoking mtr_t::init(), invoke
mtr_t::sx_latch_at_savepoint() or mtr_t::x_latch_at_savepoint().

mtr_t::init(): Initialize buf_page_t::status also for the temporary
tablespace (when redo logging is disabled), to avoid assertion failures.
2020-03-10 10:51:08 +05:30
Oleksandr Byelkin
980108ceeb MDEV-21833 Make slave_run_triggers_for_rbr enforce triggers to run on slave, even when there are triggers on the master
A bit changed patch of Anders Karlsson with examples added.

New parameters "ENFORCE" to slave-run-triggers-for-rbr added.
2020-03-09 22:16:43 +02:00
Sergey Vojtovich
1f5a8e1f77 Fixed signed/unsigned error on Windows 2020-03-09 22:50:19 +04:00
Andrei Elkin
dd3ffdbd92 MDEV-21659 XA rollback foreign_xid is allowed inside active XA
MDEV-21854 xa commit `xid` one phase for already prepared transaction must always error out

Added state and one-phase option checks to XA "external" commit/rollback
branches. While the XA standard does not prohibit it,
Commit and Rollback of an XA external to the current ongoing transaction
is not allowed; after all the current transaction may rollback
to not being able to revert that decision.
2020-03-09 20:40:52 +02:00
Sergey Vojtovich
f4f6558666 Attempt fixing build failure on Windows
Let ulong_num being converted by strtoul() rather than strtol().
2020-03-09 21:53:52 +04:00
Sergey Vojtovich
82e997ad3f MDEV-21856 - xid_t::formatID has to be constrained to 4 byte size
Engine (InnoDB) and XA replication MDEV-742 requires the XID member
be of a constant minimum across supported platform ulong size which
is 4 bytes.
2020-03-09 18:31:18 +04:00
Marko Mäkelä
276e042de3 MDEV-21893: Assertion failure on upgrade with innodb_encrypt_log
recv_log_recover_10_4(): Add a missing bit pattern negation that
was forgotten when commit f8a9f90667
(MDEV-12353) removed the support for crash-upgrading.
2020-03-09 11:38:43 +02:00
Marko Mäkelä
adb4117631 MDEV-21892: Assertion ...row_get_rec_trx_id... failed on SELECT
btr_cur_upd_rec_in_place(): Invoke page_zip_rec_set_deleted()
for ROW_FORMAT=COMPRESSED pages, so that the change will be
written to the redo log.

This part of crash recovery was broken in
commit 08ba388713 (MDEV-12353).
2020-03-09 11:38:34 +02:00
Marko Mäkelä
57c592f74d Cleanup: Remove recv_sys.remove_extra_log_files
create_log_file(): Delete all old redo log files where they used to be
deleted, after the crash injection point innodb_log_abort_6,
before commit 9ef2d29ff4
deprecated and ignored the setting innodb_log_files_in_group.
2020-03-07 14:47:15 +02:00
Marko Mäkelä
70f0dbe4d3 Cleanup: log upgrade and encryption
log_crypt_101_read_checkpoint(), log_crypt_101_read_block():
Declare as ATTRIBUTE_COLD. These are only used when
checking that a MariaDB 10.1 encrypted redo log is clean.

log_block_calc_checksum_format_0(): Define in the only
compilation unit where it is needed. This is only used
when reading the checkpoint information from redo logs
before MariaDB 10.2.2.

crypt_info_t: Declare the byte arrays directly with alignas().

log_crypt(): Use memcpy_aligned instead of reinterpret_cast
on integers.
2020-03-07 14:31:36 +02:00
Marko Mäkelä
522fbfcb5c Cleanup: Remove recv_sys.buf_size
Also, correctly document what recv_sys.mutex is protecting.
2020-03-07 12:01:12 +02:00
Sergei Petrunia
0a9633ee62 Basic LEX::print function that supports UPDATEs 2020-03-07 01:26:28 +03:00
Sergei Petrunia
92eed38c24 Provide a show_create_table_ex() function
It is like show_create_table() but allows the caller to specify the
database_name and table_name which are to be printed.
2020-03-07 01:20:45 +03:00
Sergei Petrunia
cbbe4971b6 MDEV-21887: federatedx crashes on SELECT ... INTO query in select_handler code
- Don't try to push down SELECTs that have a side effect

- In case the storage engine did support pushdown of SELECT with an INTO
  clause, write the rows we've got from it into select->join->result,
  and not thd->protocol.  This way, SELECT ... INTO ... FROM
  smart_engine_table will put the result into where instructed, and
  NOT send it to the client.
2020-03-07 01:14:41 +03:00
Marko Mäkelä
23685378ba MDEV-14425 preparation: Simplify redo log upgrade
recv_log_recover_pre_10_2(): Merged from
recv_find_max_checkpoint_0(), recv_log_format_0_recover().
2020-03-06 11:06:59 +02:00
Marko Mäkelä
a4ab54d70f MDEV-14425 Cleanup: Use std::atomic for some log_sys members
Some fields were protected by log_sys.mutex, which adds quite some
overhead for readers. Some readers were submitting dirty reads.

log_t::lsn: Declare private and atomic. Add wrappers get_lsn()
and set_lsn() that will use relaxed memory access. Many accesses
to log_sys.lsn are still protected by log_sys.mutex; we avoid the
mutex for some readers.

log_t::flushed_to_disk_lsn: Declare private and atomic, and move
to the same cache line with log_t::lsn.

log_t::buf_free: Declare as size_t, and move to the same cache line
with log_t::lsn.

log_t::check_flush_or_checkpoint_: Declare private and atomic,
and move to the same cache line with log_t::lsn.

log_get_lsn(): Define as an alias of log_sys.get_lsn().

log_get_lsn_nowait(), log_peek_lsn(): Remove.

log_get_flush_lsn(): Define as an alias of log_sys.get_flush_lsn().

log_t::initiate_write(): Replaces log_buffer_sync_in_background().
2020-03-05 16:21:31 +02:00
Eugene Kosov
555f955a16 use O_DSYNC for InnoDB
O_DSYNC is faster than O_SYNC because it syncs as little as needed
(e.g. no timestamp changes)

This change is similar to change fsync() -> fdatasync() in MDEV-21382
2020-03-05 11:35:09 +03:00
Otto Kekäläinen
f2832a010a MDEV-14918: Use sst_dump from package rocksdb-tools, don't build it
Since this tool is already shipped in the system, don't provide it from
MariaDB from 10.5 series onwards. It will potentially just create an
installation failure due to conflict if users install rocksdb-tools.

Package rocksdb-tools in Debian since Buster (10):
https://packages.debian.org/search?suite=buster&arch=any&mode=path&searchon=contents&keywords=sst_dump

Package rocksdb-tools in Ubuntu since Disco (19.04):
https://packages.ubuntu.com/search?suite=disco&arch=any&mode=exactfilename&searchon=contents&keywords=sst_dump

This change is adopted from Debian the change has been since Dec 18, 2018.
d50e2eaf1f
2020-03-05 09:11:49 +02:00