Commit graph

186381 commits

Author SHA1 Message Date
Monty
bb702c2e4c Limit minium aria_block_size to 4096
MDEV-19585  Assertion with S3 table and flush_tables

The limit has to be increased so that MariaDB can create system tables.
It should not have any notable impact on performance.

There should not be any notable performance differences between 1K and 4K,
especially for temporary tables. In most cases using bigger blocks is also
faster (with the possible exception of doing key reads of not fixed length
keys).
2019-06-26 20:41:44 +03:00
Monty
4dbe6776fb MDEV-19585 Assertion with S3 table and flush_tables
The problem was two fault:
- flush_tables() wrongly gave errors when failing to open read only tables
- backup_block_ddl() didn't properly ignores errors from flush_tables()

The test case for this will be pushed in 10.5 as the test involves
S3 tables.
2019-06-26 19:58:27 +03:00
Eugene Kosov
12ce066edf MDEV-17441 InnoDB transition to C++11 atomics
os0once.h: remove as not used now
2019-06-26 13:12:30 +03:00
Eugene Kosov
adb640e25a MDEV-17441 InnoDB transition to C++11 atomics
zip_pad_info_t::mutex_created: remove along with corresponding stuff

zip_pad_info_t::mutex: make member value instead of a pointer
2019-06-26 13:12:29 +03:00
Eugene Kosov
52a5097764 MDEV-17441 InnoDB transition to C++11 atomics
dict_table_t::stats_latch_created: remove along with related stuff

dict_table_t::stats_latch: make value member, not pointer. And always lock this
for simplicity, even to stats cloned table.

based on the work of Sergey Vojtovich
2019-06-26 13:12:29 +03:00
Sergey Vojtovich
e9a5f288f2 MDEV-17441 - InnoDB transition to C++11 atomics
Get rid of os_once.
2019-06-26 13:12:29 +03:00
Vlad Lesin
878ad986fd MDEV-19464: Altering partitioned table into S3 causes an obscure error
The error occured because aria_copy_to_s3() function tried to copy .frm file
of partition, but partition does not have it's own .frm file. The same is true
for aria_rename_s3().

To fix this issue the new parameter was added to those two functions to specify
if .frm file must be copied or not. The parameter is set to 'false' for
partitions.

Also there was other issue with EXCHANGE PARTITION. Briefly, there is the
following sequence of operations(see  exchange_name_with_ddl_log() for details):
1) rename swap table to temporary table,
2) rename partition to swap table,
3) rename temporary table to partition.

On step (1) .frm file is renamed too. On step (2) the swap table does not
have .frm file, as partition does not have it. On step (3) partition will have
.frm file, because it will be renamed from temporary table. All of this causes
error on different stages of the table access. To fix it, .frm is not touched
at all for s3 during EXCHANGE PARTITION operation. This is implemented in
ha_s3::rename_table() by additional checking of
current_thd->lex->alter_info.partition_flags(see also ALTER_PARTITION_EXCHANGE
in sql_yacc.yy).
2019-06-26 13:01:32 +03:00
Sachin
04ee96199e MDEV-19049 Server crashes in check_duplicate_long_entry_key, ASAN stack-buffer-overflow in Field_blob::get_key_image
Long Unique keys should always be last unique key.
2019-06-26 11:31:26 +05:30
Alexander Barkov
6f3612fa4d MDEV-19861 Add intfastructure to have ENUM columns in INFORMATION_SCHEMA 2019-06-26 06:46:55 +04:00
Alexander Barkov
677133f1b3 MDEV-19863 Add const to TYPELIB pointers 2019-06-26 05:29:44 +04:00
Vladislav Vaintroub
9e0ed0fabd MDEV-19860 - do not produce huge strings wtih comp_sql anymore.
Limit lines to ~16K
2019-06-25 23:53:42 +02:00
Igor Babaev
1a518aa1d2 MDEV-19820 Wrong result with multiple single column index request
The bug occured when the optimizer decided to use a rowid filter built
by a range index scan to access an InnoDB table with generated clustered
index.
When a table is accessed by a secondary index Idx employing a rowid filter the
the value of pk contained in the found index tuple is checked against the
filter. A call of the handler function position is supposed to put the
pk value into the handler::ref buffer. However for generated clustered
primary keys it did not happened. The patch fixes this problem.
2019-06-25 08:06:39 -07:00
Monty
8d4c159b1b Added s3_debug to be able to debug s3 connections 2019-06-25 13:09:06 +03:00
Ian Gilfillan
65368255ff MDEV-6521: Update server HELP contents 2019-06-25 12:33:56 +03:00
Monty
e6297bbe37 Updated to latest libmarias3 2019-06-24 12:14:31 +03:00
Monty
6aebaafe03 Added S3 test case with InnoDB 2019-06-24 12:13:19 +03:00
Alexander Barkov
c62eaa7bdf MDEV-19843 Modify ST_FIELD_INFO to use Type_handler and LEX_CSTRING 2019-06-24 06:25:16 +04:00
Alexander Barkov
5e474f92b5 MDEV-19836 Reuse new I_S table definition helper classes for RocksDB 2019-06-24 06:25:16 +04:00
Eugene Kosov
a82e42fd13 NFC: refactor Field::is_equal() and related stuff
Make Field::is_equal() const and return bool as it's a naturally fitting
type for it. Also it's agrument was narrowed to Column_definition.

InnoDB can change type of some columns by itself. InnoDB-specific code used to
reside in Field_xxx:is_equal() methods. Now engine-specific stuff was
moved to a virtual methods of handler::can_convert{string,varstring,blob,geom}.
These methods are called by Field::can_be_converted_by_engine() which is a
double dispatch pattern.

Some InnoDB-specific code still resides in compare_keys_but_name(). It should
be moved from here someday to handler::compare_key_parts(...) or similar.

IS_EQUAL_WITH_REINTERPRET_COMPATIBLE_CHARSET
IS_EQUAL_WITH_REINTERPRET_COMPATIBLE_CHARSET_BUT_COLLATE: both was removed

IS_EQUAL_NO, IS_EQUAL_YES are not needed now and should be removed
along with deprecated handler::check_if_incompatible_data().

HA_EXTENDED_TYPES_CONVERSION: was removed as such logic is not needed now by
server code.

ALTER_COLUMN_EQUAL_PACK_LENGTH: was renamed to a more generic
ALTER_COLUMN_TYPE_CHANGE_BY_ENGINE
2019-06-22 14:09:12 +03:00
Eugene Kosov
854c219a7f MDEV-17301 Change of COLLATE unnecessarily requires ALGORITHM=COPY
Patch is about two cases:
1) On some collate changes it's possible to rebuild only secondary indexes
2) For non-indexed columns collate can be changed INSTANTly

Implemented mostly in Field_{string,varstring,blob}::is_equal().
Make this method return how exactly collationa differs.
This information is later used by fill_alter_inplace_info() to pass
correct info to engine.
2019-06-22 14:09:12 +03:00
Vladislav Vaintroub
72d3676fe5 remove workaround from MDEV-9409 2019-06-22 11:56:59 +02:00
Alexander Barkov
8d0983330f MDEV-19833 Reuse new I_S table definition helper classes for Mronga 2019-06-22 06:03:33 +04:00
Alexander Barkov
1cbbe35450 MDEV-19832 Reuse new I_S table definition helper classes for Spider 2019-06-22 05:45:48 +04:00
Alexander Barkov
e9a692fe1e MDEV-19819 ALTER from POINT to LINESTRING erroneously preserves POINT values 2019-06-21 17:18:28 +04:00
Alexander Barkov
1c27a050e5 MDEV-19818 Reuse new I_S table definition helper classes for TokuDB 2019-06-21 06:48:04 +04:00
Alexander Barkov
9561b0b47e MDEV-19810 Reuse new I_S table definition helper classes for InnoDB 2019-06-20 11:40:33 +04:00
Varun Gupta
8b576616b4 MDEV-19776: Assertion `to_len >= 8' failed in convert_to_printable with optimizer trace enabled
Introduced the convert_to_printable_required_length to return the correct length(taking into
consideration of dots in the case of error messages).
2019-06-20 12:03:32 +05:30
Marko Mäkelä
49e5323dbd Merge 10.4 into 10.5 2019-06-20 09:22:10 +03:00
Alexander Barkov
cfbd714868 MDEV-19774 Assertion `sec.se c() <= 0x7FFFFFFFL' failed in Item_func_from_unixtime::get_date 2019-06-20 09:48:34 +04:00
Vladislav Vaintroub
16ac8404ac MDEV-19787 Speedup Table_map_iterator, via compiler intrinsics
Use __builtin_ctzll on GCC/Clang and _BitScanForward/_BitScanForward64 on
MSVC to speed up Table_map_iterator::next_bit(), up to 3 times in benchmarks
2019-06-19 11:10:49 +02:00
Vladislav Vaintroub
4594d68d10 MDEV-19702 Refactor Bitmap<N> to be based on ulonglong, not on uint32
Removed Field_map, since it was used only in a single function.

Fixed is_indexed_agg_distinct(), since it relied on initialization of
Bitmap in constructor.
2019-06-19 11:10:49 +02:00
Marko Mäkelä
02979daab4 Merge 10.3 into 10.4 2019-06-19 10:49:00 +03:00
Marko Mäkelä
192aa295b4 Merge 10.2 into 10.3 2019-06-19 08:56:10 +03:00
Daniel Bartholomew
efbfcc8b73 bump the VERSION 2019-06-18 17:44:05 -04:00
Michael Widenius
8acbf9c1f9 MDEV-19595 fixed
The test cases for the MDEV found several independent bugs
in MariaDB server and Aria:
- If a temporary table was marked as crashed, it could never
  be deleted.
- Opening of a crashed temporary table gave an error message
  but the error was never forwarded to the caller which caused
  an assert() in my_ok()
- init_read_record() did mmap of all temporary tables, which is
  probably not a good idea as this area can potentially be
  very big. Changed code to only mmap internal temporary tables.
- mmap-ed tables where not unmapped in case of repair/optimize
  which caused bad data in table and crashes if the original
  table files where replaced with new ones (as the old mmap
  was still in place). Fixed by removing the mmap in case
  of repair.
- Cleaned up usage of code that disabled mmap in Aria
2019-06-19 00:35:44 +03:00
Sergei Golubchik
3db4d018b8 Merge branch 'bb-10.4-release' into 10.4 2019-06-18 15:26:16 +02:00
Michael Widenius
b23c82fef3 MDEV-18078 Assertion `trnman_has_locked_tables(trn) > 0' failed
Problem was that in case of implicit rollback for alter table
Aria did try to run commit twice.

The test case for this is tricky to do in 10.2, so it will
be added to 10.4 as part of BACKUP STAGE testing.
2019-06-18 14:32:24 +03:00
mkaruza
48570eb65c MDEV-18832 Galera: 10.4 node crashed with Assertion `state() == s_committing' if you create SEQUENCE, use it, then drop and recreate and use again (#1339)
We could still end committing to binlog even in rollback.
Do not proceed with WSREP commit in this case.
2019-06-18 12:36:29 +03:00
mkaruza
03f3ba2dcb MDEV-18940 Galera: Rolling upgrade: all nodes except upgraded node5 failed with Assertion `meta->gtid.seqno == wsrep_thd_trx_seqno(thd)' with SEQUENCEs (#1342)
Empty write sets will not trigger apply callback, and will not
update thread wsrep_trx_meta.gtid.seqno. Because of that assert will
be triggered when commit callback is called.
2019-06-18 12:29:54 +03:00
Marko Mäkelä
3c88ce4cd1 Merge 10.4 into 10.5 2019-06-18 11:30:06 +03:00
Vladislav Vaintroub
44d06cd39d Fix compile warning/error on Windows. 2019-06-18 09:02:52 +02:00
Alexander Barkov
5352e9687a MDEV-17363 - Compressed columns cannot be restored from dump
In collaboration with Sergey Vojtovich <svoj@mariadb.org>

The COMPRESSED clause is now a part of the data type and goes immediately
after the data type and length, but before the CHARACTER SET clause,
and before column attributes such as DEFAULT, COLLATE, ON UPDATE,
SYSTEM VERSIONING, engine specific column attributes.

In the old reduction, the COMPRESSED clause was a column attribute.

New syntax:
  <varchar or text data type> <length> <compression> <character set> <column attributes>
  <varbinary or blob data type> <length> <compression> <column attributes>

New syntax examples:
  VARCHAR(1000) COMPRESSED CHARACTER SET latin1 DEFAULT ''
  BLOB COMPRESSED DEFAULT ''

Deprecate syntax examples:
  VARCHAR(1000) CHARACTER SET latin1 COMPRESSED DEFAULT ''
  TEXT          CHARACTER SET latin1 DEFAULT '' COMPRESSED
  VARBINARY(1000) DEFAULT '' COMPRESSED

As a side effect:
- COMPRESSED is not valid as an SP label name in SQL/PSM routines any more
  (but it's still valid as an SP label name in sql_mode=ORACLE)

- COMPRESSED is now allowed in combination with GENERATED ALWAYS AS:

  TEXT COMPRESSED GENERATED ALWAYS AS REPEAT('a',1000)
2019-06-18 07:48:08 +04:00
Vladislav Vaintroub
10ebabc364 Windows related cleanups, remove old code.
- Do not scan registry to check if TCPIP is supported.
- Do not read registry under HKEY_LOCAL_MACHINE\SOFTWARE\MySQL anymore.
- Do not load threadpool function dynamically, it is available
since Win7.
- simplify win32_init_tcp_ip(), and return error of WSAStartup() fails.
- Correct comment in my_parameter_handler()
2019-06-18 00:37:10 +01:00
Vladislav Vaintroub
73be875c8e MDEV-19773 : simplify implementation of Windows rwlock
No need to do dynamic loading and fallbacks anymore.
We can safely assume Windows 7, and availability of all SRWLock functions.
2019-06-18 00:37:09 +01:00
Sergei Golubchik
b8e655ce02 bugfix: crash on the empty db name
followup for 0a43df4fbc
2019-06-17 23:41:43 +02:00
Sergei Golubchik
e85e4814ee 10.4.6 is stable, not gamma 2019-06-17 20:04:15 +02:00
Vladislav Vaintroub
71eea0c3fb Fix debug assert to match its intention.
Do not check my_errno before it is set, check errno instead.
Also, do not check errno, if prior pread() did not fail.
2019-06-17 19:01:15 +01:00
Vladislav Vaintroub
5804bb4ef0 MDEV-19750 mysql command wrong encoding
Restore the detection of default charset in command line utilities.
It worked up to 10.1, but was broken by Connector/C.

Moved code for detection of default charset from sql-common/client.c
to mysys, and make command line utilities to use this code if charset
was not specified on the command line.
2019-06-17 18:04:47 +01:00
Vladislav Vaintroub
81f60e8ade Portability fix. 2019-06-17 18:04:47 +01:00
Daniel Bartholomew
3784ed7a62 bump the VERSION 2019-06-17 10:51:41 -04:00