Commit graph

22478 commits

Author SHA1 Message Date
Olivier Bertrand
6c593cd358 Typo 2019-08-22 23:34:42 +02:00
Marko Mäkelä
b01a95f6fc row_undo_mod_remove_clust_low(): Remove duplicated code
Some code was duplicated near the start of the function,
only for InnoDB, not XtraDB. This was noticed by
comparing the InnoDB between MariaDB and MySQL.
2019-08-22 17:37:13 +03:00
Marko Mäkelä
5b29820d80 Fix -Wstringop-truncation
For the Sphinx storage engine, this is a functional change (bug fix):
we will ensure that the message buffer is always NUL-terminated.
2019-08-22 12:13:37 +03:00
Marko Mäkelä
32ec5fb979 Merge 10.2 into 10.3 2019-08-21 15:23:45 +03:00
Marko Mäkelä
9de2e60d74 MDEV-17187 table doesn't exist in engine after ALTER of FOREIGN KEY
ha_innobase::open(): Always ignore problems with FOREIGN KEY constraints
(pass DICT_ERR_IGNORE_FK_NOKEY), no matter whether foreign_key_checks
is enabled. Instead, we must report errors when enforcing the FOREIGN KEY
constraints. As a result of ignoring these errors, the tables will be
loaded with dict_foreign_t objects whose foreign_index or referenced_index
will be NULL.

Also, pass DICT_ERR_IGNORE_FK_NOKEY instead of DICT_ERR_IGNORE_NONE
to dict_table_open_on_id_low() in many other cases. Notably, on
CREATE TABLE and ALTER TABLE, we will keep validating the FOREIGN KEY
constraints as before.

dict_table_open_on_name(): If no other flags than
DICT_ERR_IGNORE_FK_NOKEY are set, refuse access to unreadable tables.
Some encryption tests rely on this code path.

For the DML code path, we used to have the problem that when
one of the indexes was missing in dict_foreign_t, we would ignore
the FOREIGN KEY constraint altogether. The following changes
address that.

row_ins_check_foreign_constraints(): Add the parameter pk.
For the primary key, consider also foreign key constraints for which
foreign->foreign_index=NULL (no underlying index is available).

row_ins_check_foreign_constraint(): Report errors also for !check_ref.
Remove a redundant check for srv_read_only_mode.

row_ins_foreign_report_add_err(): Tolerate foreign->foreign_index=NULL.
2019-08-21 11:38:33 +03:00
Marko Mäkelä
e279c0076d MDEV-17187: Code cleanup
fkerr_t: Errors for the foreign key checks. Replaces ulint,
which used #define that looked like dberr_t literals.

wsrep_dict_foreign_find_index(): Remove. Use
dict_foreign_find_index() instead, with default parameters.

dict_foreign_push_index_error(): Do not add redundant quotes
around quoted table names.
2019-08-21 11:38:33 +03:00
Marko Mäkelä
ddaebdd210 dict_table_open_on_index_id(): Remove a redundant parameter 2019-08-21 11:38:33 +03:00
Sergei Golubchik
6c06defb5f MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
heap_scan() makes info->next_block to be either an integer number
of share->block.records_in_block's or the total number of
records in the table. So when this total number or records changes,
info->next_block needs to be recalculated to take it into account.

This is a different fix for "Fixes a problem with heap when scanning and insert rows at the same time"
2019-08-20 15:37:08 +02:00
Sergei Golubchik
1ad70bf2fe Revert "Fixes a problem with heap when scanning and insert rows at the same time"
This reverts commit 262927a9e5.
2019-08-20 15:37:08 +02:00
Monty
6dd1d6cb90 MDEV-20379 Mroonga has memory leak in ha_mroonga::is_foreign_key_field 2019-08-20 15:28:01 +03:00
Monty
262927a9e5 Fixes a problem with heap when scanning and insert rows at the same time
This causes failures in versioning.update-big in 10.3 and above
2019-08-20 12:57:52 +03:00
Olivier Bertrand
c0f9042500 Some small changes.
===================
- Modify tracing to use htrc to be compatible with old versions
  when this code is used to make an EOM module.
  modified:   storage/connect/restget.cpp
  modified:   storage/connect/tabrest.cpp

- Path apparently not needed for the cpprest lib on Linux
  modified:   storage/connect/CMakeLists.txt
2019-08-19 18:06:34 +02:00
Marko Mäkelä
fcae2a6364 MDEV-20383 Use of uninitialized value in Datafile::find_space_id() for ROW_FORMAT=COMPRESSED
Datafile::find_space_id(): Fix a regression that was introduced
in c0f47a4a58 for MDEV-12026.
Because the function buf_page_is_corrupted() now determines
the physical page size from the fsp_flags, our buffer size must
agree with the fsp_flags.

buf_page_is_corrupted(): Use the correct accessor
fil_space_t::zip_size() for convering the tablespace flags.
ROW_FORMAT=COMPRESSED files never use innodb_checksum_algorithm=full_crc32.
2019-08-19 16:29:36 +03:00
Aleksey Midenkov
6dd3f24090 MDEV-19740 Debug build of 10.3.15 FTBFS
* Replace LINT_INIT for non-struct types with ctor initializers;
* Check BUILD_DEPS list is not empty so REMOVE_DUPLICATES won't throw
  error.
2019-08-19 10:38:24 +03:00
Monty
44150a770f Updated result for rocksdb tests after merge 2019-08-18 13:18:09 +03:00
Olivier Bertrand
4d93c7f3b0 In CONNECT version 1.6.10 NOSQL facility is enhanced by a new way to retrieve NOSQL data.
In addition to files and Mongo collections, JSON as well as XML and CSV data can be retrieved
from the net as answers from REST queries. Because it uses and external package (cpprestsdk)
this is currently available only to MariaDB servers compiled from source.

-- Add compile flags needed on Windows /MD or /MDd (debug)
-- Also include some changes needed on Linux
  modified:   storage/connect/CMakeLists.txt

- Add the xtrc tracing function
  modified:   storage/connect/global.h
  modified:   storage/connect/plugutil.cpp

- Modify tracing to use xtrc and some typo
  modified:   storage/connect/array.cpp
  modified:   storage/connect/block.h
  modified:   storage/connect/restget.cpp

- Fix compilation error when ZIP is not supported
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabfmt.cpp

- Add some tracing + typo
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/tabjson.cpp

- Add conditional code based on MARIADB
  This to be able to use the same code in CONNECT and EOM modules
  modified:   storage/connect/osutil.h
  modified:   storage/connect/tabrest.cpp

- Replace PlugSetPath by some concat (crashed on Fedora) + typo
  modified:   storage/connect/reldef.cpp

- Try to fix test failures
  modified:   zlib/CMakeLists.txt
2019-08-17 16:58:58 +02:00
Monty
da53fb6d7d Updated spider result file
Kentoku told me that this is ok and that he just had forgot
to do that as part of an earlier bug fix
2019-08-17 16:18:56 +03:00
Kentoku SHIBA
6626b10a7a
fix for a compiler warning (#1372) 2019-08-17 00:40:38 +09:00
Thirunarayanan Balathandayuthapani
dc91372de3 Problem:
========
During ibd file creation, InnoDB flushes the page0 without crypt
information. During recovery, InnoDB encounters encrypted page read
before initialising the crypt data of the tablespace. So it leads t
corruption of page and doesn't allow innodb to start.

Solution:
=========
Write crypt_data information in page0 while creating .ibd file creation.
During recovery, crypt_data will be initialised while processing
MLOG_FILE_NAME redo log record.
2019-08-16 18:11:32 +05:30
Marko Mäkelä
67ddb6507d Merge 10.4 into 10.5 2019-08-16 14:35:32 +03:00
Marko Mäkelä
c221bcdce7 Merge 10.3 into 10.4 2019-08-16 10:51:20 +03:00
Marko Mäkelä
395e1dcd17 Merge 10.2 into 10.3 2019-08-16 10:02:18 +03:00
Marko Mäkelä
555af003e4 MDEV-8588/MDEV-19740: Restore a condition
It looks like the merge of MySQL 5.7.9 to MariaDB 10.2.2 conflicted with
earlier changes that were made in MDEV-8588.

row_search_mvcc(): If the page is corrupted, avoid invoking
btr_cur_store_position(). The caller should not try to fetch
the next record after a hard error.
2019-08-16 09:54:33 +03:00
Marko Mäkelä
130d9490c8 Silence GCC 9.2.1 -Warray-bounds
No memory access violated the bounds of fake_extra_buf[],
but GCC does not like the fact that the pointer fake_extra
ends up pointing before the array.
Allocate a dummy element at the start of fake_extra_buf[]
in order to silence the warning.
2019-08-16 08:29:41 +03:00
Marko Mäkelä
d50fe4021e Merge 10.2 into 10.3 2019-08-15 15:59:32 +03:00
Marko Mäkelä
112589cded MDEV-19740: Remove a bogus condition
This triggered a "may be uninitialized" warning from GCC 9.2.1.
The bogus-looking condition was added in
7e916bb86f
2019-08-15 15:58:37 +03:00
Aleksey Midenkov
ae34d85beb MDEV-20311 row_ins_step accesses unitialized memory
ins_node_create() does not initialize all members of que_common_t, so
zero-init them with mem_heap_zalloc().

Handle out-of-memory correctly.

Init insert_node->common.parent to fulfill the contract of thr usage.

Free insert_node subtree at row_update_vers_insert() exit.
2019-08-15 10:57:51 +03:00
Marko Mäkelä
870acdf534 After-merge fix: Re-record results 2019-08-15 09:00:01 +03:00
Monty
c9c689e1a3 Updated prototype of ha_s3::write_row() to get s3 to compile 2019-08-15 00:42:57 +03:00
Monty
fa490e8022 Don't copy uninitialized bytes when copying varstrings
When using field_conv(), which is called in case of field1=field2 copy in
fill_records(), full varstring's was copied, including unitialized bytes.
This caused valgrind to compilain about usage of unitialized bytes when
using Aria static length records.
Fixed by not using memcpy when copying varstrings but instead just copy
the real bytes.
2019-08-15 00:42:56 +03:00
Alexander Barkov
afe6eb499d Revert "MDEV-20342 Turn Field::flags from a member to a method"
This reverts commit e86010f909.

Reverting on Monty's request, as this change makes merging
things from 10.5 to 10.2 much harder.
2019-08-14 20:27:00 +04:00
Aleksey Midenkov
c23a5e0e5e Merge 10.2 into 10.3 2019-08-14 19:16:08 +03:00
Aleksey Midenkov
2347ffd843 MDEV-20301 InnoDB's MVCC has O(N^2) behaviors
If there're multiple row versions in InnoDB, reading one row from PK
may have O(N) complexity and reading from secondary keys may have
O(N^2) complexity.

The problem occurs when there are many pending versions of the same
row, meaning that the primary key is the same, but a secondary key is
different.  The slowdown occurs when the secondary index is
traversed. This patch creates a helper class for the function
row_sel_get_clust_rec_for_mysql() which can remember and re-use
cached_clust_rec & cached_old_vers so that rec_get_offsets() does not
need to be called over and over for the clustered record.

Corrections by Kevin Lewis <kevin.lewis@oracle.com>

MDEV-20341 Unstable innodb.innodb_bug14704286

Removed test that tested the ability of interrupting long query which
is not long anymore.
2019-08-14 19:10:17 +03:00
Marko Mäkelä
1d15a28e52 Merge 10.3 into 10.4 2019-08-14 18:06:51 +03:00
Alexander Barkov
e86010f909 MDEV-20342 Turn Field::flags from a member to a method 2019-08-14 13:33:01 +04:00
Marko Mäkelä
1c83c30064 Merge 10.4 into 10.5 2019-08-14 10:33:17 +03:00
Thirunarayanan Balathandayuthapani
7772c7cd94 MDEV-20340 Encrypted temporary tables cannot be read with full_crc32
Problem:
========
Checksum for the encrypted temporary tablespace is not stored in the page
for full crc32 format.

Solution:
========
Made temporary tablespace in full crc32 format irrespective of encryption
parameter.

buf_tmp_page_encrypt(), buf_tmp_page_decrypt() - Both follows full_crc32
format.
2019-08-14 10:32:52 +03:00
Alexander Barkov
c1599821a5 Merge remote-tracking branch 'origin/10.4' into 10.5 2019-08-13 23:49:10 +04:00
Marko Mäkelä
65d48b4a7b Merge 10.2 to 10.3 2019-08-13 19:28:51 +03:00
Marko Mäkelä
624dd71b94 Merge 10.4 into 10.5 2019-08-13 18:57:00 +03:00
Monty
c4fd167d5a Fixed access to unitialized memory when using unique HASH key
Fixed the following issues:
- Call info with HA_STATUS_CONST to ensure that (key_info->rec_per_key)
  contains latest data
- Don't access rec_per_key if key_info->algorithm == HA_KEY_ALG_LONG_HASH
  is in this case the rec_per_key points to uninitialized data
- Cleaned up code to avoid some extra 'if' and to make things more readable
- Updated test cases that used 'old' rec_per_key values
2019-08-13 17:19:00 +03:00
Sergei Petrunia
65296123d0 MDEV-12439: MariaRocks produces numerous (spurious?) valgrind failures
Enable the rocksdb test suite. It now passes the valgrind tests.
2019-08-13 16:37:21 +03:00
Sergei Petrunia
a18d1cc777 MDEV-20315: MyRocks tests produce valgrind failures (Backport to 10.2)
- Include the valgrind suppressions from the FB upstream

- Use HAVE_Valgrind, not HAVE_Purify (like the rest of MariaDB code does)
  The call to DisownData() is now actually disabled under Valgrind
2019-08-13 16:26:17 +03:00
Marko Mäkelä
f13471c9fe MDEV-20060: Remove bogus unit from error message 2019-08-13 13:32:58 +03:00
Alexander Barkov
95cdc1ca5f Merge commit '43882e764d6867c6855b1ff057758a3f08b25c55' into 10.4 2019-08-13 11:42:31 +04:00
Marko Mäkelä
ae1d17f52d MDEV-20316 InnoDB writes uninitialised tail of XID buffer
Starting with commit 210855ce5d
Valgrind became aware that the unused tail of the buffer that
is returned by thd_get_xid() is actually uninitialized.

The problem should exist already in MySQL 5.0. I was able to
repeat it on MariaDB Server 5.5 with some additional instrumentation.
InnoDB is allocating 128+4+4 bytes for the XID and the lengths of
its components, even when the XID is shorter than 64+64 bytes.
In MariaDB Server 10.3, while running the test main.xa_binlog,
in the xid_t::set() that is called by sql_yacc.yy, the 128-byte data
buffer was uninitialized according to Valgrind, and only the first bytes
were initialized. When the xid_t::data was copied to
thd.transaction.xid_state.xid.data, it happened so that the entire
target buffer was considered initialized. With MariaDB Server 10.4 since
the said commit, Valgrind will correctly be detect the tail of the buffer
as uninitialized.

The impact of this bug is as follows:

(1) InnoDB will write unnecessarily much redo log for XA PREPARE.
(2) InnoDB will write garbage bytes to the redo log and undo log pages.
(3) The garbage should be 'harmless', because on recovery, only the
actual payload of the XID will be used, based on the written length.

trx_rseg_write_wsrep_checkpoint(), trx_undo_write_xid(): Write only
the actually used length of xid->data to the data page, and
zero out the rest of the buffer by mlog_memset().
2019-08-12 19:37:24 +03:00
Marko Mäkelä
609ea2f37b MDEV-17614: After-merge fix
MDEV-17614 flags INSERT…ON DUPLICATE KEY UPDATE unsafe for statement-based
replication when there are multiple unique indexes. This correctly fixes
something whose attempted fix in MySQL 5.7
in mysql/mysql-server@c93b0d9a97
caused lock conflicts. That change was reverted in MySQL 5.7.26
in mysql/mysql-server@066b6fdd43
(with a substantial amount of other changes).

In MDEV-17073 we already disabled the unfortunate MySQL change when
statement-based replication was not being used. Now, thanks to MDEV-17614,
we can actually remove the change altogether.

This reverts commit 8a346f31b9 (MDEV-17073)
and mysql/mysql-server@c93b0d9a97 while
keeping the test cases.
2019-08-12 18:50:54 +03:00
Marko Mäkelä
be33124c9d Merge 10.1 into 10.2 2019-08-12 18:25:35 +03:00
Monty
fe8181aca1 Fixed issues found by valgrind
- mysqltest didn't free read_command_buf
- wait_for_slave_param did write different things to the log if valgrind
  was used.
- Table open cache should not write the initial variable value as it
  can depend on the configuration or if valgrind is used
- A variable in GetResult was used uninitalized
2019-08-12 15:41:14 +03:00
Marko Mäkelä
15c1ab52a9 Merge 5.5 into 10.1 2019-08-12 14:46:28 +03:00
Marko Mäkelä
1217e4a0c0 Fix -Wimplicit-fallthrough 2019-08-12 14:14:17 +03:00
Sergei Petrunia
d2a04ae55d MDEV-20315: MyRocks tests produce valgrind failures
- Include the valgrind suppressions from the FB upstream

- Use HAVE_Valgrind, not HAVE_Purify (like the rest of MariaDB code does)
  The call to DisownData() is now actually disabled under Valgrind
2019-08-11 13:17:30 +03:00
Sergei Petrunia
3b234104ae MDEV-16955: rocksdb_sys_vars.rocksdb_update_cf_options_basic
... produces "bytes lost" warnings

When rocksdb_validate_update_cf_options() returns an error,
the update won't happen.
Free the copy of the string in this case.
2019-08-10 01:46:50 +03:00
Monty
6765cc6077 Fixed assertion Assertion `!table->pos_in_locked_tables' failed
MDEV-17717
Assertion `!table->pos_in_locked_tables' failed in tc_release_table on
flushing RocksDB table under SERIALIZABLE
MDEV-17998
Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
in tc_release_table on KILL_TIMEOUT
MDEV-19591
Assertion `!table->pos_in_locked_tables' failed in tc_release_table upon
altering table into S3 under lock.

The problem was that thd->open_tables->pos_in_locked_tables was not reset
when alter table failed to reopen a locked table.
2019-08-08 23:08:23 +03:00
Monty
dbac2039e8 Fixed some errors & warnings found by clang
- pcretest.c could use macro with side effect
- maria_chk could access freed memory
- Initialized some variables that could be accessed uninitalized
- Fixed compiler warning in my_atomic-t.c
2019-08-08 23:08:23 +03:00
Vlad Lesin
d39d5dd2bc MDEV-20060: Failing assertion: srv_log_file_size <= 512ULL << 30 while preparing backup
The general reason why innodb redo log file is limited by 512G is that
log_block_convert_lsn_to_no() returns value limited by 1G. But there is no
need to have unique log block numbers in log group. The fix removes 512G
limit and limits log group size by
(uint32_t maximum value) * (minimum page size), which, in turns, can be
removed if fil_io() is no longer used for innodb redo log io.
2019-08-07 17:26:44 +03:00
Alexander Barkov
e978efd96b MDEV-20273 Add class Item_sum_min_max 2019-08-07 14:13:44 +04:00
Thirunarayanan Balathandayuthapani
47f8a18fec MDEV-20247 Replication hangs with "preparing" and never starts
- The commit ab6dd77408 wrongly sets the
condition inside innobase_srv_conc_enter_innodb().  Problem is that
InnoDB makes the thread to sleep indefinitely if it is a replication
slave thread.

Thanks to Sujatha Sivakumar for contributing the replication test case.
2019-08-07 12:35:04 +05:30
Sergei Petrunia
f36c0189b1 MDEV-17544: No warning when trying to name a primary key constraint
Part#2: update .result files for affected MyRocks tests
2019-08-06 14:37:08 +03:00
Eugene Kosov
88abca55f9 fix build (-Werror + -Wignored-qualifiers) 2019-08-06 12:56:16 +03:00
Eugene Kosov
a5a7ab1957 Cleanup: this is how to use span 2019-08-05 21:11:48 +03:00
Eugene Kosov
da7d82b8ea MDEV-20103 add a class similar to std::span
Non-owning reference to elements.

Use it as function argument instead of pointer+size pair or instead of
const std::vector<T>.

Do not use it for strings!

More info is here http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
Or just google about it.
2019-08-05 21:11:48 +03:00
Sergei Petrunia
988ff90256 MDEV-20227: rocksdb.rocksdb_concurrent_delete fails on windows
A combination of:
* lots of include'd test files where each has "--source
  include/have_rocksdb.inc"
* for each such occurrence, MTR adds testsuite's arguments into server
  arguments
* which hits some limit on the length of argv array on Windows, causing
  the server to get garbage data in the last argument.

Work around this by commenting out one of the totally redundant
"source include/have_rocksdb.inc" lines.
2019-08-04 23:37:47 +03:00
Sergei Petrunia
09a85692a6 Post-merge fixes for rocksdb.group_min_max test
- Fix the LooseScan code to support storage engines that return
  HA_ERR_END_OF_FILE if the index scan goes out of provided range
  bounds
- Add a DBUG_EXECUTE_IF("force_group_by",...) to allow a test to
  force a LooseScan
- Adjust rocksdb.group_min_max test not to use features not present
  in MariaDB 10.2 (e.g. optimizer_trace.  In MariaDB 10.4 it's present
  but it doesn't meet the  assumptions that the test makes about it
- Adjust the test result file:
  = MariaDB doesn't support "Enhanced Loose Scan" that FB/MySQL has
  = MariaDB has different cost calculations.
2019-08-04 17:25:17 +03:00
Kentoku SHIBA
b428b09997
MDEV-20179 Server hangs on shutdown during installation of Spider (#1369)
Use LOCK_server_started, COND_server_started and mysqld_server_started for waiting starting the server
2019-08-01 08:59:53 +09:00
Olivier Bertrand
d302cb3534 Typo 2019-07-31 11:17:59 +02:00
Olivier Bertrand
e4797a991f In CONNECT version 1.6.10 NOSQL facility is enhanced by a new way to retrieve NOSQL data.
In addition to files and Mongo collections, JSON as well as XML and CSV data can be retrieved
from the net as answers from REST queries. Because it uses and external package (cpprestsdk)
this is currently available only to MariaDB servers compiled from source.

-- Add the REST support when Microsoft Casablanca package (cpprestsdk) is installed.
-- Also include some changes specific to MariaDB 10.3.
  modified:   storage/connect/CMakeLists.txt

-- Add conditional REST support
-- Added string options HTTP and URI.
-- Added added internal table type TAB_REST.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/mycat.h
  modified:   storage/connect/plgdbsem.h

-- Fix MDEV-19648 Variable connect_conv_size doesn't change
-- Change Variable wrong block parameter from 8169 to 1.
-- Also change connect_conv_size default value to 1024.
  modified:   storage/connect/ha_connect.cc

-- Avoid possible buffer overflow
-- In particular by the function ShowValue.
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h

-- Add some cast to avoid some compiler warnings
  modified:   storage/connect/filamdbf.cpp

-- Fix some C++ error
  modified:   storage/connect/javaconn.cpp
  modified:   storage/connect/jmgoconn.cpp
  modified:   storage/connect/plugutil.cpp

-- Miscellaneous Typo and warning suppressing changes
  modified:   storage/connect/connect.cpp
  modified:   storage/connect/connect.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/inihandl.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/user_connect.cc
  modified:   storage/connect/user_connect.h

-- Update failing test results and disbling
  modified:   storage/connect/mysql-test/connect/disabled.def
  modified:   storage/connect/mysql-test/connect/r/dir.result
  modified:   storage/connect/mysql-test/connect/r/grant.result
  modified:   storage/connect/mysql-test/connect/r/jdbc.result
  modified:   storage/connect/mysql-test/connect/r/jdbc_postgresql.result
  modified:   storage/connect/mysql-test/connect/r/xml.result
  modified:   storage/connect/mysql-test/connect/r/xml2.result
  modified:   storage/connect/mysql-test/connect/r/xml2_mult.result
  modified:   storage/connect/mysql-test/connect/r/xml_mult.result

-- Add an option
  modified:   storage/connect/mysql-test/connect/t/grant.test
2019-07-30 22:45:04 +02:00
Alexey Botchkov
c6efbc543d MDEV-17544 No warning when trying to name a primary key constraint.
Warning added.
2019-07-30 21:57:48 +04:00
Noel Kuntze
46553c2508 Fix compiler warnings GCC8 2019-07-30 09:58:17 +03:00
Kentoku SHIBA
6dfa085fd5
MDEV-20179 Server hangs on shutdown during installation of Spider (#1368) 2019-07-30 06:16:48 +09:00
Kentoku SHIBA
7221b9ef52
MDEV-20179 Server hangs on shutdown during installation of Spider (#1367) 2019-07-30 01:30:14 +09:00
Kentoku SHIBA
83d368a062
MDEV-20179 Server hangs on shutdown during installation of Spider (#1366) 2019-07-29 21:18:51 +09:00
Vladislav Vaintroub
f61a980686 Update WolfSSL, remove older workarounds. 2019-07-28 13:45:15 +02:00
Oleksandr Byelkin
2792c6e7b0 Merge branch '10.3' into 10.4 2019-07-28 13:43:26 +02:00
Oleksandr Byelkin
d97342b6f2 Merge branch '10.2' into 10.3 2019-07-26 22:42:35 +02:00
Eugene Kosov
4c7a743964 Merge 10.3 into 10.4 2019-07-26 15:22:31 +03:00
Oleksandr Byelkin
32c6f40a63 Merge branch '10.1' into 10.2 2019-07-26 13:39:17 +02:00
Eugene Kosov
29df1003d9 MDEV-20184 data race at global counter btr_cur_n_non_sea
Make all accesses to btr_cur_n_non_sea atomic.
2019-07-26 13:52:52 +03:00
Oleksandr Byelkin
4177181e16 Merge branch 'merge-tokudb-5.6' into 10.1 2019-07-26 10:48:12 +02:00
Oleksandr Byelkin
24a0d7c507 5.6.44-86.0 2019-07-26 08:48:46 +02:00
Oleksandr Byelkin
25d216dcd5 Merge remote-tracking branch 'connect/10.1' into 10.1 2019-07-26 07:57:57 +02:00
Aleksey Midenkov
1a73444d57 Cleanups: DELETE HISTORY [MDEV-19814]
* Made make_versioned_*() proxies inline;
* Renamed truncate_history to delete_history

Part of:
MDEV-19814 Server crash in row_upd_del_mark_clust_rec or Assertion
`update->n_fields < ulint(table->n_cols + table->n_v_cols)' failed in
upd_node_t::make_versioned_helper
2019-07-25 21:11:06 +03:00
Marko Mäkelä
e9c1701e11 Merge 10.3 into 10.4 2019-07-25 18:42:06 +03:00
Marko Mäkelä
75e1b1a088 Merge 10.2 into 10.3 2019-07-25 17:44:25 +03:00
Marko Mäkelä
57421419ce RocksDB: Do not test bogus parameter slave_gtid_info
This removes the test combination
rocksdb_rpl.mdev12179 'innodb,row,row-write-committed-slave-gtid-optimized'
for which the server failed to start due to the invalid parameter
slave_gtid_info=optimized.

This was broken in 5173e396ff
2019-07-25 17:42:33 +03:00
Kentoku SHIBA
ddce859076
MDEV-18737 Spider "Out of memory" on armv7hl (#1363)
This is an issue of memory alignment of variable argument when calling my_multi_malloc().
The fix is strictly casting allocating size to "uint".
2019-07-25 22:52:45 +09:00
Marko Mäkelä
fdef9f9b89 Merge 10.2 into 10.3 2019-07-25 15:31:11 +03:00
Marko Mäkelä
a7e9395f9d fts_sync_table(), fts_sync() dead code removal
fts_sync(): Remove the constant parameter has_dict=false.

fts_sync_table(): Remove the constant parameter has_dict=false,
and the redundant parameter unlock_cache = !wait.
Make wait=true the default parameter.
2019-07-25 13:34:36 +03:00
Marko Mäkelä
7de38492fc After-merge fix: cmake -DPLUGIN_PERFSCHEMA=NO
An #include was forgotten in b6ac67389d
2019-07-25 13:34:31 +03:00
Marko Mäkelä
a3455c6085 MDEV-20133 Merge new release of InnoDB 5.7.27 to 10.2 2019-07-25 13:08:46 +03:00
Aditya A
60069a9829 Bug #29127203 VIRTUAL GENERATED COLUMN INDEX DATA INCONSISTENCY
PROBLEM
-------

Index defined on a virtual column whose base column was in a fk
relation was not getting updated. This is because while getting
the updated field information from the update vector of the parent
table we were comparing the column number of the base column (for
virtual column) in child table with the associated column number
in the parent table. There was a mismatch in this column number
because of which this update field information was skipped and
subsequently index was not getting updated.

FIX
2019-07-25 12:39:39 +03:00
Marko Mäkelä
b6ac67389d Merge 10.1 into 10.2 2019-07-25 12:14:27 +03:00
Marko Mäkelä
f6ea0389a4 Replace ut_timer() with my_interval_timer()
The function pointer ut_timer() was only used by the
InnoDB defragmenting thread. Let InnoDB use a single monotonic
high-precision timer, my_interval_timer() [in nanoseconds],
occasionally wrapped by microsecond_interval_timer().

srv_defragment_interval: Change from "timer" units to nanoseconds.

This concludes the InnoDB time function cleanup that was
motivated by MDEV-14154. Only ut_time_ms() will remain for now,
wrapping my_interval_timer().
2019-07-25 10:43:11 +03:00
Marko Mäkelä
0c7c61019d Remove the wrappers ut_time(), ut_difftime(), ib_time_t 2019-07-24 21:59:26 +03:00
Marko Mäkelä
c663a9414b MDEV-14154: Failing assertion: slot->last_run <= current_time in fts0opt.cc
The FTS optimizer thread made a false assumption that time(NULL)
is monotonic. The system clock can be adjusted to the past,
for example if the hardware clock was drifting to the future,
and it was adjusted by NTP.

fts_slot_t::interval_time: Replace with the constant
FTS_OPTIMIZE_INTERVAL_IN_SECS.

fts_slot_t::last_run, fts_slot_t::completed: Clarify the
documentation.

fts_optimize_get_time_limit(): Remove a type cast, and
add a FIXME comment about domain mismatch.

fts_optimize_compact(), fts_optimize_words(): Limit the time
also when the current time has been moved to the past.

fts_optimize_table_bk(): Check for wrap-around.

fts_optimize_how_many(): Check for wrap-around, and remove the
failing assertions.

fts_is_sync_needed(): Remove a redundant call to time(NULL).
2019-07-24 21:59:26 +03:00
Marko Mäkelä
9e5df96751 Reduce the amount of time(NULL) calls for lock processing
lock_t::requested_time: Document what the field is used for.

lock_t::wait_time: Document that the field is only used for
diagnostics and may be garbage if the system time is being adjusted.

srv_slot_t::suspend_time: Document that this is duplicating
trx_lock_t::wait_started.

lock_table_print(), lock_rec_print(): Declare in static scope.
Add a parameter for the current time.

lock_deadlock_check_and_resolve(), lock_deadlock_lock_print(),
lock_deadlock_joining_trx_print():
Add a parameter for the current time.
2019-07-24 21:59:26 +03:00
Marko Mäkelä
2b5bc761d3 MDEV-14154: Document some time_t fields better
srv_slot_t::suspend_time, os_aio_slot_t::reservation_time,
sync_cell_t::reservation_time: Explain what could happen
if the system time has is being adjusted.

fts_sync_t::start_time: Document that the field is mostly unused.
2019-07-24 21:59:26 +03:00
Marko Mäkelä
10727b6953 Always initialize trx_t::start_time_micro
This affects the function has_higher_priority() for internal or
recovered transactions.
2019-07-24 21:59:26 +03:00
Marko Mäkelä
10ee1b95b8 Remove ut_usectime(), ut_gettimeofday()
Replace ut_usectime() with my_interval_timer(),
which is equivalent, but monotonically counting nanoseconds
instead of counting the microseconds of real time.

os_event_wait_time_low(): Use my_hrtime() instead of ut_usectime().

FIXME: Set a clock attribute on the condition variable that allows
a monotonic clock to be chosen as the time base, so that the wait
is immune to adjustments of the system clock.
2019-07-24 21:59:26 +03:00
Marko Mäkelä
e764d5bc01 Correct the type of a parameter 2019-07-24 21:21:54 +03:00
Marko Mäkelä
ab6dd77408 MDEV-14154: Remove ut_time_us()
Use microsecond_interval_timer()
or my_interval_timer() [in nanoseconds] instead.
2019-07-24 21:21:54 +03:00
Marko Mäkelä
86767f4ac1 Remove unused ut_get_year_month_day() 2019-07-24 19:41:59 +03:00
Marko Mäkelä
b951fc4e7f Merge 10.2 into 10.3 2019-07-24 15:34:24 +03:00
Thirunarayanan Balathandayuthapani
8fb39b2c35 MDEV-19870 gcol.innodb_virtual_debug_purge doesn't fail if row_vers_old_has_index_entry gives wrong result
1) Whenever purge thread tries to remove the secondary virtual index
entry, purge thread acquires metadata lock for the table and release
dict_operation_lock. After that, it retries the secondary index
deletion if MDL acquired successfully.

2) Inside row_vers_old_has_index_entry(), Change the safe_to_purge
to unsafe_to_purge goto statement. So it can be more appropriate to
return true if it is unsafe_to_purge.

3) Previously, row_vers_old_has_index_entry() returns false if InnoDB
fetched the MDL on the table for the first time. This check(two cases)
should checked only during purge thread. In row_purge_poss_sec(), again
InnoDB checks whether the MDL fetched for the first time. If it is then
InnoDB retry the secondary index deletion logic. So in that case,
InnoDB have to clean up the memory used inside row_vers_old_has_index_entry()
and shouldn't care about return value.
2019-07-24 16:45:05 +05:30
Marko Mäkelä
97055e6b11 MDEV-14154: Remove ut_time_us()
Use microsecond_interval_timer()
or my_interval_timer() [in nanoseconds] instead.
2019-07-23 17:25:02 +03:00
Marko Mäkelä
058c385e03 Merge 10.1 into 10.2 2019-07-23 16:34:04 +03:00
Marko Mäkelä
1f498f901b 5.6.44-86.0 2019-07-23 15:47:22 +03:00
Marko Mäkelä
d653db32f2 MDEV-14154: Make ut_time_ms(), ut_time_us() monotonic
This is motivated by PS-5221 in
percona/percona-server@2817c561fc

The coarser-precision ut_time() will still refer to the
system clock, meaning that bad things can happen if the
real time clock is adjusted backwards.
2019-07-23 15:23:27 +03:00
Laurynas Biveinis
c385d80abd Fix PS-5388 (Enable hardware CRC32 under Valgrind)
Valgrind started supporting CRC32 instruction starting with version
3.6.1, released in 2011. Thus remove the fallback to software
implementation in case running under Valgrind.
2019-07-23 15:23:27 +03:00
Marko Mäkelä
61b5e244d6 MDEV-20127 Merge new release of InnoDB 5.6.45 to 10.1
There is one directly applicable change to InnoDB:
commit 739f5239f1 in the
5.5 branch will be merged before the next MariaDB releases.

Another potentially applicable change will be tracked
separately as MDEV-20126.

Thus, here we only update the InnoDB version number and do
not change anything else.
2019-07-23 15:23:27 +03:00
Marko Mäkelä
9d93f9dac4 MDEV-8827: Fix the 32-bit build
Follow-up to 07ba5560da:
Use the correct 64-bit type name ulonglong instead of ulint,
like in mysql/mysql-server@4e0100d86b
2019-07-23 15:00:53 +03:00
Rahul Malik
739f5239f1 Bug#15851528 DUPLICATE KEY ERROR ON AUTO-INC PK WITH MIXED AUTO_INCREMENT_INCREMENT CLIENTS
Problem: Clients running different values for auto_increment_increment
and doing concurrent inserts leads to "Duplicate key error" in one of them.

Analysis:
When auto_increment_increment value is reduced in a session,
InnoDB uses last auto_increment_increment value
to recalculate the autoinc value.
In case, some other session has inserted a value
with different auto_increment_increment, InnoDB recalculate
autoinc values based on current session previous auto_increment_increment
instead of considering the auto_increment_increment used for last insert
across all session

Fix:
revert 7acdf29cb4
a.k.a. 7c12a9e5c3
as it causing the bug.

Reviewed By:
Bin <bin.x.su@oracle.com>
Kevin <kevin.lewis@oracle.com>
RB#21777

Note: In MariaDB Server, earlier changes in
ae5bc05988
for MDEV-533 require that the original test in
mysql/mysql-server@1ccd472d63
be adjusted for MariaDB.

Also, ef47b62551 (MDEV-8827)
had to be reverted after the upstream fix had been backported.
2019-07-23 11:26:11 +03:00
Marko Mäkelä
7153e15542 Revert "MDEV-8827 Duplicate key with auto increment"
This reverts commit ef47b62551.
The parent commit 07ba5560da
which is a backport of
mysql/mysql-server@1198267c33
fixes the issue differently.
2019-07-23 11:01:44 +03:00
Thirunarayanan Balathandayuthapani
07ba5560da Bug #20989615 INNODB AUTO_INCREMENT PRODUCES SAME VALUE TWICE
Problem:
=======
Autoincrement value gives duplicate values because of the following reasons.

(1) In InnoDB handler function, current autoincrement value is not changed
based on newly set auto_increment_increment or auto_increment_offset variable.

(2) Handler function does the rounding logic and changes the current
autoincrement value and InnoDB doesn't aware of the change in current
autoincrement value.

Solution:
========
Fix the problem(1), InnoDB always respect the auto_increment_increment
and auto_increment_offset value in case of current autoincrement value.
By fixing the problem (2), handler layer won't change any current
autoincrement value.

Reviewed-by: Jimmy Yang <jimmy.yang@oracle.com>
RB: 13748
2019-07-23 10:58:56 +03:00
Marko Mäkelä
70b226d966 Merge 10.2 into 10.3 2019-07-22 17:37:04 +03:00
Marko Mäkelä
60c790d6f4 Merge 10.1 into 10.2 2019-07-22 15:28:05 +03:00
Marko Mäkelä
a5e268a293 MDEV-20102 Phantom InnoDB table remains after interrupted CREATE...SELECT
This is a regression due to MDEV-16515 that affects some versions in
the MariaDB 10.1 server series starting with 10.1.35, and possibly
all versions starting with 10.2.17, 10.3.8, and 10.4.0.

The idea of MDEV-16515 is to allow DROP TABLE to be interrupted,
in case it was stuck due to some concurrent activity. We already
made some cases of internal DROP TABLE immune to kill in MDEV-18237,
MDEV-16647, MDEV-17470. We must include the cleanup of
CREATE TABLE...SELECT in the list of such internal DROP TABLE.

ha_innobase::delete_table(): Pass create_failed=true if the current
SQL statement is CREATE, so that the table will be dropped.

row_drop_table_for_mysql(): If create_failed=true, do not allow
the operation to be interrupted.
2019-07-22 14:55:46 +03:00
Nikita Malyavin
12614af1fe MDEV-17005 ASAN heap-use-after-free in innobase_get_computed_value
This is the race between DELETE and INSERT (or other any two operations accessing to the table).
What should happen in good case:
1. ALTER TABLE is issued. vc_templ->default_rec is initialized with temporary share's default_fields
2. temporary share is freed, but datadict is still there, with garbage in vc_templ->default_rec
3. DELETE is issued. It is first after ALTER TABLE finished.
4. ha_innobase::open() is called, ib_table->get_ref_count() should be one
5. we reinitialize vc_templ, so no garbage anymore

What actually happens:
3. DELETE is issued.
4. ha_innobase::open() is called and ib_table->get_ref_count() is 1
5. INSERT (or SELECT etc.) is issued in parallel
6. ha_innobase::open() is called and ib_table->get_ref_count() is 1
7. we check ib_table->get_ref_count()  and it is 2 in both threads when we want reinitialize vc_templ
8. garbage is there

Fix:
* Do not store pointers to SHARE memory in table dict, copy it instead.
* But then we don't need to refresh it each time when refcount=1.
2019-07-22 20:29:42 +10:00
Nikita Malyavin
b0b5485251 MDEV-17005 add debug logs and set up deterministic test 2019-07-22 20:29:42 +10:00
Sergei Petrunia
731ef75175 MDEV#20107: rocksdb.check_ignore_unknown_options fails on OS X again
Make it to work on Windows, too.
2019-07-19 21:24:28 +03:00
Sergei Petrunia
8ec4aa4b6b MDEV#20107: rocksdb.check_ignore_unknown_options fails on OS X again
Rewrite the unportable sed/shell code in Perl.
2019-07-19 18:22:32 +03:00
Marko Mäkelä
09e9f884f1 MDEV-20048 Assertion 'n < tuple->n_fields on ROLLBACK after DROP COLUMN
btr_push_update_extern_fields(): Add a parameter for the original number
of fields in the record before btr_cur_trim(). Assume that this function
will only be called for the clustered index, which is the only index
that can contain off-page columns.

trx_undo_prev_version_build(), btr_cur_pessimistic_update():
Only invoke btr_push_update_extern_fields() for the clustered index.
2019-07-19 18:13:36 +03:00
Pali
5cc2096f93 Switch Perl DBI scripts from DBD::mysql to DBD::MariaDB driver
Perl DBD::MariaDB driver is available CPAN and is already used in
production environment.
2019-07-19 13:39:20 +03:00
Eugene Kosov
53a3594b90 MDEV-19471 Add ASAN-poisoned redzones for mem_heap_t
Store REDZONE_SIZE poined bytes before every allocated chunk of memory
2019-07-19 13:28:03 +03:00
Marko Mäkelä
ef44ec4afa Merge 10.2 into 10.3 2019-07-19 12:31:56 +03:00
Marko Mäkelä
059968dc5d Remove a conditionally unused declaration
The embedded server does not HAVE_PSI_STAGE_INTERFACE.
2019-07-19 11:45:35 +03:00
Eugene Kosov
9c29d06862 MDEV-20097 potential use-after-free
row_merge_read_clustered_index(): fix one more place with buf and merge_buf[i]
2019-07-19 11:42:08 +03:00
Marko Mäkelä
6a55aeb2af Merge 10.1 into 10.2 2019-07-18 23:38:48 +03:00
Marko Mäkelä
a24e824cc4 MDEV-20097: Also fix XtraDB 2019-07-18 23:24:13 +03:00
Eugene Kosov
5b205458d9 MDEV-20097 potential use-after-free
row_merge_read_clustered_index(): make buf always equals to merge_buf[i]
2019-07-18 22:28:11 +03:00
Marko Mäkelä
e55cc2d8cc Merge 10.1 into 10.2
MDEV-20094 was filed for the unexpected result differences for the test
innodb.check_ibd_filesize.
2019-07-18 18:01:04 +03:00
Marko Mäkelä
adbab0d4cd MDEV-13625: Add the test innodb.innodb-wl5980-debug 2019-07-18 17:01:59 +03:00
Marko Mäkelä
6962855185 Merge 10.1 into 10.2 2019-07-18 13:10:09 +03:00
Sergei Petrunia
52f6aa1c54 Disable rocksdb_rpl.rpl_gtid_crash_safe_optimized
It uses slave_gtid_info=optimized which is not supported in MariaDB
2019-07-16 18:42:19 +03:00
Eugene Kosov
0f83c8878d Merge 10.2 into 10.3 2019-07-16 18:39:21 +03:00
Sergei Petrunia
a2dc3b9461 Disable rocksdb_rpl.optimize_myrocks_replace_into
It requires @@enable_blind_replace which MariaDB doesn't support
2019-07-16 17:16:59 +03:00
Sergei Petrunia
e9a1918376 Disable rocksdb.rpl_row_not_found
It requires slave_exec_mode='SEMI_STRICT'
2019-07-16 16:50:05 +03:00
Sergei Petrunia
612f4908d2 rocksdb.unique_check: attempt to remove race condtitions from the test 2019-07-16 12:23:52 +03:00
Sergei Petrunia
143fede177 Disable rocksdb.force_shutdown, rocksdb.shutdown is fine
Fix this patch (two csets before):
  Disable rocksdb.shutdown test

  It was introduced by this patch in fb/mysql-5.6:
  Author: Yoshinori Matsunobu <yoshinori@fb.com>
  Date:   Mon Jun 10 14:09:28 2019 -0700

      Extending SHUTDOWN query to support read_only/aborting

      Summary:
      This diff extends SHUTDOWN query to support the following
      features.
      - Aborting with any specified exit code (range is 0..255).
      If nothing is specified or 0 is given, it does default clean
      shutdown. If 1+ is given, exits with the given error code
      immediately. This is helpful to shutting down instance
      even if it is stuck somewhere.

   MariaDB doesn't support SHUTDOWN statement or have any other way
   to exit the server process.
2019-07-16 11:10:59 +03:00
Sergei Petrunia
537893b072 Fix rocksdb.tbl_opt_data_index_dir on a mac
Part #2: also replace error text in SHOW WARNINGS
2019-07-16 11:07:46 +03:00
Sergei Petrunia
d2f094d9e6 Disable rocksdb.shutdown test
It was introduced by this patch in fb/mysql-5.6:
Author: Yoshinori Matsunobu <yoshinori@fb.com>
Date:   Mon Jun 10 14:09:28 2019 -0700

    Extending SHUTDOWN query to support read_only/aborting

    Summary:
    This diff extends SHUTDOWN query to support the following
    features.
    - Aborting with any specified exit code (range is 0..255).
    If nothing is specified or 0 is given, it does default clean
    shutdown. If 1+ is given, exits with the given error code
    immediately. This is helpful to shutting down instance
    even if it is stuck somewhere.

MariaDB doesn't support SHUTDOWN statement or have any other way
to exit the server process.
2019-07-15 22:50:18 +03:00
Sergei Petrunia
1da844124d Fix rocksdb.tbl_opt_data_index_dir on a mac 2019-07-15 12:26:13 +03:00
Sergei Petrunia
b3bd51c992 Fix rocksdb.autoinc_vars_thread test 2019-07-15 00:50:46 +03:00
Sergei Petrunia
9ccbe8d581 Fix intermittent test failure in rocksdb.rocksdb_cf_per_partition
was getting rows=2 instead of 1 on kvm-rpm-centos74-amd64
2019-07-14 11:25:24 +03:00
Sergei Petrunia
fbbc2354c8 MDEV-14455: rocksdb.2pc_group_commit failed in buildbot
Use RocksDB debug sync points to introduce a sync delay. This
commits to get grouped even when the datadir is on ramdisk.

For some unclear reason the effect is visible on write_prepared
but not write_committed, so run the test only with write_prepared.
2019-07-12 21:41:01 +03:00
Sergei Golubchik
06ad00a478 compilation error with gcc 8.3.0
error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
2019-07-12 19:38:10 +02:00
Sergei Golubchik
d78a14c599 cmake 3.14.3 warnings 2019-07-12 19:38:10 +02:00
Thirunarayanan Balathandayuthapani
aba2b41e9e MDEV-19978 Page read from tablespace is corrupted
Problem:
=======
  Checksum fields can have value as zero. In that case, InnoDB falsely
consider that page should be all zeroes. It leads to wrong detection of page
corruption.

Solution:
========
	Remove the condition that checks if checksum fields are zero then
page should be all zeroes.
2019-07-11 18:25:25 +05:30
Eugene Kosov
a0230bc76d MDEV-18266 Changing an index comment unnecessarily rebuilds index
ALTER_CHANGE_INDEX_COMMENT: new handler flag added

Compare_keys::EqualButComment: new outcome of compare_keys_but_name()
2019-07-10 21:36:29 +03:00
Thirunarayanan Balathandayuthapani
07b1a26c33 MDEV-19630 ALTER TABLE ... ADD COLUMN damages foreign keys
which are pointed to the table being altered
Problem:
========
	InnoDB failed to change the column name present in foreign key cache
for instant add column. So it leads to column mismatch for the consecutive
rename of column.

Solution:
=========
	Evict the foreign key information from cache and load the foreign
key information again for instant operation.
2019-07-10 13:24:10 +05:30
Thirunarayanan Balathandayuthapani
7df17ca8aa MDEV-19974 InnoDB: Cannot load compressed BLOB
Problem:
=======
	During online alter, fts tokenization thread uses new table page size
to read the externally stored page from old table. If the alter changes
the page size then it leads to failure of alter table.

Solution:
=========
	fts tokenization thread should use old table page size to read the
externally stored page from old table.
2019-07-10 13:21:40 +05:30
Thirunarayanan Balathandayuthapani
64900e3d7c MDEV-15641 InnoDB crash while committing table-rebuilding ALTER TABLE
Problem:
========
 There is a possibility that there can be more concurrent DMLs While the
alter table thread is waiting for upgrading to MDL_EXCLUSIVE before commit phase.
In commit phase, InnoDB acquires dict_operation_lock and it already holds MDL_EXCLUSIVE
on the table. After that, InnoDB applies the concurrent DML logs in commit phase.
This could lead to blocking of the following things:

  1) DML on the particular table (due to MDL_EXCLUSIVE on the table)
  2) InnoDB DDLs (due to dict_operation_lock)
  3) Purge thread, stats thread, the master thread (due to dict_operation_lock)

Fix:
====
Apply the concurrent DML logs in commit phase but before acquiring
dict_operation_lock in commit phase. It makes sure that (2), (3) can't be
blocked for longer time.
2019-07-10 12:43:51 +05:30
Sergei Golubchik
a43edf73f3 restore RESTRICT_SYMBOL_EXPORTS(zlib)
that was lost in c54271723c

remove zlib/libxml2 workaround in CONNECT
2019-07-10 08:58:28 +02:00
Alexander Barkov
e37d7a3715 MDEV-20006 Move geometry specific code in Field_blob::get_key_image() to Field_geom 2019-07-10 07:17:25 +04:00
Eugene Kosov
4f1e4aa2ca fix clang warnings 2019-07-09 22:16:43 +03:00
Alexander Barkov
feb2695ed3 MDEV-20004 Move Field_geom from field.cc to sql_type_geom.cc 2019-07-09 19:47:57 +04:00
Eugene Kosov
26c389b7b7 Merge 10.1 into 10.2 2019-07-09 13:22:22 +03:00
Aleksey Midenkov
cf7a8b9eb2 MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf on table with virtual columns and indexes
Cause
Stale thd->m_stmt_da->m_sql_errno which is from different invocation.

Fix
Reset error state before attempt to open table.
2019-07-09 10:01:54 +03:00
Aleksey Midenkov
e91fb70f99 MDEV-19785 Storage CONNECT compilation error: unknown type name 'UNZFAM'
Another fail fix:

undefined reference to `ZipLoadFile`
2019-07-09 10:01:54 +03:00
Aleksey Midenkov
53dd0e4f75 MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf on table with virtual columns and indexes
Cause
Stale thd->m_stmt_da->m_sql_errno which is from different invocation.

Fix
Reset error state before attempt to open table.
2019-07-08 20:14:51 +03:00
Aleksey Midenkov
0fe212a880 MDEV-19785 Storage CONNECT compilation error: unknown type name 'UNZFAM'
Another fail fix:

undefined reference to `ZipLoadFile`
2019-07-08 20:14:51 +03:00
Aleksey Midenkov
6974962945 MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf on table with virtual columns and indexes
Cause
Stale thd->m_stmt_da->m_sql_errno which is from different invocation.

Fix
Reset error state before attempt to open table.
2019-07-08 14:55:59 +03:00
Aleksey Midenkov
1bb57e59a1 MDEV-19785 Storage CONNECT compilation error: unknown type name 'UNZFAM'
Another fail fix:

undefined reference to `ZipLoadFile`
2019-07-08 13:25:04 +03:00
Aleksey Midenkov
08baaa14b9 MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf on table with virtual columns and indexes
Cause
Stale thd->m_stmt_da->m_sql_errno which is from different invocation.

Fix
Reset error state before attempt to open table.
2019-07-07 23:11:20 +03:00
Aleksey Midenkov
29ffaf405e MDEV-19785 Storage CONNECT compilation error: unknown type name 'UNZFAM'
Another fail fix:

undefined reference to `ZipLoadFile`
2019-07-07 23:11:20 +03:00
Sergei Petrunia
9abdf11ed1 Update RocksDB the revision that fixes the compile error on power8 2019-07-07 18:17:17 +03:00
Kentoku SHIBA
9d6b601e79
MDEV-19866 With a Spider table, a SELECT with WHERE involving primary key breaks following SELECTs (#1356)
Change checking scanning partitions from part_spec to part_info->read_partitions
2019-07-06 23:54:53 +09:00
Kentoku SHIBA
fa7051c419
MDEV-19842 Crash while creating statistics for Spider table (#1355)
Added checks of the number of columns of the system tables.
Move install_spider.sql into source code except installing Spider
2019-07-06 23:52:53 +09:00
Kentoku SHIBA
4a739d7650
MDEV-16248 Row based replication to spider with float column fails on delete/update (#1354) 2019-07-06 22:38:43 +09:00
Eugene Kosov
fb3998c351 fix build 2019-07-05 18:27:44 +03:00
Eugene Kosov
5ebef42238 MDEV-19292 "Row size too large" error when creating table with lots columns when row format is DYNAMIC or COMPRESSED
Basic idea of the patch: disallow creating tables which allow to create
rows which are too big to insert. In other words, if user created a table user
should never see an errors like 'can not insert row as it is too big for current
page size'.

SET innodb_strict_mode=OFF; will allow to create very long tables and only a
warning will be issued.

dict_table_t::get_overflow_field_local_len(): this function lets know a maximum
local field len for overflow fields for every file and row format.

innobase_check_column_length(): improve name to too_big_key_part_length()
and reuse in a different part of code.

create_table_info_t::prepare_create_table(): add check for maximum allowed
key part length to keep ALGORITHM=COPY behavior similar to ALGORITHM=INPLACE
behavior. Affected test is innodb.strict_mode

Rename dict_index_too_big_for_tree() to
dict_index_t::rec_potentially_too_big(): copy overflow-related size computation
from dtuple_convert_big_rec(). A lot of tests was changed because of that.
I wonder whether users will complain about it?

Test innodb.max_record_size tests dict_index_t::rec_potentially_too_big()
for different row formats and page sizes.
2019-07-05 17:02:21 +03:00
Eugene Kosov
c9aa495fb6 MDEV-19955 make argument of handler::ha_write_row() const
MDEV-19486 and one more similar bug appeared because handler::write_row() interface
welcomes to modify buffer by storage engine. But callers are not ready for that
thus bugs are possible in future.

handler::write_row():
handler::ha_write_row(): make argument const
2019-07-05 13:14:19 +03:00
Eugene Kosov
23c12ed5cb MDEV-19951 use override keyword across the InnoDB
Use on every virtual function override.

ha_innobase: mark a final

ha_innobase::bas_ext(): remove as unused

ha_innobase::get_cascade_foreign_key_table_list: remove as unused

ha_innobase::end_stmt(): merge into ha_innobase::reset()
2019-07-04 16:28:27 +03:00
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
Sergei Petrunia
c17b0b734c MDEV-19936: MyRocks: compile fails on Windows
(Cumulative diff, back-port to 10.2)
Remove other unneeded files which cause compile
warnings-treated-as-errors errors on Windows.
2019-07-04 00:53:07 +03: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
Sergei Petrunia
099007c3c9 MDEV-19936: MyRocks: compile fails on Windows
Part#2: Remove other unneeded files which cause compile
warnings-treated-as-errors errors on Windows.
2019-07-03 16:08:26 +03:00
Marko Mäkelä
24403da91a Remove unused const TABLE_HASH_SIZE 2019-07-03 14:42:04 +03:00
Robert Bindar
666730ee52 Fix gcc-8 warning in rocksdb 2019-07-03 14:32:24 +03:00
Sergei Petrunia
7d580ad141 MDEV-19936: MyRocks: compile fails on Windows
Don't compile table/mock_table.cc
(pushing this patch to 10.3 first to make sure it fixes the issue
will push to 10.2, too)
2019-07-03 10:58:40 +03:00
Marko Mäkelä
a946b36601 Fix the compilation after the parent commit
Up to MariaDB 10.2, field_name is still a C-style string.
2019-07-02 22:25:48 +03:00
Marko Mäkelä
7a3d34d645 Merge 10.3 into 10.4 2019-07-02 21:44:58 +03:00
Marko Mäkelä
1d45b3b055 Merge 10.2 into 10.3 2019-07-02 21:41:40 +03:00
Marko Mäkelä
c1cb5c17be MDEV-19869: Correct the logic, and avoid type mismatch 2019-07-02 21:40:34 +03:00
Marko Mäkelä
e82fe21e3a Merge 10.2 into 10.3 2019-07-02 17:46:22 +03:00
Marko Mäkelä
6bb922e58e MDEV-13626: Import and adjust innodb.blob-crash 2019-07-02 15:18:12 +03:00
Jan Lindström
b105427745 MDEV-19660: wsrep_rec_get_foreign_key() is dereferencing a stale pointer to a page that was previously latched
In row_ins_foreign_check_on_constraint(), clustered index record is being passed to wsrep_append_foreign_key() after releasing the latch. If a record has been changed by other thread in the meantime then it could lead to a crash when
wsrep_rec_get_foreign_key () tries to access the record.

row_ins_foreign_check_on_constraint
	Use cascade->pcur->old_rec instead of clust_rec.

row_ins_check_foreign_constraint
	Add missing error printout.
2019-07-02 10:06:13 +03:00
Thirunarayanan Balathandayuthapani
41f6e68878 MDEV-19781 Add page id matching check in innochecksum tool
- Changed the assert to ignore SRV_LOG_SPACE_FIRST_ID. Post push
fix to address the previous commit failure.
2019-07-01 21:58:20 +05:30
Marko Mäkelä
9c16460e63 Merge 10.3 into 10.4 2019-07-01 18:37:15 +03:00
Marko Mäkelä
0e1ba364a1 MDEV-19916 Corruption after instant ADD/DROP and shrinking the tree
btr_lift_page_up(): Correct the incorrect condition.

page_validate(): Validate the page type.
2019-07-01 18:24:54 +03:00
Marko Mäkelä
92bbf4f53d MDEV-19916: Improve page_validate()
page_validate(): Validate also the page type, and try to list all
errors that were encountered for the page, with a little more detail.
2019-07-01 18:24:35 +03:00
Thirunarayanan Balathandayuthapani
40c1f4bd4c MDEV-19781 Add page id matching check in innochecksum tool
Changed the debug insert inside fil_io() to check whether it writes
the page to wrong offset only for user tablespace.
2019-07-01 20:21:26 +05:30
Thirunarayanan Balathandayuthapani
dca9792a24 MDEV-17228 Encrypted temporary tables are not encrypted
- log_crypt_init() should be called from create_log_files(). Because
it should re-create the new random nonce compared to the old ones.
2019-07-01 18:50:44 +05:30
Marko Mäkelä
5a136d84f3 MDEV-19766: Disable page dump output in debug builds
The test innodb.leaf_page_corrupted_during_recovery
fails on buildbot with

Warning	1406	Data too long for column 'line' at row 10
line
 len 16384; hex ...

because of a page dumps that InnoDB is generating for a corrupted page

Since this test is using debug instrumentation, we will solve the
issue by disabling page dumps in debug builds altogether. Users of
debug builds will likely know how to extract page dumps in other means.

Page dump output could sometimes be useful when diagnosing problems
that users are facing. Hence we will keep the page dump output in
non-debug (release) builds.
2019-07-01 13:27:12 +03:00