Commit graph

185064 commits

Author SHA1 Message Date
Oleksandr Byelkin
5b4d6595d2 fix test to pass on embedded serever 2019-02-21 18:29:17 +01:00
Sergei Golubchik
33b9f80595 mysql_install_db: make sure the variable's value is visible
move the assignment out of a function, so that it wouldn't
happen in a subshell
2019-02-21 16:54:31 +01:00
Marko Mäkelä
7c8e17b931 MDEV-18677 clang-cl 7 fails to compile innodb
ib_counter_element_t: Declare as struct, not union.

Based on patch by Vladislav Vaintroub
2019-02-21 17:14:49 +02:00
Sergei Golubchik
7f6d88944c MDEV-12484 Enable unix socket authentication by default
Debian part. Do not ask to set a root password,
do not create debian-sys-maint user (but preserve an existing one
on upgrades - user scripts might be relying on it).

Just create an empty /etc/mysql/debian.cnf for --defaults-file not to fail
2019-02-21 15:04:03 +01:00
Sergei Golubchik
132216faf7 don't invoke error interceptors for fatal errors
and, again, *don't use thd->clear_error()*

this fixed main.sp_notembedded failure on various amd64 platforms
(where ER_STACK_OVERRUN_NEED_MORE happens to fire in open_stat_tables()
under Dummy_error_handler)
2019-02-21 15:04:03 +01:00
Sergei Golubchik
65ffea3924 MDEV-18297 clarify mysql_install_db help text 2019-02-21 15:04:03 +01:00
Sergei Golubchik
4386d93500 MDEV-18297 How to reset a forgotten root password
After FLUSH PRIVILEGES remember if the connection started under
--skip-grant-tables and keep it all-powerful, not a lowly anonymous.

One could use this connection to reset passwords as needed.

Also fix a crash in SHOW CREATE USER
2019-02-21 15:04:03 +01:00
Sergei Golubchik
a94b20a8e0 don't consider the password "expired" if authentication is passwordless 2019-02-21 15:04:03 +01:00
Sergei Golubchik
1e6210161d MDEV-7597 Expiration of user passwords
post-merge changes:
* handle password expiration on old tables like everything else -
  make changes in memory, even if they cannot be done on disk
* merge "debug" tests with non-debug tests, they don't use dbug anyway
* only run rpl password expiration in MIXED mode, it doesn't replicate
  anything, so no need to repeat it thrice
* restore update_user_table_password() prototype, it should not change
  ACL_USER, this is done in acl_user_update()
* don't parse json twice in get_password_lifetime and get_password_expired
* remove LEX_USER::is_changing_password, see if there was any auth instead
* avoid overflow in expiration calculations
* don't initialize Account_options in the constructor, it's bzero-ed later
* don't create ulong sysvars - they're not portable, prefer uint or ulonglong
* misc simplifications
2019-02-21 15:04:03 +01:00
Robert Bindar
90ad4dbd17 MDEV-7597 Expiration of user passwords
This patch adds support for expiring user passwords.
The following statements are extended:
  CREATE USER user@localhost PASSWORD EXPIRE [option]
  ALTER USER user@localhost PASSWORD EXPIRE [option]
If no option is specified, the password is expired with immediate
effect. If option is DEFAULT, global policy applies according to
the default_password_lifetime system var (if 0, password never
expires, if N, password expires every N days). If option is NEVER,
the password never expires and if option is INTERVAL N DAY, the
password expires every N days.
The feature also supports the disconnect_on_expired_password system
var and the --connect-expired-password client option.

Closes #1166
2019-02-21 15:04:03 +01:00
Sergei Golubchik
83de75d66d try harder to link unix_socket plugin statically
fix unix_socket tests to work if unix_socket is a built-in
2019-02-21 15:04:03 +01:00
Sergei Golubchik
38bf9319a4 update C/C 2019-02-21 15:04:03 +01:00
Sergei Golubchik
81ecc2b2b5 store string lengths in frm in 1-3 bytes 2019-02-21 14:57:10 +01:00
Sergei Golubchik
8ad23ff498 don't allow TIME columns in PERIOD specification 2019-02-21 14:57:10 +01:00
Sergei Golubchik
7b48724dcc UPDATE FOR PERIOD OF: don't crash on multi-table views 2019-02-21 14:57:10 +01:00
Sergei Golubchik
9718e374a2 update sql_yacc_ora.yy to match sql_yacc.yy 2019-02-21 14:57:10 +01:00
Sergei Golubchik
81e4b9b3bb misc cleanups 2019-02-21 14:57:10 +01:00
Sergei Golubchik
7ec3a4d76b tests
* don't suppress output unnecessary
* only run system versioning tests with two innodb combinations
* show results of delete/update (add SELECTs as needed)
2019-02-21 14:57:10 +01:00
Nikita Malyavin
6294516a56 MDEV-16975 Application-time periods: ALTER TABLE
* implicit period constraint is hidden and cannot be dropped independently
* create...like and create...select support
2019-02-21 14:57:09 +01:00
Nikita Malyavin
b2bd52290a MDEV-16974 Application-time periods: UPDATE 2019-02-21 14:48:04 +01:00
Nikita Malyavin
47e28a94d5 MDEV-16973 Application-time periods: DELETE
* inject portion of time updates into mysql_delete main loop
* triggered case emits delete+insert, no updates
* PORTION OF `SYSTEM_TIME` is forbidden
* `DELETE HISTORY .. FOR PORTION OF ...` is forbidden as well
2019-02-21 14:48:04 +01:00
Nikita Malyavin
073c93b194 MDEV-17082 Application-time periods: CREATE
* add syntax `CREATE TABLE ... PERIOD FOR <apptime>`
* add table period entity
2019-02-21 14:48:04 +01:00
Sergei Golubchik
b63604612e move aws_sdk to extra/ 2019-02-21 14:48:04 +01:00
Oleksandr Byelkin
93ac7ae70f Merge branch '10.3' into 10.4 2019-02-21 14:40:52 +01:00
Oleksandr Byelkin
a40de1bdeb Merge branch 'bb-10.3-release' into 10.3 2019-02-20 17:21:26 +01:00
Vladislav Vaintroub
5296aa8b12 MDEV-18663 Tests : use --core-file if mariabackup output is redirected to a file
This is done in order to help debugging buildbot failures.
2019-02-20 13:26:48 +01:00
Marko Mäkelä
4932aba921 MDEV-18649 Assertion supremum[7] == index.n_core_null_bytes failed
This is follow-up to MDEV-18048: Relax a too strict debug assertion

This assertion should have been relaxed when implementing the first part of
MDEV-15563: instant removal of NOT NULL attribute for ROW_FORMAT=REDUNDANT
tables.

For ROW_FORMAT=REDUNDANT, there is no bitmap of null columns;
the null flags are encoded in the end offset of each field.
We do not really care about the number of fields that can be NULL.
2019-02-20 11:40:16 +02:00
Oleksandr Byelkin
c8f9b3f915 remove aws-key management plugin 2019-02-20 08:44:08 +01:00
Marko Mäkelä
539a165b7a MDEV-12026: Fix type mismatch
Revert the type casts of 58e525e4f3.
2019-02-20 09:07:13 +02:00
Vladislav Vaintroub
58e525e4f3 Fix Windows warning/error after c0f47a4a58 2019-02-20 07:58:32 +01:00
Elena Stepanova
1005376e58 Updated list of unstable tests for 10.3.13 release 2019-02-20 04:14:23 +02:00
Oleksandr Byelkin
c65daf02f0 make compatible parser in sync with main one 2019-02-19 19:11:40 +01:00
Thirunarayanan Balathandayuthapani
c0f47a4a58 MDEV-12026: Implement innodb_checksum_algorithm=full_crc32
MariaDB data-at-rest encryption (innodb_encrypt_tables)
had repurposed the same unused data field that was repurposed
in MySQL 5.7 (and MariaDB 10.2) for the Split Sequence Number (SSN)
field of SPATIAL INDEX. Because of this, MariaDB was unable to
support encryption on SPATIAL INDEX pages.

Furthermore, InnoDB page checksums skipped some bytes, and there
are multiple variations and checksum algorithms. By default,
InnoDB accepts all variations of all algorithms that ever existed.
This unnecessarily weakens the page checksums.

We hereby introduce two more innodb_checksum_algorithm variants
(full_crc32, strict_full_crc32) that are special in a way:
When either setting is active, newly created data files will
carry a flag (fil_space_t::full_crc32()) that indicates that
all pages of the file will use a full CRC-32C checksum over the
entire page contents (excluding the bytes where the checksum
is stored, at the very end of the page). Such files will always
use that checksum, no matter what the parameter
innodb_checksum_algorithm is assigned to.

For old files, the old checksum algorithms will continue to be
used. The value strict_full_crc32 will be equivalent to strict_crc32
and the value full_crc32 will be equivalent to crc32.

ROW_FORMAT=COMPRESSED tables will only use the old format.
These tables do not support new features, such as larger
innodb_page_size or instant ADD/DROP COLUMN. They may be
deprecated in the future. We do not want an unnecessary
file format change for them.

The new full_crc32() format also cleans up the MariaDB tablespace
flags. We will reserve flags to store the page_compressed
compression algorithm, and to store the compressed payload length,
so that checksum can be computed over the compressed (and
possibly encrypted) stream and can be validated without
decrypting or decompressing the page.

In the full_crc32 format, there no longer are separate before-encryption
and after-encryption checksums for pages. The single checksum is
computed on the page contents that is written to the file.

We do not make the new algorithm the default for two reasons.
First, MariaDB 10.4.2 was a beta release, and the default values
of parameters should not change after beta. Second, we did not
yet implement the full_crc32 format for page_compressed pages.
This will be fixed in MDEV-18644.

This is joint work with Marko Mäkelä.
2019-02-19 18:50:19 +02:00
Oleksandr Byelkin
00906719fe Merge branch '10.2' into bb-10.3-merge 2019-02-19 17:26:44 +01:00
Oleksandr Byelkin
055c09ad6b Merge branch '10.3' into bb-10.3-merge 2019-02-19 17:26:32 +01:00
Oleksandr Byelkin
91d506cf2d Merge branch '10.1' into 10.2 2019-02-19 16:47:45 +01:00
Marko Mäkelä
fc124778ea Merge 10.2 into 10.3 2019-02-19 17:41:13 +02:00
Alexander Barkov
93984ff6d6 Fixing compilation problems with this DBUG_ASSERT_AS_PRINTF
For example, with this cmake command line:

cmake . -DCMAKE_C_FLAGS="-DDBUG_ASSERT_AS_PRINTF" \
        -DCMAKE_CXX_FLAGS="-DDBUG_ASSERT_AS_PRINTF"
2019-02-19 19:36:54 +04:00
Sergey Vojtovich
abd3c202f6 Fixed build failure
Apparently DBUG_ASSERT() can co-exist with DBUG_OFF when
-DCMAKE_CXX_FLAGS="-DDBUG_ASSERT_AS_PRINTF".

Removed assertion as it is useless now, since the type is unsigned.
2019-02-19 19:20:16 +04:00
Oleksandr Byelkin
431da59f1c 1. centos has symlinks /bin->usr/bin and /sbin -> usr/sbin,
but even if this script called as /bin/mysql_install_db
it is still standard install and scripts are in /usr/share/
(but not in the /share/)
2. fix of bindir path
2019-02-19 16:09:46 +01:00
Teemu Ollakka
7ae685d032 Fixed replaying bugs found with multimaster load
The replayer did not signal replaying waiters. Added
mysql_cond_broadcast() after replaying is over.

Assertion on client error failed after replay attempt failed due
to certification failure. At this point the transaction does not
go through client state, so the client error cannot be overridden.
Assign ER_LOCK_DEADLOCK to thd directly instead.

Use timed cond wait when waiting for replayers to finish and
check if the transaction has been BF aborted during the wait.
2019-02-19 17:09:19 +02:00
Jan Lindström
48554fe2db MDEV-18632: wsrep_is_wsrep_xid: Conditional jump or move depends on uninitialised value
Transaction XID is not initialized before transaction is started.
2019-02-19 16:12:00 +02:00
Igor Babaev
2a935329bc Merge branch '10.4' into bb-10.4-mdev7486 2019-02-19 05:12:56 -08:00
mkaruza
ddc983394d Fix for galera_3nodes.galera_gtid_2_cluster
Temporary disable WSREP while executing RESET MASTER. In situation when 2 nodes are both master/slave first stop slave on both and than reset master.
Enforce stricter causality check with wsrep_sync_wait.
2019-02-19 14:25:01 +02:00
mkaruza
baed6632fd Fix for galera_3nodes.galera_garbd
Check for garbd executable on different paths. If not found terminate test.
2019-02-19 14:25:01 +02:00
Sergei Golubchik
2de0b57dd1 Don't build aws_key_management plugin by default 2019-02-19 12:39:40 +01:00
Igor Babaev
2e73c56120 Merge branch '10.4' into bb-10.4-mdev7486 2019-02-19 03:18:17 -08:00
Igor Babaev
8283d7d2c0 MDEV-7486: Condition pushdown from HAVING into WHERE
Optimized the code that removed multiple equalities pushed from HAVING
into WHERE. Now this removal is postponed until all multiple equalities
are eliminated in substitute_for_best_equal_field().
2019-02-19 02:45:24 -08:00
Thirunarayanan Balathandayuthapani
88b6dc4db5 MDEV-18639 Assertion failure upon attempt to start with lower number of undo tablespaces
trx_rseg_t::is_persistent(): Correct a bogus debug assertion.
2019-02-19 12:18:50 +02:00
Vicențiu Ciorbaru
764429271d Implement avg_frequency unsmoothed jacknife estimator
When sampling data through ANALYZE TABLE, use the estimator to get a
better estimation of avg_frequency instead of just using the raw sampled data.
2019-02-19 12:01:21 +02:00