Commit graph

176155 commits

Author SHA1 Message Date
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
Kentoku
ac12ab8f66 Update Mroonga to the latest version on 2017-10-16T09:50:49+0900 2017-10-16 09:50:49 +09: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
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
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
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
Vicențiu Ciorbaru
b9418ed333 MDEV-13676: Field "create Procedure" is NULL, even if the the user has role which is the definer. (SHOW CREATE PROCEDURE)
During show create procedure we ommited to check the current role, if it
is the actual definer of the procedure. In addition, we should support
indirectly granted roles to the current role. Implemented a recursive
lookup to search the tree of grants if the rolename is present.

SQL Standard 2016, Part 5 Section 53 View I_S.ROUTINES selects
ROUTINE_BODY and its WHERE clause says that the GRANTEE must be
either PUBLIC, or CURRENT_USER or in the ENABLED_ROLES.
2017-10-11 12:15:52 +03:00
Sachin Setiya
9534c04515 Bug Fix
Tests in galera_3nodes fails to start because galera_port , sst_port is
not defined.
2017-10-11 01:09:05 +05:30
Kentoku
13167e6489 Update Mroonga to the latest version on 2017-10-10T23:15:25+0900 2017-10-10 23:15:25 +09:00
Jan Lindström
fc9ff69578 MDEV-13838: Wrong result after altering a partitioned table
Reverted incorrect changes done on MDEV-7367 and MDEV-9469. Fixes properly
also related bugs:

MDEV-13668: InnoDB unnecessarily rebuilds table when renaming a column and adding index
MDEV-9469: 'Incorrect key file' on ALTER TABLE
MDEV-9548: Alter table (renaming and adding index) fails with "Incorrect key file for table"
MDEV-10535: ALTER TABLE causes standalone/wsrep cluster crash
MDEV-13640: ALTER TABLE CHANGE and ADD INDEX on auto_increment column fails with "Incorrect key file for table..."

Root cause for all these bugs is the fact that MariaDB .frm file
can contain virtual columns but InnoDB dictionary does not and
previous fixes were incorrect or unnecessarily forced table
rebuilt. In index creation key_part->fieldnr can be bigger than
number of columns in InnoDB data dictionary. We need to skip not
stored fields when calculating correct column number for InnoDB
data dictionary.

dict_table_get_col_name_for_mysql
        Remove

innobase_match_index_columns
        Revert incorrect change done on MDEV-7367

innobase_need_rebuild
        Remove unnecessary rebuild force when column is renamed.

innobase_create_index_field_def
        Calculate InnoDB column number correctly and remove
        unnecessary column name set.

innobase_create_index_def, innobase_create_key_defs
        Remove unneeded fields parameter. Revert unneeded memset.

prepare_inplace_alter_table_dict
        Remove unneeded col_names parameter

index_field_t
        Remove unneeded col_name member.

row_merge_create_index
        Remove unneeded col_names parameter and resolution.

Effected tests:
         innodb-alter-table : Add test case for MDEV-13668
         innodb-alter : Remove MDEV-13668, MDEV-9469 FIXMEs
                        and restore original tests
         innodb-wl5980-alter : Remove MDEV-13668,  MDEV-9469 FIXMEs
                        and restore original tests
2017-10-10 17:03:40 +03:00
Vesa Pentti
93aadda513 MDEV-13149 -- show function status now works with PAD_CHAR_TO_FULL_LENGTH 2017-10-10 16:16:12 +03:00
Sergei Golubchik
2db5e4d1f9 smaller stack size on quantal-x86 and wheezy-x86
fixes failures of func_regexp_pcre
2017-10-10 14:31:33 +02:00
Alexander Barkov
c2509a1588 MDEV-13972 crash in Item_func_sec_to_time::get_date 2017-10-10 10:35:12 +04:00
Vicențiu Ciorbaru
1cfcb58539 Fix oqgraph compilation with Boost versions <=1.49 2017-10-09 20:30:52 +03:00
Sergei Golubchik
9749568deb MDEV-13946 Server RPMs have dependency on "which"
SLES11 doesn't have a dedicated package for "which",
it's part of the "util-linux" package
2017-10-09 18:24:43 +02:00
Sergei Golubchik
9b11956e86 MDEV-13049 Querying INFORMATION_SCHEMA becomes slow in MariaDB 10.1
Optimizations:
* avoid faster ext_table_discovery_simple() *only* when there are
  engines with discover_table_names() method *and* they look at
  file names. P_S implements discover_table_names(), but it's not
  a reason to use slower extension_based_table_discovery().
* don't pre-sort table names if ORDER BY or GROUP BY was specified
* starting from 10.3 only sort table names for SHOW commands
2017-10-09 17:58:28 +02:00
Sergei Golubchik
559dec33cc cleanup: is_show_command(thd) 2017-10-09 17:58:28 +02:00
Sergei Golubchik
440157cbbe MDEV-13412 main.func_regexp_pcre fails in buildbot on ppc64le
Caused by 2fcd8c1252. It used the documented pcre API

 -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0)

to calculate the pcre stack frame size. Unfortunately, modern compilers
broke it by cloning and inlining pcre match() function. 2fcd8c1252
tried to workaround it by setting the stack frame size to at least 500.
It didn't work, 500 is not a universal constant.

Now we fix our copy of pcre to not inline or clone match() - so that
stack frame detection would work again - and detect at cmake time
whether system pcre is broken or usable.

Also use stack, not (much slower) malloc in bundled pcre, unless on Windows
2017-10-09 17:51:34 +02:00
Heinz Wiesinger
4d33c74224 MDEV-10980: Fix reverse queries in OQGRAPH. 2017-10-09 14:37:45 +03:00
Marko Mäkelä
172cc70bf8 MDEV-13446 fts_create_doc_id() unnecessarily allocates 8 bytes for every inserted row
fts_create_doc_id(): Remove.

row_mysql_convert_row_to_innobase(): Implement the logic of
fts_create_doc_id(). Reuse a buffer for the hidden FTS_DOC_ID.

row_get_prebuilt_insert_row(): Allocate a buffer for the hidden
FTS_DOC_ID at the end of prebuilt->ins_upd_rec_buff.
2017-10-09 12:18:12 +03:00
Andrii Nikitin
494d1bf885 MDEV-14010 merge issue in wsrep_sst_xtrabackup-v2 2017-10-09 10:22:47 +02:00
Elena Stepanova
bc85d22bf0 MDEV-12263 Feature: skipped test file
Post-fix: RedHat does not use rh-skipped-tests.list anymore
2017-10-09 02:49:50 +03:00
Elena Stepanova
9b897d663a MDEV-12263 Feature: skipped test file
A note about unstable-tests lists in mysql-test/README, RedHat
version of it, and also various changes to bring the file
up-to-date
2017-10-09 01:43:31 +03:00
Alexey Botchkov
5eb666ad37 MDEV-12705 10.1.18-MariaDB-1~jessie - mysqld got signal 11.
Space for the next operation wasn't reserved in
        Item_func_spatial_relate::val_str()
2017-10-07 14:17:45 +04:00
Alexander Barkov
ca948e335e MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant 2017-10-07 13:42:11 +04:00
Vladislav Vaintroub
01e656a685 Merge branch 'bb-10.1-wlad' into 10.1 2017-10-07 08:46:37 +00:00
Vladislav Vaintroub
bb3f4fbb59 MDEV-13310 Preparing an incremental backup twice can corrupt data
Remove .delta file after it was successfully applied
2017-10-07 08:30:20 +00:00
Vladislav Vaintroub
8d1fb47e1d MDEV-13798 - fix incorrect alignment of the buffer in incremental backup
This incorrect alignment can later lead to memcpy over buffer boundaries,
and to a crash.
2017-10-07 08:30:20 +00:00
Vladislav Vaintroub
0f8295d7d5 MDEV-13822 mariabackup incremental prepare incorrectly sets file size.
Fix incremental prepare to change file size while applying
delta file, if delta file contains page 0 with the new size.
2017-10-07 08:30:20 +00:00
Vladislav Vaintroub
420798a81a Refactor os_file_set_size to extend already existing files.
Change fil_space_extend_must_retry() to use this function.
2017-10-07 08:30:20 +00:00
Marko Mäkelä
f9b50c0657 MDEV-13512 buf_flush_update_zip_checksum() corrupts SPATIAL INDEX in ROW_FORMAT=COMPRESSED tables
In MariaDB Server 10.1, this problem manifests itself only as
a debug assertion failure in page_zip_decompress() when an insert
requires a page to be decompressed.

In MariaDB 10.1, the encryption of InnoDB data files repurposes the
previously unused field FILE_FLUSH_LSN for an encryption key version.
This field was only used in the first page of each file of the system
tablespace. For ROW_FORMAT=COMPRESSED tables, the field was always
written as 0 until encryption was implemented.

There is no bug in the encryption, because the buffer pool blocks will
not be written to files. Instead, copies of the blocks will be encrypted.
In these encrypted copies, the key version field will be updated before
the buffer is written to the file. The field in the buffer pool is
basically garbage that does not really matter.

Already in MariaDB 10.0, the memset() calls to reset this unused field
in buf_flush_update_zip_checksum() and buf_flush_write_block_low()
are unnecessary, because fsp_init_file_page_low() would guarantee that
the field is always 0 in the buffer pool (unless 10.1 encryption is
used).

Removing the unnecessary memset() calls makes page_zip_decompress()
happy and will prevent a SPATIAL INDEX corruption bug in
MariaDB Server 10.2. In MySQL 5.7.5, as part of WL#6968, the same
field was repurposed for an R-tree split sequence number (SSN) and
these memset() were removed. (Because of the repurposing, MariaDB
encryption is not available for tables that contain SPATIAL INDEX.)
2017-10-06 17:51:29 +03:00
Alexander Barkov
e30b6a983f MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value 2017-10-06 18:23:40 +04:00
Igor Babaev
dbeffabc83 Fixed the bug mdev-11574.
Do not build an index merge of two indexes when one index is
an infix of the other index.
2017-10-06 00:08:36 -07:00
Vladislav Vaintroub
0373e05a59 Refactor os_file_set_size() so it can be used to extend existing file,
not just for creating new files.

Use os_file_set_size() in fil_space_extend_must_retry()
2017-10-05 18:38:29 +00:00
Oleksandr Byelkin
bea99275de MDEV-13595: mariadb-10.2.8/storage/maria/ma_loghandler.c:2730]: (style) Array index 'chunk_offset' is used before limits check.
In fact just a cosmetic fix, code was safe because translog_get_first_chunk_offset return offsets inside the page.
2017-10-05 15:07:21 +02:00
Alexander Barkov
1cfaafafee MDEV-13242 Wrong results for queries with row constructors and information_schema 2017-10-05 13:41:16 +04:00
Jan Lindström
bb62a0ad99 Merge pull request #458 from darkain/patch-1
MDEV-13909 Fix wsrep_sst_rsync fails on debian
2017-10-04 07:59:25 +03:00
Vladislav Vaintroub
e6862cf1ff Windows MSI : dump server error log to MSI log on installation failure.
On failure, installer executes rollback actions, among them removing newly
created data directory with all files in it.

This patch makes installer at  dump mariadb error log to installer log,
before removing the files. This should make troubleshooting a little easier.
2017-10-03 00:13:58 +00:00
Vincent Milum Jr
98e09ee4b6 MDEV-13909 Fix wsrep_sst_rsync fails on debian
Fix for the following error messages during SST:
/usr/local/mysql/bin/wsrep_sst_rsync: 258: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
/usr/local/mysql/bin/wsrep_sst_rsync: 263: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
/usr/local/mysql/bin/wsrep_sst_rsync: 268: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
2017-10-02 13:21:00 -07:00
sachin
bcda03b4fa MDEV-13950 mysqld_safe could not start Galera node after upgrade ...
This is regression caused by patch of mdev-10767.

1st problem :- mktmp is invoked without '-t' or specifing tmp directory.
2nd problem :- Since eval_log_error redirect stderr to stdout  '2>' will
return nothing. and hence $wr_logfile will be empty.

Patch Credit:- Andrii Nikitin
2017-10-02 14:07:22 +05:30
Marko Mäkelä
ac0b5a2e79 Merge 10.0 into 10.1 2017-10-02 10:45:55 +03:00
Marko Mäkelä
de4a00d4f7 Merge 5.5 into 10.0 2017-10-02 10:42:55 +03:00
Marko Mäkelä
028d253dd7 MDEV-13980 InnoDB fails to discard record lock when discarding an index page
btr_cur_pessimistic_delete(): Discard a possible record lock also in
the case when the record was the only one in the page. Failure to
do this would corrupt the record lock data structures in a partial
rollback (ROLLBACK TO SAVEPOINT or rolling back a row operation due
to some error, such as a duplicate key in a unique secondary index).
2017-10-02 10:38:35 +03:00