Commit graph

181595 commits

Author SHA1 Message Date
Sergei Golubchik
2a0f1d6132 Bug#28867993: POSSIBLE ISSUE WITH MYSQL SERVER RESTART
on startup innodb is checking whether files "ib_logfileN"
(for N from 1 to 100) exist, and whether they're readable.
A non-existent file aborted the scan.
A directory instead of a file made InnoDB to fail.

Now it treats "directory exists" as "file doesn't exist".
2019-01-23 12:39:03 +01:00
Marko Mäkelä
31d592ba7d MDEV-18349 InnoDB file size changes are not safe when file system crashes
When InnoDB is invoking posix_fallocate() to extend data files, it
was missing a call to fsync() to update the file system metadata.
If file system recovery is needed, the file size could be incorrect.

When the setting innodb_flush_method=O_DIRECT_NO_FSYNC
that was introduced in MariaDB 10.0.11 (and MySQL 5.6) is enabled,
InnoDB would wrongly skip fsync() after extending files.

Furthermore, the merge commit d8b45b0c00
inadvertently removed XtraDB error checking for posix_fallocate()
which this fix is restoring.

fil_flush(): Add the parameter bool metadata=false to request that
fil_buffering_disabled() be ignored.

fil_extend_space_to_desired_size(): Invoke fil_flush() with the
extra parameter. After successful posix_fallocate(), invoke
os_file_flush(). Note: The bookkeeping for fil_flush() would not be
updated the posix_fallocate() code path, so the "redundant"
fil_flush() should be a no-op.
2019-01-23 12:18:00 +02:00
Marko Mäkelä
942a6bd009 MDEV-18349 InnoDB file size changes are not safe when file system crashes
fil_extend_space_to_desired_size(): Invoke fsync() after posix_fallocate()
in order to durably extend the file in a crash-safe file system.
2019-01-23 09:51:06 +02:00
Sergey Vojtovich
9f4d4f404f MDEV-12747 - main.mysqld_option_err fails in buildbot with timeout
thd_destructor_proxy() may miss abort signal if innobase_end() is running
concurrently, which causes server hang in pthread_join() on shutdown.

The problem was that aborting wasn't protected by mutex:
proxy thr: while (!myvar->abort)
end thr: running->abort = 1;
end thr: mysql_cond_broadcast(...);
proxy thr: mysql_cond_wait(...); // nobody to awake it
end thr: pthread_join(...); // waits for proxy thr

Also made main.mysqld_option_err reentrant.
2019-01-22 18:26:37 +04:00
Sergei Golubchik
9c5be7d131 MDEV-14580: mysql_install_db elements based on dirname of mysql_install_db
Avoid introducing new dependencies or new syntax.
That is, don't use $(...) and don't assume dirname is present.

And remove unsighty /foo/bar/../xyz from the path. Use dirname
instead of ../
2019-01-21 17:30:07 +01:00
Daniel Black
50e593386f MDEV-14580: mysql_install_db elements based on dirname of mysql_install_db
Closes #1086
2019-01-21 17:30:07 +01:00
Sergei Golubchik
0d3c49ef5d MDEV-17615 cmake ssl error on musl/libressl
don't shortcut trying to test for openssl version,
test what is actually needed for a code to compile
2019-01-21 17:30:07 +01:00
Sergei Golubchik
6786fb004c MDEV-15925 FRM_MAX_SIZE too low for some use cases
increase to 1M
2019-01-21 17:14:31 +01:00
Jan Lindström
f9cc956065
Merge pull request #1114 from GeoffMontee/10.1-geoff-MDEV-17973
MDEV-17973: Don't overwrite xtrabackup-v2/mariabackup SST logs by def…
2019-01-21 15:06:48 +02:00
Geoff Montee
2084cd5422 MDEV-17973: Don't overwrite xtrabackup-v2/mariabackup SST logs by default 2019-01-21 05:42:00 -05:00
Vladislav Vaintroub
e292d1a800 Avoid noisy Clang 7 warning about unused variable.
Patch by Eugene Kosov.
2019-01-19 14:01:09 +01:00
Varun Gupta
2061e00c20 MDEV-14440: Assertion `inited==RND' failed in handler::ha_rnd_end
In the function QUICK_RANGE_SELECT::init_ror_merged_scan we create a seperate handler if the handler in
head->file cannot be reused. The flag free_file tells us if we have a seperate handler or not.
There are cases where you might create a handler and then there might be a failure(running ALTER)
and then we have to revert the handler back to the original one. The code does that
but it does not reset the flag 'free_file' in this case.
Also backported f2c418079d.
2019-01-18 23:36:47 +05:30
Marko Mäkelä
37ffdb44ef Merge 10.1 into 10.2 2019-01-18 06:51:52 +02:00
Marko Mäkelä
1d72db45a8 MDEV-18237 InnoDB: Unable to drop FTS index aux table and further errors (possibly bogus)
row_drop_table_for_mysql(): Fix a regression introduced in MDEV-16515.
Similar to the follow-up fixes MDEV-16647 and MDEV-17470, we must make
the internal tables of FULLTEXT INDEX immune to kills, to avoid noise
and resource leakage on DROP TABLE or ALTER TABLE. (Orphan internal tables
would be dropped at the next InnoDB startup only.)
2019-01-18 06:46:39 +02:00
Vladislav Vaintroub
69221746db MDEV-18289 - Fix a race between thd_destructor_proxy() startup and
server shutdown.

Prior to adding current thd to the global thd list, initialize
thd->mysys_var->current_cond / thd->mysys_var->current_mutex.

Otherwise thd_destructor_proxy can miss the abort condition, which is set
by the shutdown thread.
2019-01-17 23:18:50 +01:00
Marko Mäkelä
8e80fd6bfd Merge 10.1 into 10.2 2019-01-17 11:24:38 +02:00
Marko Mäkelä
c1aae37087 Re-record results for the changed max_value of table_definition_cache 2019-01-17 10:11:02 +02:00
Thirunarayanan Balathandayuthapani
ad376a05fa MDEV-18279 MLOG_FILE_WRITE_CRYPT_DATA fails to set the crypt_data->type for tablespace.
Problem:
========
MLOG_FILE_WRITE_CRYPT_DATA redo log fails to apply type for
the crypt_data present in the space. While processing the double-write
buffer pages, page fails to decrypt. It leads to warning message.

Fix:
====
Set the type while parsing MLOG_FILE_WRITE_CRYPT_DATA redo log.
If type and length is of invalid type then mark it as corrupted.
2019-01-17 13:10:45 +05:30
Marko Mäkelä
a84be48e00 Update ,32bit.rdiff 2019-01-17 09:39:20 +02:00
Marko Mäkelä
71eb762611 Merge 10.0 into 10.1 2019-01-17 06:40:24 +02:00
Daniel Black
19a7656fb1 safemalloc: warn, flush after fprintf
Corrects 94d722b6a4
2019-01-17 01:13:47 +04:00
Alexander Kuleshov
78f62e9079 remove duplicated paragraph from mysql_install_db.sh
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
2019-01-16 23:55:59 +04:00
Natanael Copa
459d6da869 MDEV-18269 - fix off-by-one bug in unittest
Fix the off-by-one overflow which was introduced with commit
b0fd06a6f2 (MDEV-15670 - unit.my_atomic failed in buildbot with
Signal 11 thrown)

Closes #1098.
2019-01-16 23:41:57 +04:00
Thirunarayanan Balathandayuthapani
038785e1f8 MDEV-18183 Server startup fails while dropping garbage encrypted tablespace
- There is no need to wait for crypt thread to stop accessing space while
dropping the garbage encrypted tablespace during recover.
2019-01-16 23:02:39 +05:30
Oleksandr Byelkin
db469b6907 MDEV-17475: Increase maximum possible value for table_definition_cache to match table_open_cache
Allow table definition cache be bigger than open table cache (due to problem with VIEWs and prepared statements).
2019-01-16 15:01:52 +01:00
Oleksandr Byelkin
1ecccb509c MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
The problem was in calculating of the mask to clear unused null bits in case of using full byte.
2019-01-16 13:57:22 +01:00
Anel Husakovic
f3e9d9a6e6 Change information_schema-big to include innodb 2019-01-16 13:34:54 +02:00
Anel Husakovic
802e8d6b89 Backport INFORMATION_SCHEMA.CHECK_CONSTRAINTS
Implement according to standard SQL specification 2008.
The check_constraints table is used for fetching metadata about
the constraints defined for tables in all databases.

There were some result files which failed after running mtr.
These files are updated with newly create record with mtr --record.
2019-01-16 13:34:54 +02:00
Vladislav Vaintroub
2153aaf66e mariabackup : use die() macro for fatal exit with error message. 2019-01-16 08:39:49 +01:00
Vladislav Vaintroub
235374aee3 MDEV-18254 upgrade HeidiSQL to 9.5 2019-01-15 18:44:03 +01:00
Vladislav Vaintroub
a8a27e65a8 MDEV-18212 mariabackup: Make output format uniform whenever possible 2019-01-15 14:15:04 +01:00
Marko Mäkelä
12f362c333 MDEV-18233 Moving the hash_node_t to improve locality of reference 2019-01-15 14:53:27 +02:00
Eugene Kosov
e0633f25e8 MDEV-18243 incorrect ASAN instrumentation
Poisoning memory after munmap() and friends is totally incorrect as this memory
could be anything.

os_mem_free_large(): remove memory poisoning
2019-01-15 15:32:18 +03:00
mkaruza
69328c31ed MDEV-18176 Galera test failure on galera.galera_gtid_slave_sst_rsync
If galera.galera_gtid_slave_sst_rsync is repeated more than once it will fail due incorrect GTID position. After stopping SLAVE node reset also GTID_SLAVE_POS variable.
2019-01-15 13:29:11 +02:00
Marko Mäkelä
71e9f0d123 MDEV-17797 Add ASAN poisoning for mem_heap_t
The merge commit d833bb65d5 did not
correctly merge the commit 03eb15933d.

Closes #948
2019-01-15 12:12:59 +02:00
Vladislav Vaintroub
7d3161def8 MDEV-18225 Avoid use of LOCK_prepared_stmt_count mutex in Statement_map destructo
This mutex can be freed when server shuts down (when thread_count goes down to 0)
, but it is still used inside THD::~THD() when Statement_map is destroyed.

The fix is to call Statement_map::reset() at the point where thread_count
is still positive, and avoid locking LOCK_prepared_stmt_count in THD
destructor.
2019-01-15 10:28:00 +01:00
sjaakola
61b600079b MDEV-16690 node hang due to conflicting inserts in FK child table
Add the test case. The actual bug was fixed in MDEV-17541.

Closes #811
2019-01-15 09:52:51 +02:00
Eugene Kosov
a06a3e4670 MDEV-18233 Moving the hash_node_t to improve locality of reference
When performing a hash search via HASH_SEARCH we first look at a key of a node
and then at its pointer to the next node in chain. If we have those in one cache
line instead of a two we reduce memory reads.

I found dict_table_t, fil_space_t and buf_page_t suitable for such improvement.
2019-01-14 22:14:56 +03:00
Eugene Kosov
662217a592 MDEV-18186 assertion failure on missing InnoDB index
This was introduced in 1a7a018939
MDEV-16557 Remove INNOBASE_SHARE::idx_trans_tbl

ha_innobase::innobase_get_index: remove incorrect assertion.
Index nullability is checked in subsequent ifs.

Closes #1079
2019-01-14 14:46:46 +02:00
Marko Mäkelä
b4c471099d
Merge pull request #973 from tempesta-tech/tt-10.0-MDEV-16499-virtual-innodb
MDEV-16499 ER_NO_SUCH_TABLE_IN_ENGINE followed by "Please drop the table and recreate" upon adding FULLTEXT key to table with virtual column
2019-01-14 14:06:26 +02:00
Eugene Kosov
cbdc2d9489 Replace log_group_t::file_header_bufs with local array
log_group_file_header_flush(): Use a stack-local variable
instead of the heap-allocated buffers.

Closes #1060
2019-01-14 13:53:04 +02:00
Marko Mäkelä
46046f2e59 After-merge fix: Disable a failing test 2019-01-14 13:46:19 +02:00
Marko Mäkelä
248dc12e60 Merge 10.1 into 10.2 2019-01-14 11:37:51 +02:00
FaramosCZ
f5ee7fb31f Fix a memory leak in ALTER TABLE
Closes #965
2019-01-14 11:33:20 +02:00
FaramosCZ
7372fe4da1 xb_process_datadir(): Fix resource leaks
Closes #983, #984
2019-01-14 11:02:04 +02:00
Sachin
79078167c3 MDEV-17753 ALTER USER fail to replicate
Change mysql_alter_user to log alter user command.
2019-01-13 20:59:45 +05:30
Vladislav Vaintroub
dc42b3c4d9 Backport MDEV-17504 to 5.5
mysql_install_db.exe should not remove datadir, if it was not created by
it.
2019-01-11 01:45:09 +01:00
Vladislav Vaintroub
7331c661db MDEV-18201 : mariabackup- fix processing of rename/create sequence in prepare
Fix one more bug in "DDL redo" phase in prepare
If table was renamed, and then new table was created with the old name,
prepare can be confused, and .ibd can end up with wrong name.

Fix the order of how DDL fixup is applied , once again - ".new" files
should be processed after renames.
2019-01-10 19:35:45 +01:00
Vladislav Vaintroub
4a872ae1e7 MDEV-18185 - mariabackup - fix specific case of table rename handing in prepare.
If, during backup
1) Innodb table is dropped (after being copied to backup) and then
2) Before backup finished, another Innodb table is renamed, and new name
is the name of the dropped table in 1)

then, --prepare fails with assertion, as DDL fixup code in prepare
did not handle this specific case.

The fix is to process drops before renames, in prepare DDL-"redo" phase.
2019-01-09 22:28:31 +01:00
Thirunarayanan Balathandayuthapani
9edadc29b1 MDEV-17748 innodb.alter_inplace_perfschema fails in buildbot with wrong result
- Changed the performance schema query which gives sampling with event
counting. It should fix the issue.
2019-01-08 20:41:39 +05:30