Commit graph

176744 commits

Author SHA1 Message Date
Marko Mäkelä
e5b155a4e5 MDEV-12091 Shutdown fails to wait for rollback of recovered transactions to finish
In the 10.1 InnoDB Plugin, a call os_event_free(buf_flush_event) was
misplaced. The event could be triggered by rollback of resurrected
transactions while shutdown was in progress. This bug was caught
by cmake -DWITH_ASAN testing. This call was only present in the
10.1 InnoDB Plugin, not in other versions, or in XtraDB.

That said, the bug affects all InnoDB versions. Shutdown assumes the
cessation of any page-dirtying activity, including the activity of
the background rollback thread. InnoDB only waited for the background
rollback to finish as part of a slow shutdown (innodb_fast_shutdown=0).
The default is a clean shutdown (innodb_fast_shutdown=1). In a scenario
where InnoDB is killed, restarted, and shut down soon enough, the data
files could become corrupted.

logs_empty_and_mark_files_at_shutdown(): Wait for the
rollback to finish, except if innodb_fast_shutdown=2
(crash-like shutdown) was requested.

trx_rollback_or_clean_recovered(): Before choosing the next
recovered transaction to roll back, terminate early if non-slow
shutdown was initiated. Roll back everything on slow shutdown
(innodb_fast_shutdown=0).

srv_innodb_monitor_mutex: Declare as static, because the mutex
is only used within one module.

In 10.2, os_event_destroy() sets the event to a NULL pointer,
while os_event_free() in earlier versions did not do that.
2017-03-13 18:11:36 +02:00
Marko Mäkelä
ff8bf6e933 Define a mtr_t::start() wrapper inline. 2017-03-13 18:11:01 +02:00
Marko Mäkelä
c32dcae65a Adjust an outdated comment.
os_sync_free(), which hid resource leaks, was removed in MySQL 5.7.
2017-03-13 18:11:01 +02:00
Oleksandr Byelkin
c0fb7b458b MDEV-10555: Server crashes in mysql_admin_table upon killing ANALYZE
Take into acount result of open table operation in mysql_admin_table.
2017-03-13 15:31:12 +01:00
Sergei Golubchik
c99d71a29c MDEV-12231 MariaDB fails to restart after 10.0.30-1.el7 update
force SELinux policies to be built in mysql_release RPM packages
2017-03-12 10:30:57 +01:00
Elena Stepanova
68be011cf2 Updated list of unstable tests for 10.1.22 2017-03-11 20:59:52 +02:00
Sergei Golubchik
2033844319 test failures in buildbot 2017-03-11 16:23:31 +01:00
Otto Kekäläinen
eded6243bc MDEV-12096: Fix ln syntax in debian/rules for libmariadb3 symlink creation
Compatibility links ended up looking like this:
libmysqlclient.so.18 -> /tmp/buildd/mariadb-10.2-10.2.0/debian/tmp/usr/lib/i386-linux-gnu/libmariadb.so.3

This change fixes ln syntax to create links with correct target paths.
2017-03-11 10:54:51 +02:00
Oleksandr Byelkin
eb574697c0 fix test for windows 64 2017-03-10 22:44:52 +01:00
Vladislav Vaintroub
f2fe5cb282 Fix several compile warnings on Windows 2017-03-10 19:07:07 +00:00
Vladislav Vaintroub
7c512138a1 Revert MySQL commit that disables writing on Windows while flush is in progress
Reason : after running sysbench tests (rw,update_no_index), in all cases
the throughout was considerably (approx 15%) better with the patch removed.

Reverted commit info
commit 8dc03bee3ade2edcc53a3a257346f4a0a9f0b44c
Author: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com>
Date:   Wed Nov 20 17:02:24 2013 +0900

Bug #17824101 : WL#7050 CAUSES RW PERFORMANCE REGRESSION AT SOME WINDOWS ENVIRONMENT
2017-03-10 19:07:07 +00:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Golubchik
2a0ae1c90a MDEV-11965 -Werror should not appear in released tarballs 2017-03-10 18:21:29 +01:00
Sergei Golubchik
5d40ed864e MDEV-11752 Unsafe strmov - function definition in include/m_string.h
assert that strmov() cannot be used on overlapping strings.
(because strpcpy cannot)
2017-03-10 18:21:29 +01:00
Sergei Golubchik
e0a03ca30a ed25519 plugin: simplify the api
various ed25519/ref10 api simplifications for our specific use case
2017-03-10 18:21:28 +01:00
Sergei Golubchik
7120118a5e MDEV-12160 Modern alternative to the SHA1 authentication plugin
ED25519 authentication plugin
2017-03-10 18:21:28 +01:00
Sergei Golubchik
269ab56f8b small plugin API related fixes
* define MYSQL_DYNAMIC_PLUGIN only for server plugins
* don't typedef my_bool in mysql.h if plugin.h has already done it
* fix the include guard in plugin.h
2017-03-10 18:21:28 +01:00
Sergei Golubchik
227f63db3b cleanup: sort various lists of services 2017-03-10 18:21:28 +01:00
Sergei Golubchik
0877eff401 thd_rnd service 2017-03-10 18:21:27 +01:00
Sergei Golubchik
6305533de2 Auth Plugin API: add THD to MYSQL_SERVER_AUTH_INFO
so that auth plugins could use various thd services
2017-03-10 18:21:27 +01:00
Sergei Golubchik
051851b9a6 base64 service 2017-03-10 18:21:27 +01:00
Sergei Golubchik
70a2efde03 remove old API for SHA2 2017-03-10 18:21:27 +01:00
Sergei Golubchik
d6a7aece08 my_sha2 service 2017-03-10 18:21:26 +01:00
Sergei Golubchik
bd1139ad27 cleanup: generalize my_sha1.cc
move most of the code into my_sha.ic, making it independent
from the actual SHAx variant.
2017-03-10 18:21:26 +01:00
Sergei Golubchik
6cddd12ad6 make sql_udf.cc to shorten dlerror() messages
just as sql_plugin.cc does
2017-03-10 18:21:26 +01:00
Sergei Golubchik
2b1bbac5fa cleanup: remove a duplicate file 2017-03-10 18:21:25 +01:00
Sergei Golubchik
aa51b559ab typo fixed 2017-03-10 18:21:25 +01:00
Sergei Golubchik
0633d0e2ed don't show 'performance_schema_%_classes_lost' variables in tests
because FLUSH STATUS does not reset them, so their values
are affected by previously run tests since the last server restart.
2017-03-10 18:21:25 +01:00
Sergei Golubchik
3d06f0f72c MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation
fix the patch. add tests
2017-03-10 18:21:25 +01:00
Hartmut Holzgraefe
c372388e48 make mysql_upgrade try to install missing storage engine plugins (MDEV-11942) 2017-03-10 18:21:24 +01:00
Sergei Golubchik
8f1ca5e311 MDEV-11943 I_S.TABLES inconsistencies with tables with unknown storage engine
Try harder to show the table's engine.

If the table's engine is not loaded, the table won't open.
But we can still read the engine name from frm as a string.
2017-03-10 18:21:24 +01:00
Sergei Golubchik
48b1d17534 MDEV-11943 I_S.TABLES inconsistencies with tables with unknown storage engine
Make SELECT <columns> FROM I_S.TABLES behave identically independently
from whether <columns> require opening the table in engine or
<columns> can be filled with only opening the frm.

In particular, fill_schema_table_from_frm() should not silently skip
frms with unknown engine, but should fill the I_S.TABLES row
with NULLs just like fill_schema_table_by_open() does.
2017-03-10 18:21:24 +01:00
Sergei Golubchik
25c32c89f1 trivial cleanup 2017-03-10 18:21:24 +01:00
Sergei Golubchik
8eb66bc382 cleanup: change dd_frm_type() to return the engine name, not legacy_db_type
this simplifies the code and avoids unnecessary conversions back and forth.
and it works even if the engine is not installed.
2017-03-10 18:21:23 +01:00
Sergei Golubchik
1c8d2121ab don't do vio_description(NULL)
this fixes the crash of innodb.innodb-blob --ps-protocol
2017-03-10 18:21:23 +01:00
Sergei Golubchik
5fa04aae9e MDEV-11842 Fail to insert on a table where a field has no default
has_no_default_value() should only fail the insert in the strict mode.

Additionally, don't check for "all fields are given values" twice,
it'll produce duplicate warnings.
2017-03-10 18:21:23 +01:00
Sergei Golubchik
b6a1d6538b compiler warnings 2017-03-10 18:21:22 +01:00
Marko Mäkelä
032678ad18 MDEV-12091 Shutdown fails to wait for rollback of recovered transactions to finish
In the 10.1 InnoDB Plugin, a call os_event_free(buf_flush_event) was
misplaced. The event could be signalled by rollback of resurrected
transactions while shutdown was in progress. This bug was caught
by cmake -DWITH_ASAN testing. This call was only present in the
10.1 InnoDB Plugin, not in other versions, or in XtraDB.

That said, the bug affects all InnoDB versions. Shutdown assumes the
cessation of any page-dirtying activity, including the activity of
the background rollback thread. InnoDB only waited for the background
rollback to finish as part of a slow shutdown (innodb_fast_shutdown=0).
The default is a clean shutdown (innodb_fast_shutdown=1). In a scenario
where InnoDB is killed, restarted, and shut down soon enough, the data
files could become corrupted.

logs_empty_and_mark_files_at_shutdown(): Wait for the
rollback to finish, except if innodb_fast_shutdown=2
(crash-like shutdown) was requested.

trx_rollback_or_clean_recovered(): Before choosing the next
recovered transaction to roll back, terminate early if non-slow
shutdown was initiated. Roll back everything on slow shutdown
(innodb_fast_shutdown=0).

srv_innodb_monitor_mutex: Declare as static, because the mutex
is only used within one module.

After each call to os_event_free(), ensure that the freed event
is not reachable via global variables, by setting the relevant
variables to NULL.
2017-03-10 18:54:29 +02:00
Marko Mäkelä
0094b6581d Merge 10.0 into 10.1 2017-03-10 15:16:13 +02:00
Vicențiu Ciorbaru
814d050760 MDEV-12215: main.repair_symlink-5543 fails in buildbot
If openat is present on the system and it tries to open a symlink with
O_NOFOLLOW, we get errno 40.

If openat is not present on the system, we use the alternative open call, with
slightly different logic. IF the symlink doesn't point to a valid file,
we get errno 20. This test uses an invalid symlink on the table t1.MYD.
2017-03-10 14:07:22 +02:00
iangilfillan
18de829618 MDEV-11964 Add missing stub manpages 2017-03-10 11:15:28 +04:00
Marko Mäkelä
a20340cf85 Hard-code innodb_page_size as the undo log page size.
InnoDB undo logs currently always use the innodb_page_size,
whether they are stored in the system tablespace, in a
dedicated undo tablespace, or in the temporary tablespace.
Remove redundant page_size parameters.

TrxUndoRsegsIterator::set_next(): return bool instead of page_size.
2017-03-10 08:15:25 +02:00
Marko Mäkelä
0ef91c8958 Simplify InnoDB transaction system initialization.
trx_rseg_mem_create(): Remove the parameter rseg_array.
Update trx_sys->rseg_array directly.
2017-03-10 08:15:25 +02:00
Marko Mäkelä
1417839810 InnoDB purge_sys cleanup.
TrxUndoRsegsIterator::m_purge_sys: Remove. There is only one purge_sys.

purge_sys_t: Renamed from trx_purge_t. Define a constructor and
destructor. Allocate rseg_iter, purge_queue inline.

purge_sys->trx: Remove. Use purge_sys->sess->trx instead.

purge_sys->view_active: Remove. Access to purge_sys->view is always
protected by purge_sys->latch.

trx_purge_sys_create(): Replaced by purge_sys_t::purge_sys_t().

trx_purge_sys_close(): Replaced by purge_sys_t::~purge_sys_t().
2017-03-10 08:15:25 +02:00
Vladislav Vaintroub
9928dbe5f6 Add SRV_ALL_O_DIRECT_FSYNC to switch(srv_flush_method) in log0log.c.
Also in log_checkpoint(), where fil_flush_file_spaces() was
not done on Windows, it is not done.
2017-03-09 22:47:29 +01:00
Vladislav Vaintroub
a98009ab02 MDEV-12201 innodb_flush_method are not available on Windows
Remove srv_win_file_flush_method

- Rename srv_unix_file_flush_method to srv_file_flush_method, and
  rename constants to remove UNIX from them, i.e SRV_UNIX_FSYNC=>SRV_FSYNC

- Add SRV_ALL_O_DIRECT_FSYNC corresponding to current Windows default
(no buffering for either log or data, flush on both log and data)

- change os_file_open on Windows to behave identically to Unix wrt
O_DIRECT and O_DSYNC settings. map O_DIRECT to FILE_FLAG_NO_BUFFERING and
O_DSYNC to FILE_FLAG_WRITE_THROUGH

- remove various #ifdef _WIN32
2017-03-09 19:19:38 +00:00
Oleksandr Byelkin
8e05953dad MDEV-11363: Assertion `!derived->first_sel ect()->first_inner_unit() || derived->first_select()->first_inner_unit()->first_select()-> exclude_from_table_unique_test' failed in TABLE_LIST::set_check_materialized()
Do not try to materialize derived table which already merged (irreversebly).
2017-03-09 19:24:17 +01:00
Marko Mäkelä
70a0500d3c Remove some InnoDB purge definitions from trx0types.h. 2017-03-09 17:35:09 +02:00
Marko Mäkelä
7a30d86e9d Simplify InnoDB startup.
InnoDB needs to collect transactions from the persistent data files
in trx_rseg_array_init() before trx_lists_init_at_db_start() is
executed. But there is no need to create purge_sys->purge_queue
separately from purge_sys.

trx_sys_init_at_db_start(): Change the return type to void.
Remove the direct call to trx_rseg_array_init(). It will be called
by trx_lists_init_at_db_start(), which we are calling.
Initialize the purge system read view.

trx_lists_init_at_db_start(): Call trx_purge_sys_create(), which will
invoke trx_rseg_array_init() to read the undo log segments.

trx_purge_sys_create(): Remove the parameters. Do not initialize
the purge system read view, because trx_sys->rw_trx_list has not
been recovered yet. The purge_sys->view will be initialized at
the end of trx_sys_init_at_db_start().

trx_rseg_array_init(): Remove the parameter. Use purge_sys->purge_queue
directly.

innobase_start_or_create_for_mysql(): Remove the local variable
purge_queue. Do not call trx_purge_sys_create(), because it will be
called by trx_sys_init_at_db_start().
2017-03-09 17:28:06 +02:00
Vicențiu Ciorbaru
07d89fa59c Remove leftover merge conflict marker 2017-03-09 16:54:40 +02:00