Commit graph

188141 commits

Author SHA1 Message Date
Marko Mäkelä
8cc15c036d Merge 10.4 into 10.5 2019-12-27 21:17:16 +02:00
Marko Mäkelä
b86e0f25f8 Cleanup: Use more page_id_t in crash recovery 2019-12-27 20:44:34 +02:00
Marko Mäkelä
4c25e75ce7 Merge 10.3 into 10.4 2019-12-27 18:20:28 +02:00
Marko Mäkelä
808bc919eb Re-record funcs_1.is_columns_is_embedded after a merge
This was broken since commit 193b5ed50b
2019-12-27 17:04:47 +02:00
Alexander Barkov
1d9532cd8b After-merge cleanup 2019-12-27 18:22:16 +04:00
Marko Mäkelä
5ab70e7f68 Merge 10.2 into 10.3 2019-12-27 15:14:48 +02:00
Oleksandr Byelkin
cc28947315 MDEV-20632: prerequisite:
Removed hack with with_list
2019-12-27 10:49:52 +01:00
Marko Mäkelä
16bce0f6fe Cleanup: Remove dict_delete_tablespace_and_datafiles()
The function was only called by innobase_drop_tablespace(),
which was removed in commit 494e4b99a4
and added in commit 2e814d4702.
2019-12-27 11:23:28 +02:00
Varun Gupta
891609b571 MDEV-21318: Wrong results with window functions and implicit grouping
The issue here is for degenerate joins we should execute the window
function but it is not getting executed in all the cases.

To get the window function values window function needs to be executed
always. This currently does not happen in few cases
where the join would return 0 or 1 row like
  1) IMPOSSIBLE WHERE
  2) MIN/MAX optimization
  3) EMPTY CONST TABLE

The fix is to make sure that window functions get executed
and the temporary table is setup for the execution of window functions
2019-12-26 15:18:49 +05:30
Vladislav Vaintroub
961413d26f Fix PCRE2 build for Windows, with Ninja and Makefiles generator.
Also, suppress pcre2 warning, it is external project, its warnings should
not bother us.
2019-12-25 15:09:51 +00:00
Alexander Barkov
4c57ab34d4 Merge remote-tracking branch 'origin/10.3' into 10.4 2019-12-25 13:33:28 +04:00
Alexander Barkov
ee9a19fb05 MDEV-21392 Cleanup redundant overriding in Item_sum_num 2019-12-25 12:23:24 +04:00
Alexander Barkov
b21dc11986 MDEV-21389 Derive Item_func_month from Item_long_func 2019-12-24 18:10:18 +04:00
Alexander Barkov
3dfe1ba3b8 MDEV-21388 Wrong result of DAYNAME()=xxx in combination with condition_pushdown_for_derived=on 2019-12-24 15:05:52 +04:00
Eugene Kosov
373443903b MDEV-21362 do something with -fno-builtin-memcmp for rem0cmp.cc
Such CMake check is not relevant as the oldest supported gcc is 4.8 and
compiler issue was solved in gcc-4.6 already.
https://godbolt.org/z/7G64qo

cmp_data(): simplify code
2019-12-24 17:06:04 +08:00
Eugene Kosov
cbc170adf2 MDEV-21362 do something with -fno-builtin-memcmp for rem0cmp.cc
innodb.cmake: restrict -fno-builtin-memcmp for GCC versions older that 4.6
where optimization issue was solved.
2019-12-24 17:03:27 +08:00
Jan Lindström
3fbd9f1522 MDEV-20909 : Galera test failure on galera.galera_gcs_fc_limit: Server crash with signal 6
Add proper wait condition when provider options are restored.
2019-12-23 16:06:25 +02:00
Sujatha
714762ddb7 MDEV-18648: slave_parallel_mode= optimistic default in 10.5
Description:
============
To change 'CONSERVATIVE' @@global.slave_parallel_mode default to 'OPTIMISTIC'
in 10.5.

@sql/sys_vars.cc
Changed default parallel_mode to 'OPTIMISTIC'

@sql/rpl_filter.cc
Changed default parallel_mode to 'OPTIMISTIC'

@sql/mysqld.cc
Removed the initialization of 'SLAVE_PARALLEL_CONSERVATIVE' to
'opt_slave_parallel_mode' variable.

@mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test
@mysql-test/suite/rpl/t/rpl_mdev6386.test
Added 'mtr' suppression to ignore 'ER_PRIOR_COMMIT_FAILED'. In case of
'OPTIMISTIC' mode if a transaction gets killed during "wait_for_prior_commit"
it results in above error "1964". Hence suppression needs to be added for this
error.

@mysql-test/suite/rpl/t/rpl_parallel_conflicts.test
Test has a 'slave.opt' which explicitly sets slave_parallel_mode to
'conservative'. When the test ends this mode conflicts with new default mode.
Hence check test case reports an error. The 'slave.opt' is removed and options
are set and reset within test.

@mysql-test/suite/multi_source/info_logs.result
@mysql-test/suite/multi_source/reset_slave.result
@mysql-test/suite/multi_source/simple.result
Result content mismatch in "show slave status" output. This is expected as new
slave_parallel_mode='OPTIMISTIC'.

@mysql-test/include/check-testcase.test
Updated default 'slave_parallel_mode' to 'optimistic'.

Refactored rpl_parallel.test into following test cases.
Test case 1: @mysql-test/suite/rpl/t/rpl_parallel_domain.test
Test case 2: @mysql-test/suite/rpl/t/rpl_parallel_domain_slave_single_grp.test
Test case 3: @mysql-test/suite/rpl/t/rpl_parallel_single_grpcmt.test
Test case 4: @mysql-test/suite/rpl/t/rpl_parallel_stop_slave.test
Test case 5: @mysql-test/suite/rpl/t/rpl_parallel_slave_bgc_kill.test
Test case 6: @mysql-test/suite/rpl/t/rpl_parallel_gco_wait_kill.test
Test case 7: @mysql-test/suite/rpl/t/rpl_parallel_free_deferred_event.test
Test case 8: @mysql-test/suite/rpl/t/rpl_parallel_missed_error_handling.test
Test case 9: @mysql-test/suite/rpl/t/rpl_parallel_innodb_lock_conflict.test
Test case 10: @mysql-test/suite/rpl/t/rpl_parallel_gtid_slave_pos_update_fail.test
Test case 11: @mysql-test/suite/rpl/t/rpl_parallel_wrong_exec_master_pos.test
Test case 12: @mysql-test/suite/rpl/t/rpl_parallel_partial_binlog_trans.test
Test case 13: @mysql-test/suite/rpl/t/rpl_parallel_ignore_error_on_rotate.test
Test case 14: @mysql-test/suite/rpl/t/rpl_parallel_wrong_binlog_order.test
Test case 15: @mysql-test/suite/rpl/t/rpl_parallel_incorrect_relay_pos.test
Test case 16: @mysql-test/suite/rpl/t/rpl_parallel_retry_deadlock.test
Test case 17: @mysql-test/suite/rpl/t/rpl_parallel_deadlock_corrupt_binlog.test
Test case 18: @mysql-test/suite/rpl/t/rpl_parallel_mode.test
Test case 19: @mysql-test/suite/rpl/t/rpl_parallel_analyze_table_hang.test
Test case 20: @mysql-test/suite/rpl/t/rpl_parallel_record_gtid_wakeup.test
Test case 21: @mysql-test/suite/rpl/t/rpl_parallel_stop_on_con_kill.test
Test case 22: @mysql-test/suite/rpl/t/rpl_parallel_rollback_assert.test
2019-12-23 17:48:01 +05:30
Jan Lindström
17b1b8118a MDEV-21189 : Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION sql_log_bin = 0' cases the galera node to hang
Test cleanup. Best practice for using RSU, is to isolate the node
up-front, so this test did not reflect real world scenario
2019-12-23 12:57:22 +02:00
Jan Lindström
cc9c55b2e2 MDEV-21189 : Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION sql_log_bin = 0' cases the galera node to hang
Test cleanup. Best practice for using RSU, is to isolate the node
up-front, so this test did not reflect real world scenario
2019-12-23 12:43:15 +02:00
Thirunarayanan Balathandayuthapani
90ba87cb9e MDEV-19176 Reduce the memory usage during recovery
- post-push to fix the compilation issue
2019-12-23 15:56:57 +05:30
Thirunarayanan Balathandayuthapani
bba59abb03 MDEV-19176 Reduce the memory usage during recovery
- Moved the recv_sys->heap memory condition inside recv_parse_log_recs().
So that, InnoDB can mark the status as STORE_NO earlier.

- InnoDB uses one third of buffer pool chunk size for reading the redo
log records. In that case, we can avoid the scenario where buffer ran
out of memory issue during recovery.
2019-12-23 15:51:02 +05:30
Marko Mäkelä
a59a015a75 Plug memory leaks from numa_get_mems_allowed() 2019-12-23 07:47:16 +02:00
Marko Mäkelä
73985d8301 Merge 10.1 into 10.2 2019-12-23 07:14:51 +02:00
Eugene Kosov
496532b5c5 MDEV-20950: Fix 32-bit Windows build 2019-12-21 21:36:25 +02:00
Alexey Botchkov
aaaf6ceb8b MDE-21369 rpl.rpl_timezone fails with valgrind: Use of uninitialised value.
It's not safe to chenge the THD::thread_id.
So send the thread_id as an argument to the mysql_audit_external_lock.
2019-12-21 13:46:33 +04:00
Sergei Golubchik
7e10e80b8f correct dbug function names 2019-12-21 10:42:19 +01:00
Sergei Golubchik
83b0468c47 dependencies for VS
item_cmpfunc.h includes pcre2.h, so with the bundled pcre2
it has to be built before anything that includes pcre2.h .
And item_cmpfunc.h is indirectly included everywhere,
also in many plugins.

Somehow Ninja and Makefiles generators can still deduce the
correct build dependencies, but Visual Studio generator cannot.

Two changes:
* move pcre2.h from item_cmpfunc.h to item_cmpfunc.cc
* create an explicit dependency on pcre2 for the server
2019-12-21 10:42:12 +01:00
Sergei Golubchik
67f928d8c2 remove pcre, add support for bundled pcre2 2019-12-21 10:35:07 +01:00
Sergei Golubchik
3b654d54c1 longer regex error messages 2019-12-21 10:34:02 +01:00
Alexey Botchkov
9dadfdcde5 MDEV-14024 PCRE2.
Related changes in the server code.
2019-12-21 10:34:02 +01:00
Sergei Golubchik
aade6e53d3 fix a bad merge
in 10.1+ one should use

MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-address-of-packed-member")

and it's already done in storage/tokudb/PerconaFT/CMakeLists.txt
2019-12-20 19:47:31 +01:00
Marko Mäkelä
8174e68895 MDEV-21371 Assertion failure in page_rec_get_next_low() during innodb_gis.rtree_compress
A debug assertion that was added in
commit ed0793e096
turns out to be too strict. In the test innodb_gis.rtree_compress,4k
the function is sometimes being invoked by purge for a
spatial index root page that is not a leaf page (PAGE_LEVEL is 1).
2019-12-20 19:21:37 +02:00
Marko Mäkelä
ce70573f62 MDEV-21353 Assertion failures due to btr_pcur_restore_pos() misbehaving
In commit befde6e97e
a bogus condition was added, aiming to avoid debug assertion failures
during ALTER TABLE...IMPORT TABLESPACE.

page_cur_delete_rec(): Remove the bogus condition, and replace the
use of buf_block_modify_clock_inc() with a lower-level operation
that skips the debug checks that would fail during IMPORT.
2019-12-20 17:57:32 +02:00
Eugene Kosov
f6b58d2916 MDEV-21239 ASAN use-after-poison in a server shutdown in innodb.innodb_buffer_pool_resize
If we manually poison memory region, ASAN requires that we manually unpoison
it too. We didn't do it and munmap() didn't do it too. That was the issue.

os_mem_free_large(): unpoison memory region. Just in case.

https://github.com/google/sanitizers/issues/182
86acaa9457/compiler-rt/include/sanitizer/asan_interface.h (L21)
2019-12-20 19:59:58 +08:00
Alexander Barkov
5e0c80c2a5 An extra test with NULLIF() for MDEV-13995 MAX(timestamp) returns a wrong result near DST change 2019-12-20 15:59:09 +04:00
Eugene Kosov
305081a735 check I/O buffer size and alignment in InnoDB 2019-12-19 23:46:49 +08:00
Alexander Barkov
1f1e3ce8a1 MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
Item_ref::val_(datetime|time)_packed() erroneously called
(*ref)->val_(datetime|time)_packed().

- Fixing to call (*ref)->val_(datetime|time)_packed_result().
- Backporting Item::val_(datetime|time)_packed_result() from 10.3.
- Fixing Item_field::get_date_result() to handle null_value in the same
  way how Item_field::get_date() does.
2019-12-19 14:03:54 +04:00
Eugene Kosov
a5a433e256 fix windows compilation 2019-12-18 23:35:33 +08:00
Marko Mäkelä
44be8652c5 Cleanup: Remove fil_space_get_flags()
Replace fil_space_get_flags(space) == ULINT_UNDEFINED
with the functionally equivalent fil_space_get_size(space) == 0.
2019-12-18 16:27:26 +02:00
Eugene Kosov
3d3d8f1012 MDEV-21337 fix aligned_malloc()
do not fallback to malloc(), always return properly aligned buffer
2019-12-18 20:09:52 +08:00
Sergei Petrunia
984b3c1544 MDEV-21341: Fix UBSAN failures, part #3
One may not call memcpy(dst, src=NULL, size), even if size==0.
2019-12-18 13:11:07 +03:00
Sergei Petrunia
8b9db11718 MDEV-21341: Fix optimizer-related UBSAN failures, part #2
Remove Query_tables_list::lock_tables_state - it is not used and it causes
errors like this:

sql_lex.h:1675:7: runtime error: load of value 2779096485, which is not a
valid value for type 'enum_lock_tables_state'
2019-12-18 12:56:54 +03:00
Sergei Petrunia
0ac0bc8cb6 MDEV-21341: Fix optimizer-related UBSAN failures, part #1:
Fix wrong typecast
2019-12-18 12:34:14 +03:00
Jan Lindström
c3824766c5 Fortify galera_partition test. 2019-12-18 10:02:57 +02:00
Jan Lindström
e9259d50f0 MDEV-21335 : Galera test failure on suite wsrep
Problem was that wsrep_on was OFF.
2019-12-18 10:02:57 +02:00
Jan Lindström
088de81d96 MDEV-21335 : Galera test failure on suite wsrep
Problem was that wsrep_on was OFF.

This is 10.4 version.
2019-12-18 08:22:07 +02:00
Vladislav Vaintroub
189fa30085 MDEV-21343 Threadpool/Unix- wait_begin() function does not wake/create threads, when it should
Fixed the condition for waking up/creating another thread.

If there is some work to do (if the request queue is not empty),
a thread should be woken or created.

The condition was incorrect since 18c9b345b4
2019-12-17 21:57:40 +01:00
Sergei Golubchik
0d70f40bdb Disable -Werror for rocksdb submodule
We cannot have -Werror for third-party submodules because
whenever they break the build we cannot fix it as needed.
2019-12-17 21:22:57 +01:00
Varun Gupta
164cf4f463 MDEV-16579: Wrong result of query using DISTINCT COUNT(*) OVER (*)
The query requires 2 temporary tables for execution, the window function
is always attached to the last temporary table, but in this case the
result field of the window function points to the first temporary table
rather than the last one.
Fixed this by not changing window function items with temporary table
items of the first temporary table.
2019-12-17 21:45:53 +05:30