Commit graph

20687 commits

Author SHA1 Message Date
Jacob Mathew
d6594847cf MDEV-16246: insert timestamp into spider table from mysqldump gets wrong time zone.
The problem occurred because the Spider node was incorrectly handling
timestamp values sent to and received from the data nodes.

The problem has been corrected as follows:
- Added logic to set and maintain the UTC time zone on the data nodes.
  To prevent timestamp ambiguity, it is necessary for the data nodes to use
  a time zone such as UTC which does not have daylight savings time.
- Removed the spider_sync_time_zone configuration variable, which did not
  solve the problem and which interfered with the solution.
- Added logic to convert to the UTC time zone all timestamp values sent to
  and received from the data nodes.  This is done for both unique and
  non-unique timestamp columns.  It is done for WHERE clauses, applying to
  SELECT, UPDATE and DELETE statements, and for UPDATE columns.
- Disabled Spider's use of direct update when any of the columns to update is
  a timestamp column.  This is necessary to prevent false duplicate key value
  errors.
- Added a new test spider.timestamp to thoroughly test Spider's handling of
  timestamp values.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Merged:
  Commit 97cc9d3 on branch bb-10.3-MDEV-16246
2018-07-24 15:57:13 -07:00
Oleksandr Byelkin
de745ecf29 MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operations 2018-07-04 19:13:55 +02:00
Alexander Barkov
e61568ee93 Merge remote-tracking branch 'origin/10.3' into 10.4 2018-07-03 14:02:05 +04:00
Marko Mäkelä
c3289d27ee Merge mariadb-10.3.8 into 10.3 2018-07-03 10:22:43 +03:00
Marko Mäkelä
502f1a3c11 MDEV-16623 ASAN: use-after-free in create_index()
Before attempting to create an index, copy any fields from
dict_table_t, because the table would be freed after a failed
index creation.
2018-07-02 12:27:28 +03:00
Sergei Golubchik
36e59752e7 Merge branch '10.2' into 10.3 2018-06-30 16:39:20 +02:00
Vladislav Vaintroub
04677f44c7 Innodb : do not use errno on Windows to print os_file_pwrite() error.
Use GetLastError() instead.
2018-06-28 17:23:05 +01:00
Marko Mäkelä
377cd52064 Pretty-print table names in some error messages 2018-06-27 23:22:08 +03:00
Marko Mäkelä
31c950cca8 Merge 10.1 into 10.2 2018-06-26 18:16:49 +03:00
Marko Mäkelä
c6392d52ee Merge 10.0 into 10.1 2018-06-26 17:34:44 +03:00
Marko Mäkelä
1b4ac075bf Merge 10.1 into 10.2 2018-06-26 15:39:23 +03:00
Thirunarayanan Balathandayuthapani
fe76e68e0e MDEV-16365 Setting a column NOT NULL fails to return error for
NULL values when there is no DEFAULT

- Fixed the test failure, assigned number of rows read to new table.
2018-06-26 14:10:58 +05:30
Marko Mäkelä
c4eb4bcef6 MDEV-16515 InnoDB: Failing assertion: ++retries < 10000 in file
dict0dict.cc

buf_LRU_drop_page_hash_for_tablespace(): Return whether any adaptive
hash index entries existed. If yes, the caller should keep retrying to
drop the adaptive hash index.

row_import_for_mysql(), row_truncate_table_for_mysql(),
row_drop_table_for_mysql(): Ensure that the adaptive hash index was
entirely dropped for the table.
2018-06-26 11:34:51 +03:00
Eugene Kosov
ff8b3c8df8 MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir
ha_innobase::prepare_inplace_alter_table: preserve DATA DICTIONARY for table
2018-06-26 11:11:15 +03:00
Thirunarayanan Balathandayuthapani
1ba5b38bfa MDEV-16365 Setting a column NOT NULL fails to return error for
NULL values when there is no DEFAULT

- Fixed typecasting failure for log->n_rows in row0log.cc
2018-06-25 20:49:22 +05:30
Thirunarayanan Balathandayuthapani
69b9ed063b MDEV-16365 Setting a column NOT NULL fails to return error for
NULL values when there is no DEFAULT

- Post push fix for adding n_rows in row_log_t.
2018-06-25 18:16:29 +05:30
Thirunarayanan Balathandayuthapani
88aaf590ac MDEV-16365 Setting a column NOT NULL fails to return error for
NULL values when there is no DEFAULT

Copy and inplace algorithm works similarly for
NULL to NOT NULL conversion for the following cases:
(1) strict sql mode - Should give error.
(2) non-strict sql mode - Should give warnings alone
(3) alter ignore table command. - Should give warnings alone.
2018-06-25 14:52:38 +05:30
Sergei Golubchik
a40c06e03a Merge branch 'connect/10.2' into 10.2 2018-06-24 15:27:38 +02:00
Sergei Golubchik
f577311027 fix mroonga post-install script
it only worked if mroonga plugin wasn't installed before (normal case),
but then it didn't need to delete anything.

if, by some glitch, mroonga was already installed, it would delete
mroonga from mysql.plugin, but INSTALL would fail (as mroonga was running),
and the script aborted, leaving mroonga not in mysql.plugin at all.
2018-06-24 15:18:36 +02:00
Sergei Golubchik
ef64856b97 don't crash on innodb_undo_tablespaces=1 2018-06-21 23:49:37 +02:00
Sergei Golubchik
b942aa34c1 Merge branch '10.1' into 10.2 2018-06-21 23:47:39 +02:00
Sergei Golubchik
5f0510225a MDEV-16238 root/localhost authn prioritizes authentication_string over Password
Don't let SET PASSWORD to set the password, if auth_string is set.

Now SET PASSWORD always sets the plugin/auth_string fields and clears
the password field (on pre-plugin mysql.user table it works as before).
2018-06-21 10:15:27 +02:00
Sergei Golubchik
1033fa4bcc MDEV-13403 Mariadb (with TokuDB) excessive memory usage/leak
In RPM/DEB packages - always ld-preload jemalloc, instead
of linking ha_tokudb.so with it.

Keep linking in bintars, because they don't install cnf files
in the correct locations.
2018-06-21 10:15:27 +02:00
Eugene Kosov
9dc81f7d38 MDEV-16330 Allow instant change of WITH SYSTEM VERSIONING column attribute
Changing columns WITH/WITHOUT SYSTEM VERSIONING doens't require to read data at
all. Thus it should be an instant operation.

Patch also fixes a bug when ALTER_COLUMN_UNVERSIONED wasn't passed to InnoDB
to change its internal structures.

change_field_versioning_try(): apply WITH/WITHOUT SYSTEM VERSIONING
change in SYS_COLUMNS for one field.

change_fields_versioning_try(): apply WITH/WITHOUT SYSTEM VERSIONING
change in SYS_COLUMNS for every changed field in a table.

change_fields_versioning_cache(): update cache for versioning property
of columns.
2018-06-20 19:23:48 +03:00
Alexander Barkov
4b821e02f6 Merge remote-tracking branch 'origin/10.0' into 10.1 2018-06-20 16:57:21 +04:00
Alexander Barkov
6c08ff3eb7 Merge remote-tracking branch 'origin/5.5' into 10.0 2018-06-20 16:55:24 +04:00
Alexander Barkov
170b43c156 MDEV-16534 PPC64: Unexpected error with a negative value into auto-increment columns in HEAP, MyISAM, ARIA 2018-06-20 16:36:46 +04:00
Vicențiu Ciorbaru
d79bf0009a MDEV-16525: MyRocks linking fails with: Undefined reference to `ZDICT_trainFromBuffer'
RocksDB will only build with libzstd support if libzstd version is
>=1.1.13. Unfortunately CMake's FindPackage claims it found version
1.1.13 when we have 1.1.12-1 installed, so a workaround with
CheckFunctionExists is used to properly check for correct libzstd
support.
2018-06-20 01:23:07 +03:00
Monty
ab19466656 MDEV-15114 ASAN heap-use-after-free in mem_heap_dup or dfield_data_is_binary_equal
The bug was that innobase_get_computed_value() trashed record[0] and data
in Field_blob::value

Fixed by using a record on the heap for innobase_get_computed_value()

Reviewer: Marko Mäkelä
2018-06-19 16:23:34 +03:00
Alexander Barkov
f5b128dfad Merge remote-tracking branch 'origin/10.0' into 10.1 2018-06-19 14:04:53 +04:00
Alexander Barkov
c450f7d8d5 Merge remote-tracking branch 'origin/5.5' into 10.0 2018-06-19 14:03:41 +04:00
Jacob Mathew
b27ec70935 MDEV-16319: Test for crash introduced by b4a2baffa8 fixed by 4968049799
Add a Spider test to ensure that a bug similar to MDEV-11084 is not
re-introduced.  Spider would crash if the first partition was not used first.

Author:
  Eric Herman.

First Reviewer:
  Jacob Mathew.

Second Reviewer:
  Kentoku Shiba.
2018-06-18 15:29:50 -07:00
Olivier Bertrand
c69efab396 - Fix MDEV-16167 Cannot insert unsigned values into a VEC table
modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/tabvct.cpp

_ Typo
    modified:   storage/connect/CMakeLists.txt
2018-06-18 17:54:30 +02:00
Marko Mäkelä
0121d5a790 Merge 10.2 into 10.3 2018-06-18 15:43:59 +03:00
Thirunarayanan Balathandayuthapani
eb77f8cf8d MDEV-16087 Inconsistent SELECT results when query cache is enabled
The following conditions will decide the query cache retrieval or
storing inside innodb:

    (1) There should not be any locks on the table.
    (2) Some other trx shouldn't invalidated the cache before the
    transaction started.
    (3) Read view shouldn't exist. If exists then the view
    low_limit_id should be greater than or equal to the transaction that
    invalidates the cache for the particular table.

 For read-only transaction: should satisfy  the above (1) and (3)
 For read-write transaction: should satisfy the above (1), (2), (3).

 - Changed the variable from query_cache_inv_id to query_cache_inv_trx_id.

 - Moved the function row_search_check_if_query_cache_permitted from
    row0sel.h and made it as static function in ha_innodb.cc
2018-06-18 14:26:37 +05:30
Marko Mäkelä
b8514c94f6 MDEV-16496 Mariabackup: Implement --verbose option to instrument InnoDB log apply
srv_print_verbose_log: Introduce the value 2 to refer to
mariabackup --verbose.

recv_recover_page(), recv_parse_log_recs(): Add output for
mariabackup --verbose.
2018-06-15 16:14:12 +03:00
Jan Lindström
c69357d8d4 MDEV-15611 Due to the failure of foreign key detection, Galera slave node killed himself.
Merge following change from 10.2

revision-id: d52cff9f10aeea208a1058f7b5527e602125584c (mariadb-10.2.14-25-gd52cff9)
parent(s): bc2501453c
author: Sachin Setiya
committer: Sachin Setiya
timestamp: 2018-04-04 12:26:06 +0530
message:

MDEV-15611 Due to the failure of foreign key detection, Galera...
slave node killed himself.

Problem:- If we try to delete table with foreign key and table whom it is
referring with wsrep_slave_threads>1 then galera tries to execute both
Delete_rows_log-event in parallel, which should not happen.

Solution:- This is happening because we do not have foreign key info in
write set. Upto version 10.2.7 it used to work fine. Actually it happening
because of issue in commit 2f342c4. wsrep_must_process_fk should be used
with negation.
2018-06-15 09:04:26 +03:00
Marko Mäkelä
2ca904f0ca MDEV-13103 Deal with page_compressed page corruption
fil_page_decompress(): Replaces fil_decompress_page().
Allow the caller detect errors. Remove
duplicated code. Use the "safe" instead of "fast" variants of
decompression routines.

fil_page_compress(): Replaces fil_compress_page().
The length of the input buffer always was srv_page_size (innodb_page_size).
Remove printouts, and remove the fil_space_t* parameter.

buf_tmp_buffer_t::reserved: Make private; the accessors acquire()
and release() will use atomic memory access.

buf_pool_reserve_tmp_slot(): Make static. Remove the second parameter.
Do not acquire any mutex. Remove the allocation of the buffers.

buf_tmp_reserve_crypt_buf(), buf_tmp_reserve_compression_buf():
Refactored away from buf_pool_reserve_tmp_slot().

buf_page_decrypt_after_read(): Make static, and simplify the logic.
Use the encryption buffer also for decompressing.

buf_page_io_complete(), buf_dblwr_process(): Check more failures.

fil_space_encrypt(): Simplify the debug checks.

fil_space_t::printed_compression_failure: Remove.

fil_get_compression_alg_name(): Remove.

fil_iterate(): Allocate a buffer for compression and decompression
only once, instead of allocating and freeing it for every page
that uses compression, during IMPORT TABLESPACE. Also, validate the
page checksum before decryption, and reduce the scope of some variables.

fil_page_is_index_page(), fil_page_is_lzo_compressed(): Remove (unused).

AbstractCallback::operator()(): Remove the parameter 'offset'.
The check for it in FetchIndexRootPages::operator() was basically
redundant and dead code since the previous refactoring.
2018-06-14 14:23:01 +03:00
Marko Mäkelä
f5eb37129f MDEV-13103 Deal with page_compressed page corruption
fil_page_decompress(): Replaces fil_decompress_page().
Allow the caller detect errors. Remove
duplicated code. Use the "safe" instead of "fast" variants of
decompression routines.

fil_page_compress(): Replaces fil_compress_page().
The length of the input buffer always was srv_page_size (innodb_page_size).
Remove printouts, and remove the fil_space_t* parameter.

buf_tmp_buffer_t::reserved: Make private; the accessors acquire()
and release() will use atomic memory access.

buf_pool_reserve_tmp_slot(): Make static. Remove the second parameter.
Do not acquire any mutex. Remove the allocation of the buffers.

buf_tmp_reserve_crypt_buf(), buf_tmp_reserve_compression_buf():
Refactored away from buf_pool_reserve_tmp_slot().

buf_page_decrypt_after_read(): Make static, and simplify the logic.
Use the encryption buffer also for decompressing.

buf_page_io_complete(), buf_dblwr_process(): Check more failures.

fil_space_encrypt(): Simplify the debug checks.

fil_space_t::printed_compression_failure: Remove.

fil_get_compression_alg_name(): Remove.

fil_iterate(): Allocate a buffer for compression and decompression
only once, instead of allocating and freeing it for every page
that uses compression, during IMPORT TABLESPACE.

fil_node_get_space_id(), fil_page_is_index_page(),
fil_page_is_lzo_compressed(): Remove (unused code).
2018-06-14 13:46:07 +03:00
Marko Mäkelä
72005b7a1c MDEV-13103: Improve 'cannot be decrypted' error message
buf_page_check_corrupt(): Display the file name.
2018-06-13 16:02:40 +03:00
Marko Mäkelä
3fcc11fbb4 Remove traces of the non-working MDEV-6354
MariaDB never supported the MySQL 5.7 compression format.

FIL_PAGE_TYPE_COMPRESSED: Remove. This was originally added
as FIL_PAGE_COMPRESSED.
2018-06-13 16:02:40 +03:00
Marko Mäkelä
92bd177fe9 Correct a typo in a comment 2018-06-13 16:02:40 +03:00
Sergei Petrunia
8662015c90 MDEV-15304: Server crash in print_keydup_error / key_unpack or unexpected ER_DUP_KEY
Adjust the patch to match the variant accepted into the upstream:
undo the changes in ha_rocksdb::load_hidden_pk_value().
2018-06-13 15:26:50 +03:00
Sergei Petrunia
931daaf79b MDEV-15319: [SQL Layer] Server crashes in Field::set_null / myrocks::ha_rocksdb ...
Added a testcase
2018-06-13 14:50:25 +03:00
Vicențiu Ciorbaru
6e55236c0a Merge branch '10.0-galera' into 10.1 2018-06-12 19:39:37 +03:00
Vicențiu Ciorbaru
aa59ecec89 Merge branch '10.0' into 10.1 2018-06-12 18:55:27 +03:00
Vicențiu Ciorbaru
170bec36c0 Merge branch '5.5' into 10.0 2018-06-12 17:59:31 +03:00
Marko Mäkelä
b52bb6eb82 MDEV-16469 SET GLOBAL innodb_change_buffering has no effect
When type of the settable global variable innodb_change_buffering was
changed from string to ENUM in MDEV-12218, the "shadow" variable ibuf_use
stopped being updated as a result of SET GLOBAL innodb_change_buffering.
Only on InnoDB startup, the parameter innodb_change_buffering would
take effect.

ibuf_use: Remove, and use the global variable innodb_change_buffering.
2018-06-12 12:49:42 +03:00
Marko Mäkelä
8f5f0575ab MDEV-16456 InnoDB error "returned OS error 71" complains about wrong path
When attempting to rename a table to a non-existing database,
InnoDB would misleadingly report "OS error 71" when in fact the
error code is InnoDB's own (OS_FILE_NOT_FOUND), and not report
both pathnames. Errors on rename could occur due to reasons
connected to either pathname.

os_file_handle_rename_error(): New function, to report errors in
renaming files.
2018-06-12 10:25:23 +03:00
Marko Mäkelä
0ad9c3a016 MDEV-16456 InnoDB error "returned OS error 71" complains about wrong path
When attempting to rename a table to a non-existing database,
InnoDB would misleadingly report "OS error 71" when in fact the
error code is InnoDB's own (OS_FILE_NOT_FOUND), and not report
both pathnames. Errors on rename could occur due to reasons
connected to either pathname.

os_file_handle_rename_error(): New function, to report errors in
renaming files.
2018-06-12 09:54:31 +03:00