Commit graph

187858 commits

Author SHA1 Message Date
Marko Mäkelä
15b713cadc MDEV-17138 follow-up: Use MLOG_MEMSET in xdes_init() 2019-11-08 13:36:20 +02:00
Marko Mäkelä
a6d614fb4a MDEV-12353 preparation: Remove redundant writes
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.
(Side note: before that fix, other parts of the pages
could contain nonzero garbage.)

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.
2019-11-08 11:04:26 +02:00
Marko Mäkelä
5b72e8136f Cleanup: Do not pass mtr_t* as NULL
PageConverter::update_index_page(): Invoke lower-level writes directly.
2019-11-08 09:44:08 +02:00
Marko Mäkelä
5d596064d6 Cleanup: Define FIL_PAGE_TYPE constants as constexpr 2019-11-08 09:44:08 +02:00
Marko Mäkelä
52246dff2c Merge 10.4 into 10.5 2019-11-08 09:43:41 +02:00
Marko Mäkelä
78d0d2cdc5 Cleanup: Remove mach_read_ulint()
The function mach_read_ulint() is a wrapper for the lower-level
functions mach_read_from_1(), mach_read_from_2(), mach_read_from_8().
Invoke those functions directly, for better readability of the code.

mtr_t::read_ulint(), mtr_read_ulint(): Remove. Yes, we will lose the
ability to assert that the read is covered by the mini-transaction.
We would still check that on writes, and any writes that
wrongly bypass mini-transaction logging would likely be caught by
stress testing with Mariabackup.
2019-11-08 09:41:06 +02:00
Hartmut Holzgraefe
c4a844ca51 MDEV-20981 wsrep_sst_mariabackup fails silently when mariabackup is not installed (#1406)
Make sure failure to find mariabackup binary does not terminate
the script silently, terminate with a clear error message instead
2019-11-08 09:03:49 +02:00
Marko Mäkelä
8a5eb4141b MDEV-17138 follow-up: Use MLOG_MEMSET for writing FIL_NULL
Always use the MLOG_MEMSET record for writing FIL_NULL,
because it is more compact.
2019-11-08 09:00:10 +02:00
Aleksey Midenkov
db56543993 Compilation fix with partitioning off (MDEV-17553) 2019-11-07 20:25:20 +03:00
Aleksey Midenkov
1e73d7d6c6 MDEV-17553 Enable setting start datetime for interval partitioned history of system versioned tables
* Explicit STARTS syntax
* SHOW CREATE
* Default STARTS rounding depending on INTERVAL type
* Warn when STARTS timestamp is later than query time
* Fix uninitialized Lex->create_last_non_select_table under
  mysql_unpack_partition()

Default STARTS rounding depending on INTERVAL type

If STARTS clause is omitted, default one is assigned with value
derived from query timestamp. The rounding is done on STARTS value
depending on INTERVAL type:

SECOND: no rounding is done;
MINUTE: timestamp seconds is set to 0;
HOUR: timestamp seconds and minutes are set to 0;
DAY, WEEK, MONTH and YEAR: timestamp seconds, minutes and hours are
set to 0 (the date of rotation is kept as current date).
2019-11-07 19:24:06 +03:00
Varun Gupta
b1ab2ba583 MDEV-20519: Query plan regression with optimizer_use_condition_selectivity > 1
The issue here is the wrong estimate of the cardinality of a partial join,
the cardinality is too high because the function table_cond_selectivity()
returns an absurd number 100 while selectivity cannot be greater than 1.

When accessing table t by outer reference t1.a via index we do not perform any
range analysis for t. Yet we see TABLE::quick_key_parts[key] and
TABLE->quick_rows[key] contain a non-zero value though these should have been
remained untouched and equal to 0.

Thus real cause of the problem is that TABLE::init does not clean the arrays
TABLE::quick_key_parts[] and TABLE::>quick_rows[].
It should have done it because the TABLE structure created for any
instance of a table can be reused for many queries.
2019-11-07 15:24:21 +05:30
Marko Mäkelä
77e8a311e1 Merge 10.4 into 10.5
A conflict between MDEV-19514 (b42294bc64)
and MDEV-20934 (d7a2401750)
was resolved. We will not invoke the function ibuf_delete_recs()
from ibuf_merge_or_delete_for_page(). Instead, we will add that
logic to the function ibuf_read_merge_pages().
2019-11-07 10:34:33 +02:00
Oleksandr Byelkin
3ad37ed0eb Merge 10.4 into 10.5 2019-11-07 08:52:30 +01:00
Marko Mäkelä
c24ec3cece Merge 10.3 into 10.4 2019-11-07 07:39:55 +02:00
Marko Mäkelä
352e766787 MDEV-20934: Make the test more robust
Due to MDEV-12288, the slow shutdown in MariaDB 10.3 will include
resetting the DB_TRX_ID for all inserted records. This might
cause the 60-second shutdown_server timeout to be exceeded.
Let us wait for the purge to complete before initiating slow shutdown.
2019-11-06 17:56:56 +02:00
Marko Mäkelä
928abd6967 Merge 10.3 into 10.4 2019-11-06 13:44:56 +02:00
Marko Mäkelä
908ca4668d Merge 10.2 into 10.3 2019-11-06 13:14:31 +02: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
Alexander Barkov
46f2f24ec4 MDEV-20985 Add LEX methods stmt_drop_{function|procedure}() and stmt_alter_{function|procedure}_start()
Adding a few helper LEX methods,
to unify sql_yacc.yy and sql_yacc_ora.yy easier
2019-11-05 22:37:45 +04:00
Daniel Bartholomew
d9899ce671
bump the VERSION 2019-11-05 10:00:06 -05:00
Daniel Bartholomew
5d3bd2b75b
bump the VERSION 2019-11-05 09:57:56 -05: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
Alexander Barkov
79e295b601 Cleanup: moving '(' after the stmt_create_stored_function_start() call
This is a logically better position.
Also, this makes the code in sql_yacc.yy and sql_yacc_ora.yy look more similar.
2019-11-05 17:35:26 +04:00
Alexander Barkov
0858500f2f Cleanup: reusing opt_sp_parenthesized_fdparam_list and removing duplicate rules. 2019-11-05 17:06:34 +04: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ä
51fb39bf17 MDEV-19586: Restore pointer indirection for recv_t::data
Something was wrong with the removal of pointer indirection,
because on 32-bit Windows we got crash recovery failures.
Curiously, WITH_ASAN of a 32-bit debug build did not notice anything.

This reverts a part of commit b7fc2c899e.

We have a 2MiB recv_sys.buf for the initial buffering. The minimum size
of log_sys.buf would be 16MiB, and that buffer should be practically
unused during recovery. If the buffer pool size is measured in gigabytes,
it would indeed make sense to use the buffer pool for the recovered log
records, perhaps after we have run out of log_sys.buf.

FIXME: allow the entire buf_block_t::frame to be used for buffered
log records, and remove MEM_HEAP_FOR_RECV_SYS. For example, use
buf_page_t::list or buf_page_t::LRU for keeping track of memory that
was allocated for recovery? Most members of buf_block_t
(except buf_block_t::frame) are unused when
block->page.state == BUF_BLOCK_MEMORY.
2019-11-04 16:13:43 +02: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
Marko Mäkelä
f89436b592 MDEV-18115: Remove a unused variable 2019-11-04 15:11:51 +02:00
Marko Mäkelä
8f40c029db Fix -Wmaybe-uninitialized
Follow-up to commit 8965ae27b9:
always initialize found_group.
2019-11-04 15:00:44 +02:00
Marko Mäkelä
541b00a3ba MDEV-19586: Clean up recv_t a little
recv_t, recv_t::data_t: Define constructors that copy the log records

Ideally, we should remove recv_sys.buf, RECV_DATA_BLOCK_SIZE,
and recv_sys_justify_left_parsing_buf(), and let the
recv_sys.pages point directly to a buffer of parsed redo log
records.

The RECV_PARSING_BUF_SIZE (size of recv_sys.buf) is only 2MiB,
while the minimum innodb_log_buffer_size (size of log_sys.buf) is 16MiB,
and log_sys.buf is unused during redo log apply!
2019-11-04 09:30:53 +02:00
Marko Mäkelä
64a02e4fa2 MDEV-19586: Add const qualifiers
Except for fil_name_process(), which invokes os_normalize_path(),
the redo log record parser will not modify the redo log records.
Add const qualifiers accordingly.
2019-11-04 09:25:26 +02:00
Sergei Golubchik
9d1bbdc56c Fix linking errors on Windows
followup to 00c3a28820
2019-11-03 21:33:04 +01:00
Elena Stepanova
0339cbe2f6 List of unstable tests for 10.4.9 release 2019-11-03 20:41:47 +02:00
Elena Stepanova
e1a2b12577 List of unstable tests for 10.3.19 release 2019-11-03 17:59:48 +02:00
Sergei Golubchik
3ef01d1118 compilation failure, gcc 8.3.0
storage/innobase/log/log0recv.cc|1760 col 35 error| 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct recv_t' with no trivial copy-assignment [-Werror=class-memaccess]
2019-11-03 12:11:23 +01:00
Oleksandr Byelkin
903f5fea30 Revert "wolfssl 4.2.0" (it is not ready jet)
This reverts commit dacd1794e4.
2019-11-02 18:54:01 +01: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
Oleksandr Byelkin
dacd1794e4 wolfssl 4.2.0 2019-11-02 12:11:39 +01:00
Oleksandr Byelkin
6818f40adf Postmerge fix of rocksdb test results 2019-11-02 08:40:43 +01:00
Oleksandr Byelkin
f566889a79 Merge branch '10.3' into 10.4 2019-11-01 20:01:44 +01:00
Sergei Petrunia
9c6fec88b1 MDEV-17171: RocksDB Tables do not have "Creation Date"
- Add SLEEP() calls to the testcase to make it really test that the
  time doesn't change.
- Always use .frm file creation time as a creation timestamp (attempts
  to re-use older create_time when the table DDL changes are not good
  because then create_time will change after server restart)
- Use the same method names as the upstream patch does
- Use std::atomic for m_update_time
2019-11-01 21:40:10 +03:00
Marko Mäkelä
e5fed3b94d MDEV-19586: Avoid std::map::emplace()
GCC 4.7 only knows about std::map::insert(), not emplace().

Also, reformat the function in the common style.
2019-11-01 16:56:44 +02:00
Marko Mäkelä
ec40980ddd Merge 10.3 into 10.4 2019-11-01 15:23:18 +02:00