Commit graph

177199 commits

Author SHA1 Message Date
Oleksandr Byelkin
62dbf4f18d post merge 2018-09-07 01:35:09 +02:00
Oleksandr Byelkin
31081593aa Merge branch '11.0' into 10.1 2018-09-06 22:45:19 +02:00
Sergei Golubchik
3a4242fd57 TokuDB: Don't free P_S instrumented mutexes after exit()
don't create static objects that destroy mutexes from destructors,
and don't destroy mutexes from .so destructor (on-unload) function.

if it happens after exit(), P_S will be long gone by that time

this fixes tokudb tests crashing on quantal-amd64
2018-09-06 21:06:31 +02:00
Oleksandr Byelkin
d527bf5390 Merge branch 'merge-tokudb-5.6' into 10.0 2018-09-06 21:04:56 +02:00
Jan Lindström
b0026e33af Disable failing galera test for now. 2018-09-06 18:55:57 +03:00
Jan Lindström
fba683c069 MDEV-17062: Test failure on galera.MW-336
MDEV-17058: Test failure on wsrep.variables
MDEV-17060: Test failure on galera.galera_var_slave_threads

Fix incorrect calculation of increased applier (slave) threads.
Note that increase change takes effect "immediately" but we should
use proper wait condition to wait it. Reducing the number of
slave threads is not immediate as thread will only exit after a
replication event.
2018-09-06 16:05:31 +03:00
Jan Lindström
653038ccad
Merge pull request #855 from tempesta-tech/sysprg/10.1-MDEV-10756
MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dir
2018-09-06 14:10:29 +03:00
Sergei Golubchik
0ccba62db3 MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys
lowercase db and table names before prelocking.

Post-fix for 9180e8666b

This fixes failures on main.lowercase_table4 on Windows
2018-09-06 01:30:10 +02:00
Sergey Vojtovich
4cf75706b3 MDEV-16757 Memory leak after adding manually min/max statistical data
for blob column

Moved delete_stat_values_for_table_share() call to proper place.
2018-09-05 17:14:20 +04:00
Jan Lindström
6695fcead3 Galera test case cleanups. 2018-09-05 10:34:36 +03:00
Jan Lindström
b44b9f71bd MDEV-15436: If log_bin and log_bin_index is different SST with rsync fails.
Problem was that in SST log_bin_index name and directory was not
handled and passed to rsync SST script.

wsrep_sst_common.sh
	Read binlog index dirname and filename if --binlog-index
	parameter is provided. Read binlog filenames from that file
	from donor and write transfered binlog filenames to that
	file in joiner.

mysqld.cc, mysqld.h
	Moved opt_binlog_index_name from static to global and added
	it to extern.

wsrep_sst.cc

generate_binlog_index_opt_val
	New function to generate binlog index name if opt_binlog_index_name is
	given on configuration.

sst_prepare_other
	Add binlog index configuration to SST command.

wsrep_sst.h
	Add new SST parameter --binlog-index

Add test case.
2018-09-05 10:34:36 +03:00
Marko Mäkelä
4caf3e08a8 Add MDEV-11080, MDEV-16709 tests for the MDEV-13333 fix
The regression that was introduced in
commit 723f87e9d3
was fixed as part of MDEV-13333
(commit 3b37edee1a)
without a test case, because the MDEV-13333 test case
is even less deterministic than these ones.
2018-09-04 20:21:57 +03:00
Sergei Golubchik
09bc99fac9 cleanup: remove extra/rpl_tests/rpl_foreign_key.test 2018-09-04 09:49:53 +02:00
Sergei Golubchik
d831cefb43 MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys
Disable "Invalid (old?) table or database name" warning when
converting table names in InnoDB's get_foreign_key_info().

Because a name can be a temporary table name during the ALTER TABLE,
and some other thread can do SHOW CREATE TABLE for the other table
in the FK relationships _anytime_.
2018-09-04 09:49:53 +02:00
Sergei Golubchik
9180e8666b MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys
ALTER TABLE locks the table with TL_READ_NO_INSERT, to prevent the
source table modifications while it's being copied. But there's an
indirect way of modifying a table, via cascade FK actions.

After previous commits, an attempt to modify an FK parent table
will cause FK children to be prelocked, so the table-being-altered
cannot be modified by a cascade FK action, because ALTER holds a
lock and prelocking will wait.

But if a new FK is being added by this very ALTER, then the target
table is not locked yet (it's a temporary table). So, we have to
lock FK parents explicitly.
2018-09-04 09:49:53 +02:00
Sergei Golubchik
e81f101dac create a reusable function that tells what FK actions can write
Backport of 794f71cbc4
2018-09-04 09:49:52 +02:00
Sergei Golubchik
dd74332d2c MDEV-12669 Circular foreign keys cause a loop and OOM upon LOCK TABLE
table_already_fk_prelocked() was looking for a table in the wrong
list (not the complete list of prelocked tables, but only in its tail,
starting from the current table - which is always empty for the last
added table), so for circular FKs it kept adding same tables to the list
indefinitely.

Backport of d6d7e169fb
2018-09-04 09:49:52 +02:00
Sergei Golubchik
710093ccb0 compilation failure 2018-09-04 09:49:52 +02:00
Sergei Golubchik
a6246cab16 fix failures of innodb_plugin tests in --embedded
Post-fix for 7e8ed15b95

Also, apply the same innodb fix to xtradb.
2018-09-04 09:19:50 +02:00
Sergei Golubchik
c272754740 MDEV-15792 Fix mtr to be able to wait for >1 exited mysqld
Post-merge fixes: minor perlification and get rid of an
annoying run-time warning (undef value in string comparison)

Closes #709
2018-09-04 09:19:49 +02:00
Vasil Dimov
1d98255f61 MDEV-15792 Fix mtr to be able to wait for >1 exited mysqld
If a mtr test case has started two mysqld processes (replication tests),
then kills the first one and kills the second one before starting the
first (so at some point there are two mysqlds down), then the ./mtr
waiting process bricks and forgets to monitor the "expect" file of the
first mysqld, so it never gets started again, even when its contents is
changed to "restart".

A victim of this deficiency is at least galera.galera_gcache_recover.

The fix is to keep a list of all mysqlds we should wait to start, not
just one (the last one killed).
2018-09-04 09:19:49 +02:00
Sergei Golubchik
82bb01588d run binlog.binlog_stm_binlog test in non-debug builds 2018-09-04 09:19:49 +02:00
Sergei Golubchik
8bee7c16c8 compiler warnings (clang 4.0.1 on i386)
extra/mariabackup/fil_cur.cc:361:42: warning: format specifies type 'unsigned long' but the argument has type 'ib_int64_t' (aka 'long long') [-Wformat]
extra/mariabackup/fil_cur.cc:376:9: warning: format specifies type 'unsigned long' but the argument has type 'ib_int64_t' (aka 'long long') [-Wformat]
sql/handler.cc:6196:45: warning: format specifies type 'unsigned long' but the argument has type 'wsrep_trx_id_t' (aka 'unsigned long long') [-Wformat]
sql/log.cc:1681:16: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
sql/log.cc:1687:16: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
sql/wsrep_sst.cc:1388:86: warning: format specifies type 'long' but the argument has type 'wsrep_seqno_t' (aka 'long long') [-Wformat]
sql/wsrep_sst.cc:232:86: warning: format specifies type 'long' but the argument has type 'wsrep_seqno_t' (aka 'long long') [-Wformat]
storage/connect/filamdbf.cpp:450:47: warning: format specifies type 'short' but the argument has type 'int' [-Wformat]
storage/connect/filamdbf.cpp:970:47: warning: format specifies type 'short' but the argument has type 'int' [-Wformat]
storage/connect/inihandl.cpp:197:16: warning: address of array 'key->name' will always evaluate to 'true' [-Wpointer-bool-conversion]
storage/innobase/btr/btr0scrub.cc:151:17: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/innobase/buf/buf0buf.cc:5085:8: warning: nonnull parameter 'bpage' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
storage/innobase/fil/fil0crypt.cc:2454:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/innobase/handler/ha_innodb.cc:18685:7: warning: format specifies type 'unsigned long' but the argument has type 'wsrep_trx_id_t' (aka 'unsigned long long') [-Wformat]
storage/innobase/row/row0mysql.cc:3319:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/innobase/row/row0mysql.cc:3327:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/maria/ma_norec.c:35:10: warning: implicit conversion from 'int' to 'my_bool' (aka 'char') changes value from 131 to -125 [-Wconstant-conversion]
storage/maria/ma_norec.c:42:10: warning: implicit conversion from 'int' to 'my_bool' (aka 'char') changes value from 131 to -125 [-Wconstant-conversion]
storage/maria/ma_test2.c:1009:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
storage/maria/ma_test2.c:1010:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
storage/mroonga/ha_mroonga.cpp:9189:44: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
storage/mroonga/vendor/groonga/lib/expr.c:4987:22: warning: comparison of constant -1 with expression of type 'grn_operator' is always false [-Wtautological-constant-out-of-range-compare]
storage/xtradb/btr/btr0scrub.cc:151:17: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/xtradb/buf/buf0buf.cc:5047:8: warning: nonnull parameter 'bpage' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
storage/xtradb/fil/fil0crypt.cc:2454:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/xtradb/row/row0mysql.cc:3324:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
storage/xtradb/row/row0mysql.cc:3332:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
unittest/sql/mf_iocache-t.cc:120:35: warning: format specifies type 'unsigned long' but the argument has type 'int' [-Wformat]
unittest/sql/mf_iocache-t.cc:96:35: note: expanded from macro 'INFO_TAIL'
2018-09-04 09:19:48 +02:00
Sergei Golubchik
aec54fb938 MDEV-9627 clang builds fail on i386
don't use C11 atomics unless HAVE_GCC_C11_ATOMICS is defined
2018-09-04 09:19:48 +02:00
Sergei Golubchik
64d4181f0c Fix TokuDB's check for -Wno-address-of-packed-member
(failed configure with old clang)
2018-09-04 09:19:47 +02:00
Sergei Golubchik
64a23c1c8a extend prelocking to FK-accessed tables
Backport of f136291098
2018-09-04 08:37:44 +02:00
Sergei Golubchik
3b365fa829 cleanup: sp_head::add_used_tables_to_table_list()
Use TABLE::init_one_table(), don't duplicate it.
Put additional initializations into TABLE::init_one_table_for_prelocking()

Backport of f136291098
2018-09-04 08:37:44 +02:00
Sergei Golubchik
22bcfa011a cleanup: FOREIGN_KEY_INFO
instead of returning strings for CASCADE/RESTRICT
from every storage engine, use enum values

Backport of a3614d33e8
2018-09-04 08:37:44 +02:00
Oleksandr Byelkin
a816eac92a 5.6.41-84.1 2018-09-03 16:29:29 +02:00
Oleksandr Byelkin
b9bc3c2463 Merge branch '5.5' into 10.0 2018-09-03 10:57:02 +02:00
Monty
43c393ff47 MDEV-16682 Assertion `(buff[7] & 7) == HEAD_PAGE' failed
Missed one file in last push...
2018-09-03 11:10:46 +03:00
Jan Lindström
34e026f35a
Merge pull request #859 from grooverdan/10.1-galera_new_cluster-unsed-vars
galera_new_cluster.sh: unused variables
2018-09-03 08:37:22 +03:00
Daniel Black
eda88e60fb galera_new_cluster.sh: unused variables 2018-09-03 09:53:05 +10:00
Alexey Botchkov
63ad6a9e1a MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after LOCK TABLES <view>.
Check if the argument of the FLUSH TABLE is a VIEW and handle it
accordingly.
2018-09-02 09:24:33 +04:00
Oleksandr Byelkin
796d54df11 MDEV-16957: Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP
The problem was that join_columns creation was not finished due to error of notfound column in USING, but next execution tried to use join_columns lists.

Solution is cleanup the lists on error. It can eat memory in statement MEM_ROOT but it is an error and error will be fixed or statement/procedure removed/altered.
2018-08-31 17:07:43 +02:00
Jan Lindström
288212f489 Disable failing Galera tests. 2018-08-31 15:41:15 +03:00
Marko Mäkelä
f693170c75 MDEV-16647 InnoDB fails to drop large temporary table on disconnect
This regression was introduced in MDEV-16515.
We would fail to drop a temporary table on client disconnect,
because trx_is_interrupted() would hold. To add insult to
injury, in MariaDB 10.1, InnoDB temporary tables are actually
persistent, so the garbage temporary tables will never be dropped.

row_drop_table_for_mysql(): If several iterations of
buf_LRU_drop_page_hash_for_tablespace() are needed,
do not interrupt dropping a temporary table even after
the transaction was marked as killed.

Server shutdown will still terminate the loop, and also DROP TABLE
of persistent tables will keep checking if the execution was aborted.
2018-08-31 13:16:31 +03:00
Marko Mäkelä
3b5d3cd68e Revert MDEV-9519 due to regressions
This reverts commit 75dfd4acb9.
2018-08-31 12:36:31 +03:00
Alexey Botchkov
c933970974 MDEV-16665 ed25519 describes itself as 1.0-alpha even though it's not alpha.
Plugin version name fixed.
2018-08-30 15:57:22 +04:00
Alexey Botchkov
2ad51a0bd8 MDEV-17095 pam_user_map module throws syntax error if group name contains backslash.
Let '\\' and '/' symbols to be part of a group name.
2018-08-30 14:51:15 +04:00
Monty
42f09adab6 MDEV-16682 Assertion `(buff[7] & 7) == HEAD_PAGE' failed
Problem was that SQL level tried to read a record with rnd_pos()
that was already deleted by the same statement.
In the case where the page for the record had been deleted, this
caused an assert.
Fixed by extending the assert to also handle empty pages and
return HA_ERR_RECORD_DELETED for reads to deleted pages.
2018-08-30 13:45:27 +03:00
Jan Lindström
104089e182 MDEV-15512 - Fix sh parse error when [sst] config value has spaces.
Merged https://github.com/MariaDB/server/pull/617 authored by
Colin Mollenhour.
2018-08-29 19:30:03 +03:00
Varun Gupta
b3c320bb0b MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
optimizer_use_condition_selectivity>=3

Selectivity analysis should be disabled for Geometrical columns
for the case like geometric_field= string_constant.
2018-08-29 12:48:23 +05:30
Varun Gupta
a9c09c95bd MDEV-15306: Wrong/Unexpected result with the value optimizer_use_condition_selectivity set to 4
Currently for selectivity calculation we perform range analysis for a column even when we don't have any statistics(EITS).
This makes less sense but is used to catch contradiction for WHERE condition.

So the solution is to not perform range analysis for selectivity calculation for columns that do not have statistics.
2018-08-29 02:17:37 +05:30
Ian Gilfillan
6c588c92a9 MDEV-14927: Missing man pages 2018-08-28 14:12:42 +03:00
Jan Lindström
f4454a35fc
Merge pull request #539 from grooverdan/10.1-wsrep_sst_rsync_read_MYSQL_BASE_VERSION_config
MDEV-14851: galera_recovery to read correct configuration file sections
2018-08-28 13:48:43 +03:00
Monty
cded083a37 MDEV-15797 Assertion `thd->killed != 0' failed in ha_maria::enable_indexes
Problem was that a parallel open of a table, overwrote info->state that
was in used by repair.

Fixed by changing _ma_tmp_disable_logging_for_table() to use
a new state buffer state.no_logging to store the temporary state.

Other things:
- Use original number of rows when retrying repair to get rid of a
  potential warning "Number of rows changed from X to Y"
- Changed maria_commit() to make it easier to merge with 10.4
- If table is not locked (like with show commands), use the global
  number of rows as the local number may not be up to date.
  (Minor not critical fix)
- Added some missing DBUG_RETURN
2018-08-27 22:00:14 +03:00
Julius Goryavsky
c11fb374b5 MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dir
Current versions of xtrabackup-v2 and mariabackup support the option
--innodb-data-home-dir, but this parameter is not passed to them from
the SST script, since the SST script does not receive this information
from mysqld. The transfer of this information to the SST is already
fixed by the MDEV-10754 patch, but we need to process it in the SST
script. Also, we should take into account that on the joiner side
the corresponding information is not read yet from the configuration
file (at the mysqld side) during the start of SST, so the script must
itself read it.

https://jira.mariadb.org/browse/MDEV-10756
2018-08-27 16:24:29 +02:00
Marko Mäkelä
5fb251642e Commit the MDEV-17023 fix with the correct number 2018-08-27 12:22:27 +03:00
Varun Gupta
69d7bfd970 MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
No need to read statistics for tables that are not USER tables.
We allocate memory for structures to collect statistics only for USER TABLES.
2018-08-27 12:21:26 +03:00