Commit graph

67590 commits

Author SHA1 Message Date
Igor Babaev
e57bb1f76c MDEV-19258 RIGHT JOIN hangs in MariaDB
This patch corrects the patch for the bug 10006. The latter incorrectly
calculates the attribute TABLE_LIST::dep_tables for inner tables
of outer joins that are to be converted into inner joins.
As a result after the patch some valid join orders were not evaluated
and the optimizer could choose an execution plan that was far from
being optimal.
2019-05-23 21:54:17 -07:00
Robert Bindar
aad4e5637d Stale files cause intermittent failure when ordering is unfortunate
Running trigger_null-8605 drop_bad_db_type tests in this order was
failing due to unremoved temporary files created in trigger_null-8605
2019-05-22 16:01:39 +04:00
Varun Gupta
6dbc2ab8b3 MDEV-17752: Plan changes from hash_index_merge to index_merge with new optimizer defaults
The code in best_access_path function, when it does not find a key suitable for ref access
and join_cache_level is set to a value so that hash_join is possible we build a hash key.
Later in the function we compare the cost of ref access with table scan (or index scan
or quick selects). No need to do this when we have got the hash key.
2019-05-21 23:29:13 +05:30
Jan Lindström
c84f390df2 MDEV-16021: galera mtr test galera_evs_suspect_timeout crashed
Crash was timeout crash. Add correct waits for connections, wsrep
sync waits and auto increment offset save and restore.
2019-05-17 08:29:45 +03:00
Jan Lindström
61469b3a3b MDEV-13549: Timeout in wait_condition.inc for PROCESSLIST
Use wsrep sync wait instead of unnecessary waits and
correct slave setting.
2019-05-17 08:29:45 +03:00
Jan Lindström
579c1a8c20 MDEV-17061: Test failure on galera.galera_gcs_fc_limit
Remove unnecessary sleeps and fix wait_condition to use
wsrep_flow_control_paused i.e. we wait until flow control
pauses a transaction on master.
2019-05-17 08:29:15 +03:00
Varun Gupta
70a5fb49a7 Fixed the case when statistics were not getting read because
we had the statistics tables in the FROM list of the select.
The statistics for tables are not read in such cases, so we need
to check this case separately.
2019-05-16 14:15:59 +05:30
Varun Gupta
6ab9d1627a MDEV-19407: Assertion `field->table->stats_is_read' failed in is_eits_usable
Statistics were not read for a table when we had a CREATE TABLE query.
Enforce reading statistics for commands CREATE TABLE, SET and DO.
2019-05-16 08:33:06 +05:30
Robert Bindar
a941e58fb8 MDEV-788 mysqlimport should support the ability to disable foreign keys 2019-05-15 18:45:58 +04:00
Sujatha
47637a3dd1 MDEV-11095: rpl.rpl_row_mysqlbinlog test fails if row annotation enabled
Problem:
=======
Whel rpl.rpl_row_mysqlbinlog test is executed as shown below it fails with
result content mismatch.

perl mtr rpl_row_mysqlbinlog --mysqld=--binlog-annotate-row-events=1

Analysis:
=========
When row annotations are enabled the actual query is written into the binlog
which helps users to understand the query, even when row based replication is
enabled.

For example: Simple insert in row based replication looks like shown below.

#190402 16:31:27 server id 1  end_log_pos 526 	Annotate_rows:
#Q> insert into t values (10)
#190402 16:31:27 server id 1  end_log_pos 566 	Table_map: `test`.`t` mapped to number 19
# at 566
#190402 16:31:27 server id 1  end_log_pos 600 	Write_rows: table id 19 flags: STMT_END_F

BINLOG '
B0GjXBMBAAAAKAAAADYCAAAAABMAAAAAAAEABHRlc3QAAXQAAQMAAQ==
B0GjXBcBAAAAIgAAAFgCAAAAABMAAAAAAAEAAf/+CgAAAA==
'/*!*/;
# at 600

The test creates some binary log events and redirects them into a SQL file.
Executes RESET MASTER and sources the SQL file back on clean master and verifies
that the data is available. Please refer following steps.

../client/mysqlbinlog ./var/mysqld.1/data/master-bin.000001 > test.sql
../client/mysql -uroot -S./var/tmp/mysqld.1.sock -Dtest  < test.sql
../client/mysqlbinlog ./var/mysqld.1/data/master-bin.000001 -v > row.sql

When the row based replication specific SQL file is sourced once again on master
the newly generated binlog will treat the entire "BASE 64" encoded event as
query and write it into the binary log.

Output from 'row.sql':

#Q> BINLOG '
#Q> B0GjXBMBAAAAKAAAADYCAAAAABMAAAAAAAEABHRlc3QAAXQAAQMAAQ==
#Q> B0GjXBcBAAAAIgAAAFgCAAAAABMAAAAAAAEAAf/+CgAAAA==
#190402 16:31:27 server id 1  end_log_pos 657 	Table_map: `test`.`t` mapped to number 23
# at 657
#190402 16:31:27 server id 1  end_log_pos 691 	Write_rows: table id 23 flags: STMT_END_F

BINLOG '
B0GjXBMBAAAAKAAAAJECAAAAABcAAAAAAAEABHRlc3QAAXQAAQMAAQ==
B0GjXBcBAAAAIgAAALMCAAAAABcAAAAAAAEAAQH+CgAAAA==
### INSERT INTO `test`.`t`
### SET
###   @1=10
'/*!*/;
# at 691


This is expected behaviour as we cannot extract query from BASE 64 encoded
input. This causes more number of binary logs to be generated when the test is
executed with row annotations.

The following lines from test assumes that only two binary logs will contain
entire data.

 --echo --- Test 4 Second Remote test --
---exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1
	--port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
---exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1
	--port=$MASTER_MYPORT master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/remote.sql

In a case when row annotations are enabled the data gets spread across four
binary logs. As test uses only the first two binary log files, data available in
other binary logs gets missed. Hence test fails with result content mismatch as
less data is avaialble.

Fix:
====
Use "-to-the-last" option of "mysqlbinlog" tool which will ensure that all the
available binary log specific contents are included in .sql file.
2019-05-14 13:03:06 +05:30
Marko Mäkelä
2647fd101d MDEV-19445 heap-use-after-free related to innodb_ft_aux_table
Try to fix the race conditions between
SET GLOBAL innodb_ft_aux_table = ...;
and access to the INFORMATION_SCHEMA tables that depend on
this variable.

innodb_ft_aux_table: Replaces
fts_internal_tbl_name,fts_internal_tbl_name2. Just store the
user-specified parameter as is.

innodb_ft_aux_table_id: The table_id corresponding to
SET GLOBAL innodb_ft_aux_table, or 0 if the table does not exist
or does not contain FULLTEXT INDEX. If the table is renamed later,
the INFORMATION_SCHEMA tables will continue to refer to the table.
If the table is dropped or rebuilt, the INFORMATION_SCHEMA tables
will not find the table.
2019-05-13 17:16:42 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Vicențiu Ciorbaru
c0ac0b8860 Update FSF address 2019-05-11 19:25:02 +03:00
Sergey Vojtovich
d0b73fb8d3 MDEV-16060 - InnoDB: Failing assertion: ut_strcmp(index->name, key->name)
A sequel to 9180e86 and 149b754.

ALTER TABLE ... ADD FOREIGN KEY may crash if parent table is updated
concurrently.

Block FK parent table updates even earlier, before intermediate child
table is created.

Use proper charset info for my_casedn_str() and don't update original
identifiers so that lower_cast_table_names == 2 is honoured.
2019-05-09 11:13:44 +04:00
Thirunarayanan Balathandayuthapani
7b93d71a4b MDEV-19387 innodb_ft_result_cache_limit_32 fails on s390x
Fix:
====
1) Combined innodb_ft_result_cache_limit_32.test and
innodb_ft_result_cache_limit_64.test test case in sys_vars suite.

2) Use word_size.inc for combinations of innodb_ft_result_cache_limit test case.
2019-05-08 12:49:08 +05:30
Jan Lindström
db9622f1f5 MDEV-19405: Galera test failure on galera_parallel_autoinc_largetrx
Test case was not stable. Fixed also galera_parallel_autoinc_manytrx
as it has the same problem.
2019-05-07 12:51:59 +03:00
Eugene Kosov
c83f837053 MDEV-18214 remove some duplicated MONITOR counters
MONITOR_PENDING_LOG_WRITE
MONITOR_PENDING_CHECKPOINT_WRITE
MONITOR_LOG_IO: read values from log_t members instead of updating own
monitor variables
2019-05-06 16:00:15 +03:00
Oleksandr Byelkin
b85aa20065 Merge branch '5.5' into 10.1 2019-05-02 17:23:36 +02:00
Varun Gupta
ca94ce2a58 MDEV-19352: Server crash in alloc_histograms_for_table_share upon query from information schema
To read histograms for a table, we should check if the allocation of statistics was done or not,
if not done we should not try to read histograms for such a table.
2019-05-02 01:02:56 +05:30
Aleksey Midenkov
aba9115426 MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check 2019-05-01 10:15:29 +02:00
Elena Stepanova
e9da78ee92 Updated list of unstable tests for 10.1.39 release 2019-04-30 23:58:14 +03:00
Oleksandr Byelkin
5b035c8456 MDEV-14572: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status upon EXPLAIN UPDATE in PS
Restore EXPAIN flag in SELECT_LEX before execution multi-update by flag in LEX
(the same but in other way made before INSERT/DELETE/SELECT)

Without it, mysql_update() didn't know that there will be EXPLAIN result set and was sending OK at the end of the update, which conflicted with the EOF sent later by EXPLAIN.
2019-04-30 11:38:41 +02:00
Alexander Barkov
ba9f8776c2 Tests for MDEV-19359 ASAN heap-use-after-free in copy_if_not_alloced / make_sortkey
The patch for MDEV-18738 fixed this problem. Adding tests only.
2019-04-30 11:10:53 +04:00
Alexander Barkov
5fb6444a37 MDEV-18738 ASAN heap-use-after-free in copy_if_not_alloced / copy_fields
copy_if_not_alloced() did not handle situations when
"from" is a constant string pointing to a substring of "to",
so this code part freed "to" but then tried to copy its old (already freed)
content to a new buffer:

  if (to->realloc(from_length))
    return from;
  if ((to->str_length=MY_MIN(from->str_length,from_length)))
    memcpy(to->Ptr,from->Ptr,to->str_length);

Adding a new code piece that catches such constant substrings
and propery reallocs "to" to preserve its important part referenced
by "from".
2019-04-30 10:53:59 +04:00
Alexander Barkov
021c7216c0 Tests for MDEV-11895 NO_ZERO_DATE affects timestamp values without any warnings
This problem was earlier fixed, possibly by f8a800bec8
and is not repeatable in 10.1-10.4 any more. Adding tests only.
2019-04-29 10:36:57 +04:00
Vladislav Vaintroub
e8778f1c7c MDEV-19265 Server should throw warning if event is created and event_scheduler = OFF 2019-04-28 12:49:59 +02:00
Vladislav Vaintroub
7590861779 MDEV-19276 during connect, write error log warning for ER_DBACCESS_DENIED_ERROR,
if log_warnings > 1.

This makes ER_DBACCESS_DENIED_ERROR handling the same as we do for other
"access denied"
2019-04-28 12:49:59 +02:00
Vladislav Vaintroub
6c9a6bad4f MDEV-19262 Server error message is unclear if event is created and event_scheduler = DISABLED
Change error message.
2019-04-28 12:49:59 +02:00
Vladislav Vaintroub
e116f11f0a MDEV-18131 MariaDB does not verify IP addresses from subject alternative
names

Added a call to X509_check_ip_asc() in case server_hostname represents
an IP address.
2019-04-28 12:49:59 +02:00
Alexander Barkov
eb9b03ab48 MDEV-13335 UTF8 escape wildcard LIKE match has different behavior in different collations
The fix for MDEV-17064 addressed this problem. Adding tests only.
2019-04-28 11:05:50 +04:00
Sergei Golubchik
d88dfd8732 MDEV-19350 Server crashes in delete_tree_element / ... / Item_func_group_concat::repack_tree
Item_func_group_concat stores values in `tree`, which is often, but not
always the same as `&tree_base`.
2019-04-27 19:38:39 +02:00
Sergei Golubchik
3fe38574fb gis2 fails in embedded
move privilege specific part of gis2.test to gis_notembedded.test
and the rest to gis.test
2019-04-27 11:28:50 +02:00
Varun Gupta
0d5aabd632 MDEV-19334: bool is_eits_usable(Field*): Assertion `field->table->stats_is_read' failed.
Fixed the assert by making sure that not to use EITS if the column statistics was not allocated.
2019-04-27 14:27:02 +05:30
Alexander Barkov
f239fd5034 MDEV-11015 Assertion failed: precision > 0 in decimal_bin_size upon SELECT with DISTINCT, CAST and other functions
Item_func_min_max::fix_length_and_dec() erroneously set max_length
to UINT32_MAX.

Merge notes:
In 10.3 this problem had been fixed earlier.
During merge to 10.3, do a "null merge" in item_func.cc
2019-04-27 08:44:29 +04:00
Marko Mäkelä
1389c94b3c Merge 5.5 into 10.1 2019-04-26 16:41:59 +03:00
Marko Mäkelä
926446880f MDEV-15772: Clean up the test
Before killing the server, we must issue FLUSH TABLES in order
to cleanly close any MyISAM system tables, to avoid warnings about
them when restarting.
2019-04-26 15:31:31 +03:00
Sergei Golubchik
2ce52790ff Merge branch '5.5' into 10.1 2019-04-26 14:02:37 +02:00
Sergei Golubchik
757daa4174 fix the test for embedded 2019-04-26 08:55:37 +02:00
Sergei Golubchik
da0e00e710 Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH 2019-04-25 21:43:31 +02:00
Sergei Golubchik
33fe3b58cc test case for a previous commit 2019-04-25 21:43:27 +02:00
Marko Mäkelä
caa9023c9e MDEV-19331 Merge new release of InnoDB 5.6.44 to 10.1 2019-04-25 14:15:54 +03:00
Marko Mäkelä
1cd31bc132 Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT DEPENDING ON ALGORITHM
For partitioned table, ensure that the AUTO_INCREMENT values will
be assigned from the same sequence. This is based on the following
change in MySQL 5.6.44:

commit aaba359c13d9200747a609730dafafc3b63cd4d6
Author: Rahul Malik <rahul.m.malik@oracle.com>
Date:   Mon Feb 4 13:31:41 2019 +0530

    Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT DEPENDING ON ALGORITHM

    Problem:
    When a partition table is in-place altered to add an auto-increment column,
    then its values are starting over for each partition.

    Analysis:
    In the case of in-place alter, InnoDB is creating a new sequence object
    for each partition. It is default initialized. So auto-increment columns
    start over for each partition.

    Fix:
    Assign old sequence of the partition to the sequence of next partition
    so it won't start over.

    RB#21148
    Reviewed by Bin Su <bin.x.su@oracle.com>
2019-04-25 14:12:45 +03:00
Marko Mäkelä
ac97ad4eab Bug#19811005: Add a simple test case 2019-04-25 14:12:45 +03:00
Alexander Barkov
bb17094be4 MDEV-18452 ASAN unknown-crash in Field::set_default upon SET bit_column = DEFAULT
Field_bit for BIT(20) uses 2 full bytes in the record,
with additional 4 uneven bits in the "null bit area".

Field::set_default() called from Field_bit::set_default() erroneously
copied 3 bytes instead of 2 bytes from the record with default values.

Changing Field::set_default() to copy pack_length_in_rec() bytes
instead of pack_length() bytes.
2019-04-25 11:48:43 +04:00
Marko Mäkelä
ecea90871e 5.6.43-84.3 2019-04-25 10:43:55 +03:00
Sergei Golubchik
979cad2291 MDEV-9531 GROUP_CONCAT with ORDER BY inside takes a lot of memory while it's executed
group concat tree is allocated in a memroot, so the only way to free
memory is to copy a part of the tree into a new memroot.

track the accumilated length of the result, and when it crosses
the threshold  - copy the result into a new tree, free the old one.
2019-04-24 16:06:54 +02:00
Sergei Golubchik
d3b2228fd8 cleanup: cosmetic fixes 2019-04-24 16:06:54 +02:00
Sergei Golubchik
9ca3571cb8 MDEV-18686 Add option to PAM authentication plugin to allow case insensitive username matching
add a new option --pam-windbind-workaround for a pam plugin to
work around pam_winbind unconditional username lowercasing
2019-04-24 16:06:54 +02:00
Sergei Golubchik
ed866e9301 MDEV-19182 mysqldump not always handling SHOW CREATE TRIGGER failures correctly
only use SHOW TRIGGERS on old (< 5.1.21) servers, otherwise
always use SHOW CREATE TRIGGER and don't fallback.
2019-04-24 16:06:54 +02:00