Commit graph

176589 commits

Author SHA1 Message Date
Alexey Botchkov
766ab17329 MDEV-11544 innodb_gis.precise fails in buildbot on Power.
Test fixed.
2017-02-10 01:24:54 +04:00
Alexey Botchkov
25aaecb240 MDEV-11858 json_merge() concatenates instead of merging.
Fix json_merge implementation.
2017-02-10 01:05:27 +04:00
Vladislav Vaintroub
de49fd842a RocksDB : Add lookup / compiling with optional compression libraries.
This change add WITH_ROCKSDB_{LZ4,BZIP2,ZSTD,snappy} CMake variables
that can be set to ON/OFF/AUTO.

If variable has default value AUTO, rocksdb links with corresponding
compression library. OFF disables compiling/linking with specific compression
library, ON forces compiling with it (cmake would throw error if library
is not available)

Support for ZLIB is added unconditionally, as it is always there.
2017-02-09 16:55:02 +00:00
Alexey Botchkov
3ae038b732 MDEV-11857 json_search() shows "Out of memory" with empty key.
Test result updated.
2017-02-09 17:55:58 +04:00
Marko Mäkelä
777422070a Adjust a test that is not supposed to crash.
This is follow-up to commit 1293e5e59b.
2017-02-09 16:04:02 +02:00
Sergei Golubchik
ddb284afaa MDEV-11601 Out-of-bounds string access in create_schema_table()
in Item_partition_func_safe_string(THD *thd, const char *name_arg,
uint length, CHARSET_INFO *cs= NULL), the 'name_arg' is the value
of the string constant and 'length' is the length of this constant,
so length == strlen(name_arg).
2017-02-09 16:03:56 +02:00
Marko Mäkelä
5ffbd084f5 Revert an accidental commit to work around MDEV-11601. 2017-02-09 16:02:57 +02:00
Alexey Botchkov
0e6968c244 MDEV-11857 json_search() shows "Out of memory" with empty key.
We should be ready for an empty key.
2017-02-09 17:38:53 +04:00
Marko Mäkelä
66c6188a4b Relax assertions on shutdown after aborted startup.
A proper InnoDB shutdown after aborted startup was introduced
in commit 81b7fe9d38.

Also related to this is MDEV-11985, making read-only shutdown more robust.

If startup was aborted, there may exist recovered transactions that were
not rolled back. Relax the assertions accordingly.
2017-02-09 10:18:46 +02:00
Marko Mäkelä
070a8754c4 MDEV-12024 InnoDB startup fails to wait for recv_writer_thread to finish
recv_writer_thread(): Do not assign recv_writer_thread_active=true
in order to avoid a race condition with
recv_recovery_from_checkpoint_finish().

recv_init_crash_recovery_spaces(): Assign recv_writer_thread_active=true
before creating recv_writer_thread.
2017-02-08 15:42:15 +02:00
Vladislav Vaintroub
bae2fc1f38 More verbose output for the Wix linker (light.exe)
This is an attempt to workaround buildbot
"1200 seconds without output, killing process"
2017-02-08 12:19:28 +00:00
Marko Mäkelä
3c411e3ad6 Test fix for MDEV-6076 Persistent AUTO_INCREMENT for InnoDB
Before killing the server, ensure that the redo log for the
incomplete transaction is flushed, so that the AUTO_INCREMENT
sequence will always be updated. Usually the INSERT
transaction would not have persisted the sequence before the
server was killed, but sometimes it could happen, causing
result mismatch.

Note: This test used to be called innodb_fts.innodb_fts_misc_debug.
2017-02-08 12:48:25 +02:00
Marko Mäkelä
9fa20716b6 Remove some more error log spam.
Do not effectively set DEBUG_DBUG='d' by setting DEBUG_DBUG='-d,...'.
Instead, restore the saved value of DEBUG_DBUG.

Also, split the test innodb_fts.innodb_fts_misc_debug into
innodb_fts.crash_recovery and innodb_fts.misc_debug, and enable
these tests for --valgrind, the latter test for --embedded,
and the former tests for the non-debug server.
2017-02-08 12:36:07 +02:00
Oleksandr Byelkin
a75633b5bd MDEV-11681: PARTITION BY LIST COLUMNS with default partition: Assertion `part_info->num_list_values' failed in get_part_iter_for_interval_cols_via_map
process adge case with only default partition
2017-02-08 10:22:42 +01:00
Jan Lindström
7b27465e10 MDEV-11974: MariaDB 10.2 encryption does not support spatial indexes
Encryption stores used key_version to
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION (offset 26)
field. Spatial indexes store RTREE Split Sequence Number
(FIL_RTREE_SPLIT_SEQ_NUM) in the same field. Both values
can't be stored in same field. Thus, current encryption
implementation does not support encrypting spatial indexes.

fil_space_encrypt(): Do not encrypt page if page type is
FIL_PAGE_RTREE (this is required for background
encryption innodb-encrypt-tables=ON).

create_table_info_t::check_table_options() Do not allow creating
table with ENCRYPTED=YES if table contains spatial index.
2017-02-08 09:05:15 +02:00
Alexander Barkov
163ac07b93 MDEV-12020 ctype tests are non-deterministic due to missing sorting 2017-02-08 06:47:39 +04:00
Vicențiu Ciorbaru
241e8a15a2 Ignore "invisible" files 2017-02-07 22:15:11 +02:00
Vicențiu Ciorbaru
e2f3739aa1 Ignore dynamically generated build_version.cc file 2017-02-07 22:15:05 +02:00
Vicențiu Ciorbaru
f46176cbef Make rocksdb build with clang
We need to provide -fPIC for ROCKSDB files as well as -frtti if we
compile with Clang
2017-02-07 22:14:59 +02:00
Vicențiu Ciorbaru
840f8eab71 Make mysql_ldb work on clang 2017-02-07 22:14:52 +02:00
Vicențiu Ciorbaru
884fd9ac2b Make RocksDB run git submodule init and update if rocksdb is not fetched 2017-02-07 22:14:44 +02:00
Alexey Botchkov
abe6aca8d4 MDEV-11554 innodb_gis.precise fails in buildbot on Power.
Usual '8' turns into 7.9999999 on Power. Test case fixed.
2017-02-07 17:32:50 +04:00
Marko Mäkelä
92bbf4ad04 MDEV-11782 WIP: Support upgrade from MariaDB 10.1.
recv_log_format_0_recover(): Invoke log_decrypt_after_read() after
reading the old-format redo log buffer.

With this change, we will upgrade to an encrypted redo log that
is misleadingly carrying a MySQL 5.7.9 compatible format tag while
the log blocks (other than the header and the checkpoint blocks)
are in an incompatible, encrypted format.
That needs to be fixed by introducing a new redo log format tag that
indicates that the entire redo log is encrypted.
2017-02-07 11:55:16 +02:00
Marko Mäkelä
b40a1fbc93 MDEV-11782 WIP: Clean up the code, and add a test.
LOG_CHECKPOINT_ARRAY_END, LOG_CHECKPOINT_SIZE: Remove.

Change some error messages to refer to MariaDB 10.2.2 instead of
MySQL 5.7.9.

recv_find_max_checkpoint_0(): Do not abort when decrypting one of the
checkpoint pages fails.
2017-02-07 11:55:16 +02:00
Marko Mäkelä
c5fc3a903c MDEV-12004 InnoDB wrongly thinks that a column is indexed
after failed ADD UNIQUE INDEX

check_col_exists_in_indexes(): Add the parameter only_committed.
When considering committed indexes, evaluate index->is_committed().
Else, evaluate index->to_be_dropped.

rollback_inplace_alter_table(): Invoke check_col_exists_in_indexes()
with only_committed=true.
2017-02-07 11:55:16 +02:00
Jan Lindström
2aa47d9849 MDEV-11035: Restore removed disallow-writes for Galera
Galera disallow-writes feature was lost in InnoDB 5.7 merge
to 10.2. This patch restores this feature and fixes test
failure on test galera.galera_var_innodb_disallow_writes.
2017-02-07 11:36:36 +02:00
Igor Babaev
c16c9e8e76 Fixed bug mdev-11999.
This patch complements the patch for bug 11138.
Without this patch some table-less queries with window functions
could cause crashes due to a memory overwrite.
2017-02-06 22:12:53 -08:00
Sergei Petrunia
7468ccfadf Copy of
commit d1bb19b8f751875472211312c8e810143a7ba4b6
Author: Manuel Ung <mung@fb.com>
Date:   Fri Feb 3 11:50:34 2017 -0800

    Add cardinality stats to information schema

    Summary: This adds cardinality stats to the INFORMATION_SCHEMA.ROCKSDB_INDEX_FILE_MAP table. This is the only missing user collected properties from SST files that we don't expose, which is useful for debugging cardinality bugs.

    Reviewed By: hermanlee

    Differential Revision: D4509156

    fbshipit-source-id: 2d3918a
2017-02-06 17:39:08 +00:00
Marko Mäkelä
2f00b73a4b MDEV-11985 Make innodb_read_only shutdown more robust
If InnoDB is started in innodb_read_only mode such that
recovered incomplete transactions exist at startup
(but the redo logs are clean), an assertion will fail at shutdown,
because there would exist some non-prepared transactions.

logs_empty_and_mark_files_at_shutdown(): Do not wait for incomplete
transactions to finish if innodb_read_only or innodb_force_recovery>=3.
Wait for purge to finish in only one place.

trx_sys_close(): Relax the assertion that would fail first.

trx_free_prepared(): Also free recovered TRX_STATE_ACTIVE transactions
if innodb_read_only or innodb_force_recovery>=3.

Also, revert my earlier fix to MySQL 5.7 because this fix is more generic:

Bug#20874411 INNODB SHUTDOWN HANGS IF INNODB_FORCE_RECOVERY>=3
SKIPPED ANY ROLLBACK

trx_undo_fake_prepared(): Remove.

trx_sys_any_active_transactions(): Revert the changes.
2017-02-06 10:45:18 +02:00
Marko Mäkelä
a440d6ed3a MDEV-11948 innodb.log_file fails in buildbot on CentOS 5
Rewrite the test so that the main server is restarted, instead of
--exec $MYSQLD_CMD. In this way, the test can be run with Valgrind
and with any --mysqld=--innodb-page-size.

Also remove the workaround --skip-innodb-use-native-aio. It should
not be needed when we are inheriting the server parameters from
the test environment.
2017-02-06 10:45:18 +02:00
Marko Mäkelä
3534500b87 Test recovery when a .ibd file is a directory.
Datafile::validate_for_recovery(): Remove a redundant error message.
An error is already reported by Datafile::open_read_write() if the
file cannot be opened.

Also, do not assign SEARCH_ABORT, so that the full test will be executed
even if one step fails.
2017-02-06 10:45:18 +02:00
Marko Mäkelä
5a21094a43 Simplify innodb.innochecksum test.
There already are ROW_FORMAT=COMPRESSED tests in innodb_zip.innochecksum_2.

Use shutdown_mysqld.inc and start_mysqld.inc.
2017-02-06 10:45:18 +02:00
Alexey Botchkov
abf7582112 MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.
Fixes for issues found.
2017-02-06 06:47:48 +04:00
Igor Babaev
e51b015fc3 Fixed bug mdev-11138.
Supported usage of expressions with window functions
in SELECTs without tables.
2017-02-04 21:51:40 -08:00
Igor Babaev
20aae56efa Fixed bug mdev-10660.
The method Item_sum::print did not print opening '(' after the name
of simple window functions (like rank, dense_rank etc).
As a result the view definitions with such window functions
were formed invalid in .frm files.
2017-02-03 15:50:25 -08:00
Marko Mäkelä
bc12d993d7 MDEV-11947 InnoDB purge workers fail to shut down
srv_release_threads(): Actually wait for the threads to resume
from suspension. On CentOS 5 and possibly other platforms,
os_event_set() may be lost.

srv_resume_thread(): A counterpart of srv_suspend_thread().
Optionally wait for the event to be set, optionally with a timeout,
and then release the thread from suspension.

srv_free_slot(): Unconditionally suspend the thread. It is always
in resumed state when this function is entered.

srv_active_wake_master_thread_low(): Only call os_event_set().

srv_purge_coordinator_suspend(): Use srv_resume_thread() instead
of the complicated logic.
2017-02-03 12:52:37 +02:00
Marko Mäkelä
3ebe08204a MDEV-11782 Work-in-progress (test only).
Test server startup with an empty encrypted redo log from 10.1.21.
FIXME: Pass the encryption parameters. Currently we only test startup
without properly set up encryption.
2017-02-03 12:52:36 +02:00
Marko Mäkelä
5285504857 innodb.log_corruption: Use the main error log. 2017-02-03 12:52:36 +02:00
Igor Babaev
fd7accabbb Fixed bug mdev-9923.
Partition and order lists of a window specification cannot
use constant integer to refer to select list elements.
2017-02-03 00:10:36 -08:00
Igor Babaev
5606f878bf Fixed bug mdev-11594.
Using window functions over results of implicit groupings
required special handling in JOIN::make_aggr_tables_info.
The patch made sure that the result of implicit grouping
was written into a temporary table properly.
2017-02-02 18:01:35 -08:00
Alexey Botchkov
d123ed852a MDEV-11938 json.json_no_table crashes or fails with valgrind warnings in json_find_path / Item_func_json_length::val_int.
Paths with quoted keynames handled improperly.
2017-02-02 18:56:15 +04:00
Marko Mäkelä
650ffcd3a0 Extend the innodb.log_corruption test.
Remove the dependency on unzip. Instead, generate the InnoDB files
with perl.

log_block_checksum_is_ok(): Correct the error message.

recv_scan_log_recs(): Remove the duplicated error message for
log block checksum mismatch.

innobase_start_or_create_for_mysql(): If the server is in read-only
mode or if innodb_force_recovery>=3, do not try to modify the system
tablespace. (If the doublewrite buffer or the non-core system tables
do not exist, do not try to create them.)

innodb_shutdown(): Relax a debug assertion. If the system tablespace
did not contain a doublewrite buffer and if we started up in
innodb_read_only mode or with innodb_force_recovery>=3, it will not
be created.

dict_create_or_check_sys_tablespace(): Set the flag
srv_sys_tablespaces_open when the tables exist.
2017-02-02 10:20:22 +02:00
Igor Babaev
8481c70ede Fixed bug mdev-11867.
If a window function with aggregation is over the result
set of a grouping query then the argument of the aggregate
function from the window function is allowed to be an
aggregate function itself.
2017-02-01 19:15:28 -08:00
Vladislav Vaintroub
5875633c2a MDEV-11901 : MariaRocks on Windows
fixed compilation, disabled unix-only tests (the ones that use bash
etc).

Changed plugin library name to ha_rocksdb.dll/so
2017-02-01 21:27:13 +00:00
Igor Babaev
69114862f2 Adjusted more tests after the fix for mdev-9976. 2017-02-01 13:09:07 -08:00
Nirbhay Choubey
b0ea044d12 Update galera tests to adapt to recent changes in 10.2. 2017-02-01 15:43:40 -05:00
Georg Richter
23628d123b Fix for MDEV-11174:
A GCM encrypted ciphertext must contain an authentication tag with AES_BLOCK_SIZE length, so we need to check that the length of ciphertext is at least AES_BLOCK_SIZE.
2017-02-01 12:14:37 +01:00
Marko Mäkelä
e1977712cc Clean up a test.
Import and adapt the changes from MySQL 5.7.
2017-02-01 09:30:55 +02:00
Marko Mäkelä
81b7fe9d38 Shut down InnoDB after aborted startup.
This fixes memory leaks in tests that cause InnoDB startup to fail.

buf_pool_free_instance(): Also free buf_pool->flush_rbt, which would
normally be freed when crash recovery finishes.

fil_node_close_file(), fil_space_free_low(), fil_close_all_files():
Relax some debug assertions to tolerate !srv_was_started.

innodb_shutdown(): Renamed from innobase_shutdown_for_mysql().
Changed the return type to void. Do not assume that all subsystems
were started.

que_init(), que_close(): Remove (empty functions).

srv_init(), srv_general_init(): Remove as global functions.

srv_free(): Allow srv_sys=NULL.

srv_get_active_thread_type(): Only return SRV_PURGE if purge really
is running.

srv_shutdown_all_bg_threads(): Do not reset srv_start_state. It will
be needed by innodb_shutdown().

innobase_start_or_create_for_mysql(): Always call srv_boot() so that
innodb_shutdown() can assume that it was called. Make more subsystems
dependent on SRV_START_STATE_STAT.

srv_shutdown_bg_undo_sources(): Require SRV_START_STATE_STAT.

trx_sys_close(): Do not assume purge_sys!=NULL. Do not call
buf_dblwr_free(), because the doublewrite buffer can exist while
the transaction system does not.

logs_empty_and_mark_files_at_shutdown(): Do a faster shutdown if
!srv_was_started.

recv_sys_close(): Invoke dblwr.pages.clear() which would normally
be invoked by buf_dblwr_process().

recv_recovery_from_checkpoint_start(): Always release log_sys->mutex.

row_mysql_close(): Allow the subsystem not to exist.
2017-02-01 09:30:55 +02:00
Marko Mäkelä
774056c825 MDEV-11671 Duplicated message for innodb_page_size
Display a NOTE, not a WARNING for non-default page size.
2017-02-01 09:30:55 +02:00