Commit graph

188656 commits

Author SHA1 Message Date
Marko Mäkelä
d82ac8d374 MDEV-21907: Fix some -Wconversion outside InnoDB
Some .c and .cc files are compiled as part of Mariabackup.
Enabling -Wconversion for InnoDB would also enable it for
Mariabackup. The .h files are being included during
InnoDB or Mariabackup compilation.

Notably, GCC 5 (but not GCC 4 or 6 or later versions)
would report -Wconversion for x|=y when the type is
unsigned char. So, we will either write x=(uchar)(x|y)
or disable the -Wconversion warning for GCC 5.

bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit(), bitmap_is_set():
Always implement as inline functions.
2020-03-12 19:44:52 +02:00
Marko Mäkelä
c7920fa8ff MDEV-16264: Eliminate unsafe os_aio_userdata_t type cast 2020-03-12 19:43:45 +02:00
Marko Mäkelä
8be3794b42 MDEV-21924 Clean up InnoDB GIS record comparison
The extension of the record comparison functions for SPATIAL INDEX in
mysql/mysql-server@b66ad511b6
was suboptimal for multiple reasons:

Some functions used unnecessary temporary variables of the int type,
instead of the more appropriate size_t, causing type mismatch.

Many functions unnecessarily required rec_get_offsets() to be
computed, or a parameter for length, although the size of the
minimum bounding rectangle (MBR) is hard-coded as
SPDIMS * 2 * sizeof(double), or 32 bytes.

In InnoDB SPATIAL INDEX records, there always is a 32-byte key
followed by either a 4-byte child page number or the PRIMARY KEY value.

The length parameters were not properly validated.
The function cmp_geometry_field() was making an incorrect attempt
at checking that the lengths are at least sizeof(double) (8 bytes),
even though the function is accessing up to 32 bytes in both MBR.

Functions that are called from only one compilation unit are defined
in another compilation unit, making the code harder to follow and
potentially slower to execute.

cmp_dtuple_rec_with_gis(): FIXME: Correct the debug assertion
and possibly the function TABLE_SHARE::init_from_binary_frm_image()
or related code, which causes an unexpected length of
DATA_MBR_LEN + 2 bytes to be passed to this function.
2020-03-12 18:13:53 +02:00
Marko Mäkelä
0d76777872 MDEV-13362: Fix -Wset-but-unused 2020-03-12 18:13:47 +02:00
Julius Goryavsky
28fabc86db MDEV-13362: implement --require_secure_transport option
Currently, if a user wants to require TLS for every connection made
over the network, then every user account on the system needs to be
created with "REQUIRE SSL" or one of the other TLS options.

Implementing a require_secure_transport system varuable (which,
in particular, can be set using the --require_secure_transport=ON
command line option) in the MariaDB Server would make it a lot
easier to require TLS (or other secure transport) system-wide.

This patch implements this new system variable, adds the ability
to set it with SQL statements, from the command line and from the
configuration file, and also contains improvements for mtr that allow
the user to establish non-secure TCP/IP connections (for example,
to verify the operation of the new option).
2020-03-12 11:46:08 +01:00
Vladislav Vaintroub
9d7ed94f6a CMake cleanup - simplify create_initial_db.cmake
Also make initial_database optional target on non-Windows, as sometimes
it can be quite handy to bootstrap without MTR.
2020-03-11 10:58:53 +01:00
Marko Mäkelä
574d8b2940 MDEV-21907: Fix most clang -Wconversion in InnoDB
Declare innodb_purge_threads as 4-byte integer (UINT)
instead of 4-or-8-byte (ULONG) and adjust the documentation string.
2020-03-11 08:29:48 +02:00
Marko Mäkelä
6ec3682371 MDEV-21743: Re-record --big-test results 2020-03-11 08:29:48 +02:00
Marko Mäkelä
4f4fccecb2 Fix perfschema.statement_program_concurrency 2020-03-11 08:29:48 +02:00
Alexander Barkov
0e04beb28f Recoding new suite/perfschema/r/start_server_low_digest_sql_length.result
Fixing a test failure introduced by MDEV-21743
2020-03-11 00:35:30 +04:00
Alexander Barkov
a1e330de5a MDEV-21743 Split up SUPER privilege to smaller privileges 2020-03-10 23:49:47 +04:00
Oleksandr Byelkin
91ba789aaf fix for VALGRIND build 2020-03-10 20:36:18 +01:00
Oleksandr Byelkin
7676208ce6 Fixed problem of exiting over 32 bit on windows. 2020-03-10 20:12:30 +01:00
Sergei Golubchik
43460839dd MDEV-21795 10.5 with bundled pcre2 and embedded server could not be built
partially reverting 961413d26f
2020-03-10 19:24:24 +01:00
Sergei Golubchik
7180afa094 fix perfschema for pool-of-threads 2020-03-10 19:24:24 +01:00
Sergei Golubchik
a9b8131d99 cleanup: remove source files that aren't used 2020-03-10 19:24:23 +01:00
Sergei Golubchik
cbede21d0d cleanup: pass trxid by value 2020-03-10 19:24:23 +01:00
Sergei Golubchik
211421d5cc cleanup: remove unused argument 2020-03-10 19:24:23 +01:00
Sergei Golubchik
c1c5222cae cleanup: PSI key is *always* the first argument 2020-03-10 19:24:23 +01:00
Sergei Golubchik
7af733a5a2 perfschema compilation, test and misc fixes 2020-03-10 19:24:23 +01:00
Sergei Golubchik
81cffda2e6 perfschema transaction instrumentation related changes 2020-03-10 19:24:23 +01:00
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