Commit graph

187045 commits

Author SHA1 Message Date
Monty
97dd057702 Fixed issues when running mtr with --valgrind
- Note that some issues was also fixed in 10.2 and 10.4. I also fixed them
  here to be able to continue with making 10.5 valgrind safe again
- Disable connection threads warnings when doing shutdown
2019-08-23 22:03:54 +02:00
Monty
b444b6b910 Removed some warnings from InnoDB when compiled with clang 2019-08-23 22:03:54 +02:00
Monty
a38f47e90c Fixed compiler warnings from connect engine
- clang complains about register in C++
- Removed not used variables
- Fixed bug when printing date in filamdbf.cpp
- Added {} to fix warning about dangling else
- Changed connect_done_func() to be global to remove conflict with header
  files
- Added extra () around assignment in if
2019-08-23 22:03:54 +02:00
Monty
de8b51fdc9 Fixed some test that failed randomly 2019-08-23 22:03:54 +02:00
Monty
76ce6ae4bb Removed some compiler warnings found by clang
- Fixed some unitialized variables
- Removed some warnings:
  -Wno-parentheses-equality gives warnings from macro-expressions
  -Wno-string-plus-int is not a common problem and it's not trivial to
  fix it in connect
2019-08-23 22:03:54 +02:00
Monty
4a75b480e9 Fixed BUILD scripts for gcc 6.x
Added also -DTRASH_FREE_MEMORY to valgrind builds
2019-08-23 22:03:54 +02:00
Sergei Golubchik
e6bad1c75d move Aria/S3 specific flag into Aria code
it doesn't belong in include/my_base.h
2019-08-23 22:02:39 +02:00
Monty
1b5e5bdef3 MDEV-20306 Assert when converting encrypted Aria table to S3
Changes:
- maria_create() now uses a bit in the parameter flags to check if table
  should be encrypted instead of using maria_encrypted_tables.
- Don't encrypt tables that are to be converted to S3
- Added encrypted flag to ARIA_TABLE_CAPABILITIES
- maria_chk --description now prints if table is encrypted. Other
  operations is not allowed on encrypted tables.
2019-08-23 22:02:39 +02:00
Monty
bb6d674df9 Fixed assertion Assertion `!table->pos_in_locked_tables' failed
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-23 22:02:39 +02:00
Sergei Golubchik
2e665fb294 alloc_on_stack: simplify the API 2019-08-23 22:01:39 +02:00
Monty
6c50875a38 MDEV-20279 Increase Aria index length limit
Limit increased from 1000 to 2000.

Avoiding stack overflow by only storing keys and pages on the stack in
recursive functions if there is plenty of space on it.

Other things:
- Use less stack space for b-tree operations as we now only allocate as
  much space as needed instead of always allocating HA_MAX_KEY_LENGTH.
- Replaced most usage of my_safe_alloca() in Aria with the stack_alloc
  interface.
- Moved my_setstacksize() to mysys/my_pthread.c
2019-08-23 11:26:04 +02:00
Sergey Vojtovich
afe969ba05 Removed redundant log_type == LOG_BIN checks 2019-08-22 13:20:30 +04:00
Sergey Vojtovich
6b0b25a25b Cleanup log_type_arg of MYSQL_BIN_LOG::open()
It is always LOG_BIN anyway.
2019-08-22 13:20:30 +04:00
Sergey Vojtovich
e976d95614 Cleanup MYSQL_LOG
Embed MYSQL_LOG::init().
Reduce visibility of MYSQL_LOG::init_and_set_log_file_name().
Cleanup unused mysql_bin_log_file_name() and mysql_bin_log_file_pos().
2019-08-22 13:20:30 +04:00
Alexander Barkov
1d58e62d5b MDEV-20384 Assertion `field.is_sane()' failed in Protocol_text::store_field_metadata 2019-08-19 20:57:59 +04: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
Alexander Barkov
cb4dcf39e7 MDEV-20363 Assertion `is_unsigned() == attr.unsigned_flag' failed in Type_handler_longlong::make_table_field 2019-08-16 22:49:56 +04:00
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ä
fe6eac0cf7 MDEV-19200: shutdown timeout on innodb.undo_truncate_recover
Optimize the test by dropping the table early and by using only
one undo log thread, so that purge will be doing more useful work
and less busy work of suspending and resuming the worker threads.

The test used to cause shutdown timeout on 10.4 on buildbot, and
for me locally when using --mysqld=--innodb-sync-debug.
With these tweaks, it passes for me with --mysqld=--innodb-sync-debug.
2019-08-16 09:56:43 +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
Jan Lindström
3bbf008096 Remove file accidentally pushed. 2019-08-16 08:33:01 +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
Jan Lindström
e6b505fd3c MDEV-18778: mysql_tzinfo_to_sql does not work correctly in MariaDB Galera
There were two problems:

(1) If user wanted same time zone information on all nodes in the Galera
cluster all updates were not replicated as time zone information was
stored on MyISAM tables. This is fixed on Galera by altering time zone
tables to InnoDB while they are modified.

(2) If user wanted different time zone information to nodes in the Galera
cluster TRUNCATE TABLE for time zone tables was replicated by Galera
destroying time zone information from other nodes. This is fixed
on Galera by introducing new option for mysql_tzinfo_to_sql_symlink
tool --skip-write-binlog to disable Galera replication while
time zone tables are modified.

Changes to be committed:
        modified:   mysql-test/r/mysql_tzinfo_to_sql_symlink.result
        modified:   mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
        new file:   mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result
        new file:   mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test
        modified:   sql/tztime.cc

This is 10.4 version of commit fa74088838
2019-08-16 07:07:31 +03:00
Alexander Barkov
6073049a36 MDEV-20353 Add separate type handlers for unsigned integer data types 2019-08-15 21:53:24 +04: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
Marko Mäkelä
d07936aaba MDEV-19740: Silence a bogus "may be uninitialized" warning 2019-08-15 15:58:37 +03:00
Marko Mäkelä
ec28f9532e MDEV-19740: Fix C++11 violations caught by GCC 9.2.1 2019-08-15 15:58:37 +03:00
Jan Lindström
136cf0400f Fix result error. 2019-08-15 13:48:55 +03:00
Jan Lindström
0b20b9e911 Disable galera.query_cache as it still fails on bb and azure. 2019-08-15 12:53:08 +03:00
Jan Lindström
5a2012d2b3 Fix test failure on galera-features#56
We need to use wsrep_sync_wait=15 before selects to make sure
that node has applied all inserts from other node.
2019-08-15 12:40:27 +03:00
Sujatha
828191b6a0 MDEV-20348: DROP TABLE IF EXISTS killed on master but was replicated
Merge branch '10.2' into 10.3
2019-08-15 14:09:53 +05:30
Monty
ae4b9b7689 Fixed crash introduced with change to memcpy_field_possible 2019-08-15 11:34:44 +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
Alexander Barkov
841294cfaa MDEV-20351 Window function BIT_OR() OVER (..) return a wrong data type 2019-08-15 10:32:42 +04: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
Sujatha
29e560cdf3 MDEV-20348: DROP TABLE IF EXISTS killed on master but was replicated
Problem:
=======
DROP TABLE IF EXISTS was killed. The table still exists on
the master but the DDL was still logged.

Analysis:
=========
During the execution of DROP TABLE command "ha_delete_table" call is invoked
to delete the table. If the query is killed at this point, the kill command
is not handled within the code. This results in two issues.
1) The table which is not dropped also gets written into the binary log.
2) The code continues further upon receiving 'KILL QUERY'.

Fix:
===
Upon receiving the KILL command the query should stop its current execution.
Tables which were successfully dropped prior to KILL command should be
included in the binary log.
2019-08-14 22:53:16 +05:30
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
Aleksey Midenkov
a20f6f9853 MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
Exclude SELECT and INSERT SELECT from vers_set_hist_part(). We cannot
likewise exclude REPLACE SELECT because it may REPLACE into itself
(and REPLACE generates history).

INSERT also does not generate history, but we have history
modification setting which might be interfered.
2019-08-14 17:32:19 +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ä
fa21952e25 Merge 10.4 into 10.5 2019-08-14 12:01:04 +03:00
Aleksey Midenkov
39db116562 MDEV-18862 Unfortunate error message upon attempt to drop system versioning
Fix error code.
2019-08-14 11:58:58 +03:00
Marko Mäkelä
c4feef50cf MDEV-20138 innodb.trx_id_future fails on 10.4+
Adjust the test for full_crc32.
2019-08-14 11:58:22 +03:00