Commit graph

183597 commits

Author SHA1 Message Date
Igor Babaev
5ec144cfab MDEV-17211 Server crash on query
The function JOIN_TAB::choose_best_splitting() did not take into account
that for some tables whose fields were used in the GROUP BY list of
the specification of a splittable materialized derived there might exist
no elements in the array ext_keyuses_for_splitting.
2018-09-17 18:50:21 -07:00
Jacob Mathew
e33961611a MDEV-17144: Sample of spider_direct_sql cause crash
The crash occurs when the Spider node server attempts to create an error
message stating that the temporary table is not found.  The function to
create the error message is called with incorrect parameters.

I fixed the crash by correcting the incorrect parameter values.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.
2018-09-17 18:48:38 -07:00
Jan Lindström
cc616bea53 Test galera.query_cache is still failing on bb. 2018-09-17 18:18:19 +03:00
Marko Mäkelä
21f310db30 Fix the Windows build 2018-09-17 18:10:37 +03:00
Marko Mäkelä
774a4cb547 Mroonga follow-up fix for MDEV-16328
Now that ha_innobase::prepare_inplace_alter_table() is accessing
ha_alter_info->create_info->option_struct, we must initialize it in
the Mroonga wrapper for ALTER TABLE based on the parsed table options
for the wrap_altered_table.
2018-09-17 17:50:56 +03:00
Marko Mäkelä
ac24289e66 MDEV-16328 ALTER TABLE…page_compression_level should not rebuild table
The table option page_compression_level is something that only
affects future writes, not actually the data format. Therefore,
we can allow instant changes of this option.

Similarly, the table option page_compressed can be set on a
previously uncompressed table without rebuilding the table,
because an uncompressed page would be considered valid when
reading a page_compressed table.

Removing the page_compressed option will continue to require
the table to be rebuilt.

ha_innobase_inplace_ctx::page_compression_level: The requested
page_compression_level at the start of ALTER TABLE, or 0 if
page_compressed=OFF.

alter_options_need_rebuild(): Renamed from
create_option_need_rebuild(). Allow page_compression_level and
page_compressed to be changed as above, without rebuilding the table.

ha_innobase::check_if_supported_inplace_alter(): Allow ALGORITHM=INSTANT
for ALTER_OPTIONS if the table is not to be rebuilt. If rebuild is
needed, set ha_alter_info->unsupported_reason.

innobase_page_compression_try(): Update SYS_TABLES.TYPE according
to the table flags, for an instant change of page_compression_level
or page_compressed.

commit_cache_norebuild(): Adjust dict_table_t::flags, fil_space_t::flags
and (if needed) FSP_SPACE_FLAGS if page_compression_level was specified.
2018-09-17 14:37:39 +03:00
Jan Lindström
145c947b88 MDEV-17206: Test failure on galera.galera_ist_* in debug builds
Failure is due missing .rdiff files for debug build as tests have
@have_debug combination.
2018-09-17 12:03:41 +03:00
Jan Lindström
dbf4e68704 MDEV-13879: galera.galera_wan fails in buildbot with Stray state UUID msg or with "Transport endpoint is not connected" or with a failure to start a node
Add correct suppressions and wait conditions for expected database
contents.
2018-09-17 09:05:52 +03:00
Marko Mäkelä
4fa9eaf454 Remove unused ha_innobase::lock
In MySQL 5.7, a follow-up to WL#6671 removed the unused
fields ha_innobase::lock and INNOBASE_SHARE::lock, but
MariaDB did not remove them, even though a counterpart of
WL#6671 itself was implemented as MDEV-7660 in
commit d665e79c5b.

INNOBASE_SHARE was removed in MDEV-16557. Thus, all that
needs to be removed is the unused member ha_innobase::lock
and related code.

Thanks to Monty (and Valgrind) for noticing that
ha_innobase::lock was uninitialized.
2018-09-17 08:55:56 +03:00
Jan Lindström
6a31e86bbd Adjust Galera disabled tests based on test results. 2018-09-17 08:11:38 +03:00
Michael Widenius
bd7c31621f MDEV-17065 Crash on SHOW CREATE TABLE with CHECK CONSTRAINT
The problem was that the original alias was replaced with a new allocated
string, but constraint item's are still pointing to the original alias.

Fixed by storing the original alias used when printing constraint in the
tables mem_root.
2018-09-16 11:23:27 +03:00
Michael Widenius
4dc20ff687 Fixed wrong printf in mariabackup 2018-09-16 11:23:27 +03:00
Alexey Botchkov
e89b611dc9 MDEV-16050 cte + geometry functions lead to crash.
Structures based on Gcalc_dyn_list need to be treated
properly when copied in Item::get_copy().
2018-09-16 10:22:32 +04:00
Igor Babaev
7419f72b71 Fixed a compiler warning. 2018-09-15 15:43:08 -07:00
Igor Babaev
c5a9a63293 MDEV-16917 Index affects query results
The optimizer erroneously allowed to use join cache when joining a
splittable materialized table together with splitting optimization.
As a consequence in some rare cases the server returned wrong result
sets for queries with materialized derived.

This patch allows to use either join cache without usage of splitting
technique for materialization of a splittable derived table or splitting
without usage of join cache when joining such table. The costs the these
alternatives are compared and the best variant is chosen.
2018-09-15 14:28:33 -07:00
Elena Stepanova
7c76f8aa3a Disable incompatible tests 2018-09-15 21:54:22 +03:00
Igor Babaev
3473e0452e MDEV-17154 Multiple selects from parametrized CTE fails with syntax error
This patch fills a serious flaw in the implementation of common table
expressions. Before this patch an attempt to prepare a statement from
a query with a parameter marker in a CTE that was used more than once
in the query ended up with a bogus error message. Similarly if a statement
in a stored procedure contained a CTE whose specification used a
local variables and this CTE was referred to more than once in the
statement then the server failed to execute the stored procedure returning
a bogus error message on a non-existing field.

The problems appeared due to incorrect handling of parameter markers /
local variables in CTEs that were referred more than once.

This patch fixes the problems by differentiating between the original
occurrences of a parameter marker / local variable used in the
specification of a CTE and the corresponding occurrences used
in copies of this specification. These copies are substituted
instead of non-first references to the CTE.

The idea of the fix and even some code were taken from the MySQL
implementation of the common table expressions.
2018-09-14 18:13:16 -07:00
Vladislav Vaintroub
f0ee8496d2 MDEV-15088 Lighter version of Windows Zip distributions
Add new target win_package, that produces
a) light ZIP (no test suite, no sql-bench, no debugsymbols)
b) debug symbols ZIP
2018-09-14 20:54:54 +01:00
Marko Mäkelä
aba5c72be2 MDEV-17196 Crash during instant ADD COLUMN with long DEFAULT value
A debug assertion would fail if an instant ADD COLUMN operation
involves splitting the leftmost leaf page and storing a default
value off-page. Another debug assertion could fail if the
default value does not fit in an undo log page.

btr_cur_pessimistic_update(): Invoke rec_offs_make_valid()
in order to prevent rec_offs_validate() assertion failure.

innobase_add_instant_try(): Invoke btr_cur_pessimistic_update()
with the BTR_KEEP_POS_FLAG, which is the correct course of action
when BLOBs may need to be written. Whenever returning true,
ensure that my_error() will have been called.
2018-09-14 15:06:58 +03:00
Jan Lindström
d3a8b5aa9c MDEV-14143: galera.galera_kill_smallchanges, galera.galera_kill_ddl fail in buildbot with "Last Applied Action message in non-primary configuration from member 0"
Add supression.
2018-09-14 13:10:48 +03:00
Vladislav Vaintroub
6b2da93359 MDEV-17192 Backup with -no-lock should fail, if DDL is detected at the end of backup 2018-09-14 09:36:02 +01:00
Jan Lindström
c886368a3a Test galera_sst_rsync_data_dir has different result on release
and debug builds. Modified version for 10.1 from following commit:

commit 8e68876477
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Thu Sep 13 15:06:44 2018 +0200

    Fix of the test which has debug version
2018-09-14 11:16:54 +03:00
Jan Lindström
ed7a0e5efc MDEV-13876: galera.MW-328A failed in buildbot with wrong result or timeout
Move MW-328[A,B,C] to big tests as there seem to be big variation
on their execution times and sometimes that could lead timeout.
2018-09-14 10:40:39 +03:00
Oleksandr Byelkin
28f08d3753 Merge branch '10.1' into 10.2 2018-09-14 08:47:22 +02:00
Jacob Mathew
ed49f9aae2 MDEV-16912: Spider Order By column[datatime] limit 5 returns 3 rows
The problem occurs in 10.2 and earlier releases of MariaDB Server because the
Partition Engine was not pushing the engine conditions to the underlying
storage engine of each partition.  This caused Spider to return the first 5
rows in the table with the data provided by the customer.  2 of the 5 rows
did not qualify the WHERE clause, so they were removed from the result set by
the server.

To fix the problem, I have back-ported support for engine condition pushdown
in the Partition Engine from MariaDB Server 10.3 to 10.2 and 10.1.  In 10.3
and 10.4 I have merged the comments and the test case.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Merged:
  Commit eb2ca3d on branch bb-10.2-MDEV-16912
2018-09-13 14:55:46 -07:00
Jacob Mathew
6c47c1c456 MDEV-16912: Spider Order By column[datatime] limit 5 returns 3 rows
The problem occurs in 10.2 and earlier releases of MariaDB Server because the
Partition Engine was not pushing the engine conditions to the underlying
storage engine of each partition.  This caused Spider to return the first 5
rows in the table with the data provided by the customer.  2 of the 5 rows
did not qualify the WHERE clause, so they were removed from the result set by
the server.

To fix the problem, I have back-ported support for engine condition pushdown
in the Partition Engine from MariaDB Server 10.3.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Cherry-Picked:
  Commit eb2ca3d on branch bb-10.2-MDEV-16912
2018-09-13 13:27:03 -07:00
Jacob Mathew
3866589308 MDEV-16912: Spider Order By column[datatime] limit 5 returns 3 rows
The problem occurs in 10.2 and earlier releases of MariaDB Server because the
Partition Engine was not pushing the engine conditions to the underlying
storage engine of each partition.  This caused Spider to return the first 5
rows in the table with the data provided by the customer.  2 of the 5 rows
did not qualify the WHERE clause, so they were removed from the result set by
the server.

To fix the problem, I have back-ported support for engine condition pushdown
in the Partition Engine from MariaDB Server 10.3.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.

Merged:
  Commit eb2ca3d on branch bb-10.2-MDEV-16912
2018-09-13 11:41:55 -07:00
Oleksandr Byelkin
8e68876477 Fix of the test which has debug version 2018-09-13 15:06:44 +02:00
Sergei Petrunia
d85a7220dc MDEV-17188: rocksdb.2pc_group_commit fails intermittently in BB
When counter increment is not within the expected range, print the number
instead of just FAIL.

This doesnt solve the bug but will help with the diagnostics.
2018-09-13 15:00:13 +03:00
Oleksandr Byelkin
c9d6728c36 try to fix version detection 2018-09-13 12:46:51 +03:00
Alexey Botchkov
f54485eadb MDEV-17001 JSON_MERGE returns nullwhen merging empty array.
Don't add the comma if nothing appended to the array.
2018-09-13 13:42:09 +04:00
Oleksandr Byelkin
2b46dca5d7 Merge remote-tracking branch 'connect/10.2' into 10.2 2018-09-13 10:09:28 +02:00
Jan Lindström
ec457c08d7
Merge pull request #865 from grooverdan/MDEV-17173-wsrep_sst
MDEV-17173: correct parsing of 12.13.14.15:4444/xtrabackup_sst leavin…
2018-09-13 08:29:41 +03:00
Daniel Black
b96d36344e MDEV-17173: correct parsing of 12.13.14.15:4444/xtrabackup_sst leaving LSN/SST_VER blank
Correcting commit e78e308e81
$ . scripts/wsrep_sst_common.sh --address 12.13.14.15:4444/xtrabackup_sst ; set | grep WSREP_SST
WSREP_SST_OPT_ADDR=12.13.14.15:4444/xtrabackup_sst
WSREP_SST_OPT_ADDR_PORT=4444
WSREP_SST_OPT_AUTH=
WSREP_SST_OPT_BINLOG=
WSREP_SST_OPT_BINLOG_INDEX=
WSREP_SST_OPT_BYPASS=0
WSREP_SST_OPT_CONF='  '
WSREP_SST_OPT_DATA=
WSREP_SST_OPT_DEFAULT=
WSREP_SST_OPT_EXTRA_DEFAULT=
WSREP_SST_OPT_HOST=12.13.14.15
WSREP_SST_OPT_HOST_UNESCAPED=12.13.14.15
WSREP_SST_OPT_LSN=
WSREP_SST_OPT_MODULE=xtrabackup_sst
WSREP_SST_OPT_PATH=xtrabackup_sst
WSREP_SST_OPT_PORT=4444
WSREP_SST_OPT_PSWD=
WSREP_SST_OPT_SST_VER=
WSREP_SST_OPT_SUFFIX_DEFAULT=
WSREP_SST_OPT_SUFFIX_VALUE=
WSREP_SST_OPT_USER=

. scripts/wsrep_sst_common.sh --address 12.13.14.15:4444/xtrabackup_sst/1234/5676 ; set | grep WSREP_SST
WSREP_SST_OPT_ADDR=12.13.14.15:4444/xtrabackup_sst/1234/5676
WSREP_SST_OPT_ADDR_PORT=4444
WSREP_SST_OPT_AUTH=
WSREP_SST_OPT_BINLOG=
WSREP_SST_OPT_BINLOG_INDEX=
WSREP_SST_OPT_BYPASS=0
WSREP_SST_OPT_CONF='  '
WSREP_SST_OPT_DATA=
WSREP_SST_OPT_DEFAULT=
WSREP_SST_OPT_EXTRA_DEFAULT=
WSREP_SST_OPT_HOST=12.13.14.15
WSREP_SST_OPT_HOST_UNESCAPED=12.13.14.15
WSREP_SST_OPT_LSN=1234
WSREP_SST_OPT_MODULE=xtrabackup_sst
WSREP_SST_OPT_PATH=xtrabackup_sst/1234/5676
WSREP_SST_OPT_PORT=4444
WSREP_SST_OPT_PSWD=
WSREP_SST_OPT_SST_VER=5676
WSREP_SST_OPT_SUFFIX_DEFAULT=
WSREP_SST_OPT_SUFFIX_VALUE=
WSREP_SST_OPT_USER=
2018-09-13 10:00:51 +10:00
Alexey Botchkov
a93363022c MDEV-17018 JSON_SEARCH and User-Defined Variables.
Item_func_json_search needs a member to store the path.
2018-09-12 21:57:28 +04:00
Jan Lindström
6c7910ee22 Fix test galera#505 galera library version check.
Test requires galera library version 25.3.24.
2018-09-12 19:54:40 +03:00
Sergei Petrunia
e63b84b916 MDEV-17155: Incorrect ORDER BY optimization: full index scan is used instead of range
The bug was this scenario:
1. Join optimizer picks a range plan on index IDX1
   (This index doesn't match the ORDER BY clause, so sorting will be needed)
2. Index Condition Pushdown pushes a part of WHERE down. The pushed
   condition is removed from SQL_SELECT::cond
3. test_if_skip_sort_order() figures that it's better to use IDX2
   (as it will match ORDER BY ... LIMIT and so will execute faster)

3.1 It sees that there was a possible range access on IDX2. It tries to
   construct it by calling SQL_SELECT::test_quick_select(), but alas,
   SQL_SELECT::cond doesn't have all parts of WHERE anymore.
   So it uses full index scan which is slow.

(The execution works fine because there's code further in test_if_skip_sort_order()
which "Unpushes" the index condition and restores the original WHERE clause.
It was just the test_quick_select call that suffered).
2018-09-12 16:58:30 +03:00
Ming Lin
87609324e0 MDEV-16768: fix blob key length
The blob key length could be shorter than the length of the entire blob,
for example,

CREATE TABLE t1 (b BLOB, i INT, KEY(b(8)));
INSERT INTO t1 VALUES (REPEAT('a',9),1);

The key length is 8, while the blob length is 9.
So we need to set the correct key length in Field_blob::sort_string().
2018-09-12 15:15:13 +03:00
Jan Lindström
038804d594 Update disabled Galera tests. 2018-09-12 14:56:48 +03:00
Jan Lindström
794e89ed3f MDEV-17108: Test failure on galera.galera_kill_ddl
Add suppression.
2018-09-12 14:54:59 +03:00
Jan Lindström
c76ee73dc7 MDEV-13743: galera_toi_truncate may fail with: query 'reap' succeeded - should have failed with errno 1213
Replace sleep with debug sync point before insert commit to
make sure insert is not executed before truncate has started.
2018-09-12 13:32:14 +03:00
mkaruza
16384fae63 MDEV-15845 Test failure on galera.galera_concurrent_ctas
While executing CTAS galera applier thread can cause CTAS to abort and rollback. Rollback can take time causing applier thread to shutdown node after serial unsuccessful retries to apply transaction. Don't set lock_wait_timeout to zero to wait for lock.
2018-09-12 12:56:24 +03:00
Jacob Mathew
eb2ca3d445 MDEV-16912: Spider Order By column[datatime] limit 5 returns 3 rows
The problem occurs in 10.2 and earlier releases of MariaDB Server because the
Partition Engine was not pushing the engine conditions to the underlying
storage engine of each partition.  This caused Spider to return the first 5
rows in the table with the data provided by the customer.  2 of the 5 rows
did not qualify the WHERE clause, so they were removed from the result set by
the server.

To fix the problem, I have back-ported support for engine condition pushdown
in the Partition Engine from MariaDB Server 10.3.

Author:
  Jacob Mathew.

Reviewer:
  Kentoku Shiba.
2018-09-11 16:29:44 -07:00
Vladislav Vaintroub
e46b2a3e94 MDEV-12956 provide default datadir for mariabackup --copy-back
On Unix, it is compiled-in datadir value.
On Windows, the directory is ..\data, relative to directory
mariabackup.exe

server uses the same logic to determine datadir.
2018-09-11 20:59:35 +01:00
Vladislav Vaintroub
c3124174c3 MDEV-17168 mariabackup reports "failed to open bitmap directory"
MariaDB does not support changed page tracking, since 10.2. Remove bitmap
initialization
2018-09-11 15:24:35 +01:00
Alexey Botchkov
c8bb43a938 MDEV-17121 JSON_ARRAY_APPEND.
Extra comma added to the result when an json array is empty.
2018-09-11 14:37:45 +04:00
mkaruza
4d9ec7cb6c MDEV-16052 galera mtr galera_certification_double_failure fails with deadlock
There was change in error reporting from my_error to my_message so new recording is required.
2018-09-11 13:55:40 +03:00
Jan Lindström
8dda6d797a
Merge pull request #850 from HeMan/10.3
Return code from starting MariaDB.
2018-09-11 12:05:47 +03:00
Jan Lindström
ffd583bb8b
Merge pull request #858 from codership/10.3-MDEV-16052
MDEV-16052 galera mtr galera_certification_double_failure fails with deadlock
2018-09-11 12:00:39 +03:00
Jan Lindström
4d93fea4e0
Merge pull request #857 from codership/10.3-MDEV-15845
MDEV-15845 Test failure on galera.galera_concurrent_ctas
2018-09-11 11:49:49 +03:00