Commit graph

184700 commits

Author SHA1 Message Date
Sergei Golubchik
5b15cc613e MDEV-11340 Allow multiple alternative authentication methods for the same user
introduce the syntax

... IDENTIFIED { WITH | VIA }
      plugin [ { USING | AS } auth ]
 [ OR plugin [ { USING | AS } auth ]
 [ OR ... ]]

Server will try auth plugins in the specified order until the first
success. No protocol changes, server uses the existing "switch plugin"
packet.

The auth chain is stored in json as

  "auth_or":[{"plugin":"xxx","authentication_string":"yyy"},
             {},
             {"plugin":"foo","authentication_string":"bar"},
            ...],
  "plugin":"aaa", "authentication_string":"bbb"

Note:
* "auth_or" implies that there might be "auth_and" someday;
* one entry in the array is an empty object, meaning to take plugin/auth
  from the main json object. This preserves compatibility with
  the existing mysql.global_priv table and with the mysql.user view.
  This entry is preferrably a mysql_native_password plugin for a
  non-empty mysql.user.password column.

SET PASSWORD is supported and changes the password for the *first*
plugin in the chain that has a notion of a "password"
2019-02-04 16:06:57 +01:00
Sergei Golubchik
798d1a9ddf upgrade C/C to 3.1 2019-02-04 16:06:31 +01:00
Sergei Golubchik
3416e8ac9a cleanup: sys_vars.cc
add DEPRECATED() warning for variables with "deprecated" in the
help text. Remove redundant initializers.
2019-02-04 15:54:10 +01:00
Sergei Golubchik
9c9b4590b6 Fix the bug introduced in MDEV-17658
if auth_root_socket is set, root user should be using unix_socket

Followup for 4abb8216a0
2019-02-04 15:54:10 +01:00
Sergei Golubchik
b8344be4fa cleanup 2019-02-04 15:54:10 +01:00
Sergei Golubchik
9b3f177c6d avoid unintentional %union size increases 2019-02-04 15:54:10 +01:00
Sergei Golubchik
103a32fdd3 ed25519: better error message for an incorrect password hash 2019-02-04 15:54:10 +01:00
Sergei Golubchik
c94ec9fc67 MDEV-17950 SHOW GRANTS FOR does not work for a user identified with non-existing plugin
Revert the side effect of 7c40996cc8.
Do not convert password hash to its binary representation when a user
entry is loaded. Do it lazily on the first authenticatation attempt.

As a collateral - force all authentication plugins to follow the
protocol and read_packet at least once before accessing info->username
(username is not available before first client handshake packet is read).

Fix PAM and GSSAPI plugins to behave.
2019-02-04 15:54:10 +01:00
Sergei Golubchik
3742f6f9aa cleanup: use only one callback in PAM plugin, not two 2019-02-04 15:54:10 +01:00
Sergei Golubchik
3ab445819e MDEV-18119 upgrading from 10.3 to 10.4 can result in the password for a user to be wiped ou 2019-02-04 15:54:10 +01:00
Sergei Golubchik
eeaaf4a845 stricter json unit tests 2019-02-04 15:54:10 +01:00
Kentoku
5b996782be MDEV-16279 Spider crashes on CHECKSUM TABLE with spider_quick_mode=3
add tests
2019-02-03 15:58:45 +05:30
Kentoku
540e82d1b4 MDEV-16787 optimistic parallel replication fails on spider
Add a system variable spider_slave_trx_isolation.
- spider_slave_trx_isolation
  The transaction isolation level when Spider table is used by slave SQL thread.
  -1 : OFF
   0 : READ UNCOMMITTED
   1 : READ COMMITTED
   2 : REPEATABLE READ
   3 : SERIALIZABLE
  The default value is -1

Miscellaneous Spider typos
2019-02-03 15:58:45 +05:30
Kentoku
41e60e7fe8 MDEV-16520 Out-Of-Memory running big aggregate query on Spider Engine
Change default value of the followings
quick_mode 0 -> 3
quick_page_size 100 -> 1024

Add the following parameter for limiting result page size by byte
- quick_page_byte(qpb)
  Number of bytes in a page when acquisition one by one.
  When quick_mode is 1 or 2, Spider stores at least 1 record even if
  quick_page_byte is smaller than 1 record. When quick_mode is 3,
  quick_page_byte is used for judging using temporary table.
  That is given to priority when server parameter spider_quick_page_byte
  is set.
  The default value is 10485760

Fix "out of sync" issue at using quick_mode = 1 or 2
2019-02-03 15:58:45 +05:30
Kentoku
b27284db4a MDEV-16279 Spider crashes on CHECKSUM TABLE with spider_quick_mode=3
The fields of the temporary table were not created in create_tmp_table function. Because item->const_item() was true. But the temporary tables that is created by Spider are always used all columns. So Spider should call create_tmp_table function with TMP_TABLE_ALL_COLUMNS flag.
2019-02-03 15:58:45 +05:30
Kentoku
4a28a79e48 Update Spider to version 3.3.14. Add direct left outer join/right outer join/inner join feature 2019-02-03 15:58:45 +05:30
Varun Gupta
74eb4fc9fc MDEV-17484: New defaults for eq_range_index_dive_limit in 10.4
The default value for eq_range_index_dive_limit is set to 10
2019-02-01 23:43:38 +05:30
Marko Mäkelä
923415ffdb Merge bb-10.4-release into 10.4 2019-01-30 09:13:38 +02:00
Daniel Bartholomew
ac55d3e448 bump the VERSION 2019-01-29 13:24:19 -05:00
Sergey Vojtovich
4b3656a44d Avoid taking LOCK_thread_count for thread_count protection
Replaced wait on COND_thread_count with busy waiting with 1 millisecond
sleep.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
2019-01-29 11:56:35 +04:00
Sergey Vojtovich
8553525931 MDEV-18400 - Move shutdown handling to main thread
Signal handler is now respoinsible for setting abort_loop and breaking
poll() in main thread. The rest is handled by main thread itself.

Removed redundant LOCK_error_log init/destroy wrappers.
Removed redundant unireg_end(): it is trivial and it has only one caller.
Removed unused ready_to_exit from PFS.
Removed kill_in_progress: duplicates abort_loop.
Removed shutdown_in_progress: duplicates abort_loop.
Removed ready_to_exit: was used to make sure main thread waits for
cleanups, which are now done by main thread itself.
Removed SIGNALS_DONT_BREAK_READ, MAYBE_BROKEN_SYSCALL,
kill_broken_server: never defined/used.
Make clean_up() static.
2019-01-29 11:56:35 +04:00
Vladislav Vaintroub
c2318291be MDEV-15135 - Make LOCK_show_status rwlock, to enable parallelism of
fill_status.

Also, remove LOCK_status around calc_sum_of_all_status()

Also, rename LOCK_show_status into LOCK_all_status_vars.
This reflects the variable the lock protects.
2019-01-28 17:49:53 +04:00
Vladislav Vaintroub
8b4fcc434d Use rwlock rather than mutex for protecting THD_list
modifications (insert/erase) are protected by write lock
iteration over list is protected by read lock.

This way, threads that iterate over the list (as in SHOW PROCESSLIST,
SHOW GLOBAL STATUS) do not block each other.
2019-01-28 17:45:35 +04:00
Sergei Golubchik
9c60535f86 SSL test fixes
* fix CRL tests to work
* regenerate certificates to be at least 2048 bit
  (fixes buster and rhel8 in buildbot)
* update generate-ssl-cert.sh to generate crl files
* make all SSL tests to use certificates generated
  in generate-ssl-cert.sh, remove unused certificates
2019-01-28 14:41:39 +01:00
Sergei Golubchik
eff7f9bea2 update the result file after the merge 2019-01-28 14:41:38 +01:00
Sergei Golubchik
41a9a677eb downgrade wsrep_plugin_init()/wsrep_plugin_deinit log messages
from info to debug
2019-01-28 14:41:38 +01:00
Sergey Vojtovich
9824ec81aa Removed redundant service_thread_count
In contrast to thread_count, which is decremented by THD destructor,
this one was most probably intended to be decremented after all THD
destructors are done.

THD_count class was added to achieve similar effect with thread_count.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
Part of MDEV-15135.
2019-01-28 17:39:08 +04:00
Sergey Vojtovich
3503fbbebf Move THD list handling to THD_list
Implemented and integrated THD_list as a replacement for the global
thread list. It uses own mutex instead of LOCK_thread_count for THD
list protection.

Removed unused first_global_thread() and next_global_thread().

delayed_insert_threads is now protected by LOCK_delayed_insert. Although
this patch doesn't fix very wrong synchronization of this variable.

After this patch there are only 2 legitimate uses of LOCK_thread_count
left, both in mysqld.cc: thread_count and ready_to_exit.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
Part of MDEV-15135.
2019-01-28 17:39:07 +04:00
Sergey Vojtovich
891be49a36 Simplified THD::current_linfo locking
LOG_INFO::lock was useless. It could've only protect against concurrent
iterators execution, which was already protected by LOCK_thread_count.

Use LOCK_thd_data instead of LOCK_thread_count as a protection against
THD::current_linfo reset.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
Part of MDEV-15135.
2019-01-28 17:39:07 +04:00
Sergey Vojtovich
c88fd54d17 Execute bootstrap in main thread
Bootstrap in a separate thread was introduced in 746f0b3b7 to workaround
OS/2 small stack size. OS/2 support was discontinued in 2006 and modern
operating systems have default stack size a few times larger than
default thread_stack and it is tunable.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
Part of MDEV-15135.
2019-01-28 17:39:06 +04:00
Sergey Vojtovich
7ad742b265 Simplified code, no functional changes 2019-01-28 17:39:06 +04:00
Monty
4007eaba91 Removed declaration of strconvert() from innodb_priv.h 2019-01-26 19:18:22 +02:00
Monty
c0c62196ca Removed \n from sql_print_error() 2019-01-26 19:18:22 +02:00
Monty
d0bfa4afc4 Fixed failing testcase when blackhole engine is not enabled 2019-01-26 19:18:22 +02:00
Sergei Golubchik
574cde9be4 fix failing openssl_1 test
if ssl_cipher is not specified, it must be NULL, not ""
2019-01-26 10:26:20 +01:00
Sergei Golubchik
9b76e2843b Merge branch '10.3' into 10.4 2019-01-26 01:13:41 +01:00
Aleksey Midenkov
06a37d37a1 MDEV-18122 Assertion 'table->versioned() == m_prebuilt->table->versioned()' failed in ha_innobase::open
Closes #1134
2019-01-25 23:30:45 +02:00
Sergei Golubchik
3b1b665fcb Merge branch '10.2' into 10.3 2019-01-25 20:35:40 +01:00
Sergei Golubchik
a4ab66c8f8 Make the PYTHON_SHEBANG value configurable
and gitignore myrocks_hotbackup (as it's now generated)

Closes #1081
2019-01-25 20:00:00 +01:00
Honza Horak
7334f9717d Do not import commands library as it is not used
Closes #1080
2019-01-25 20:00:00 +01:00
Sergei Golubchik
e99e6f29e9 cleanup: trg2bit() helper 2019-01-25 19:59:04 +01:00
Sergei Golubchik
3fb6d2587d Don't run tests that check privileges in --embedded 2019-01-25 19:57:37 +01:00
Sergei Golubchik
d4515d1305 Deb: don't edit control file from inside rules file
It's too late. Might work or not (and on buster it doesn't).
2019-01-25 19:57:37 +01:00
Sergei Golubchik
74f184aff2 Fix tests not to fail with OpenSSL 1.1.1 with TLSv1.3 2019-01-25 19:57:37 +01:00
Eugene Kosov
0e1f7f5c4a MDEV-18057 Assertion `(node->state == 5) || (node->state == 6)' failed in row_upd_sec_step upon DELETE after UPDATE failed due to FK violation
The idea of the fix: reset state from previous query.

row_upd_clust_step(): reset cached index before updating a clustered index

Closes #1133
2019-01-25 16:35:50 +02:00
Marko Mäkelä
9bd80ada6f Merge 10.2 into 10.3 2019-01-25 16:35:13 +02:00
Jan Lindström
e77156d51d
Merge pull request #1135 from codership/10.4-fix-galera_3nodes-ipv6
Fix for galera_3nodes galera_ipv6_mysqldump and galera_ipv6_mariabackup
2019-01-25 15:58:01 +02:00
Eugene Kosov
31d0727a10 MDEV-18235: Changes related to fsync()
Remove fil_node_t::sync_event.

I had a discussion with kernel fellows and they said it's safe to call
fsync() simultaneously at least on VFS and ext4. So initially I wanted
to disable check for recent Linux but than I realized code is buggy.

Consider a case when one thread is inside fsync() and two others are
waiting inside os_event. First thread after fsync() calls os_event_set()
which is a broadcast! So two waiting threads will awake and may call
fsync() at the same time.

One fix is to add a notify_one() functionality to os_event but I decided
to remove incorrect check completely. Note, it works for one waiting
thread but not for more than one.

IMO it's ok to avoid existing bugs but there is not too much sense in
avoiding possible(!) bugs as this code does.

fil_space_t::is_in_rotation_list(), fil_space_t::is_in_unflushed_spaces():
Replace redundant bool fields with member functions.

fil_node_t::needs_flush: Replaces fil_node_t::modification_counter and
fil_node_t::flush_counter. We need to know whether there _are_ some
unflushed writes and we do not need to know _how many_ writes.

fil_system_t::modification_counter: Remove as not needed.
Even if we needed fil_node_t::modification_counter, every file
could have its own counter that would be incremented on each write.

fil_system_t::modification_counter is a global modification counter
for all files. It was incremented on every write. But whether some
file was flushed or not is an internal fil_node_t deal/state and
this makes fil_system_t::modification_counter useless.

Closes #1061
2019-01-25 15:40:04 +02:00
Jan Lindström
f2518f3da9
Merge pull request #1136 from tempesta-tech/sysprg/MDEV-18379
MDEV-18379: Unification of check for IPv6
2019-01-25 14:38:44 +02:00
Julius Goryavsky
a22dc6268b MDEV-18379: Unification of check for IPv6
Currently, the three-node mtr suite for Galera (galera_3nodes)
uses a separate IPv6 availability check using the "have_ipv6.inc"
file. This check duplicates a more accurate check at suite.pm
level, which can be used by including the file "check_ipv6.inc".

This patch removes this discrepancy between suites. In addition,
one of the files in the galera_3nodes suite does not contain the
option "--bind-address=::" which is needed for the test to work
correctly with IPv6 (at least on some systems), since without
it the server will not wait for connections on the IPv6 interface.

https://jira.mariadb.org/browse/MDEV-18379
2019-01-25 12:29:50 +01:00