Commit graph

182594 commits

Author SHA1 Message Date
Eugene Kosov
748ef3ec91 MDEV-15991 Server crashes in setup_on_expr upon calling SP or function executing DML on versioned tables
Do not try to set versioning conditions on every SP call. It may work
incorrectly, but it's a general bug described in MDEV-774.
This patch makes system versioning stuff consistent with other code and
also fixes a use-after-free bug.

Closes #756
2018-06-03 23:25:43 +02:00
Aleksey Midenkov
b1efff46cd Vers cleanups
* Always-false vers_select_conds_t::from_query
* Debug helpers

Closes #684
2018-06-03 23:25:43 +02:00
Sergei Golubchik
486682b1da cleanup: vers tests, remove create_table procedure 2018-06-03 23:25:43 +02:00
Otto Kekäläinen
898a8c3c0c Deb: Disable PIE in debian/rules on older Debian/Ubuntu releases
This partially reverts commit dc0a76600b.
2018-06-02 21:32:18 +03:00
Yuqi
ee5124d714 Make MariaDB CRC32-lib platform independence (#780)
Make mariadb crc32 lib platform independent

It looks strange that someone can make use of 2 crc libraries
(Power64 or AArch64) at the same time.

The patch sets macros 'CRC32_LIBRARY' to make platform independence as an optional crc32 library.

Change-Id: I68bbf73cafb6a12f7fb105ad57d117b114a8c4af
Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
2018-06-01 14:06:01 +04:00
Marko Mäkelä
db677cc6ef Follow-up to MDEV-14168: Correct INNOBASE_DEFAULTS
INNOBASE_DEFAULTS: Replace ALTER_ADD_COLUMN with the more appropriate
ALTER_ADD_STORED_BASE_COLUMN. This clean-up causes no change of
behaviour, because ALGORITHM=INPLACE would be refused for
ALTER_ADD_STORED_GENERATED_COLUMN, and default values are not computed
nor substituted for ALTER_ADD_VIRTUAL_COLUMN.
2018-05-31 22:52:56 +03:00
Vladislav Vaintroub
5a61fa9882 MDEV-16345 : No upgrade wizard in 10.3 in Windows packages.
Disable /permissive- flag, so MFC  is found, and upgrade_wizard is built.

MFC code is not standard C++, so it doesn not play well with /permissive-
2018-05-30 21:37:51 +00:00
Marko Mäkelä
682e7b8ff4 MDEV-16334 Incorrect ALTER TABLE for changing column option
commit 2dbeebdb16 accidentally changed
ALTER_COLUMN_OPTION and ALTER_COLUMN_STORAGE_TYPE to be separate flags.
InnoDB and Mroonga are only checking for the latter;
the example storage engine is checking for the former only.

The impact of this bug should be incorrect operation of Mroonga when
the column options GROONGA_TYPE, FLAGS are changed.

InnoDB does not define any column options, only table options,
so the flag ALTER_COLUMN_OPTION should never have been set.

Also, remove the unused flag ALTER_DROP_HISTORICAL.
2018-05-30 14:35:34 +03:00
Marko Mäkelä
c0f9771058 After-merge fixes
Fix type mismatches in the unit test mdev10259().

btr_search_info_get_ref_count(): Do not return early if !table->space.
We can simply access table->space_id even after the tablespace has
been discarded.

btr_get_search_latch(): Relax a debug assertion to allow
!index->table->space.
2018-05-30 10:06:29 +03:00
Otto Kekäläinen
00677b368b Deb: Import default.mk instead of only the subset buildflags.mk
Include all the Makefiles that define variables that can be useful
within debian/rules. This includes buildflags.mk as well.

Use the standard variable names and don't define our own.
2018-05-29 23:52:47 +03:00
James Clarke
26d50036d9 Deb: Fix FTBFS on non-Linux architectures that don't support systemd
For details see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852728
2018-05-29 23:52:47 +03:00
Adrian Bunk
dc0a76600b Deb: Don't disable PIE in debian/rules, it's enabled anyway
For details see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865737
2018-05-29 23:52:46 +03:00
Otto Kekäläinen
a2499a2d46 Deb: Clean away legacy rules sections which no longer have a function 2018-05-29 23:52:46 +03:00
Marko Mäkelä
a3539bbb2a Merge 10.2 into 10.3 2018-05-29 17:34:49 +03:00
Marko Mäkelä
6f96ff7268 Allow tests to work with cmake -DPLUGIN_PARTITION=NO 2018-05-29 17:14:34 +03:00
Marko Mäkelä
7269c70821 Add an end-marker to ease future merges 2018-05-29 16:52:59 +03:00
Marko Mäkelä
18934fb583 Merge 10.1 into 10.2 2018-05-29 16:52:12 +03:00
Marko Mäkelä
6aa50bad39 MDEV-16283 ALTER TABLE...DISCARD TABLESPACE still takes long on a large buffer pool
Also fixes MDEV-14727, MDEV-14491
InnoDB: Error: Waited for 5 secs for hash index ref_count (1) to drop to 0
by replacing the flawed wait logic in dict_index_remove_from_cache_low().

On DISCARD TABLESPACE, there is no need to drop the adaptive hash index.
We must drop it on IMPORT TABLESPACE, and eventually on DROP TABLE or
DROP INDEX. As long as the dict_index_t object remains in the cache
and the table remains inaccessible, the adaptive hash index entries
to orphaned pages would not do any harm. They would be dropped when
buffer pool pages are reused for something else.

btr_search_drop_page_hash_when_freed(), buf_LRU_drop_page_hash_batch():
Remove the parameter zip_size, and pass 0 to buf_page_get_gen().

buf_page_get_gen(): Ignore zip_size if mode==BUF_PEEK_IF_IN_POOL.

buf_LRU_drop_page_hash_for_tablespace(): Drop the adaptive hash index
even if the tablespace is inaccessible.

buf_LRU_drop_page_hash_for_tablespace(): New global function, to drop
the adaptive hash index.

buf_LRU_flush_or_remove_pages(), fil_delete_tablespace():
Remove the parameter drop_ahi.

dict_index_remove_from_cache_low(): Actively drop the adaptive hash index
if entries exist. This should prevent InnoDB hangs on DROP TABLE or
DROP INDEX.

row_import_for_mysql(): Drop any adaptive hash index entries for the table.

row_drop_table_for_mysql(): Drop any adaptive hash index for the table,
except if the table resides in the system tablespace. (DISCARD TABLESPACE
does not apply to the system tablespace, and we do no want to drop the
adaptive hash index for other tables than the one that is being dropped.)

row_truncate_table_for_mysql(): Drop any adaptive hash index entries for
the table, except if the table resides in the system tablespace.
2018-05-29 14:00:20 +03:00
Marko Mäkelä
b7985a45a6 Fix type mismatch 2018-05-29 08:55:07 +03:00
Marko Mäkelä
35a9c90fff MDEV-14589 InnoDB should not lock a delete-marked record
When the transaction isolation level is SERIALIZABLE, or when
a locking read is performed in the REPEATABLE READ isolation level,
InnoDB must lock delete-marked records in order to prevent another
transaction from inserting something.

However, at READ UNCOMMITTED or READ COMMITTED isolation level or
when the parameter innodb_locks_unsafe_for_binlog is set, the
repeatability of the reads does not matter, and there is no need
to lock any records.

row_search_for_mysql(): Skip locks on delete-marked committed records
upfront, instead of invoking row_unlock_for_mysql() afterwards.
The unlocking never worked for secondary index records.
2018-05-29 08:54:33 +03:00
Marko Mäkelä
8a42ad7a5d MDEV-13834 10.2 wrongly recognizes 10.1.10 innodb_encrypt_log=ON data as after-crash and refuses to start
infos[]: Allocate enough entries to accommodate all keys from both
checkpoint pages.

infos_used: The size of infos[].

get_crypt_info(): Merge to the only caller, log_crypt_101_read_block().

log_crypt_101_read_block(): Do not validate the log block checksum,
because it will not be valid when upgrading from MariaDB 10.1.10.
Instead, check that the encryption key exists.

log_crypt_101_read_checkpoint(): Append to infos[] instead of overwriting.
2018-05-28 14:31:31 +03:00
Sergei Petrunia
1a8afb4885 MDEV-16310: rocksdb.check_ignore_unknown_options fails on OS X
Use a compatible xargs command-line arguments.
2018-05-28 13:02:48 +03:00
Otto Kekäläinen
c98e6d4b3d Deb: Remove dependencies on packages that are 'essential' anyway
All packages in group 'essential' are by default installed on all
Debian and Ubuntu systems, and there is no need to mark them as
dependencies for any binary.
2018-05-28 11:32:22 +03:00
Otto Kekäläinen
44e7ec193e Deb: Extend new package descriptions to meet Lintian minimum criteria 2018-05-28 11:32:22 +03:00
Otto Kekäläinen
d46ebfb5b6 Deb: Mark binary package architectures correctly
(This change matches how debian/control is in downstream Debian.org)
2018-05-28 11:32:22 +03:00
Otto Kekäläinen
0a2ef601e0 Deb: Skip building RocksDB, TokuDB and using jemalloc on certain archs
(This change matches how debian/rules is in downstream Debian.org)
2018-05-28 11:32:21 +03:00
Otto Kekäläinen
548ec3a088 Deb: Update documentation and fix spelling errors 2018-05-28 11:32:21 +03:00
Kristien Nielsen
c902d5a4de Apply debian/patches/61_replace_dash_with_bash_mbug675185.dpatch
We have carried along this patch as a patch inside our sources
since 2012 (commit cfd4fcb0bc).

The validity of this has thus been vetted in production for years
and the review done now did not find otherwise.

A race in dash causes mysqld_safe to occasionally loop infinitely.
Fix by using bash instead.

https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/675185

As this is the last patch, we can also clean away usage of dpatch.
2018-05-28 11:32:21 +03:00
Christian Hammers
64094e12c0 Apply debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch
We have carried along this patch as a patch inside our sources
since 2012 (commit cfd4fcb0bc).

This same patch has been used also in MySQL packaging at Oracle
and in downstream Debian.org packages for both MySQL and MariaDB.

The validity of this has thus been vetted in production for years
and the review done now did not find otherwise.

Code contributed to Oracle with
http://forge.mysql.com/wiki/Sun_Contributor_Agreement

Reported as http://bugs.mysql.com/bug.php?id=31361
2018-05-28 11:32:21 +03:00
Monty
58721c3e38 MDEV-16286 Killed CREATE SEQUENCE leaves sequence in unusable state
Fixed by deleting the sequence if we where not able to initialize it

I also noticed that we didn't always set the error message when
check_killed(), which could lead to aborted queries without error
beeing properly set. Fixed by default setting error message if
check_error() noticed that killed had been called.
This allowed me to remove a lot of calls to thd->send_kill_message().
2018-05-27 19:47:17 +03:00
Monty
b3a2761807 Remove warning when using ScopedStatementReplication 2018-05-27 19:47:17 +03:00
Monty
3e03b3dc15 Extended vcol.update with checking if statement worked 2018-05-27 19:47:17 +03:00
Monty
afbea676de Fixed wrong usage of variable in ha_sphinx.cc
This only affected printing of errors
2018-05-27 19:47:17 +03:00
Monty
13c241c64f Fixed memory overrun in binlog_encryption.encrypted_master
Problem was that max_row_lengt() used different bitmap
than pack_row()
2018-05-26 17:03:00 +03:00
Monty
2d62a4cb2f Updated results for galera_encrypt_tmp_files 2018-05-26 17:01:42 +03:00
Monty
d8da920264 MDEV-10679 Crash in performance schema and partitioning with discovery
Crash happened because in discover, table->work_part_info was not properly
reset before execution.
Fixed by resetting before calling execute alter table, create table or
mysql_create_frm_image.
2018-05-26 12:49:25 +03:00
Monty
199517f501 Avoid warnings in String::copy when copying string on itself (ok to do) 2018-05-26 12:49:25 +03:00
Monty
5a16fe0e6f Fixed compiler warnings
When merging this with 10.2 and later, one can just use the 10.2 or later code
2018-05-26 12:49:25 +03:00
Monty
29dbb23fb7 MDEV-16093 Memory leak with triggers
Problem was that blob memory allocated in Table_trigger_list was not
properly freed
2018-05-26 12:49:25 +03:00
Sergey Vojtovich
aeaac6ca76 moved include <cmath> from my_global.h 2018-05-26 13:31:12 +04:00
Sergey Vojtovich
8f888ab1d8 Cleanup log2() portability checks 2018-05-26 13:30:13 +04:00
Sergey Vojtovich
3e63fa6eb3 Cleanup rint() portability checks 2018-05-26 13:27:50 +04:00
Sergey Vojtovich
7ffd7fe962 Cleanup isnan() portability checks 2018-05-26 13:26:32 +04:00
Sergey Vojtovich
bc469a0bdf Cleanup isinf() portability checks
Original problem reported by Wlad: re-compilation of 10.3 on top of 10.2
build would cache undefined HAVE_ISINF from 10.2, whereas it is expected
to be 1 in 10.3.

std::isinf() seem to be available on all supported platforms.
2018-05-26 13:17:22 +04:00
Sergei Golubchik
9e22cae1cf embedded use-after-free ASAN error
Close MYSQL (and destroy THD) in the same thread where it was used,
because THD embeds MDL_context, that owns some LF_PINS, that remember
a pointer to my_thread_var->stack_ends_here.
2018-05-25 18:24:06 +02:00
Andrei Elkin
3bbc30c73b MDEV-13727 top-level query timestamp reset at stored func/trigger internal statements
Being executed under slow_log is ON the test revealed a "side-effect"
in MDEV-8305 implementation which inadvertently made the trigger or
stored function statements to reset the top-level query's
THD::start_time et al. (Details of the test failure analysis are footnoted).
Unlike the SP case the SF and Trigger's internal statement should not
do that.

Fixed with revising the MDEV-8305 decision to backup/reset/restore
the session timestamp inside sp_instr_stmt::execute(). The timestamp
actually remains reset in the SP case by its caller per statement basis by ever
existing logics.

Timestamps related tests are extended to cover the trigger and stored function case.

Note, commit 3395ab7324 is reverted as its struct QUERY_START_TIME_INFO
declaration is not in use anymore after this patch.

Footnote:
--------
Specifically to the failing test, a query on the master was logged
okay with a timestamp of the query's top-level statement but its post
update trigger managed to compute one more (later) timestamp which got
inserted into another table. The latter table master-vs-slave
no fractional part timestamp discrepancy became evident
thanks to different execution time of the trigger combined with the
fact of the logged with micro-second fractional part master timestamp
was truncated on the slave. On master when the fractional part was
close to 1 the trigger execution added up its own latency to overflow
to next second value. That's how the master timestamp surprisingly
turned out to bigger than the slave's one.
2018-05-25 14:57:48 +03:00
Marko Mäkelä
83ec8c88c6 Make a test independent of VERSION 2018-05-25 14:27:34 +03:00
Daniel Bartholomew
c86ea54003 bump the VERSION 2018-05-24 22:13:02 -04:00
Vladislav Vaintroub
b8fdd56a4d Fix conversion warnings/errors. 2018-05-24 20:11:52 +00:00
Marko Mäkelä
6f01c42fd6 Merge 10.2 into 10.3 2018-05-24 22:36:40 +03:00