Commit graph

173079 commits

Author SHA1 Message Date
Daniel Black
19a7656fb1 safemalloc: warn, flush after fprintf
Corrects 94d722b6a4
2019-01-17 01:13:47 +04:00
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
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
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
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
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
Varun Gupta
d0d0f88f2c MDEV-13784: query causes seg fault
When we have a nested subquery then a subquery that was a dependent subquery
may change to an independent one when we optimizer the inner subqueries.
This is handled st_select_lex::optimize_unflattened_subqueries.
Currently a subquery that was changed to independent from dependent after optimization
phase incorrectly shows dependent in the output of Explain, this happens because we
don't update used_tables for the WHERE clause, ON clause, etc after the optimization phase.
2019-01-06 23:15:25 +05:30
Sergei Golubchik
b87eb04f77 Merge branch '5.5' into 10.0 2019-01-03 00:20:53 +01:00
Sergei Golubchik
884caeafba fix RHEL8 "ambiguous python shebang" build failures 2019-01-02 19:32:05 +01:00
Sergei Golubchik
32150d2513 compilation warning on Windows 2019-01-02 19:28:48 +01:00
Sergei Golubchik
2450fd67ed fix the test for 2019 2019-01-02 12:03:15 +01:00
Eugene Kosov
802ce9672f MDEV-18041 Database corruption after renaming a prefix-indexed column
This is a regression after MDEV-13671.

The bug is related to key part prefix lengths wich are stored in SYS_FIELDS.
Storage format is not obvious and was handled incorrectly which led to data
dictionary corruption.

SYS_FIELDS.POS actually contains prefix length too in case if any key part
has prefix length.

innobase_rename_column_try(): fixed prefixes handling

Tests for prefixed indexes added too.

Closes #1063
2018-12-29 22:57:05 +02:00
Marko Mäkelä
b74eb5a5fe row_drop_table_for_mysql(): Correct a parameter to innobase_format_name()
This fixes a regression that was introduced in MySQL 5.6.6
in an error handling code path, in the following change:

commit 024f363d6b5f09b20d1bba411af55be95c7398d3
Author: kevin.lewis@oracle.com <>
Date:   Fri Jun 15 09:01:42 2012 -0500

    Bug #14169459 INNODB; DROP TABLE DOES NOT DELETE THE IBD FILE
    FOR A TEMPORARY TABLE.
2018-12-28 12:28:16 +02:00
Sergei Golubchik
8634f7e528 Merge branch '5.5' into 10.0 2018-12-20 09:15:01 +01:00
Sachin
f16d4d4c6e MDEV-17720 slave_ddl_exec_mode=IDEMPOTENT does not handle DROP DATABASE
Relevant if exists flag are added for create database and drop database.
2018-12-19 23:47:26 +05:30
Varun Gupta
7e606a2d5c MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
Create a new constant MAX_DATA_LENGTH_FOR_KEY.
Replace the value of MAX_KEY_LENGTH to also include the LENGTH and NULL BYTES
of a field.
2018-12-19 10:38:46 +05:30
Varun Gupta
da4efd56aa Backported MDEV-11196(e4d10e09cf) and MDEV-10360(8a8ba1949b) to 10.0 2018-12-19 10:38:29 +05:30
Sergey Vojtovich
b0fd06a6f2 MDEV-15670 - unit.my_atomic failed in buildbot with Signal 11 thrown
Workaround glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20116
by making unittest threads joinable. It makes code better anyway.
2018-12-18 17:20:15 +04:00
Sergei Golubchik
65525550ab Don't default to bundled zlib
This reverts part of c54271723c
2018-12-17 21:47:14 +01:00
Varun Gupta
d1f399408d MDEV-6453: Assertion `inited==NONE || (inited==RND && scan)' failed in handler::ha_rnd_init(bool)
with InnoDB, joins, AND/OR conditions

The inited parameter handler is not initialised when we do a quick_select after a table scan.
2018-12-16 21:50:49 +02:00
Sergei Golubchik
1a7158b88a remove unsed variable 2018-12-13 19:51:40 +01:00
Sergey Vojtovich
15eaeace39 MDEV-16987 - ALTER DATABASE possible in read-only mode
Forbid ALTER DATABASE under read_only.
2018-12-13 20:52:23 +04:00
Marko Mäkelä
8e613458e1 Fix cmake -DWITH_PARTITION_STORAGE_ENGINE:BOOL=OFF
This is a backport of a part of
commit 18455ec3f1
from 10.1.
2018-12-13 12:37:40 +02:00
Marko Mäkelä
5ab91f5914 Remove space before #ifdef 2018-12-13 12:15:27 +02:00
Thirunarayanan Balathandayuthapani
5f5e73f1fe MDEV-17957 Make Innodb_checksum_algorithm stricter for strict_* values
Problem:

  Innodb_checksum_algorithm checks for all checksum algorithm to
validate the page checksum even though the algorithm is specified as
strict_crc32, strict_innodb, strict_none.

Fix:

   Remove the checks for all checksum algorithm to validate the page
checksum if the algo is specified as strict_* values.
2018-12-13 12:06:14 +02:00
Varun Gupta
ce1669af12 Fix compile error when building without the partition engine 2018-12-13 10:03:09 +05:30
Sergei Golubchik
b58f28725b Merge branch '5.5' into 10.0 2018-12-12 20:19:06 +01:00
Jiaye Wu
9eadef013e Fix UNICODE issue of dlerror
Current implementation is conflicting. If UNICODE is defined, FormatMessage() will be FormatMessageW(), and variable win_errormsg with type char can not be passed to it, which should be changed to TCHAR instead. Since we don't use UNICODE here, we can use FormatMessageA() directly to avoid conversion error.
```
my_global.h(1092): error C2664: 'DWORD FormatMessageW(D
WORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,va_list *)' : cannot convert argument 5 from 'char [2048]' to 'LPWSTR'
```
2018-12-12 12:36:28 +01:00
Eugene Kosov
d956709b4b MDEV-17833 ALTER TABLE is not enforcing prefix index size limit
ha_innobase::prepare_inplace_alter_table(): check max column length for every
index in a table, not just added in this particular ALTER TABLE with ADD INDEX ones.
2018-12-11 22:03:44 +03:00
Varun Gupta
4886d14827 MDEV-17032: Estimates are higher for partitions of a table with @@use_stat_tables= PREFERABLY
The problem here is EITS statistics does not calculate statistics for the partitions of the table.
So a temporary solution would be to not read EITS statistics for partitioned tables.

Also disabling reading of EITS for columns that participate in the partition list of a table.
2018-12-07 19:59:45 +05:30
Marko Mäkelä
12b1ba195c MDEV-17904 Crash in fts_is_sync_needed() after failed ALTER or CREATE TABLE
create_table_def(), ha_innobase::create(): Defer fts_optimize_add_table()
until after the table has been successfully created.
2018-12-07 13:12:39 +02:00
Sergei Golubchik
daca7e70d7 MDEV-17898 FLUSH PRIVILEGES crashes server with segfault
merge_role_db_privileges() was remembering pointers into Dynamic_array
acl_dbs, and later was using them, while pushing more elements into the
array. But pushing can cause realloc, and it can invalidate all pointers.

Fix: remember and use indexes of elements, not pointers.
2018-12-06 14:22:07 +01:00
Sergei Golubchik
eed0013bed correct order of arguments for Dynamic_array<>::CMP_FUNC2 2018-12-06 14:22:07 +01:00
Sergei Golubchik
8a37ce0767 cleanup: DYNAMIC_ARRAY -> Dynamic_array<ACL_DB> acl_dbs 2018-12-06 14:22:07 +01:00
Varun Gupta
17e8570285 Added a testcase for mdev-17734 2018-12-05 19:31:25 +05:30
Eugene Kosov
e8bb94ccc8 MDEV-16499 [10.1] ER_NO_SUCH_TABLE_IN_ENGINE followed by "Please drop the table and recreate" upon adding FULLTEXT key to table with virtual column
There was an incorrect check for MariaDB and InnoDB
tables fields count. Corruption was reported when there was no corruption.
Also, a warning message had incorrect field numbers for both MariaDB and InnoDB
tables.

ha_innobase::open(): fixed check and message
2018-11-30 01:15:30 +03:00
Sergei Golubchik
32b7d456d5 mysqltest: use a dynamically growing command buffer 2018-11-28 20:18:49 +01:00
Varun Gupta
14f6b0cdfd MDEV-17734: AddressSanitizer: use-after-poison in create_key_parts_for_pseudo_indexes
In this case we were trying to access memory for key_parts which we did not
assign for a fields because it did not any EITS statistics.
The check if EITS statistics for a column is avaialable or not was missing.
2018-11-20 20:16:38 +05:30
fran
c362ea3ffd Added Master_Host to the Replication information
Closes #3
2018-11-16 13:26:21 +01:00
Oleksandr Byelkin
a84d87fde8 Merge branch '5.5' into 10.0 2018-11-15 13:57:35 +01:00
Alexander Barkov
1956695c69 MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615
The fix for "MDEV-17698 MEMORY engine performance regression"
previously fixed this problem.

- Adding the test for MDEV-17724
- Re-recording wrong results for tests:
  * engines/iuds/r/insert_number
  * engines/iuds/r/update_delete_number
  which started to fail since MDEV-17698
2018-11-15 16:45:43 +04:00
Alexander Barkov
7f175595c8 Backport for "MDEV-17698 MEMORY engine performance regression"
Also, backporting a part of:
  MDEV-11485 Split Item_func_between::val_int() into virtual methods in Type_handler
for easier merge to 10.3.
2018-11-15 06:35:37 +04:00
Oleksandr Byelkin
47274d902e fix of test suite 2018-11-14 15:46:53 +01:00
Oleksandr Byelkin
6cecb10a2f MDEV-11167: InnoDB: Warning: using a partial-field key prefix in search, results in assertion failure or "Can't find record" error
Fix ha_rnd_init() argument (we do not doing scan but use rnd_pos)
2018-11-07 09:25:12 +01:00
Marko Mäkelä
5f29fdecc0 Merge 5.5 into 10.0 2018-11-07 08:02:18 +02:00
Anel Husakovic
9c026273a9 Add implementation in .h and delete unneccessery printing 2018-11-06 12:07:26 +00:00
Marko Mäkelä
db55b39fb2 Revert some InnoDB/XtraDB changes
The relevant InnoDB/XtraDB fixes up to 5.6.42 had already
been applied to MariaDB in commit 30c3d6db32.

Revert some changes that appeared in
the merge commit 87d852f102.
2018-11-05 16:47:14 +02:00
Eugene Kosov
03977e8273 MDEV-13671 InnoDB should use case-insensitive column name comparisons like the rest of the server
Problem affects INPLACE ALTER rename columns.

innobase_rename_column_try(): some strcmp() was replaced with my_strcasecmp(),
queries to update data dictionary was updated to not match column name case.
2018-11-05 11:59:59 +02:00
Oleksandr Byelkin
b68d8a05d3 MDEV-17401: LOAD DATA from very big file into MyISAM table results in EOF error and corrupt index
my_read fixed as in higher versions.
my_pread made as my_read aware of partial read of huge chunks of files
MY_FULL_IO enabled for file operations
2018-11-02 18:01:49 +01:00