Commit graph

186320 commits

Author SHA1 Message Date
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
9ca517613a BUILD scripts: Don't build with-plugin-test_sql_discovery staticly 2019-06-26 23:32:30 +03:00
Vlad Lesin
5c5ea59bf8 MDEV-19867: fix mysqldump to by default not copy S3 tables
There are two options when coping S3 tables with mysqldump
(there is startup option --copy_s3_tables, boolean, default no)
1) Ignore all tables with engine S3, as the data is already safe in S3 and any
computer where you restore the backup will automatically discover the S3 table.
2) Copy the table as a normal table with the following 2 changes:
- Change ENGINE=S3 to ENGINE=ARIA;
- After copy add to log 'ALTER TABLE table_name ENGINE=S3'
2019-06-26 20:59:35 +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
Alexander Barkov
677133f1b3 MDEV-19863 Add const to TYPELIB pointers 2019-06-26 05:29:44 +04: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
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
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
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
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
306e439c6d MDEV-17592 Create MariaDB named commands/symlinks
post-merge fixes:
* .gitignore
* don't put the keyword COMPONENT into ${COMP} anymore
* don't alias mytop, but do alias mysql_client_test
* don't symlink manpages, use troff aliasing technique instead
  (symlinked manpages break rpm and out-of-source bintar builds)
* move debian to use troff aliased manpages, fix typos in debian files,
  put aliases in the correct packages, add more aliases to match
  rpm/bintar packaging
2019-06-17 12:26:26 +02:00
Rasmus Johansson
24503d5711 MDEV-17592 Create MariaDB named commands/symlinks 2019-06-17 12:26:26 +02:00
Sergei Golubchik
f02bc3cf0f change pam and disks plugin maturity beta->gamma 2019-06-17 12:26:26 +02:00
Sergei Golubchik
da619f010f compilation fix for fulltest-big 2019-06-17 12:26:26 +02:00
Sergei Golubchik
20bb4ed15e make the heap.heap test portable
in HEAP btree indexes, the address of a record in memory is part of the
key. So, when inserting many identical keys, the actual btree
shape is defined by how and where records in memory are allocated.

records_in_range uses floats to estimate the size of the chunk of the
btree between min and max records, it depends on the btree shape and,
thus, is not portable either. As are optimizer decisions that are based
on records_in_range estimations, if the number happens to be close
to a tipping point.

as a fix, reduce the number of matching rows, so that even with
system-specific variations the optimizer would still pick the
expected plan.

Fixes heap.heap failure (range vs ALL) on ppc64
2019-06-17 12:26:26 +02:00
Sergei Golubchik
13e8f728ec compilation failure on ppc with -DCMAKE_BUILD_TYPE=Debug
if ${CRC32_LIBRARY} target has no COMPILE_FLAGS yet,
GET_TARGET_PROPERTY returns COMPILE_FLAGS-NOTFOUND, which
doesn't work very well when it's later fed back into COMPILE_FLAGS.

GET_PROPERTY() returns an empty string in this case.
2019-06-17 12:26:25 +02:00
Sergei Golubchik
0933212036 C/C 2019-06-17 12:26:25 +02:00
Sergei Golubchik
a4cc6fb91f MDEV-15526 SysV init service deployed file '/etc/init.d/mysql' prevents systemctl disable command to work correctly (mariadb|mysql naming support) (debian/ubuntu)
mariadb service is controlled by systemd

Do not install SysV init script on Debian/Ubuntu in /etc/init.d/
put it in /usr/share/mysql in case the user would need it for something.

Use systemctl in pre/post scripts directly
without funky conditionals and wrapper scripts
2019-06-17 12:26:25 +02:00
Sergei Golubchik
0a43df4fbc MDEV-14735 better matching order for grants
fixes
MDEV-14732 mysql.db privileges evaluated on order of grants rather than hierarchically
MDEV-8269 Correct fix for Bug #20181776 :- ACCESS CONTROL DOESN'T MATCH MOST SPECIFIC HOST WHEN IT CONTAINS WILDCARD

reimplement the old ad hoc get_sort() function to use a wildcard
pattern ordering logic that works correctly in may be all practical cases.

get_sort() is renamed to catch merge errors at compilation time.
moved to a separate included file, because of a long comment.
2019-06-17 12:26:25 +02:00
Sergei Golubchik
fd00c449e3 bugfix: PROXY privilege matched usernames incorrectly
username can be empty, meaning anybody, or must match literally.
only db and host names are matched with wildcards.
2019-06-17 12:26:25 +02:00