Commit graph

190387 commits

Author SHA1 Message Date
Varun Gupta
737c3025e9 MDEV-10120: Wrong result of UNION .. ORDER BY GROUP_CONCAT()
Reject queries that have aggregate functions with UNION as these
are not allowed by standard.
2020-07-10 00:01:24 +05:30
Eugene Kosov
24ed08c3c4 fix compilation with gcc-10
../sql/sql_class.cc: In constructor ‘start_new_trans::start_new_trans(THD*)’:
../include/m_string.h:61:49: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct Ha_data’; use assignment or value-initialization instead [-Werror=class-memaccess]
   61 | # define bzero(A,B)             memset((A),0,(B))
      |                                                 ^
../sql/sql_class.cc:5805:3: note: in expansion of macro ‘bzero’
 5805 |   bzero(thd->ha_data, sizeof(thd->ha_data));
      |   ^~~~~
In file included from ../sql/sql_class.cc:33:
../sql/sql_class.h:2003:8: note: ‘struct Ha_data’ declared here
 2003 | struct Ha_data
      |        ^~~~~~~
2020-07-09 21:12:11 +03:00
Oleksandr Byelkin
a759f9af51 Fix typo in the comment (and old info) 2020-07-09 08:54:59 +02:00
Sergei Petrunia
41221091f6 MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey
In mi_check_index_tuple(), when rowid filter check returns
CHECK_OUT_OF_RANGE, set info->lastpos= HA_OFFSET_ERROR, like
it is done above for the ICP check.
2020-07-08 23:27:19 +03:00
Varun Gupta
7148b84673 MDEV-13694: Wrong result upon GROUP BY with orderby_uses_equalities=on
For the case when  the SJM scan table is the first table in the join order,
then if we want to do the sorting on the SJM scan table, then we need to
make sure that we unpack the values to base table fields in two cases:
    1) Reading the SJM table and writing the sort-keys inside the sort-buffer
    2) Reading the sorted data from the sort file
2020-07-08 20:43:57 +05:30
Oleksandr Byelkin
0d6d801e58 MDEV-23102 10.4 create mariadb.sys user on each update even is the user is not needed
Check if we really need the mariadb.sys user
2020-07-08 13:10:07 +02:00
Otto Kekäläinen
55c7536a02 Add man page for new command aria_s3_copy
Based on output of 'aria_s3_copy --help'.

Also fix a typo in command help.
2020-07-08 12:24:55 +03:00
Eugene Kosov
0e86254b05 MDEV-22930 Unnecessary contention on rw_lock_list_mutex in ibuf_dummy_index_create()
1. Do not initialize dict_table_t::stats_latch in ibuf
2. Remove overengineering in GenericPolicy to speed up things

dict_mem_table_create(): add new argument init_stats_latch

ibuf_dummy_index_create(): do not initialize dict_table_t::stats_latch

GenericPolicy: add new members m_filename and m_line

sync_file_create_register()
sync_file_created_deregister()
sync_file_created_get()
CreateTracker: remove

rw_lock_t::created: a new debug member
2020-07-08 04:08:30 +03:00
Vicențiu Ciorbaru
f18c5a7ed7 MDEV-23114 AUTH_PAM plugin can not be disabled when using mysql_release config
When setting the PLUGIN_AUTH_PAM variable, mark it as a "CACHE" variable
so it can be overridden by the user.
2020-07-07 17:59:47 +03:00
Varun Gupta
253aa7bbc4 MDEV-12059: Assertion `precision > 0' failed with a window function or window aggregate function
Pass the unsigned flag from the Item_sum to the window function
2020-07-07 17:30:53 +05:30
Eugene Kosov
1ae008d272 replace UT_LIST with ilist in rw_lock_list_t 2020-07-07 09:47:30 +03:00
Eugene Kosov
ee5841376a fix clang compilation 2020-07-06 22:03:58 +03:00
Rucha Deodhar
a536625553 MDEV-22654: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'
failed in Diagnostics_area::set_ok_status on FUNCTION replace

When there is REPLACE in the statement, sp_drop_routine_internal() returns
0 (SP_OK) on success which is then assigned to ret. So ret becomes false
and the error state is lost. The expression inside DBUG_ASSERT()
evaluates to false and thus the assertion failure.
2020-07-06 21:17:15 +05:30
Vladislav Vaintroub
cad9a9b1f8 MDEV-23098 mariadb-upgrade-service.exe does not work on WAMPServer
While trying to detect datadir, take into account that one can use
Windows service name as section name in options file, for Windows service.

The historical obscurity is being used by WAMP installations.
2020-07-06 13:51:25 +02:00
Varun Gupta
6163af9397 MDEV-22390: Assertion `m_next_rec_ptr >= m_rawmem' failed in Filesort_buffer::spaceleft | SIGSEGV in __memmove_avx_unaligned_erms from my_b_write
Make sure that the sort_buffer that is allocated has atleast space for MERGEBUFF2 keys.
The issue here was that the record length is quite high and sort buffer size is very small,
due to which we end up with zero number of keys in the sort buffer. The Sort_param::max_keys_per_buffer
was zero in such a case, due to which we were flushing empty sort_buffer to the disk.
2020-07-06 16:30:27 +05:30
Daniel Black
3efdac2064 MDEV-22173: socket accept - test for failure
accept might return an error, including SOCKET_EAGAIN/
SOCKET_EINTR. The caller, usually handle_connections_sockets
can these however and invalid file descriptor isn't something
to call fcntl on.

Thanks to Etienne Guesnet (ATOS) for diagnosis,
sample patch description and testing.
2020-07-06 12:33:35 +02:00
Oleksandr Byelkin
846174c5ba MDEV-23071 remove potentially dangerouws casting to Item_in_subselect
Remove types casting with a help of virtual functions.
2020-07-06 09:13:15 +02:00
Marko Mäkelä
79c166c56d Fix cmake -DWITH_MSAN=ON
commit ab4069909d accidentally
misplaced #endif directives.
2020-07-05 20:38:50 +03:00
Marko Mäkelä
f3f23b5c4b One more ASAN/MSAN cleanup
commit 484931325e included a
workaround for a 10.5 merge issue that should now be properly
addressed in commit ab4069909d.

buf_chunk_init(): Remove an unnecessary MEM_MAKE_ADDRESSABLE().
We might invoke MEM_UNDEFINED() here, but actually the allocated
memory ought to be guaranteed to be zero-initialized.
2020-07-05 16:31:34 +03:00
Marko Mäkelä
ab4069909d After-merge fix for ASAN and MSAN
The merge commit 0fd89a1a89
of commit b6ec1e8bbf
seems to cause occasional MemorySanitizer failures,
because it failed to replace some MEM_UNDEFINED() calls
with MEM_MAKE_ADDRESSABLE().

my_large_free(): Correctly invoke MEM_MAKE_ADDRESSABLE() after
freeing memory. Failure to do so could cause bogus
AddressSanitizer failures for memory allocated by my_large_malloc().
On MemorySanitizer, we will do nothing.

buf_pool_t::chunk_t::create(): Replace the MEM_MAKE_ADDRESSABLE()
that had been added in commit 484931325e
to work around the issue.
2020-07-05 16:25:29 +03:00
Marko Mäkelä
90d5d90640 Merge 10.4 into 10.5 2020-07-04 22:19:49 +03:00
Marko Mäkelä
b99fa1e767 Merge 10.3 into 10.4 2020-07-04 22:11:16 +03:00
Marko Mäkelä
453dc4b300 Fixup the parent commit for MSAN and Valgrind
commit 484931325e was a necessary
fix for the buffer pool resizing tests in 10.5 in
AddressSanitizer. However, that change would break the tests
innodb.innodb_buffer_pool_resize and
innodb.innodb_buffer_pool_resize_with_chunks
when run in MemorySanitizer, or presumably in Valgrind as well.
(Those tests run "forever" in Valgrind.)

buf_pool_resize(): Cancel the effect of MEM_NOACCESS() in Valgrind
and ASAN. In MSAN, MEM_NOACCESS() is a no-op, and hence we must do
nothing special here.

MEM_MAKE_ADDRESSABLE() would declare the memory contents undefined.
In this particular case, we must actually declare the contents
defined for Valgrind.
2020-07-04 22:02:30 +03:00
Vladislav Vaintroub
9701759b3d MDEV-23043 Refactor Windows service handling
Removed the existing nt_service classes - they provide little
abstraction, and only obscure a relatively simple service handling.
This replaces by similar code inspired by MS docs samples.

Service handling is now moved into winmain.cc, which contains
the main() function for Windows.

winmain provides reporting callbacks, which should be used by external code
,to report transitions from starting to running to shutting down to stopped.

Removed a  do-nothing ServiceMain thread, and the
non-working service "pause/continue".  Removed a lot of #ifdef __WIN__
code from mysqld.cc
2020-07-04 18:24:40 +02:00
Vladislav Vaintroub
d46576b35a merge 10.5 2020-07-04 18:14:41 +02:00
Marko Mäkelä
a85f81af03 MDEV-22535 fixup: Define a single-caller function inline
Let us avoid any overhead in release builds, for an empty function.
2020-07-04 14:28:11 +03:00
Marko Mäkelä
2d00e003b2 After-merge fixes for ASAN
The merge commit 0fd89a1a89
of commit b6ec1e8bbf
was slightly incomplete.

ReadView::mem_valid(): Use the correct primitive
MEM_MAKE_ADDRESSABLE(), because MEM_UNDEFINED() now has
no effect on ASAN.

recv_sys_t::alloc(), recv_sys_t::add(): Use MEM_MAKE_ADDRESSABLE()
instead of MEM_UNDEFINED(), to get the correct behaviour for ASAN.
For Valgrind and MSAN, there is no change in behaviour.

recv_sys_t::free(), recv_sys_t::clear(): Before freeing memory to
buf_pool.free_list, invoke MEM_MAKE_ADDRESSABLE() on the entire
buf_block_t::frame, to cancel the effect of MEM_NOACCESS() in
recv_sys_t::alloc().
2020-07-04 14:28:11 +03:00
Vladislav Vaintroub
272828a171 Merge branch '10.5' into 10.6 2020-07-04 11:53:26 +02:00
Sergei Golubchik
478591608e optimize ha_delete_table_force
first try discovering engines, then the rest.
otherwise every DROP TABLE non_existent; will do
lots of i/o trying to remove .MYI/.MYD/.MAI/.MAD/.CSV/etc files

this matches the old behavior where DROP TABLE always tried to discover
the table before dropping.
2020-07-04 01:44:47 +02:00
Sergei Golubchik
4227dd2ac6 continue DROP TEMPORARY TABLE t1, t2, t3 after error.
normal DROP TABLE with many tables continues after an error,
trying to drop as many tables as possible. But DROP TEMPORARY TABLE
was aborting on the first error. Change it to behave as DROP TABLE does.
2020-07-04 01:44:47 +02:00
Sergei Golubchik
6c52931680 replace HTON_AUTOMATIC_DELETE_TABLE with return -1 from drop_table() 2020-07-04 01:44:47 +02:00
Sergei Golubchik
4876651e0f remove mysql_declare_plugin declaration from some plugins 2020-07-04 01:44:47 +02:00
Sergei Golubchik
7c2ba9e9d7 MDEV-11412 Ensure that table is truly dropped when using DROP TABLE
don't do table discovery on DROP. DROP falls back to "force"
approach when a table isn't found and will try to drop in all
engines anyway. That is, trying to discover in all engines before
the drop is redundant and may be expensive.
2020-07-04 01:44:47 +02:00
Sergei Golubchik
79a3f96166 rewrite bug#26704 test case
drop-no_root needs DROP DATABASE to fail.
But `chmod 000` is not reliable after drop table force anymore.

Make DROP DATABASE to fail by creating an extra file in the db dir
2020-07-04 01:44:47 +02:00
Sergei Golubchik
529b6dffe9 small cleanup 2020-07-04 01:44:46 +02:00
Sergei Golubchik
35f566db8d cleanup: make dd_frm_type to work as documented
remove redundant argument, return all possible enum values
2020-07-04 01:44:46 +02:00
Sergei Golubchik
2bb5981c20 MDEV-11412 Ensure that table is truly dropped when using DROP TABLE
minor post-review fixes
* remove duplicate tests
* first file indicates table existance even with discovery
* don't duplicate trigger dropping code
2020-07-04 01:44:46 +02:00
Sergei Golubchik
b014720b6c optimization: use hton->drop_table in few simple cases 2020-07-04 01:44:46 +02:00
Sergei Golubchik
c55c292832 introduce hton->drop_table() method
first step in moving drop table out of the handler.
todo: other methods that don't need an open table

for now hton->drop_table is optional, for backward compatibility
reasons
2020-07-04 01:44:46 +02:00
Sergei Golubchik
f17f7a43ba test dropping of a MEMORY table 2020-07-04 01:44:46 +02:00
Sergei Golubchik
d2b852b4ca cleanup, less #ifdef's 2020-07-04 01:44:46 +02:00
Monty
7d75e43261 Disable rpl_parallel2 temporarly until we have a proper fix for it in 10.5 2020-07-04 02:19:02 +03:00
Monty
0fd89a1a89 Merge remote-tracking branch 'origin/10.4' into 10.5 2020-07-03 23:31:12 +03:00
Qi Wu
70684afef2 Atomic write support for ScaleFlux NVMe SSD's 2020-07-03 22:42:10 +03:00
Monty
e9f06b19e0 Merge remote-tracking branch 'origin/10.3' into 10.4 2020-07-03 20:26:09 +03:00
Monty
484931325e Fix for MSAN from Marko related to buf_pool_resize 2020-07-03 18:37:33 +03:00
Julius Goryavsky
1bf863a91a Merge branch '10.4-MDEV-22222' of https://github.com/codership/mariadb-server into 10.4-MDEV-22222 2020-07-03 16:17:59 +02:00
Sergei Golubchik
7a4afad969 compilation fix
include/my_valgrind.h:88:112: error: ‘void* memset(void*, int, size_t)’ writing to an object of non-trivial type ‘key_map’ {aka ‘class Bitmap<64>’}; use assignment instead [-Werror=class-memaccess]

in this case it's safe, Bitmap<> is trivial enough
2020-07-03 15:01:21 +02:00
Monty
e6595a06d6 Don't give errors for default value copy in create_tmp_table 2020-07-03 01:18:51 +03:00
Monty
6e81ba0c12 Don't give errors for default value copy in create_tmp_table 2020-07-03 01:16:31 +03:00