Commit graph

180454 commits

Author SHA1 Message Date
Thirunarayanan Balathandayuthapani
d897b4dc25 MDEV-15855: Use atomics for dict_table_t::n_ref_count
Make dict_table_t::n_ref_count private, and protect it with
a combination of dict_sys->mutex and atomics. We want to be
able to invoke dict_table_t::release() without holding
dict_sys->mutex.
2018-07-05 15:47:51 +03:00
Marko Mäkelä
fdb9e66fee Implement a parameter for wait_all_purged.inc 2018-07-05 15:47:13 +03:00
Marko Mäkelä
e9f1d8da57 Fix warnings about possibly uninitialized variables 2018-07-05 14:14:31 +03:00
Igor Babaev
058554027f MDEV-16629 "Table Does Not Exist" Error from Recursive CTE Query Inside Function
When processing a query containing with clauses a call of the function
check_dependencies_in_with_clauses() before opening tables used in the
query is necessary if with clauses include specifications of recursive
CTEs.
This call was missing if such a query belonged to a stored function.
This caused misbehavior of the server: it could report a fake error
as in the test case for MDEV-16629 or the executed query could hang
as in the test cases for MDEV-16661 and MDEV-15151.
2018-07-05 00:06:39 -07:00
Vladislav Vaintroub
400cf01715 MDEV-16571 - some backup tests sometimes with missing data after restore.
Marko mentions, it could be caused by  MDEV-15740 where InnoDB does not
flush redo log as often as it should, with innodb_flush_log_at_trx_commit=1

The workaround is to use innodb_flush_log_at_trx_commit=2, which,
according to MDEV-15740 is more durable.
2018-07-02 18:06:10 +01:00
Anel Husakovic
8639e28808 MDEV-16630: Ambiguous error message when check constraint matches table name
One can create table with the same name for `field` and `table` `check` constraint.
For example:
`create table t(a int check(a>0), constraint a check(a>10));`
But when inserting new rows same error is always raised.
For example with
```insert into t values (-1);```
and
```insert into t values (10);```
same error `ER_CONSTRAINT_FAILED` is obtained and it is not clear which constraint is violated.
This patch solve this error so that in case if field constraint is violated the first parameter
in the error message is `table.field_name` and if table constraint is violated the first parameter
in error message is `constraint_name`.
2018-07-01 22:32:55 +03:00
Vladislav Vaintroub
b71c9ae030 amend fix for MDEV-16596 - do not use CREATE_NEW flag when reopening redo log file.
use OPEN_ALWAYS instead, since we know file already exist.
2018-07-01 14:00:29 +01:00
Vladislav Vaintroub
c612a1e77c MDEV-16596 : Windows - redo log does not work on native 4K sector disks.
Disks with native 4K sectors need 4K alignment and size for  unbuffered IO
(i.e for files opened with FILE_FLAG_NO_BUFFERING)

Innodb opens redo log with FILE_FLAG_NO_BUFFERING, however it always does
512byte IOs. Thus, the IO on 4K native sectors will fail, rendering
Innodb non-functional.

The fix is to check whether OS_FILE_LOG_BLOCK_SIZE is multiple of logical
sector size, and if it is not, reopen the redo log without
FILE_FLAG_NO_BUFFERING flag.
2018-06-30 11:04:51 +01:00
Sergei Golubchik
1dd3c8f8ba Merge branch '10.1' into 10.2 2018-06-28 22:46:12 +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
Sergei Golubchik
45cabf1017 MDEV-16615 ASAN SEGV in handler::print_error or server crash after error upon CREATE TABLE
table->in_use is not always set and a KILL signal can arrive anytime.
2018-06-28 16:17:21 +02:00
Andrei Elkin
8ca18294d5 MDEV-14014 Multi-Slave Replication Fail: bogus data in log event
MDEV-7257 made a dump thread to read from binlog concurrently with
writers as long as the read bytes are below a water-mark
(MYSQL_BIN_LOG::binlog_end_pos). However it appeared to be possible a
dump thread reader reach out for bytes past the water mark through a
feature of IO_CACHE that fills in the internal buffer and while doing
so it could read what the reader is not supposed to see (the bytes
above MYSQL_BIN_LOG::binlog_end_pos).

The issue is fixed with constraining the IO_CACHE buffer fill to respect
the watermark.

An added unit test proves reading from file is bound to an external
parameter
passed to {IO_CACHE::end_of_file} cache member.
2018-06-28 15:47:03 +02:00
Sergei Golubchik
16c14d7ba0 mark ed25519 stable 2018-06-28 15:46:57 +02:00
Sergei Golubchik
44d1cada12 Merge branch '10.0' into 10.1 2018-06-28 14:07:51 +02:00
Sergei Golubchik
3d4beee1a9 remove double-counting
rnd_pos_by_record calls ha_rnd_pos, which does the counting
2018-06-28 13:36:51 +02:00
Sergei Golubchik
78a0646fe4 make plugins.processlist more robust 2018-06-28 12:38:58 +02:00
Andrei Elkin
00ccff48af MDEV-14014 Multi-Slave Replication Fail: bogus data in log event
MDEV-7257 made a dump thread to read from binlog concurrently with
writers as long as the read bytes are below a water-mark
(MYSQL_BIN_LOG::binlog_end_pos). However it appeared to be possible a
dump thread reader reach out for bytes past the water mark through a
feature of IO_CACHE that fills in the internal buffer and while doing
so it could read what the reader is not supposed to see (the bytes
above MYSQL_BIN_LOG::binlog_end_pos).

The issue is fixed with constraining the IO_CACHE buffer fill to respect
the watermark.

An added unit test proves reading from file is bound to an external
parameter
passed to {IO_CACHE::end_of_file} cache member.
2018-06-28 12:38:58 +02:00
Sergei Golubchik
52a25d7b67 MDEV-16473 WITH statement throws 'no database selected' error
Different fix, just use NULL, not no_db,
2018-06-28 12:38:53 +02:00
Igor Babaev
090febbb2d This is another attempt to fix mdev-16473.
The previous correction of the patch for mdev-16473 did not work
correctly for the databases whose names started with '*'.
Added a test case with a database named "*".
2018-06-28 00:36:50 -07:00
Marko Mäkelä
377cd52064 Pretty-print table names in some error messages 2018-06-27 23:22:08 +03:00
Sergey Vojtovich
bf4244d1a0 MDEV-8540 - Crash on server shutdown since 10.0.16
Only close stdin if it was open initinally. Otherwise we may close file
descriptor which is reused for different puprose (specifically for binlog
index file in case of this bug).
2018-06-27 17:06:00 +04:00
Jan Lindström
be5698265a MDEV-15607: mysqld crashed few after node is being joined with sst
This is a typical systemd response where it tries to shutdown the
joiner (due to "timeout") before the joiner manages to complete SST.

wsrep_sst_wait
wsrep_SE_init_wait
	While waiting the operation to finish use mysql_cond_timedwait
	instead of mysql_cond_wait and if operation is not finished
	extend systemd timeout (if needed).
2018-06-27 12:37:21 +03:00
Igor Babaev
6d377a523c Correction for the patch to fix mdev-16473. 2018-06-26 10:49:23 -07:00
Marko Mäkelä
31c950cca8 Merge 10.1 into 10.2 2018-06-26 18:16:49 +03:00
Daniel Bartholomew
0e937f30f6 bump the VERSION 2018-06-26 11:04:57 -04:00
Marko Mäkelä
c6392d52ee Merge 10.0 into 10.1 2018-06-26 17:34:44 +03:00
Marko Mäkelä
cc8772f33e MDEV-15953 Alter InnoDB Partitioned Table ignores pre-existing DATA DIRECTORY attribute 2018-06-26 17:02:46 +03:00
Marko Mäkelä
1b4ac075bf Merge 10.1 into 10.2 2018-06-26 15:39:23 +03:00
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
Igor Babaev
7d0d934ca6 MDEV-16473 WITH statement throws 'no database selected' error
Before this patch if no default database was set the server threw
an error for any table name reference that was not fully qualified by
database name. In particular it happened for table names referenced
CTE tables. This was incorrect.
The error message was thrown at the parser stage when the names referencing
different tables were not resolved yet.
Now if no default database is set and  a with clause is used in the
processed statement  any table reference is just supplied with a dummy
database name "*none*" at the parser stage. Later after a call
of check_dependencies_in_with_clauses() when the names for CTE tables
can be resolved error messages are thrown only for those names that
refer to non-CTE tables. This is done in open_and_process_table().
2018-06-26 00:02:48 -07:00
Oleksandr Byelkin
31e52b1632 Optimize charset tracking a bit. 2018-06-25 19:01:41 +02:00
Oleksandr Byelkin
517d718201 MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid
register changes of last_gtid
2018-06-25 19:01:41 +02:00
Oleksandr Byelkin
73de63e898 Session tracking info support in mysqltest (port from mysql) 2018-06-25 18:49:14 +02:00
Oleksandr Byelkin
a8e1eef899 Reset connection support in mysqltest (port from mysql) 2018-06-25 18:49:14 +02:00
Andrei Elkin
28e1f1453f MDEV-15242 Poor RBR update performance with partitioned tables
Observed and described
partitioned engine execution time difference
between master and slave was caused by excessive invocation
of base_engine::rnd_init which was done also for partitions
uninvolved into Rows-event operation.
The bug's slave slowdown therefore scales with the number of partitions.

Fixed with applying an upstream patch.

References:
----------
https://bugs.mysql.com/bug.php?id=73648
Bug#25687813 REPLICATION REGRESSION WITH RBR AND PARTITIONED TABLES
2018-06-25 16:45:00 +03:00
Elena Stepanova
bb825194b8 Updated list of unstable tests for 10.2.16 2018-06-25 14:04:16 +03:00
Alexander Barkov
ee6ac4d313 MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type 2018-06-25 09:08:07 +04:00
Sergei Golubchik
01bbb912bf update C/C 2018-06-24 20:38:45 +02:00
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
f25a5c39c1 MDEV-14560 Extra engines enabled through additional config are not loaded on first installation
Solution for Debian/Ubuntu: install a trigger to restart mysqld
automatically whenever a package changes something in /etc/mysql
or in /etc/systemd/system/mariadb.service.d
2018-06-24 15:18:36 +02:00
Sergei Golubchik
a19089ff4e MDEV-16537 aws key management plugin on Ubuntu bionic has impossible dependencies
remove manual libcurl3 dependency.
it'll be automatically added (libcurl3 or libcurl4, whatever was
actually used)
2018-06-24 15:18:36 +02:00
Sergei Golubchik
ffb96be9e7 fix debian packaging for tokudb 2018-06-24 15:18:36 +02:00
Sergei Golubchik
b2190f859b fix vcol.vcol_misc --embedded 2018-06-24 15:18:36 +02:00
Sergei Golubchik
e561a346c3 fix mtr warnings after 5f0510225a 2018-06-24 15:18:36 +02:00
Igor Babaev
364a20fe0b MDEV-16507 SIGSEGV when use_stat_tables = preferably and
optimizer_use_condition_selectivity = 4

It does not makes sense to try to read statistics for temporary tables
because it's not collected.
2018-06-23 19:36:26 -07:00
Vladislav Vaintroub
95ef8de891 mariabackup - rename backup-rocksdb option to rocksdb-backup
to avoid "using unique option prefix 'backup' is error-prone", there is
already --backup option there.
2018-06-22 23:30:26 +01:00
Vladislav Vaintroub
ecc4682672 MDEV-16519 : mariabackup should fail if MDL could not be acquired with lock-ddl-per-table
There is a tiny chance for race condition during MDL acquisition.

If table is renamed just prior to
SELECT 1 FROM <table_name> LIMIT 0

then this query would  fail, yet mariabackup --backup does not handle
it as fatal error and continues, only to fail later during file copy.

The fix is to die on error, of MDL lock query fails.
2018-06-22 15:24:09 +01:00
Sergei Golubchik
0d745343fc fix plugins.processlist
make it not to fail when `show engine innodb status` output
contains a double quote
2018-06-22 09:52:21 +02:00