Commit graph

182861 commits

Author SHA1 Message Date
Marko Mäkelä
142442d571 MDEV-21024: Cleanup XDES_CLEAN_BIT
The XDES_CLEAN_BIT is always set for every element of
the page allocation bitmap in the extent descriptor pages.
Do not bother touching it, to avoid redundant writes.
2019-11-11 14:18:50 +02:00
Marko Mäkelä
878bc854d9 MDEV-21024: Clean up dict_hdr_create()
The DICT_HDR_MAX_SPACE_ID was already zero-initialized at page allocation.
2019-11-11 14:15:04 +02:00
Marko Mäkelä
33f74e8fcf MDEV-21024: Clean up IMPORT TABLESPACE
page_rec_write_field(): Remove.

dict_create_index_tree_step(): If the SYS_INDEXES.PAGE does not change,
do not update it in the data dictionary. Typically, all index page numbers
would be unchanged before and after IMPORT TABLESPACE, except if some
secondary indexes were created after loading some data.

btr_root_fseg_adjust_on_import(): Remove the redundant mtr_t* parameter.
Redo logging is disabled during the page adjustments that IMPORT TABLESPACE
is performing.
2019-11-11 14:14:26 +02:00
Marko Mäkelä
dfdd96214b MDEV-21024: Clean up btr_root_raise_and_insert()
The root page must never have any siblings, so it is unnecessary
to clear those fields.
2019-11-11 14:14:26 +02:00
Marko Mäkelä
fc2ca2be4e MDEV-21024: Clean up page allocation
fsp_alloc_seg_inode_page(): Ever since
commit 3926673ce7
all newly allocated pages are zero-initialized.
Assert that this is the case for the FSEG_ID fields.
2019-11-11 14:14:26 +02:00
Marko Mäkelä
98e1d603bf MDEV-21024: Optimize writing BTR_EXTERN_LEN
btr_store_big_rec_extern_fields(): Remove the redundant initialization
of the most significant 32 bits of BTR_EXTERN_LEN. InnoDB never supported
BLOBs that are longer than 4GiB. In fact, dtuple_convert_big_rec()
would write emit an error message if a clustered index record tuple would
exceed 1,000,000,000 bytes in length.

The BTR_EXTERN_LEN in the BLOB pointers in clustered index leaf page
records is zero-initialized at least since
commit 41bb3537ba
2019-11-11 14:14:26 +02:00
Marko Mäkelä
3621df70ca MDEV-21024: Clean up rtr_adjust_upper_level()
Remove the unnecessary retrieval and null-modifications of
the preceding page.
2019-11-11 14:14:20 +02:00
Marko Mäkelä
29d67d051a Cleanup btr_page_get_prev(), btr_page_get_next()
Remove the redundant parameter mtr_t*.

Make use of page_has_prev(), page_has_next() whenever possible.
2019-11-11 13:36:21 +02:00
Marko Mäkelä
1d2458f813 MDEV-21024: Clean up rtr_adjust_upper_level()
Remove the unnecessary retrieval and null-modifications of
the preceding page.
2019-11-11 13:26:19 +02:00
Daniel Bartholomew
cbf5f6d6b5
bump the VERSION 2019-11-08 09:51:11 -05:00
Marko Mäkelä
90451a5981 Follow-up to 792c9f9a49
dict_index_add_to_cache(): Make the 'index' a reference to a pointer,
so that the caller will avoid the expensive call to
dict_index_get_if_in_cache_low().
2019-11-06 13:01:34 +02:00
Marko Mäkelä
8688ef22c2 Merge 10.1 to 10.2 2019-11-06 10:18:51 +02:00
Marko Mäkelä
d7a2401750 MDEV-20934 Infinite loop on innodb_fast_shutdown=0 with inconsistent change buffer
Due to a data corruption bug that may have occurred a long time earlier
(possibly involving physical backup and MySQL Bug #69122, which was
addressed in commit f166ec71b7)
it seems possible that the InnoDB change buffer might end up containing
entries, while no buffered changes exist according to the change buffer
bitmap pages in the .ibd files.

ibuf_delete_recs(): New function, to be invoked on slow shutdown only.
Remove all buffered changes for a specific page.

ibuf_merge_or_delete_for_page(): If the change buffer bitmap is clean
and a slow shutdown is in progress, invoke ibuf_delete_recs().
We do not want to do that during normal operation, due to the additional
overhead that is involved. The bitmap page should be consistent with
the change buffer in the first place.
2019-11-06 08:48:48 +02:00
Marko Mäkelä
4e99e67c4e Merge 5.5 into 10.1 2019-11-06 08:17:03 +02:00
Thirunarayanan Balathandayuthapani
5c3bbbd845 MDEV-20987 InnoDB fails to start when fts table has FK relation
InnoDB: Assertion failure in file .../dict/dict0dict.cc line ...
InnoDB: Failing assertion: table->can_be_evicted

This fixes a regression that was caused by the fix of MDEV-20621
(commit a41d429765).
MySQL 5.6 (and MariaDB 10.0) introduced eviction of tables from
the InnoDB data dictionary cache. Tables that are connected to
FOREIGN KEY constraints or FULLTEXT INDEX are exempt of the eviction.
With the problematic change, a table that would already be exempt
from eviction due to FOREIGN KEY would cause the problem if there
also was a FULLTEXT INDEX defined on it.

dict_load_table(): Only prevent eviction if table->can_be_evicted holds.
2019-11-06 08:12:00 +02:00
Daniel Bartholomew
7bc26de591
bump the VERSION 2019-11-05 09:56:31 -05:00
Daniel Bartholomew
6e48f3a062
bump the VERSION 2019-11-05 09:55:18 -05:00
Daniel Bartholomew
e23cb3835e
bump the VERSION 2019-11-05 09:53:45 -05:00
Vladislav Vaintroub
dc771113a6 Fix ninja build
Do not rely on existence of CMakeFiles/${target}.dir directory existence
It is not there for custom targets in Ninja build.
2019-11-05 00:20:13 +01:00
Sergei Golubchik
cd156e2c3e MDEV-20971 ASAN heap-use-after-free in list_delete / heap_close
Don't save/restore HP_INFO as it could be changed by a concurrent thread.
different parts of HP_INFO are protected by different mutexes and
the mutex that protect most of the HP_INFO does not protect its open_list
data.

As a bonus, make heap_check_heap() to take const HP_INFO* and not
make any changes there whatsoever.
2019-11-04 23:14:27 +01:00
Marko Mäkelä
5164f8c206 Fix GCC 9.2.1 -Wstringop-truncation
dict_table_rename_in_cache(): Use strcpy() instead of strncpy(),
because they are known to be equivalent in this case (the length
of old_name was already validated).

mariabackup: Invoke strncpy() with one less than the buffer size,
and explicitly add NUL as the last byte of the buffer.
2019-11-04 15:52:54 +02:00
pkubaj
eb56339b66 Fix build on !glibc/powerpc*
Do the same that newer branches do and don't include glibc-related headers on non-glibc environment.
2019-11-02 18:25:12 +04:00
Varun Gupta
8afe4bba2e MDEV-20424: New default value for optimizer_use_condition-selectivity leads to bad plan
In the function prev_record_reads where one finds the different row combinations for a
subset of partial join, it did not take into account the selectivity of tables
involved in the subset of partial join.
2019-11-01 17:22:05 +05:30
Eugene Kosov
0b1bc4bf76 cleanup: replace some mtr_read_ulint() with mach_read_from_4() 2019-11-01 14:31:26 +03:00
Eugene Kosov
792c9f9a49 cleanup: get rid of dict_index_add_to_cache_w_vcol()
dict_index_add_to_cache_w_vcol(): merge with dict_index_add_to_cache()
2019-11-01 14:21:29 +03:00
Robert Bindar
6f86150ab3 MDEV-17896 Assertion `pfs->get_refcount() > 0' failed
Unfortunate DROP TEMPORARY..IF EXISTS on a regular table may allow
subsequent CREATE TABLE statements to steal away the PFS_table_share
instance from the dropped table.
2019-11-01 11:10:04 +02:00
Elena Stepanova
1552b254a0 List of unstable tests for 10.2.28 release 2019-10-31 20:42:08 +02:00
Elena Stepanova
d925aec1c1 List of unstable tests for 10.1.42 release 2019-10-31 18:07:19 +02:00
Oleksandr Byelkin
259edb1f60 Merge branch '10.1' into 10.2 2019-10-31 09:07:26 +01:00
Marko Mäkelä
1bb857089f MDEV-20927: Remove duplicated code
In commit d1e6b0bcff
some code was supposed to be modified, but instead
it got duplicated. Remove the duplicated copy.
2019-10-31 07:44:18 +02:00
Oleksandr Byelkin
2ba9a269df new CC 3.1 due to typo in it 2019-10-31 06:13:38 +01:00
Sergei Golubchik
fd6dfb3b54 Merge branch 'github/10.1' into 10.2 2019-10-30 23:38:05 +01:00
Sergei Golubchik
313855766f cleanup
* use compile_time_assert instead of DBUG_ASSERT

* don't use thd->clear_error(), because
  * the error was already consumed by the error handler, so there is
     nothing to clear
  * it's dangerous to clear errors indiscriminately, if the error came
    from outside of read_statistics_for_tables() it must not be cleared
2019-10-30 23:14:44 +01:00
Sergei Golubchik
5392b4a32c MDEV-20354 All but last insert ignored in InnoDB tables when table locked
mysql_insert() first opens all affected tables (which implicitly
starts a transaction in InnoDB), then stat tables.
A failure to open a stat table caused open_tables() to abort
the current stmt transaction (trans_rollback_stmt()). So, from the
server point of view the following ha_write_row()-s happened outside
of a transactions, and the server didn't bother to commit them.

The server has a mechanism to prevent a transaction being
unexpectedly committed or rolled back in the middle of a statement -
if an operation takes place _in a sub-statement_ it cannot change
the transaction state. Operations on stat tables are exactly that -
they are not allowed to change a transaction state. Put them in
a sub-statement to make sure they don't.
2019-10-30 23:14:44 +01:00
Oleksandr Byelkin
6680b04961 Merge remote-tracking branch 'connect/10.2' into 10.2 2019-10-30 21:56:35 +01:00
Oleksandr Byelkin
baaf02a48b new CC 3.1 2019-10-30 21:37:46 +01:00
Oleksandr Byelkin
36f67a7dff Merge branch '10.1' into 10.2 2019-10-30 21:33:01 +01:00
Oleksandr Byelkin
c8ba98206f Merge branch '10.1' into bb-10.1-release 2019-10-30 20:01:51 +01:00
Sergei Golubchik
8fce180765 MDEV-19432 Systemd service does not get re-enabled after upgrade
following Fedora recommendations (see %systemd_post macro in FC29)
let's do `systemctl preset` on the first installation of the server
2019-10-30 16:46:08 +01:00
Oleksandr Byelkin
d671f506b0 Merge branch '5.5' into 10.1 2019-10-30 14:47:35 +01:00
Sergei Golubchik
9277b6ec1c Revert "MDEV-14448: Ctrl-C should not exit the client"
This reverts commit 396313d301.
2019-10-30 14:44:56 +01:00
Oleksandr Byelkin
708d46158b Merge remote-tracking branch 'connect/10.1' into 10.1 2019-10-30 13:55:35 +01:00
Oleksandr Byelkin
b58c38a3a9 Merge branch 'merge-tokudb-5.6' into 10.1 2019-10-30 13:49:25 +01:00
Marko Mäkelä
d03a59c6ff XtraDB 5.6.45-86.1 2019-10-30 13:21:36 +02:00
Marko Mäkelä
d1e6b0bcff MDEV-20927 Duplicate key with auto increment
Apply the changes to InnoDB and XtraDB that had been
inadvertently skipped in the merge
commit ae476868a5

That merge failure sabotaged part of MDEV-20127:
>Revert a problematic auto_increment_increment 'fix' from 2014.
>This involves replacing the MDEV-8827 fix and in 10.1,
>removing some WSREP instrumentation.

The code changes were re-merged manually by executing the following:

 # Get the parent of the problematic merge.
git checkout ae476868a5394041a00e75a29c7d45917e8dfae8^
 # Perform the merge again.
git merge ae476868a5394041a00e75a29c7d45917e8dfae8^2
 # Get the conflict resolution from that merge.
git checkout ae476868a5 .
 # Note: Any changes to these files were removed (empty diff)!
git diff HEAD storage/{innobase,xtradb}/handler/ha_innodb.cc
 # Apply the code changes:
git diff cf40393471b10ca68cc1d2804c22ab9203900978^2..MERGE_HEAD \
storage/{innobase,xtradb}/handler/ha_innodb.cc|
patch -p1
2019-10-30 13:21:36 +02:00
Eugene Kosov
b8eff8bce4 avoid accessing TLS 2019-10-30 13:23:15 +03:00
Oleksandr Byelkin
a3553a1387 5.6.45-86.1 2019-10-30 11:15:05 +01:00
Eugene Kosov
a7e3008ab3 MDEV-20926 UBSAN: load of value 165, which is not a valid value for type bool
Basicaly it's an uninitialized read. 165 is 0xa5 which comes from TRASH_ALLOC()

Fix by calling a class ctor which initializes problematic
TMP_TABLE_PARAM::force_copy_fields field
2019-10-30 12:53:25 +03:00
Sergey Vojtovich
afb4878703 MDEV-18783 - Server crash in hp_rb_make_key
In debug build, whenever MEMORY table instance gets closed it performs
consistency check without protection. It may cause server crash if
executed concurrently with DML.

Moved consistency check to ha_heap::external_lock(F_UNLCK), so that it
is protected by THR_LOCK.
2019-10-30 12:52:19 +04:00
Jan Lindström
cd1c10859d Fix test cases that use debug galera library.
Changes to be committed:
	modified:   mysql-test/suite/galera/r/MW-369.result
	modified:   mysql-test/suite/galera/r/MW-402.result
	modified:   mysql-test/suite/galera/r/galera#500.result
	modified:   mysql-test/suite/galera/r/galera_gcs_fragment.result
	modified:   mysql-test/suite/galera/r/mysql-wsrep#332.result
2019-10-30 10:14:56 +02:00