Commit graph

185807 commits

Author SHA1 Message Date
Sergey Vojtovich
5e1b3cc8dc Fixed Aria to follow THD ha_data protocol
Use thd_get_ha_data()/thd_set_ha_data() which protect against plugin
removal until it has THD ha_data.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
ba59cc0f37 Fixed Sphinx to follow THD ha_data protocol
Use thd_get_ha_data()/thd_set_ha_data() which protect against plugin
removal until it has THD ha_data.

Do not reset THD ha_data in sphinx_close_connection(), cleaner approach
is to let ha_close_connection() do it.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
00e533c78b Fixed Mroonga to follow THD ha_data protocol
Use thd_get_ha_data()/thd_set_ha_data() which protect against plugin
removal until it has THD ha_data.

Do not reset THD ha_data in mrn_close_connection(), cleaner approach
is to let ha_close_connection() do it.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
5c18ba6c88 Fixed Spider to follow THD ha_data protocol
Do not reset THD ha_data in spider_close_connection(), cleaner approach
is to let ha_close_connection() do it.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
762d2b96fa Fixed FederatedX to follow THD ha_data protocol
Use thd_get_ha_data()/thd_set_ha_data() which protect against plugin
removal until it has THD ha_data.

Do not reset THD ha_data in ha_federatedx::disconnect(), cleaner approach
is to let ha_close_connection() do it.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
ce30c99478 Moved vio allocation to connection thread
Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
efb61c12a9 Simplified away CONNECT::real_id
It was wrong anyway, as it may not get updated by the time created thread
reads it. And it was 0 for cached threads.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
7192d7b700 Simplified away CONNECT::extra_port
Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
c90c769807 Simplified away CONNECT::host
Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
56b1cdde37 Removed duplicate thread cache check
It may be beneficial for slow-path, where new thread is to be created.
However it is harmful for fast-path, where thread cache can fulfil
request: it caused 2 extra loads of write-contended variables.

Also shrink variables scope.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
701e2a7edb Optimised fcntl() when accepting connections
Removed FD_CLOEXEC setting: already done by mysql_socket_accept().

Moved O_NONBLOCK setting out of accepting loop.

Removed blocking acceptance attempt, which was dead code. It was supposed
to be executed before the last iteration, however it was actually executed
during the last iteration. And it is not correct to block on one socket
leaving other sockets unattended anyway.

Gives ~5% throughput improvemet in sysbench connect benchmark.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
218a68bbc5 Less shared variables loads under the mutex
Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
8268fa881f Moved set_timespec out of LOCK_thread_cache mutex
Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Sergey Vojtovich
ca847584eb Cleanup redundant abort_loop checks
abort_loop is intended to break accepting connections loop in main thread,
however it is being used for other purposes.

cache_thread() is governed by kill_cached_threads, no need to check
abort_loop here.

Check in create_new_thread() is redundant, abort_loop already checked
by caller.

Part of MDEV-19515 - Improve connect speed
2019-05-21 17:55:09 +04:00
Robert Bindar
042f5165e3 MDEV-307 review minor edits, add yacc_ora support 2019-05-21 09:33:30 +03:00
Gagan Goel
e9c6d5a1e8 MDEV-307 Add functionality for database comments
This commit adds a new feature to the server to add comments at the database
level. 1024 bytes is the maximum comment length allowed. If the comment length
exceeds this limit, a new error/warning code 4144 is thrown, based on whether
thd->is_strict_mode() is true/false. The database comment is also added to the
db.opt file, as well as to the information_schema.schemata table.
2019-05-21 09:33:17 +03:00
Monty
9a8d1d84f8 Merge remote-tracking branch 'origin/10.4' into 10.5 2019-05-16 12:56:02 +03:00
Jan Lindström
ea77162452 MDEV-19423: Galera test failure on galera.MDEV-16509
Make sure that SIGNALs are not overwritten before they
are received.
2019-05-15 12:09:12 +03:00
Oleksandr Byelkin
5cf4022340 fix the test for windows 2019-05-15 10:10:49 +02:00
Varun Gupta
51dcdf2adb Added a 32 bit rdiff for myisam_mrr instead of a 64 bit rdiff 2019-05-15 13:17:22 +05:30
Sergey Vojtovich
30ddf96113 Fixed ya main.flush_read_lock sporadic failure
Use different signal names, so that subsequent WAIT_FOR is not awaken by
previous signal.
2019-05-14 23:51:10 +04:00
Oleksandr Byelkin
29a0f5acf3 MDEV-19277: Add status variable that gets incremented if connection is aborted prior to authentication
MDEV-19282: Log more specific warning with log_warnings=2 if connection is aborted prior to authentication
2019-05-14 16:38:13 +02:00
Marko Mäkelä
c3ea52c92a MDEV-17958: Remove IS_BIG_ENDIAN
In 62d28f83b6 the CMake variable
IS_BIG_ENDIAN became orphaned. Remove it.
2019-05-14 12:35:42 +03:00
Jan Lindström
3d8cacee6e MDEV-19404: Assertion failure on !is_thread_specific || (mysqld_server_initialized && thd)
In wsrep_plugins_post_init we iterate all theads and if they are
galera appliers (wsrep_applier) we init session variables. However,
current_thd was not set and recent changes on session variables
require holding LOCK_gloal_system_variables mutex.

This is 10.4 version.
2019-05-14 11:25:42 +03:00
Varun Gupta
41779561ec Fixed myisam_mrr for 32 bit systems 2019-05-13 22:41:28 +05:30
Sergey Vojtovich
7a6c36b547 Fixed main.flush_read_lock sporadic failure
With MDEV-19384 fixed FTWRL releases HANDLER locks early, which allows
concurrent threads to go. Test case may get stuck on FTWRL waiting for
LOCK TABLES.
2019-05-13 20:23:44 +04:00
Monty
a868e799c7 Change version to 10.5.0 2019-05-13 15:16:29 +03:00
Monty
341c3379ae Removed obsolete file maria_rename.sh 2019-05-13 13:59:41 +03:00
Monty
60518a6b85 Make maria-autozerofill a bit more rebust
- Remove warning about aria_control_file
- Write to unique test file

Other things:
- Fixed typo in aria_chk --help
2019-05-13 13:59:41 +03:00
Varun Gupta
6a365e0bf2 MDEV-13628: ORed condition in pushed index condition is not removed from the WHERE
So to push index condition for each join tab we have calculate the index condition that can be pushed and then
remove this index condition from the original condition. This is done through the function make_cond_remainder.
The problem is the function make_cond_remainder does not remove index condition when there is an OR operator.

Fixed this by making the function make_cond_remainder to keep in mind of the OR operator.
Also updated results for multiple test files which were incorrectly updated by the commit e0c1b3f242

code which was supposed to remove the condition present in the index
condition was not getting executed when the condition had OR operator, with AND the pushed
index condition was getting removed from where.

This problem affects all versions starting from 5.5 but this is a performance improvement, so fixing it in 10.4
2019-05-11 20:50:12 +05:30
Monty
9965966a49 Fixed that storage/funcs tests works with Aria
Problem was that SHOW CREATE didn't remove PAGE_CHECKSUM=1
2019-05-11 13:52:31 +03:00
hygonsoc
6f3b09993f add Hygon Dhyana support in check-cpu
Signed-off-by: hygonsoc <hygonsoc@gmail.com>
2019-05-10 21:56:39 +03:00
Daniel Black
d2fa5f8cfc MDEV-8553: Impossible where for a!=a, a<a, a>a
For a table column `a`, the above expressions logically
equate to false in all cases.

With this patch the optimizer knows about this and queries
like:

SELECT * FROM t1 WHERE a!=a

no longer need to evaluate a!=a for every row.

The same applies if the expression was `a<a`, or `a>a`

An `EXPLAIN SELECT COOUNT(*) FROM t1 WHERE a<a` will show:

id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE

Similarly `NOT (a!=a)` is always true.

EXPLAIN SELECT COUNT(*) FROM t1 WHERE not (a!=a);
id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
2019-05-10 14:05:36 +04:00
Vladislav Vaintroub
ad36d38024 MDEV-19235 MariaDB Server compiled for 128 Indexes crashes at startup
With MAX_INDEXIES=64(default), key_map=Bitmap<64> is just a wrapper around
ulonglong and thus "trivial" (can be bzero-ed, or memcpy-ed, and stays
valid still)

With MAX_INDEXES=128, key_map = Bitmap<128> is not a "trivial" type
anymore. The implementation uses MY_BITMAP, and MY_BITMAP contains pointers
which make Bitmap invalid, when it is memcpy-ed/bzero-ed.

The problem in 10.4 is that there are many new key_map members, inside TABLE
or KEY, and those are often memcopied and bzeroed

The fix makes Bitmap "trivial", by inlining most of MY_BITMAP functionality.
pointers/heap allocations are not used anymore.
2019-05-09 18:58:16 +02:00
Monty
44b8b002f5 Disable 5733_tokudb as the result is not stable 2019-05-09 11:24:06 +03:00
Vladislav Vaintroub
a3a48d4561 MDEV-19403 Remove mysql_secure_installation.pl 2019-05-07 18:14:14 +00:00
Igor Babaev
fd386e39cd MDEV-18689 Simple query with extra brackets stopped working
Parenthesis around table names and derived tables should be allowed
in FROM clauses and some other context as it was in earlier versions.

Returned test queries that used such parenthesis in 10.3 to their
original form. Adjusted test results accordingly.
2019-05-06 11:14:39 -07:00
Monty
b8259e4b59 MDEV-19384 Deadlock in FTWRL
The deadlock happened between FTWRL under open HANDLER, LOCK TABLE and
DROP DATABASE

Fixed by reverting the previous fix for handler open in
lock_global_read_lock()

Fixed the original (wrong) test case in flush_read_lock.test to be
repeatable.
2019-05-06 14:56:31 +03:00
Vladislav Vaintroub
60bd353bdf Fixes for atomic writes on Windows.
Windows does atomic writes, as long as they are aligned and multiple
of sector size. this is documented in MSDN.

Fix innodb.doublewrite test to always use doublewrite buffer,
(even if atomic writes are autodetected)
2019-05-06 11:32:17 +00:00
Vladislav Vaintroub
59a266a9f9 MDEV-17380: fix incorrect #ifdef 2019-05-06 11:31:51 +00:00
Vladislav Vaintroub
c477623f04 MDEV-19388 Improve SSD detection on Windows
Fallback to detecting if TRIM is enabled, if we cannot determine
seek penalty.
2019-05-06 10:15:46 +00:00
Marko Mäkelä
f81007f8d8 Fix the Windows build 2019-05-05 22:59:53 +03:00
Marko Mäkelä
d3dcec5d65 Merge 10.3 into 10.4 2019-05-05 15:06:44 +03:00
Marko Mäkelä
b132b8895e Merge 10.3 into 10.4 2019-05-05 10:23:14 +03:00
Sachin
27980b0f83 MDEV-19365 Assertion failure in LONG Unique after 10.3 merge
If handler->inited is RND use cloned handler for long unique duplicate search.
2019-05-05 10:19:22 +03:00
Sergey Vojtovich
e8dd18a474 Restore vars_list destructor
Regression after reverting fair THD members constructors/destructors.
vars_list can be used standalone, in such cases destructor is needed.

Part of MDEV-14984 - regression in connect performance
2019-05-04 12:43:29 +04:00
Marko Mäkelä
b6f4cccd19 Merge 10.2 into 10.3 2019-05-03 20:14:09 +03:00
Marko Mäkelä
ce195987c3 MDEV-19385: Inconsistent definition of dtuple_get_nth_v_field()
The accessor dtuple_get_nth_v_field() was defined differently between
debug and release builds in MySQL 5.7.8 in
mysql/mysql-server@c47e1751b7
and a debug assertion to document or enforce the questionable assumption
tuple->v_fields == &tuple->fields[tuple->n_fields] was missing.

This was apparently no problem until MDEV-11369 introduced instant
ADD COLUMN to MariaDB Server 10.3. With that work present, in one
test case, trx_undo_report_insert_virtual() could in release builds
fetch the wrong value for a virtual column.

We replace many of the dtuple_t accessors with const-preserving
inline functions, and fix missing or misleadingly applied const
qualifiers accordingly.
2019-05-03 20:02:50 +03:00
Marko Mäkelä
3db94d2403 MDEV-19346: Remove dummy InnoDB log checkpoints
log_checkpoint(), log_make_checkpoint_at(): Remove the parameter
write_always. It seems that the primary purpose of this parameter
was to ensure in the function recv_reset_logs() that both checkpoint
header pages will be overwritten, when the function is called from
the never-enabled function recv_recovery_from_archive_start().

create_log_files(): Merge recv_reset_logs() to its only caller.

Debug instrumentation: Prefer to flush the redo log, instead of
triggering a redo log checkpoint.

page_header_set_field(): Disable a debug assertion that will
always fail due to MDEV-19344, now that we no longer initiate
a redo log checkpoint before an injected crash.

In recv_reset_logs() there used to be two calls to
log_make_checkpoint_at(). The apparent purpose of this was
to ensure that both InnoDB redo log checkpoint header pages
will be initialized or overwritten.
The second call was removed (without any explanation) in MySQL 5.6.3:
mysql/mysql-server@4ca37968da

In MySQL 5.6.8 WL#6494, starting with
mysql/mysql-server@00a0ba8ad9
the function recv_reset_logs() was not only invoked during
InnoDB data file initialization, but also during a regular
startup when the redo log is being resized.

mysql/mysql-server@45e9167983
in MySQL 5.7.2 removed the UNIV_LOG_ARCHIVE code, but still
did not remove the parameter write_always.
2019-05-03 20:02:11 +03:00
Eugene Kosov
bcc1359223 MDEV-17702 fix unaligned access UB in sint4korr() and similar functions
Disable (hopefully temprorary) this check. Also add tests for some serialized
functions.
2019-05-03 18:54:12 +04:00