Commit graph

21974 commits

Author SHA1 Message Date
Vladislav Vaintroub
4513e73e0f Remove os_aio_simulated_put_read_threads_to_sleep()
According to the code, it was Windows specific "simulated AIO"
workaround. The simulated s not supported on Windows anymore.

Thus, remove the dead code
2019-07-04 10:27:11 +02:00
Vladislav Vaintroub
bd917e0811 Fix clang-cl warnings 2019-07-04 10:27:10 +02:00
Alexander Barkov
9c9e0ac73d MDEV-19944 Remove GIS data types from keyword list in lex.h 2019-07-04 07:48:46 +04:00
Marko Mäkelä
695230c067 MDEV-19940: Fix integer type mismatch 2019-07-04 00:42:40 +03:00
Marko Mäkelä
8773bee9f7 MDEV-18582: Fix the 32-bit build 2019-07-04 00:30:14 +03:00
Marko Mäkelä
412533b4a7 MDEV-18582: Extend SHOW STATUS LIKE 'Innodb_%'
Many InnoDB internal variables and counters were only exposed
in an unstructured fashion via SHOW ENGINE INNODB STATUS.

Expose more variables via SHOW STATUS. Many of these were
exported in XtraDB.

Also, introduce SHOW_SIZE_T and use the proper size for
exporting the InnoDB variables.

Remove some unnecessary indirection via export_vars, and
bind some variables directly.

dict_sys_t::rough_size(): Replaces dict_sys_get_size()
and includes the hash table sizes.

This is based on a contribution by Tony Liu from ServiceNow.
2019-07-04 00:09:16 +03:00
Marko Mäkelä
61e26289fc MDEV-18582 preparation: Allocate ibuf statically 2019-07-04 00:09:16 +03:00
Marko Mäkelä
d09aec7a15 MDEV-19940 Clean up INFORMATION_SCHEMA.INNODB_ tables
Shorten some VARCHAR attributes to a more reasonable length.

INNODB_METRICS: Rename the column STATUS to ENABLED, and make it Boolean.

Replace with INT(1) many Boolean attributes that were declared as VARCHAR
containing 'NO','YES','disabled','enabled','Uninitialized','Initialized'.

Replace some VARCHAR attributes with ENUM.

Replace some BIGINT with INT when 32 bits are sufficient.

Remove INNODB_SYS_TABLESPACES.SPACE_TYPE. The type of a tablespace
can be derived from the tablespace ID. A fixed number is used for
the system tablespace and the temporary tablespace. All other tablespaces
are single-table or single-partition tablespaces.

i_s_locks_row_t::lock_type, lock_get_type_str(): Remove.
This is a redundant field. Table and record locks can be
distinguished by whether i_s_locks_row_t::lock_index is NULL.

fill_trx_row(): Do not unnecessarily copy the constant strings that
trx->op_info is pointing to.

i_s_locks_row_t::lock_mode: Replace string with integer.

lock_get_mode_str(), lock_get_trx_id(), lock_get_trx(): Remove.

field_store_ulint(): Remove.
2019-07-04 00:09:16 +03:00
Vladislav Vaintroub
0179aad633 Windows, compiling : Reenable /MP for connect engine.
Remove this flag only from domdoc.cpp, which uses #import directive.
2019-06-30 17:48:19 +02:00
Alexander Barkov
3e7e87ddcc MDEV-19897 Rename source code variable names from utf8 to utf8mb3 2019-06-28 12:37:04 +04:00
Monty
1a41fc77dd Merge remote-tracking branch 'origin/10.4' into 10.5 2019-06-27 01:21:41 +03:00
Monty
8e2a24bb33 Added s3_protocol_version=auto 2019-06-26 23:39:13 +03:00
Monty
0765d823e4 Updated to latest libmarias3 to fix some compatiblity issues 2019-06-26 23:39:12 +03:00
Monty
f48943468f MDEV-19575 Fixed assert in ma_pagecache
There was a bug in the page cache that didn't take into account that
another thread could be waiting for a page to be read by read_big_block().
Fixed by releasing all waiters in read_big_block()
2019-06-26 23:39:12 +03:00
Monty
f44c687815 S3: Don't do discover in mysql database (makes boot faster and safer) 2019-06-26 23:32:30 +03:00
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
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
Alexander Barkov
6f3612fa4d MDEV-19861 Add intfastructure to have ENUM columns in INFORMATION_SCHEMA 2019-06-26 06:46:55 +04: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
Monty
e6297bbe37 Updated to latest libmarias3 2019-06-24 12:14:31 +03: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
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
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
Marko Mäkelä
49e5323dbd Merge 10.4 into 10.5 2019-06-20 09:22:10 +03: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
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
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
Marko Mäkelä
3c88ce4cd1 Merge 10.4 into 10.5 2019-06-18 11:30:06 +03:00
Michael Widenius
c8b5fa4afc MDEV-19055 Failures with temporary tables and Aria
There was two separate problems:
- Aria pagecache didn't properly handle re-reading of blocks
  that have given errors before (this triggered an assert)
- temporary tables that where opened several times where
  not properly closed in ALTER, REPAIR or OPTIMIZE table

Other things
- Added a couple of asserts that will make it easier to
  find problems like this in the future.
2019-06-17 17:50:08 +03:00
Sergei Golubchik
da619f010f compilation fix for fulltest-big 2019-06-17 12:26:26 +02:00
Nikita Malyavin
a626abb669 Fix LEX_CSTRING passed as argument of printf-like functions 2019-06-17 19:31:17 +10:00
Marko Mäkelä
2b660fb4c2 mtr_t::is_block_dirtied(): Define inline 2019-06-16 15:55:09 +03:00
Marko Mäkelä
a94638f155 Clarify the purpose of MTR_LOG_NONE 2019-06-16 15:54:14 +03:00
Marko Mäkelä
e9795d0208 Add mtr_buf_t::for_each_block_in_reverse() const
Avoid unnecessary creation of named objects for invoking
mtr_buf_t::for_each_block_in_reverse().
2019-06-16 15:53:06 +03:00
Michael Widenius
fb5ee3ff96 Fixed that ma_test_all.sh works
Updated ma_test1 to reflect the change from MDEV-15458 where
ma_write() doesn't update current record position anymore.
2019-06-16 13:31:42 +03:00
Sergei Petrunia
93c84cc8f2 MDEV-17045: MyRocks tables cannot be updated when binlog_format=MIXED. 2019-06-16 12:13:52 +03:00
Vladislav Vaintroub
bf90a486c3 Do not use LEX_CSTRING in printf-like function 2019-06-14 23:52:13 +02:00
Oleksandr Byelkin
f66d1850ac Merge branch '10.3' into 10.4 2019-06-14 22:10:50 +02:00
Oleksandr Byelkin
4a3d51c76c Merge branch '10.2' into 10.3 2019-06-14 07:36:47 +02:00
Marko Mäkelä
e5fab61a73 MDEV-6275: Use a non-narrowing conversion
On 32-bit systems, sizeof(uint)==sizeof(long).
The C++11 narrowing cast would issue a warning due to the sign mismatch.
2019-06-14 07:53:42 +03:00