Commit graph

181498 commits

Author SHA1 Message Date
Eugene Kosov
fd73c6dda4 Vers IB: Mark unversioned fields in system versioning tables
Some fields in system-versioned table may be unversioned.
SQL layer marks unversioned.
And this patch makes InnoDB mark unversioned too because of two reasons:
1) by default fields are versioned
2) most of fields are expected to be versioned

dtype_t::vers_sys_field(): fixed return true on row_start/row_end
dict_col_t::vers_sys_field(): fixed return true on row_start/row_end
2018-03-19 17:32:54 +03:00
Aleksey Midenkov
0cf97ad5b9 IB: CASCADE operation for DELETE
* Removed "Not supported for TIMESTAMP-based" error
* Fixed code duplication with node->vers_set_fields()
* Recovered foreign.test

[closes tempesta-tech#473]
2018-03-19 17:32:46 +03:00
Jan Lindström
85ddd9e8ce Revert pull request #640 from grooverdan/10.3-MDEV-8743-wsrep_sst_common-close-fds 2018-03-17 12:56:23 +02:00
Marko Mäkelä
c231a228ca Pull request #660: Simplify os_file_create_tmpfile() 2018-03-16 09:09:02 +02:00
Alexander Barkov
9472f0f4a4 Adding "const" qualifier into a few methods and parameters in the LOAD code
Methods:
- Item_user_var_as_out_param::print_for_load()
- sql_exchange::escaped_given(void)

Parameters:
- sql_exchange in write_execute_load_query_log_event()
- sql_exchange in mysql_load()
- sql_exchange in Load_log_event::Load_log_event()

Also, removing cast to "char*" in a few places in
Load_log_event::Load_log_event()
2018-03-15 23:29:48 +04:00
Alexander Barkov
d509981498 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2018-03-15 13:39:26 +04:00
Jan Lindström
1a0b573b2b
Merge pull request #640 from grooverdan/10.3-MDEV-8743-wsrep_sst_common-close-fds
MDEV-8743: wsrep_sst_common close FDs > 2
2018-03-15 08:44:54 +02:00
Jan Lindström
f66a315910
Merge pull request #638 from grooverdan/10.3-MDEV-8743-fopen_o_cloexec
MDEV-8743: fopen mode e (glibc only) to prevent galera SST scripts ac…
2018-03-15 08:38:05 +02:00
Daniel Black
7bb661cd40 innodb: os_file_create_tmpfile always called with NULL -> simplify 2018-03-15 13:49:00 +11:00
Daniel Black
fafec1a9cc MDEV-8743: where O_CLOEXEC is available, use for innodb buf_dump
As this is the only moderately critical fopened for writing file,
create an alternate path to use open and fdopen for non-glibc platforms
that support O_CLOEXEC (BSDs).

Tested on Linux (by modifing the GLIBC defination) to take this
alternate path:

$ cd /proc/23874
$ more fdinfo/71
pos:    0
flags:  02100001
mnt_id: 24
$ ls -la fd/71
l-wx------. 1 dan dan 64 Mar 14 13:30 fd/71 -> /dev/shm/var_auto_i7rl/mysqld.1/data/ib_buffer_pool.incomplete
2018-03-14 13:31:31 +11:00
Alexander Barkov
42433a2dbc
Merge pull request #652 from halfspawn/bb-10.2-ext
MDEV-10574 / SUBSTR - sql_mode=Oracle: return null instead of empty string
2018-03-13 14:22:28 +04:00
halfspawn
3e6893e29a MDEV-10574 / SUBSTR - sql_mode=Oracle: return null instead of empty string 2018-03-13 10:34:28 +01:00
Marko Mäkelä
7fb03d7abf Merge bb-10.2-ext into 10.3 2018-03-13 08:15:06 +02:00
Marko Mäkelä
1c4b6afbaa Merge 10.2 into bb-10.2-ext 2018-03-13 08:11:54 +02:00
Marko Mäkelä
036b9dc9a1 After-merge fix 2018-03-12 22:08:08 +02:00
Alexey Botchkov
9d95b8665a MDEV-15217 Assertion `thd->transaction.xid_state.xid.is_null()' failed
in trans_xa_start.

        test fixed.
2018-03-12 23:43:42 +04:00
Vladislav Vaintroub
68482a2215 MDEV-14581 - changded .result file 2018-03-12 18:38:40 +00:00
Vladislav Vaintroub
248e5d01a5 MDEV-14581 Warning info not cleared when caching THD
In thread caching code, clear THD's warnings before reuse.
2018-03-12 18:29:54 +00:00
Oleksandr Byelkin
5511e8ed59 MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM LAST_INSERT_ID ()
There is not current SELECT during assigning SP parameters, do not use it if current_select is empty.
2018-03-12 17:37:23 +01:00
Marko Mäkelä
e0792e7603 Merge 10.2 into bb-10.2-ext 2018-03-12 15:11:15 +02:00
Marko Mäkelä
3a93ec53c1 Merge 10.1 into 10.2 2018-03-12 14:27:17 +02:00
Marko Mäkelä
0be18c4038 Merge 10.0 into 10.1 2018-03-12 13:22:13 +02:00
Marko Mäkelä
4a35e76f64 MDEV-14773 DROP TABLE hangs for InnoDB table with FULLTEXT index
fts_sync(): If the dict_table_t::to_be_dropped flag is set,
do not "goto begin_sync".

Also, clean up the way how dict_index_t::index_fts_syncing
is cleared.

It looks like this regression was introduced by merging
Oracle Bug #24938374 MYSQL CRASHED AFTER LONG WAIT ON DICT OPERATION LOCK
WHILE SYNCING FTS INDEX
068f8261d4
from MySQL 5.6.38 into MariaDB 10.0.33, 10.1.29, 10.2.10.
The same hang is present in MySQL 5.7.20.
2018-03-12 13:06:21 +02:00
Alexey Botchkov
cd109592ca MDEV-15217 Assertion `thd->transaction.xid_state.xid.is_null()' failed
in trans_xa_start.

        THD.transaction.xid_state.xid.rm_error should be cleaned
        as the thread ends.
2018-03-12 08:30:08 +04:00
Sergei Petrunia
28777046b4 MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
Don't call handler->position() if the last call to read a row did
not succeed.
2018-03-11 16:43:36 +00:00
Marko Mäkelä
112df06996 MDEV-15529 IMPORT TABLESPACE unnecessarily uses the doublewrite buffer
fil_space_t::atomic_write_supported: Always set this flag for
TEMPORARY TABLESPACE and during IMPORT TABLESPACE. The page
writes during these operations are by definition not crash-safe
because they are not written to the redo log.

fil_space_t::use_doublewrite(): Determine if doublewrite should
be used.

buf_dblwr_update(): Add assertions, and let the caller check whether
doublewrite buffering is desired.

buf_flush_write_block_low(): Disable the doublewrite buffer for
the temporary tablespace and for IMPORT TABLESPACE.

fil_space_set_imported(), fil_node_open_file(), fil_space_create():
Initialize or revise the space->atomic_write_supported flag.

buf_page_io_complete(), buf_flush_write_complete(): Add the parameter
dblwr, to indicate whether doublewrite was used for writes.

buf_dblwr_sync_datafiles(): Remove an unnecessary flush of
persistent tablespaces when flushing temporary tablespaces.
(Move the call to buf_dblwr_flush_buffered_writes().)
2018-03-10 11:54:34 +02:00
Marko Mäkelä
54765aaa4d MDEV-15524 Do not disable page checksums for temporary tables
buf_flush_init_for_writing(): Remove the parameter skip_checksum.
2018-03-10 11:54:34 +02:00
Marko Mäkelä
4fa18d52b5 MDEV-15524 Do not write garbage for temporary tables
fsp_init_file_page_low(): Always initialize the page.
2018-03-10 11:54:34 +02:00
Marko Mäkelä
1e4cb8403c buf_page_io_complete(): Minor code cleanup 2018-03-10 11:54:34 +02:00
Marko Mäkelä
10f06b07bc Merge 10.0 into 10.1 2018-03-09 22:43:54 +02:00
Marko Mäkelä
4a5c237c76 MDEV-14648 Restore fix for MySQL BUG#39053 - UNINSTALL PLUGIN does not allow the storage engine to cleanup open connections
ha_close_connection(): Do invoke the method also for plugins
for which UNINSTALL PLUGIN was deferred due to open connections.
2018-03-09 22:43:05 +02:00
Marko Mäkelä
09c5c335e3 Follow-up to MDEV-13690: Remove unused globals
buf_flush_batch(), buf_flush_stats(): Declare static.

buf_flush_common(): Remove (unused function).
2018-03-09 20:33:41 +02:00
Jan Lindström
aec4734f61 MDEV-13935: INSERT INTO stuck at state "Unlocking tables"
There were some differences on MariaDB compared with MySQL.
Fix these differences.
2018-03-08 12:25:01 +02:00
Daniel Black
04ed70fa55 MDEV-8743: wsrep_sst_common close FDs > 2
To prevent accidential overwriting of files due to mysqld file
descriptors being open we ensure where that only FDs 1, 2 and 3
are available to SST scripts. Assumed is mysqld has thse still
mapped to stdin (unused), stdout and stderr.
2018-03-08 18:55:01 +11:00
Alexander Barkov
6ec3de5d2d MDEV-15497 Wrong empty value in a GEOMETRY column on LOAD DATA
- Adding a new virtual method Field::load_data_set_no_data().
- Overriding Field_timestamp::load_data_set_no_data() and moving
  the TIMESTAMP specific code there.
- Overriding Field_geom::load_data_set_no_data() and implementing
  GEOMETRY specific behavior, to prevent writing empty strings
  when the loaded file ends unexpectedly. This fixes the bug.
- Adding a new test gis-loaddaata.test.
- The test in loaddata.test for CHAR was added simply to record behavior.
  The CHAR data type did not change its behaviour (only GEOMRYRY did).
- Additionally, moving duplicate code into a new method
  Field::load_data_set_value() and reusing it in three places.
2018-03-07 19:55:12 +04:00
Marko Mäkelä
8ef727b3d0 MDEV-14904 Backport innodb_default_row_format
InnoDB in Debian uses utf8mb4 as default character set since
version 10.0.20-2. This leads to major pain due to keys longer
than 767 bytes.

MariaDB 10.2 (and MySQL 5.7) introduced the setting
innodb_default_row_format that is DYNAMIC by default. These
versions also changed the default values of the parameters
innodb_large_prefix=ON and innodb_file_format=Barracuda.
This would allow longer column index prefixes to be created.
The original purpose of these parameters was to allow InnoDB
to be downgraded to MySQL 5.1, which is long out of support.

Every InnoDB version since MySQL 5.5 does support operation
with the relaxed limits.

We backport the parameter innodb_default_row_format to
MariaDB 10.1, but we will keep its default value at COMPACT.
This allows MariaDB 10.1 to be configured so that CREATE TABLE
is less likely to encounter a problem with the limitation:

	loose_innodb_large_prefix=ON
	loose_innodb_default_row_format=DYNAMIC

(Note that the setting innodb_large_prefix was deprecated in
MariaDB 10.2 and removed in MariaDB 10.3.)

The only observable difference in the behaviour with the default
settings should be that ROW_FORMAT=DYNAMIC tables can be created
both in the system tablespace and in .ibd files, no matter what
innodb_file_format has been assigned to. Unlike MariaDB 10.2,
we are not changing the default value of innodb_file_format,
so ROW_FORMAT=COMPRESSED tables cannot be created without
changing the parameter.
2018-03-07 17:49:42 +02:00
Daniel Black
2ef2863c30 my_fdopen: list all args in comment 2018-03-07 17:25:08 +04:00
Ian Gilfillan
08fa321877 MDEV-15474 Update server.cnf section to mariadb-10.3 2018-03-07 17:14:37 +04:00
Ian Gilfillan
a050189773 MDEV-15474 Update server.cnf section to mariadb-10.2 2018-03-07 17:13:03 +04:00
Marko Mäkelä
8f361a83cc ReadView::snapshot(): Define inline 2018-03-06 23:35:49 +02:00
Marko Mäkelä
93d495f365 MDEV-15418 innodb_force_recovery=5 displays bogus warnings
With MDEV-15132 in MariaDB 10.3.5, InnoDB no longer writes the
transaction identifier to the TRX_SYS page. The information is
only written to undo log headers and sometimes rollback segment
headers. Because the setting innodb_force_recovery=5 will skip
reading any of those pages, the maximum transaction identifier
will no longer be determined.

innobase_map_isolation_level(): Always report READ UNCOMMITTED
if innodb_force_recovery has been set to 5 or more, or
innodb_read_only is set. This will avoid errors reported by
lock_check_trx_id_sanity() and ReadView::check_trx_id_sanity().

lock_clust_rec_cons_read_sees(): Do not check for
innodb_read_only, now that innobase_map_isolation_level() will
guarantee that no read view will be created or used.

row_search_mvcc(): Do not check for innodb_force_recovery<5,
now that innobase_map_isolation_level() will guarantee that
no read view will be created or used.
2018-03-06 23:33:35 +02:00
Marko Mäkelä
67f6d40bd9 MDEV-15443 Properly read wsrep XID and binlog position from rollback segment headers
The problem is a regression caused by MDEV-15158.
If some transactions were committed with wsrep_on=0, a
rollback segment header having the highest trx_id assigned might
store undefined wsrep XID. When reading the wsrep checkpoint
from InnodB, the undefined wsrep XID might be returned instead
of the highest valid one.

Similarly, if the binary log is intermittently disabled or enabled
while InnoDB transactions are being committed, the latest updated
rollback segment header page might not contain the latest binlog metadata.

Therefore, the MDEV-15158 logic to rely on TRX_RSEG_MAX_TRX_ID for
determining the most recent WSREP XID or binlog position is invalid.
We must choose the maximum entries among the rollback segment header
pages.

This fix is based on code submitted by Teemu Ollakka from Codership
and by Thirunarayanan Balathandayuthapani from MariaDB Corporation.

trx_purge_add_undo_to_history(): Only write TRX_RSEG_MAX_TRX_ID
when it was used to be written before MDEV-15158.

wsrep_seqno: Renamed from trx_sys_cur_xid_seqno.

wsrep_uuid: Renamed from trx_sys_cur_xid_uuid, and enable in non-debug
builds.

read_wsrep_xid_uuid(): Make non-debug, and remove the memcpy().

trx_rseg_update_wsrep_checkpoint(): Correctly compare and copy
the entire UUID in the debug check. In case of UUID mismatch,
write the WSREP XID to all 128 rollback segment headers in
a single mini-transaction.

trx_rseg_read_wsrep_checkpoint(rseg_header, xid): Make static.
In case the information is absent, do not overwrite xid.

trx_rseg_read_wsrep_checkpoint(xid): Determine the maximum
WSREP XID.

trx_rseg_mem_restore(): Remove the parameter max_rseg_trx_id.
Determine the latest binlog file and position by comparing
file names and offsets. Declare trx_sys.recovered_binlog_offset
as an unsigned type.
2018-03-06 23:32:26 +02:00
Daniel Black
0a63c91ab0 MDEV-8743: fopen mode e (glibc only) to prevent galera SST scripts accessing server files
For RemoteDatafile::read_link_file and buffer poool dumps

Note: STR_O_CLOEXEC needs to be at the end of the fopen otherwise
fopen will return EINVAL.
2018-03-05 12:00:09 +11:00
Sergei Golubchik
176d603cc7 MDEV-15462 TokuDB does not build on openSUSE
fix 50359719f0
don't rely on any specific engine checking order
2018-03-04 18:59:29 +01:00
Elena Stepanova
8f98835bb8 MDEV-15448 Remove "innodb_additional_mem_pool_size" setting from my-innodb-heavy-4G.cnf file 2018-03-03 01:59:52 +02:00
Alexander Barkov
d70573564c Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2018-03-02 12:09:41 +04:00
Alexander Barkov
88a9d4ab42 MDEV-15444 Querying I_S.PARAMETERS can crash with a corrupted mysql.proc 2018-03-02 11:31:27 +04:00
Oleksandr Byelkin
5cf0662d76 MDEV-13749: Server crashes in _ma_unique_hash / JOIN_CACHE::generate_full_extensions on INTERSECT
Expect index except unique constrain in case of heap table conversion.
2018-03-01 16:28:31 +01:00
Alexander Barkov
4025cfaec0 MDEV-15416 Crash when reading I_S.PARAMETERS 2018-02-28 23:05:57 +04:00
Daniel Bartholomew
92993d92e4 bump the VERSION 2018-02-28 09:29:30 -05:00