Commit graph

178702 commits

Author SHA1 Message Date
Sergei Golubchik
e0a1c745ec Merge branch '10.1' into 10.2 2017-10-24 14:53:18 +02:00
Vladislav Vaintroub
4ec88ea9c3 Fix a warning on Win64 2017-10-23 22:01:19 +00:00
Sergei Petrunia
9d47c4cfdb Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks 2017-10-23 09:47:10 +00:00
Sergei Petrunia
d577b1a9c2 MDEV-11934: MariaRocks: Group Commit with binlog
Fix a failure in rocksdb_rpl.rpl_rocksdb_2pc_crash_recover test.
Don't do XA with binlog if @@rocksdb_enable_2pc=OFF.
2017-10-23 09:45:47 +00:00
Sergei Golubchik
2aa51f528f Various compier warnings
gcc 5.4 and 7.1, Debug and Release builds
2017-10-22 14:51:45 +02:00
Sergei Golubchik
9d2e2d7533 Merge branch '10.0' into 10.1 2017-10-22 13:03:41 +02:00
Sergei Petrunia
4995091c33 Temporarily disable rocksdb.rpl_ddl_high_priority test 2017-10-20 14:15:37 +00:00
Sergei Petrunia
7c42b091b7 Make rocksdb.index_merge_rocksdb2 test stable 2017-10-20 13:36:55 +03:00
Sergei Golubchik
607d8f9e97 MDEV-14081 ALTER TABLE CHANGE COLUMN Corrupts Index Leading to Crashes in 10.2
remove remnants of 10.0 bugfix, incorrectly merged into 10.2

Using col_names[i] was obviously, wrong, must've been col_names[ifield->col_no].
incorrect column name resulted in innodb having index unique_id2(id1),
while the server thought it's unique_id2(id4).
But col_names[ifield->col_no] is wrong too, because `table` has non-renamed
columns, so the correct column name is always dict_table_get_col_name(table, ifield->col_no)
2017-10-18 22:15:27 +02:00
Sergei Golubchik
e6df6031f6 MDEV-13969 sst mysqldump and xtrabackup-v2 handle WSREP_SST_OPT_CONF incorrectly
$WSREP_SST_OPT_CONF already includes --defaults-extra-file= prefix.
2017-10-18 22:15:27 +02:00
Sergei Golubchik
4c2c057d40 MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable" 2017-10-18 22:15:26 +02:00
Sergei Golubchik
30faf331b8 MDEV-13836 mariadb_config & mysql_config output differ
allow to build with the default port number 3306.
Now -DMYSQL_TCP_PORT=# sets the default port name and
-DMYSQL_TCP_PORT_DEFAULT=# sets the magic port=0 behavior,
if it's MYSQL_TCP_PORT_DEFAULT=0 it's enabled, otherwise - disabled.
2017-10-18 22:15:26 +02:00
Sergei Golubchik
a75884e701 MDEV-13836 mariadb_config & mysql_config output differ
Use mariadb_config, for C/C config variables
2017-10-18 22:15:26 +02:00
Marko Mäkelä
2eb3c5e542 MDEV-13918 Race condition between INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS and ALTER/DROP/TRUNCATE TABLE
i_s_sys_tables_fill_table_stats(): Acquire dict_operation_lock
S-latch before acquiring dict_sys->mutex, to prevent the table
from being removed from the data dictionary cache and from
being freed while i_s_dict_fill_sys_tablestats() is accessing
the table handle.
2017-10-18 21:19:33 +03:00
Michael Widenius
98cc7a8eef Fixed compiler warnings 2017-10-18 17:10:49 +03:00
Sergei Golubchik
da4503e956 Merge branch '5.5' into 10.0 2017-10-18 15:14:39 +02:00
Marko Mäkelä
3294f6c30d MDEV-14085 Merge new release of InnoDB MySQL 5.7.20 to 10.2 2017-10-18 11:57:38 +03:00
Marko Mäkelä
59d3ba0b5d Adjust the instrumentation and test 2017-10-18 11:53:45 +03:00
Darshan M N
7c9651a371 BUG#25479538 ASSERT:SIZE == SPACE->SIZE DURING BUF_READ_AHEAD_RANDOM
Issue
=====
The original issue was that the size of a fil_per_table tablespace was calculated
incorrectly during truncate in the presence of an fts index. This incorrect calculation
was fixed as part of BUG#25053705 along with a testcase to reproduce the bug. The
assert that was added as part of it to reproduce the bug was wrong and resulted in
this bug.

Fix
===
Although the assert was removed earlier in a seperate commit as it was blocking the
ntest, this patch replaces the other parts of the code that were added to reproduce
the bug and replaces it with code that tries to reproduce the bug in a different way.

The new code basically tries to tweak conditions so as to simulate the random read
where a page that doesn't exist is tried to be read.

RB: 15890
Reviewed-by: Jimmy Yang <Jimmy.Yang@oracle.com>
Reviewed-by: Satya Bodapati <satya.bodapati@oracle.com>
2017-10-18 11:53:34 +03:00
Marko Mäkelä
babbf8c6fc fts_query_free(): Fix a potential assertion failure
The ownership of the field query->intersection usually transfers
to query->doc_ids. In some error scenario, it could be possible
that fts_query_free() would be invoked with query->intersection!=NULL.
Let us handle that case, instead of intentionally crashing the server.
2017-10-18 10:22:10 +03:00
Marko Mäkelä
30e89acd95 Import, adapt and extend a test from Oracle 2017-10-18 10:06:48 +03:00
Marko Mäkelä
3bc094d32a Remove dead code for pushing down LIMIT to InnoDB FULLTEXT INDEX queries
MySQL 5.7 added code to push down the LIMIT to fulltext search
in InnoDB:

commit 2cd0ebf97e1b265e2282d7ceb5d8dfb663ffc48f
Author: Thirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com>
Date:   Fri May 27 13:49:28 2016 +0530

    Bug #22709692   FTS QUERY EXCEEDS RESULT CACHE LIMIT

The code was disabled when MySQL 5.7.9 was merged to MariaDB 10.2.2.

We shall remove the disabled code and unnecessary variables.
2017-10-18 09:07:53 +03:00
Marko Mäkelä
9817479563 Add a test of LIMIT with FULLTEXT INDEX
In MariaDB, InnoDB fulltext search does not currently
truncate results based on LIMIT. In MySQL 5.7, it does.
2017-10-18 08:25:04 +03:00
Marko Mäkelä
dfd010ef90 MDEV-14086 Setting innodb_buffer_pool_load_now or innodb_buffer_load_abort will crash if innodb_read_only
When MySQL 5.6.10 introduced innodb_read_only mode, it skipped the
creation of the InnoDB buffer pool dump/restore subsystem in that mode.
Attempts to set the variable innodb_buf_pool_dump_now would have
no effect in innodb_read_only mode, but the corresponding condition
was forgotten in from the other two update functions.

MySQL 5.7.20 would fix the innodb_buffer_pool_load_now,
but not innodb_buffer_pool_load_abort. Let us fix both in MariaDB.
2017-10-18 06:35:11 +03:00
Vicențiu Ciorbaru
4090ef820e Fix check_role_is_granted for embedded 2017-10-17 15:33:19 +03:00
Sergei Petrunia
cd7fa0fd62 MDEV-11934: MariaRocks: Group Commit with binlog
Port the previous patch:
- Implement MariaDB's Group Commit API. This is a first
   attempt which lacks the expected performance.

To newer MariaDB (which includes newer MyRocks)
2017-10-17 12:04:53 +03:00
Sergei Golubchik
b000e16956 Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:

commit f7316aa0c9
Author: Ajo Robert <ajo.robert@oracle.com>
Date:   Thu Aug 24 17:03:21 2017 +0530

    Bug#26361149  MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
                           COL), NAME_CONST('NAME', NULL))

    Backport of Bug#19143243 fix.

    NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
    NULL_ITEM has special processing in Item_func_in function.
    In Item_func_in::fix_length_and_dec an array of possible comparators is
    created. Since NAME_CONST function has NULL_ITEM type, corresponding
    array element is empty. Then NAME_CONST is wrapped to ITEM_CACHE.
    ITEM_CACHE can not return proper type(NULL_ITEM) in Item_func_in::val_int(),
    so the NULL_ITEM is attempted compared with an empty comparator.
    The fix is to disable the caching of Item_name_const item.
2017-10-17 11:04:09 +02:00
Sergei Golubchik
df5f25fa7a Merge branch 'mysql/5.5' into 5.5 2017-10-17 10:18:17 +02:00
Marko Mäkelä
a63102226e MDEV-14082 Enforcing innodb_open_files leads to fil_system->mutex problem
fil_mutex_enter_and_prepare_for_io(): Reacquire fil_system->mutex after
failing to close a file and before retrying.
2017-10-17 10:58:46 +03:00
Sergei Golubchik
b036b6b594 MDEV-13937 Aria engine: Internal Error 160 after partition handling
Partition wasn't setting HA_OPTION_PACK_RECORD on ALTER TABLE
if the row format was PAGE.

(so one bit in the null bitmap was reserved for a deleted bit -
see make_empty_rec - and all actual null bits were one off)
2017-10-17 07:37:39 +02:00
Sergei Golubchik
19a702a85c MDEV-14056 DROP TEMPORARY TABLE IF EXISTS causes error 1290 with read_only option
if it's a DROP TABLE, we cannot detect whether a table is
temporary by looking in thd->temporary_tables - because the
table might simply not exist at all.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
421716391b MDEV-13912 Can't refer the same column twice in one ALTER TABLE
backport ce6c0e584e

MDEV-8960: Can't refer the same column twice in one ALTER TABLE

Problem was that if column was created in alter table when
it was refered again it was not tried to find from list
of current columns.

mysql_prepare_alter_table:
  There is two cases
    (1) If alter table adds a new column and then later alter
        changes the field definition, there was no check from
	list of new columns, instead an incorrect error was given.
    (2) If alter table adds a new column and then later alter
        changes the default, there was no check from list of
	new columns, instead an incorrect error was given.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
93144b9e92 MDEV-13440 mysql_install_db fails with hard-coded langdir
always search in compile-time specified paths
INSTALL_BINDIR, INSTALL_SBINDIR, INSTALL_MYSQLSHAREDIR. User
can set them to arbitrary values, it's not enough to search only
in their usual values of bin, sbin and libexec, share and share/mysql.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
52516706c8 cleanup mysql_install_db
1. detect resolveip location, don' assume it's in $basedir/bin
2. don't guess $scriptdir to (incorrectly) construct the $0 path
3. rename find_in_basedir -> find_in_dirs, don't prepend $basedir
   automatically. This allows to use identical path lists in
   find_in_dirs and in cannot_find_file.
4. move search path lists to CMakeLists.txt to avoid specifying the
   same path list twice (in find_in_dirs and in cannot_find_file).
2017-10-17 07:37:39 +02:00
Sergei Golubchik
d76f5774fe MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
2017-10-17 07:37:39 +02:00
Marko Mäkelä
d11af09865 MDEV-14076 InnoDB: Failing assertion when accessing INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES upon upgrade from 10.1.0 to 10.1.20
i_s_dict_fill_sys_tablespaces(): Adjust the tablespace flags if needed.
2017-10-16 20:54:07 +03:00
Marko Mäkelä
9a791c9c8d MDEV-12676 MySQL#78423 InnoDB FTS duplicate key error
fts_get_next_doc_id(): Assign the first and subsequent FTS_DOC_ID
in the same way: by post-incrementing the cached value.
If there is a user-specified FTS_DOC_ID, do not touch the internal
sequence.
2017-10-16 19:11:30 +03:00
Marko Mäkelä
1eee3a3fb7 MDEV-13051 MySQL#86607 InnoDB crash after failed ADD INDEX and table_definition_cache eviction
There are two bugs related to failed ADD INDEX and
the InnoDB table cache eviction.

dict_table_close(): Try dropping failed ADD INDEX when releasing
the last table handle, not when releasing the last-but-one.

dict_table_remove_from_cache_low(): Do not invoke
row_merge_drop_indexes() after freeing all index metadata.
Instead, directly invoke row_merge_drop_indexes_dict() to
remove the metadata from the persistent data dictionary
and to free the index pages.
2017-10-16 19:11:30 +03:00
Alexander Barkov
98cd0ec536 MDEV-10802 TIMESTAMP NOT NULL field with explicit_defaults_for_timestamp and NO_ZERO_DATE shouldn't throw error 2017-10-14 19:43:16 +04:00
Marko Mäkelä
ad46ce658a MDEV-14055 Assertion `page_rec_is_leaf(rec)' failed in lock_rec_validate_page
This was a false alarm in a debug check that was introduced in
commit 48192f963a which was a
10.2 code refactoring in preparation for
MDEV-11369 (instant ADD COLUMN) in 10.3.2. The code refactoring
only affected debug builds.

InnoDB B-tree record locks are only supposed to exist on leaf page
records. An assertion failed, because the debug function lock_validate()
was invoking lock_rec_block_validate() on a page for which there were
no locks set in the record lock bitmap. This could happen on a page split.
Especially when the index size grows from a single page to multiple pages,
the root page would transform from a leaf node into an internal node,
and its record lock bitmap would be emptied.

lock_validate(): Skip empty lock bitmaps.
2017-10-14 14:28:11 +03:00
Vladislav Vaintroub
bcd1a08eb3 Fix mtr to create a process dump on Window for hanging or looping processes 2017-10-13 22:24:25 +00:00
Marko Mäkelä
9ee840cd0a mariabackup: Properly call os_thread_exit() with detach=true
There is no call to os_thread_join(), so we should detach the thread
handles in order to avoid any resource leaks.
2017-10-13 22:22:03 +03:00
Oleksandr Byelkin
3b7aa3017b Cleanup usage of DBUG_ASSERTS. 2017-10-13 19:32:38 +02:00
Oleksandr Byelkin
235b68299b MDEV-9619: Assertion `null_ref_table' failed in virtual table_map Item_direct_view_ref::used_tables() const on 2nd execution of PS
Refer left expression indirectly in case it changes from execution to execution.
2017-10-13 19:32:38 +02:00
Igor Babaev
2bab29ebba Fixed the bug mdev-13135.
For each SELECT the list sj_nests is built by the
function simplify_joins() when scanning different
join nests. This function may be called several
times for the same join nest. That's why before
adding a new member to sj_nests it is necessary
to check if it's already in the list.
The code of simplify_joins() lacked this check and
as a result it could cause memory overwright for
some queries.
2017-10-13 07:24:54 -07:00
Sergey Vojtovich
8be76a6a90 MDEV-10892 - rpl.rpl_semi_sync_uninstall_plugin fails with Assertion `0' failure
in buildbot

Removed plugin_array_version: it is being checked without mutex protection and
thus is prone to data race and race conditions. In effect plugins are not
protected from concurrent destruction.

Removed state_mask inversion: doesn't seem to make any sense.

When collecting local plugins list, only add plugins that match state_mask.

Use plugin ref counting to protect against concurrent plugin destruction.
2017-10-13 16:50:58 +04:00
Sergei Petrunia
f11eaaa3f6 Merge branch 'bb-10.2-mariarocks' of github.com:MariaDB/server into 10.2
Conflicts:
	storage/rocksdb/ha_rocksdb.cc
2017-10-13 14:37:04 +03:00
Oleksandr Byelkin
a4868c3509 MDEV-9208: Function->Function->View = Mysqld segfault (Server crashes in Dependency_marker::visit_field on 2nd execution with merged subquery)
Prevent crossing name resolution border in finding item tables.
2017-10-13 12:35:17 +02:00
Sergei Petrunia
0507b09402 Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks-merge 2017-10-13 13:25:46 +03:00
Alexander Barkov
991b9ee735 MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535 2017-10-13 07:06:09 +04:00