Commit graph

185083 commits

Author SHA1 Message Date
Sergey Vojtovich
f92b7b1a27 Adieu LOCK_thread_count, COND_thread_count 2019-02-26 22:44:38 +04:00
seppo
785092ee23 LOCK_thread_count and COND_thread_count removed from wsrep modules (#1197)
Refactored wsrep patch to not use LOCK_thread_count and COND_thread_count anymore.
This has partially been replaced by using old LOCK_wsrep_slave_threads mutex.
For slave thread count change waiting, new COND_wsrep_slave_threads signal has been added

Added LOCK_wsrep_cluster_config mutex to control that cluster address change cannot happen in parallel

Protected wsrep_slave_threads variable changes with LOCK_cluster_config mutex
This is for avoiding concurrent slave thread count and cluster joining operations to happen

Fixes according to Teemu's review
2019-02-26 13:39:05 -05:00
Marko Mäkelä
bb970dda77 MDEV-18719 Assertion (c.prtype ^ o->prtype) & ... failed on ALTER TABLE
The prtype & DATA_LONG_TRUE_VARCHAR flag only plays a role when
converting between InnoDB internal format and the MariaDB SQL layer
row format. Ideally this flag would never have been persisted in the
InnoDB data dictionary.

There were bogus assertion failures when an instant ADD, DROP, or
column reordering was combined with a change of extending a VARCHAR
from less than 256 bytes to more than 255 bytes. Such changes are
allowed starting with MDEV-15563 in MariaDB 10.4.3.

dict_table_t::instant_column(), dict_col_t::same_format(): Ignore
the DATA_LONG_TRUE_VARCHAR flag, because it does not affect the
persistent storage format.
2019-02-25 16:14:30 +02:00
Daniel Bartholomew
201bd21e23 bump the VERSION 2019-02-25 08:44:37 -05:00
Alexander Barkov
b25ad1bc47 MDEV-18408 Assertion `0' failed in Item::val_native_result / Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null upon mysqld_list_fields after crash recovery
The problem happened because Item_ident_for_show did not implement val_native().

Solution:

- Removing class Item_ident_for_show
- Implementing a new method Protocol::send_list_fields() instead,
  which accepts a List<Field> instead of List<Item> as input.
  Now no any Item creation is done during mysqld_list_fields().

Adding helper methods, to reuse the code easier:
- Moved a part of Protocol::send_result_set_metadata(),
  responsible for sending an individual field metadata,
  into a new method Protocol_text::store_field_metadata().
  Reusing it in both send_list_fields() and send_result_set_metadata().
- Adding Protocol_text::store_field_metadata()
- Adding Protocol_text::store_field_metadata_for_list_fields()

Note, this patch also automatically fixed another bug:

MDEV-18685 mysql_list_fields() returns DEFAULT 0 instead of DEFAULT NULL for view columns

The reason for this bug was that Item_ident_for_show::val_xxx() and get_date()
did not check field->is_null() before calling field->val_xxx()/get_date().
Now the default value is correctly sent by Protocol_text::store(Field*).
2019-02-25 12:29:42 +04:00
Teemu Ollakka
1ab2e7573a Fixed and recorded galera_sr.galera_sr_rollback_statement
Disabled GCF-437 which relies on InnoDB redo log size limitation
which does not seem to exist or is increased in MariaDB 10.4.

Require debug sync for mysql-wsrep#215.
2019-02-25 08:32:16 +02:00
Teemu Ollakka
24be84384c Simplified Wsrep_client_service::interrupted()
Wsrep-lib is now guaranteed to hold the underlying mutex
which is wrapped in lock object passed to Wsrep_client_service
interrupted() call. The library part will now take care of
checking the wsrep::transaction specific state, so it is
enough to check the thd->killed state for the result.
2019-02-25 08:31:52 +02:00
Teemu Ollakka
6edfeb82fd Fixes to streaming replication BF aborts
The InnoDB DeadlockChecker::check_and_resolve() was missing a
call to wsrep_handle_SR_rollback() in the case when the
transaction running deadlock detection was chosen as victim.

Refined wsrep_handle_SR_rollback() to skip store_globals() calls
if the transaction was BF aborting itself.

Made mysql-wsrep-features#165 more deterministic by waiting until
the update is in progress before sending next update.
2019-02-25 08:31:52 +02:00
Daniel Black
31b65d3dd2 stop covering_keys from being set to the same thing twice 2019-02-24 10:47:15 -05:00
Oleksandr Byelkin
6471c156f1 fix embedded server test 2019-02-24 15:58:17 +01:00
Igor Babaev
25870f48cf MDEV-18668 Server crash or ASAN use-after-poison in Item_equal_iterator /
st_select_lex::pushdown_from_having_into_where upon query
           with impossible WHERE condition

Do not push from HAVING into impossible WHERE
2019-02-24 02:02:07 -08:00
Igor Babaev
31deef0953 MDEV-18681 Server crashes in embedding_sjm
Do not do substitution for best equal field in HAVING conditions.
It's not needed.
2019-02-24 01:55:51 -08:00
Oleksandr Byelkin
793f27a046 Server maturity change 2019-02-23 11:42:30 +01:00
Oleksandr Byelkin
6b8388e49b Stabilize the test. 2019-02-23 08:57:06 +01:00
Oleksandr Byelkin
fb01193ce9 make windows compiler happy 2019-02-22 17:03:14 +01:00
sachin
0372f98cb5 Fix buildbot Windows and bintar compile failure 2019-02-22 12:33:08 +01:00
Sergei Golubchik
bd7f7b1416 MDEV-371 Unique Index for long columns
post-merge fixes
2019-02-22 12:33:08 +01:00
Sergei Golubchik
f6000782fb mysql_prepare_create_table() inconsistency
sql_field->key_length was 0 for blob fields when a field was
being added, but Field_blob::character_octet_length() on
subsequent ALTER TABLE's (when the Field object in the old table
already existed). This means mysql_prepare_create_table() couldn't
reliably detect if the keyseg was a prefix.
2019-02-22 12:32:49 +01:00
Sachin
d00f19e832 MDEV-371 Unique Index for long columns
This patch implements engine independent unique hash index.

Usage:- Unique HASH index can be created automatically for blob/varchar/test column whose key
 length > handler->max_key_length()
or it can be explicitly specified.

  Automatic Creation:-
   Create TABLE t1 (a blob unique);
  Explicit Creation:-
   Create TABLE t1 (a int , unique(a) using HASH);

Internal KEY_PART Representations:-
 Long unique key_info will have 2 representations.
 (lets understand this with an example create table t1(a blob, b blob , unique(a, b)); )

 1. User Given Representation:- key_info->key_part array will be similar to what user has defined.
 So in case of example it will have 2 key_parts (a, b)

 2. Storage Engine Representation:- In this case there will be only one key_part and it will point to
 HASH_FIELD. This key_part will be always after user defined key_parts.

 So:- User Given Representation          [a] [b] [hash_key_part]
                  key_info->key_part ----^
  Storage Engine Representation          [a] [b] [hash_key_part]
                  key_info->key_part ------------^

 Table->s->key_info will have User Given Representation, While table->key_info will have Storage Engine
 Representation.Representation can be changed into each other by calling re/setup_keyinfo_hash function.

Working:-

1. So when user specifies HASH_INDEX or key_length is > handler->max_key_length(), In mysql_prepare_create_table
One extra vfield is added (for each long unique key). And key_info->algorithm is set to HA_KEY_ALG_LONG_HASH.

2. In init_from_binary_frm_image values for hash_keypart is set (like fieldnr , field and flags)

3. In parse_vcol_defs, HASH_FIELD->vcol_info is created. Item_func_hash is used with list of Item_fields,
   When Explicit length is given by user then Item_left is used to concatenate Item_field values.

4. In ha_write_row/ha_update_row check_duplicate_long_entry_key is called which will create the hash key from
table->record[0] and then call ha_index_read_map , if we found duplicated hash , we will compare the result
field by field.
2019-02-22 00:35:40 +01:00
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