Commit graph

188141 commits

Author SHA1 Message Date
Oleksandr Byelkin
af650c76a6 MDEV-18460: Server crashed in strmake / tdc_create_key / THD::create_tmp_table_def_key
When there is a WITH clause we postpone check for tables without
database for later stages when tables in WITH will be defined.
But we should not try to open such tables as temporary tables because
temporary tables always belong to a some database.
2019-12-10 07:37:18 +01:00
Varun Gupta
246e2ae12b MDEV-20900: IN predicate to IN subquery conversion causes performance regression
Disable the IN predicate to IN subquery conversion when the types on the left and
right hand side of the IN predicate are not of comparable type.
2019-12-10 11:28:04 +05:30
Vladislav Vaintroub
e47bd0073c MDEV-21262 MTR does not work with Windows ASAN builds
Do not use suppressions on Windows, the ASAN_OPTIONS can't be parsed
whenever full file names are used, because file names contain ':'
which is ASAN_OPTIONS delimeter.
2019-12-09 21:12:13 +01:00
Vladislav Vaintroub
66de4fef76 MDEV-16264 - some improvements
- wait notification, tpool_wait_begin/tpool_wait_end - to notify the
threadpool that current thread is going to wait

Use it to wait for IOs to complete and also when purge waits for workers.
2019-12-09 21:12:13 +01:00
Marko Mäkelä
d3b2625ba0 MDEV-21259 Assertion failed in mtr_t::write()
btr_free_externally_stored_field(): Pass w=mtr_t::OPT to
note that the BTR_EXTERN_LEN is not necessarily changing
when a multi-page ROW_FORMAT=COMPRESSED off-page column
is being freed, and to allow redundant writes to the redo
log to be optimized away.

Ever since commit 56f6dab1d0
the refactored function mtr_t::write() asserts by default
that the page contents is being changed.
2019-12-09 21:11:08 +02:00
Oleksandr Byelkin
a15234bf4b Merge branch '10.3' into 10.4 2019-12-09 15:09:41 +01:00
Marko Mäkelä
425748f1b5 Cleanup: Replace a redundant statement with an assertion 2019-12-09 14:54:27 +02:00
Marko Mäkelä
292015d486 MDEV-21254 Remove unused keywords from the InnoDB SQL parser
The InnoDB internal SQL parser, which is used for updating the InnoDB
data dictionary tables (to be removed in MDEV-11655), persistent
statistics (to be refactored in MDEV-15020) and fulltext indexes,
implements some unused keywords and built-in functions:

OUT BINARY BLOB INTEGER FLOAT SUM DISTINCT READ
COMPACT BLOCK_SIZE
TO_CHAR TO_NUMBER BINARY_TO_NUMBER REPLSTR SYSDATE PRINTF ASSERT
RND RND_STR ROW_PRINTF UNSIGNED

Also, procedures are never declared with parameters. Only one top-level
procedure is declared and invoked at a time, and parameters are being
passed via pars_info_t.
2019-12-09 12:32:04 +02:00
Jan Lindström
59e14b9684 MDEV-21189: Dropping partition with 'wsrep_OSU_method=RSU' and 'SESSION sql_log_bin = 0' cases the galera node to hang
Found two bugs

(1) have_committing_connections was missing mutex unlock on one
exit case. As this function is called on a loop it caused mutex
lock when we already owned the mutex. This could cause hang.

(2) wsrep_RSU_begin did set up error code when partition to
be dropped could not be MDL-locked because of concurrent
operations but wrong error code was propagated to upper layer
causing error to be ignored. This could have also caused
the hang.
2019-12-09 08:14:39 +02:00
Teemu Ollakka
9a62120089 MDEV-21229 Update wsrep-lib to deal with libstdc++ vector assertion (#1423)
The assertion was caused by use of operator[] for an empty vector.
The wsrep-lib update changes vector operations which access
the underlying data array to use data() method which is valid
for empty vectors.
2019-12-09 07:45:40 +02:00
Alexey Botchkov
fd1979bc9a MDEV-18463 Don't allow multiple table CONSTRAINTs with the same name.
Add necessary checks.
2019-12-09 01:17:16 +04:00
Vladislav Vaintroub
6aa0fa3897 CONC-417 Windows clients using Schannel often encounter error SEC_E_INVALID_TOKEN
reenable ssl_8k_key on Windows, which was affected by this bug
2019-12-08 18:28:21 +01:00
Vladislav Vaintroub
6484288cd2 CONC-447 ERROR 2026 (HY000): SSL connection error: Certificate signature check failed
Enable CRL checking on Windows.
Enable certificate verification testing in client testing.
2019-12-08 18:26:16 +01:00
Alexander Barkov
d30dbaa20d A cleanup for MDEV-8844: Fixing compilation failure on Windows
Fixing lossy type conversions:
- from int64 to int
- from size_t to uint
2019-12-07 19:12:04 +04:00
Alexander Barkov
3c6065a270 MDEV-8844 Unreadable control characters printed as is in warnings 2019-12-06 18:51:05 +04:00
Sujatha
e949b2d4ab MDEV-20959: binlog.binlog_parallel_replication_marks_row fails in buildbot with wrong result
Problem:
=======
Test "binlog.binlog_parallel_replication_marks_row" fails sporadically due to
result length mismatch.

Analysis:
=========
Test generates a binary log and it looks for certain words within the binary
log file and prints them. For example word like "GTID,BEGIN,COMMIT ...".
Binary log output contains base64 encoded characters. Occasionally the encoded
characters match with the above words and results in test failure.

+XwoFWxMBAAAALgAAAGEDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIDAwACFGTIDQ==
+AAAAAAAAAAAEEwQADQgICAoKCgGTIDw9

Fix:
===
Improve the regular expression to match exact words.
2019-12-06 19:58:12 +05:30
Alexander Barkov
00445652db A cleanup for MDEV-17088 Provide tools to encode/decode mysql-encoded file system names
tests mariadb-conv-utf8 and mariadb-conv-cp932 failed on PPC,
because "char" is "unsigned char" on PPC.

Adding a cast from "char" to "signed char" in the two affected places.
2019-12-06 10:27:59 +04:00
Elena Stepanova
e5e5877740 List of unstable tests for 10.3.21 release 2019-12-06 00:18:10 +02:00
Aleksey Midenkov
be92dce613 MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
Versioned conditions in on_expr can not be rebuilt at optimization
stage on non-conventional arena.
2019-12-05 23:53:07 +03:00
Kentoku
f5b76d8c40 fix compiler warnings 2019-12-06 05:10:01 +09:00
Kentoku
1b040ce570 fix compiler warnings 2019-12-06 04:59:22 +09:00
Robert Bindar
1fbd9bb2c5
Merge pull request #1261 from robertbindar/mdev-17978
MDEV-17978 Server crash in SHOW CREATE SEQUENCE on a broken view
2019-12-05 18:26:52 +02:00
Eugene Kosov
42bad56aab MDEV-21014 MTR does not detect {A,M,T,L,UB}SAN errors which happen upon server shutdown
Let MTR check for error existence after running a test and return it back to user.

Error reporting itset might be much better, but first of all we need to see that
something went wrong.
2019-12-05 23:09:57 +07:00
Aleksey Midenkov
d759f764f6 MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
Incorrect assertion of EXTRA_CACHE for
HA_EXTRA_PREPARE_FOR_UPDATE. The latter is related to read cache, but
must operate without it as a noop.

Related to Bug#55458 and MDEV-20441.
2019-12-05 15:25:30 +03:00
Marko Mäkelä
6189774c37 MDEV-21174: Fix undefined behaviour
ibuf_bitmap_page_set_bits(): Do not attempt to shift by a negative amount.
This bug was introduced in commit 87839258f8.
2019-12-05 12:44:19 +02:00
Jan Lindström
2b7e461cc0 MDEV-21209 : mysql_tzinfo_to_sql's Galera checks do not work
wsrep_on parameter can be visible even when wsrep_on is set OFF
so we need to check variable_value from I_S also.
2019-12-05 12:41:13 +02:00
Axel Schwenke
f00198e09f Merge branch 'bb-10.1-MDEV-17571' of github.com:MariaDB/server into bb-10.1-MDEV-17571 2019-12-05 10:37:02 +01:00
Axel Schwenke
d78f02d73d MDEV-17571 Make systemd timeout behavior more compatible with long Galera SSTs
Set an explicit start and stop timeout of 900 seconds for the
MariaDB Server systemd service
2019-12-05 10:36:20 +01:00
Marko Mäkelä
c4ed1bee5b MDEV-21172 Memory leak after failed ADD PRIMARY KEY 2019-12-05 08:54:14 +01:00
Marko Mäkelä
46fc3bdbca MDEV-21225: Fix warnings
Datafile::find_space_id(): Remove an unused variable

buf_chunk_init(): warning C4319:  '~': zero extending 'ulong' to 'ulint'
of greater size
2019-12-05 08:23:23 +02:00
Alexander Barkov
2c7b6214e7 A cleanup for MDEV-17088 Provide tools to encode/decode mysql-encoded file system names
- Load and convert the entire input file at once,
  rather than reading string-by-string using fgets().
  This change makes it possible to convert from UCS2, UTF16, UTF32 data.
- Adding the --delimiter command, to treat the specified
  characters as delimiters rather than data to convert.
  Useful in combination with `-f filename` or `-t filename`.
  The delimiter characters are not converted,
  they are copied from the input to the output as is.
- Adding diagnostics with line number and position if:
  * an illegal input byte sequence was found
  * a character cannot be converted to the target character set
2019-12-05 09:45:28 +04:00
Marko Mäkelä
42a4ae54c2 MDEV-21225 Remove ut_align() and use aligned_malloc()
Before commit 90c52e5291 introduced
aligned_malloc(), InnoDB always used a pattern of over-allocating
memory and invoking ut_align() to guarantee the desired alignment.

It is cleaner to invoke aligned_malloc() and aligned_free() directly.

ut_align(): Remove. In assertions, ut_align_down() can be used instead.
2019-12-05 06:42:31 +02:00
Elena Stepanova
3cc0e0befb List of unstable tests for 10.2.30 release 2019-12-05 01:28:11 +02:00
Elena Stepanova
3efbb5a169 List of unstable tests - intermediate update 2019-12-04 23:40:33 +02:00
Marko Mäkelä
504202bd7f MDEV-21216: Remove fsp_header_get_space_id()
The function fsp_header_get_space_id() returns ulint instead of
uint32_t, only to be able to complain that the two adjacent
tablespace ID fields in the page differ. Remove the function,
and merge the check to the callers.

Also, make some more use of aligned_malloc().
2019-12-04 20:01:04 +02:00
Oleksandr Byelkin
008ee867a4 Merge branch '10.2' into 10.3 2019-12-04 17:46:28 +01:00
Marko Mäkelä
2352f51625 MDEV-21174: Fix Galera
trx_rseg_write_wsrep_checkpoint(): Use mtr_t::OPT, because
much of the time, the redo log writes would be redundant.
This was broken in commit 56f6dab1d0.
2019-12-04 18:25:01 +02:00
Oleksandr Byelkin
670c9a3a18 Merge remote-tracking branch 'origin/bb-10.3-release' into 10.3 2019-12-04 15:57:09 +01:00
Oleksandr Byelkin
81bf7d3317 Merge branch 'bb-10.3-release' into 10.3 2019-12-04 15:01:54 +01:00
Marko Mäkelä
6b5cdd4ff7 MDEV-19514: Update stale comments 2019-12-04 15:35:58 +02:00
Marko Mäkelä
95e903261e MDEV-21216 InnoDB does dirty read of TRX_SYS page before recovery
InnoDB startup was discovering undo tablespaces in a dirty way.
It was reading a possibly stale copy of the TRX_SYS page before
processing any redo log records.

srv_start(): Do not call buf_pool_invalidate(). Invoke
trx_rseg_get_n_undo_tablespaces() after the recovery has been initiated.

recv_recovery_from_checkpoint_start(): Assert that the buffer pool is
empty. This used to be guaranteed by the buf_pool_invalidate() call.

trx_rseg_get_n_undo_tablespaces(): Move to the calling compilation unit,
and reimplement in a simpler way.

srv_undo_tablespace_create(): Remove the constant parameter
size=SRV_UNDO_TABLESPACE_SIZE_IN_PAGES.

srv_undo_tablespace_open(): Reimplement in a cleaner way, with
more robust error handling.

srv_all_undo_tablespaces_open(): Split from srv_undo_tablespaces_init().

srv_undo_tablespaces_init(): Read all "undo001","undo002" tablespace
files directly, without consulting the TRX_SYS page via calling
trx_rseg_get_n_undo_tablespaces().

This is joint work with Thirunarayanan Balathandayuthapani.
2019-12-04 15:34:28 +02:00
Marko Mäkelä
e5dfdc5606 Cleanup: use constexpr for SRV_UNDO_TABLESPACE_SIZE_IN_PAGES 2019-12-04 15:34:28 +02:00
Axel Schwenke
c5dafca87e MDEV-17571 Make systemd timeout behavior more compatible with long Galera SSTs
Set an explicit start and stop timeout of 900 seconds for the
MariaDB Server systemd service
2019-12-04 14:28:13 +01:00
Vladislav Vaintroub
bf3034195f Part2: MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
Generate sql_yacc_ora.yy from sql_yacc.yy , by using cmake script
which does some simple string(REPLACE)
2019-12-04 15:45:00 +04:00
Alexander Barkov
3f9d7072e9 Part1: MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
Mixing %type and %expect declarations:
- sql_mode=ORACLE declarations look like an empty C code section
  inside sql_yacc.yy, consisting of an inactive #ifdef..#endif block.
- sql_mode=DEFAULT declarations look like an empty C code section
  inside sql_yacc_ora.yy, consisting of an inactive #ifdef..#endif block.

Mixing rules:
- Adding a special rule _empty to the shared rule section.
- Changing all instances of /*Empty*/ in sql_mode=DEFAULT and sql_mode=ORACLE
  specific sections to _empty.
- Changing the rest of C style comments /*xxx*/ in
  sql_mode=DEFAULT and sql_mode=ORACLE specific blocks to C++ style: //xxx
- Mixing sql_yacc.yy and sql_yacc_ora.yy, so
  sql_mode=ORACLE specific blocks sit in a comment inside sql_yacc.yy, and
  sql_mode=DEFAULT specific blocks sit in a comment inside sql_yacc_ora.yy.
2019-12-04 15:45:00 +04:00
Jan Lindström
c9b9eb3315 MDEV-18497 : CTAS async replication from mariadb master crashes galera nodes (#1410)
In MariaDB 10.2 master could have been configured so that there
is extra annotate events. When we peak next event type for CTAS we
need to skip annotate events.
2019-12-04 11:46:37 +02:00
Marko Mäkelä
bb45941685 MDEV-21205 Assertion failure in btr_sec_min_rec_mark
In commit af5947f433
the function btr_discard_page() is invoking btr_set_min_rec_mark()
with the wrong buf_block_t* object. node_ptr is on merge_block,
not block.

btr_discard_page(): Remove the variables merge_page, page, and
always refer to block->frame or merge_block->frame instead.
Also, limit the scope of node_ptr and avoid duplicated conditions.

btr_set_min_rec_mark(): Add a template parameter, so that the
caller can specify whether the page is supposed to have a left sibling.
Otherwise, the assertion (which was introduced in the same commit)
would fail in btr_discard_page().
2019-12-04 10:51:38 +02:00
Daniele Sciascia
aab6cefe8d MDEV-20848 Fixes for MTR test galera_sr.GCF-1060 (#1421)
This patch contains two fixes:

* wsrep_handle_mdl_conflict(): handle the case where SR transaction
  is in aborting state. Previously, a BF-BF conflict was reported, and
  the process would abort.
* wsrep_thd_bf_abort(): do not restore thread vars after calling
  wsrep_bf_abort(). Thread vars are already restored in wsrep-lib if
  necessary. This also removes the assumption that the caller of
  wsrep_thd_bf_abort() is the given bf_thd, which is not the case.

Also in this patch:

* Remove unnecessary check for active victim transaction in
  wsrep_thd_bf_abort(): the exact same check is performed later in
  wsrep_bf_abort().
* Make wsrep_thd_bf_abort() and wsrep_log_thd() const-correct.
* Change signature of wsrep_abort_thd() to take THD pointers instead
  of void pointers.
2019-12-04 09:21:14 +02:00
Aleksey Midenkov
f6d8640d67 MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
Related to 87731177 and Bug#47649.

Don't set Query_arena::STMT_EXECUTED for any error
code. skip_setup_conds() depends on STMT_INITIALIZED_FOR_SP, but
sp_lex_keeper::reset_lex_and_exec_core() sets it to STMT_EXECUTED on
ER_TABLE_NOT_LOCKED_FOR_WRITE. There are other error codes that can
break skip_setup_conds() (ER_IT_IS_A_VIEW, ER_NON_UPDATABLE_TABLE,
etc).
2019-12-04 07:10:41 +03:00
Aleksey Midenkov
477629d2cd MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
Unit prepare prematurely fixed field which must be fixed via
setup_conds() to correctly update table->covering_keys.

Call vers_setup_conds() directly instead, because actually everything
else is not needed.
2019-12-04 07:10:41 +03:00