Commit d9d9c30b authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into 10.3

parents fde3d895 9d0ee2dc
...@@ -1173,7 +1173,7 @@ static int check_version_match(void) ...@@ -1173,7 +1173,7 @@ static int check_version_match(void)
extract_variable_from_show(&ds_version, version_str)) extract_variable_from_show(&ds_version, version_str))
{ {
print_error("Version check failed. Got the following error when calling " print_error("Version check failed. Got the following error when calling "
"the 'mysql' command line client", &ds_version); "the 'mysql_upgrade' command line client", &ds_version);
dynstr_free(&ds_version); dynstr_free(&ds_version);
return 1; /* Query failed */ return 1; /* Query failed */
} }
......
...@@ -10532,6 +10532,18 @@ SELECT CONVERT(1, CHAR) IN ('100', '10', '1'); ...@@ -10532,6 +10532,18 @@ SELECT CONVERT(1, CHAR) IN ('100', '10', '1');
CONVERT(1, CHAR) IN ('100', '10', '1') CONVERT(1, CHAR) IN ('100', '10', '1')
1 1
# #
# MDEV-23535 SIGSEGV, SIGABRT and SIGILL in typeinfo for Item_func_set_collation (on optimized builds)
#
SET NAMES utf8;
CREATE OR REPLACE TABLE t1(a DATETIME) ENGINE=MYISAM;
INSERT INTO t1 VALUES ('2019-03-10 02:55:05');
CREATE OR REPLACE TABLE t2(a VARCHAR(50) CHARACTER SET latin1) ENGINE=MYISAM;
INSERT INTO t2 VALUES ('2019-03-10 02:55:05');
SELECT * FROM t1 WHERE (SELECT 1,CONCAT(a) FROM t1) = (SELECT 1,CONCAT(a) FROM t2);
a
2019-03-10 02:55:05
DROP TABLE t1, t2;
#
# End of 10.1 tests # End of 10.1 tests
# #
# #
......
...@@ -2051,6 +2051,18 @@ SELECT CONVERT(1, CHAR) IN ('100', 10, '101'); ...@@ -2051,6 +2051,18 @@ SELECT CONVERT(1, CHAR) IN ('100', 10, '101');
SELECT CONVERT(1, CHAR) IN ('100', 10, '1'); SELECT CONVERT(1, CHAR) IN ('100', 10, '1');
SELECT CONVERT(1, CHAR) IN ('100', '10', '1'); SELECT CONVERT(1, CHAR) IN ('100', '10', '1');
--echo #
--echo # MDEV-23535 SIGSEGV, SIGABRT and SIGILL in typeinfo for Item_func_set_collation (on optimized builds)
--echo #
SET NAMES utf8;
CREATE OR REPLACE TABLE t1(a DATETIME) ENGINE=MYISAM;
INSERT INTO t1 VALUES ('2019-03-10 02:55:05');
CREATE OR REPLACE TABLE t2(a VARCHAR(50) CHARACTER SET latin1) ENGINE=MYISAM;
INSERT INTO t2 VALUES ('2019-03-10 02:55:05');
SELECT * FROM t1 WHERE (SELECT 1,CONCAT(a) FROM t1) = (SELECT 1,CONCAT(a) FROM t2);
DROP TABLE t1, t2;
--echo # --echo #
--echo # End of 10.1 tests --echo # End of 10.1 tests
......
...@@ -145,7 +145,7 @@ test ...@@ -145,7 +145,7 @@ test
Phase 7/7: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
DROP USER mysqltest1@'%'; DROP USER mysqltest1@'%';
Version check failed. Got the following error when calling the 'mysql' command line client Version check failed. Got the following error when calling the 'mysql_upgrade' command line client
ERROR 1045 (28000): Access denied for user 'mysqltest1'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'mysqltest1'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed FATAL ERROR: Upgrade failed
Run mysql_upgrade with a non existing server socket Run mysql_upgrade with a non existing server socket
...@@ -413,7 +413,7 @@ OK ...@@ -413,7 +413,7 @@ OK
# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR # Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
# #
Run mysql_upgrade with unauthorized access Run mysql_upgrade with unauthorized access
Version check failed. Got the following error when calling the 'mysql' command line client Version check failed. Got the following error when calling the 'mysql_upgrade' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed FATAL ERROR: Upgrade failed
# #
......
...@@ -615,3 +615,17 @@ id select_type table type possible_keys key key_len ref rows filtered Extra ...@@ -615,3 +615,17 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings: Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` semi join (`test`.`t4`) join `test`.`t3` where `test`.`t4`.`f4` = 1 and `test`.`t1`.`f1` >= `test`.`t2`.`f2` Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` semi join (`test`.`t4`) join `test`.`t3` where `test`.`t4`.`f4` = 1 and `test`.`t1`.`f1` >= `test`.`t2`.`f2`
DROP TABLE t1,t2,t3,t4; DROP TABLE t1,t2,t3,t4;
#
# MDEV-23535: SIGSEGV, SIGABRT and SIGILL in typeinfo for Item_func_set_collation (on optimized builds)
#
set @save_character_set_connection=@@character_set_connection;
set character_set_connection='utf8';
CREATE TABLE t1(a DATETIME, b VARCHAR(50)) ENGINE=INNODB;
INSERT INTO t1 VALUES ('2019-03-10 02:55:05', '2019-03-10 02:55:05');
CREATE TABLE t2(a VARCHAR(50)) ENGINE=INNODB;
INSERT INTO t2 VALUES ('2019-03-10 02:55:05');
SELECT * FROM t1 WHERE (SELECT 1,CONCAT(a) FROM t1) = (SELECT 1,CONCAT(a) FROM t2);
a b
2019-03-10 02:55:05 2019-03-10 02:55:05
DROP TABLE t1,t2;
set character_set_connection=@save_character_set_connection;
...@@ -611,3 +611,19 @@ FROM t1 ...@@ -611,3 +611,19 @@ FROM t1
DROP TABLE t1,t2,t3,t4; DROP TABLE t1,t2,t3,t4;
--echo #
--echo # MDEV-23535: SIGSEGV, SIGABRT and SIGILL in typeinfo for Item_func_set_collation (on optimized builds)
--echo #
set @save_character_set_connection=@@character_set_connection;
set character_set_connection='utf8';
CREATE TABLE t1(a DATETIME, b VARCHAR(50)) ENGINE=INNODB;
INSERT INTO t1 VALUES ('2019-03-10 02:55:05', '2019-03-10 02:55:05');
CREATE TABLE t2(a VARCHAR(50)) ENGINE=INNODB;
INSERT INTO t2 VALUES ('2019-03-10 02:55:05');
SELECT * FROM t1 WHERE (SELECT 1,CONCAT(a) FROM t1) = (SELECT 1,CONCAT(a) FROM t2);
DROP TABLE t1,t2;
set character_set_connection=@save_character_set_connection;
...@@ -9,4 +9,7 @@ INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repea ...@@ -9,4 +9,7 @@ INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repea
INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255)); INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
UPDATE t1 SET c1=repeat('b',255); UPDATE t1 SET c1=repeat('b',255);
INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255)); INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255));
SHOW BINLOG EVENTS FROM POS;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Invalid pos specified. Requested from pos:POS is greater than actual file size:MAX_POS
DROP TABLE t1; DROP TABLE t1;
...@@ -34,4 +34,9 @@ while ($pos <= $max_pos) ...@@ -34,4 +34,9 @@ while ($pos <= $max_pos)
--enable_query_log --enable_query_log
} }
# Testing a case where input position is greater than actual binlog file size.
--replace_result $pos POS $max_pos MAX_POS
--error 1220
eval SHOW BINLOG EVENTS FROM $pos;
DROP TABLE t1; DROP TABLE t1;
...@@ -7,13 +7,20 @@ CREATE TABLE t1 (a INT); ...@@ -7,13 +7,20 @@ CREATE TABLE t1 (a INT);
FLUSH BINARY LOGS; FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
connection slave; connection slave;
include/stop_slave.inc
connection master; connection master;
# Shutdown master # Shutdown master
include/rpl_stop_server.inc [server_number=1] include/rpl_stop_server.inc [server_number=1]
# Move the master binlog files and the index file to a new place # Move the master binlog files and the index file to a new place
# Restart master with log-bin option set to the new path # Restart master with log-bin option set to the new path
# Master has restarted successfully # Master has restarted successfully
connection slave;
include/start_slave.inc
connection master;
# Create the master-bin.index file with the old format # Create the master-bin.index file with the old format
connection slave;
include/stop_slave.inc
connection master;
# Shutdown master # Shutdown master
include/rpl_stop_server.inc [server_number=1] include/rpl_stop_server.inc [server_number=1]
# Move back the master binlog files # Move back the master binlog files
...@@ -21,6 +28,9 @@ include/rpl_stop_server.inc [server_number=1] ...@@ -21,6 +28,9 @@ include/rpl_stop_server.inc [server_number=1]
# Restart master with log-bin option set to default # Restart master with log-bin option set to default
# Master has restarted successfully # Master has restarted successfully
connection slave; connection slave;
include/start_slave.inc
connection master;
connection slave;
# stop slave # stop slave
include/stop_slave.inc include/stop_slave.inc
include/rpl_stop_server.inc [server_number=2] include/rpl_stop_server.inc [server_number=2]
......
...@@ -9,6 +9,9 @@ ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; ...@@ -9,6 +9,9 @@ ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0); INSERT INTO t1 VALUES (1, 0);
connection server_2; connection server_2;
SET sql_log_bin=0;
call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
SET sql_log_bin=1;
include/stop_slave.inc include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS; MASTER_USE_GTID=CURRENT_POS;
......
...@@ -43,7 +43,7 @@ FLUSH BINARY LOGS; ...@@ -43,7 +43,7 @@ FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
sync_slave_with_master; sync_slave_with_master;
--source include/stop_slave.inc
# #
# Test on master # Test on master
# #
...@@ -58,13 +58,15 @@ source include/rpl_stop_server.inc; ...@@ -58,13 +58,15 @@ source include/rpl_stop_server.inc;
--move_file $master_datadir/master-bin.index $tmpdir/master-bin.index --move_file $master_datadir/master-bin.index $tmpdir/master-bin.index
--echo # Restart master with log-bin option set to the new path --echo # Restart master with log-bin option set to the new path
--let $rpl_server_parameters=--log-bin=$tmpdir/master-bin --let $rpl_server_parameters=--log-bin=$tmpdir/master-bin --log-bin-index=$tmpdir/master-bin
--let $keep_include_silent=1 --let $keep_include_silent=1
source include/rpl_start_server.inc; source include/rpl_start_server.inc;
--let $keep_include_silent=0 --let $keep_include_silent=0
--echo # Master has restarted successfully --echo # Master has restarted successfully
--connection slave
--source include/start_slave.inc
--connection master
# #
# Test master can handle old format with directory path in index file # Test master can handle old format with directory path in index file
# #
...@@ -85,7 +87,10 @@ if (!$is_windows) ...@@ -85,7 +87,10 @@ if (!$is_windows)
--disable_query_log --disable_query_log
source include/write_var_to_file.inc; source include/write_var_to_file.inc;
--enable_query_log --enable_query_log
--sync_slave_with_master
--source include/stop_slave.inc
--connection master
--echo # Shutdown master --echo # Shutdown master
--let $rpl_server_number=1 --let $rpl_server_number=1
source include/rpl_stop_server.inc; source include/rpl_stop_server.inc;
...@@ -99,14 +104,17 @@ source include/rpl_stop_server.inc; ...@@ -99,14 +104,17 @@ source include/rpl_stop_server.inc;
--remove_file $tmpdir/master-bin.index --remove_file $tmpdir/master-bin.index
--echo # Restart master with log-bin option set to default --echo # Restart master with log-bin option set to default
--let $rpl_server_parameters=--log-bin=$master_datadir/master-bin --let $rpl_server_parameters=--log-bin=$master_datadir/master-bin --log-bin-index=$master_datadir/master-bin
--let $keep_include_silent=1 --let $keep_include_silent=1
source include/rpl_start_server.inc; source include/rpl_start_server.inc;
--let $keep_include_silent=0 --let $keep_include_silent=0
--echo # Master has restarted successfully --echo # Master has restarted successfully
--connection slave
--source include/start_slave.inc
connection slave; --connection master
--sync_slave_with_master
--echo # stop slave --echo # stop slave
--source include/stop_slave.inc --source include/stop_slave.inc
--let $rpl_server_number= 2 --let $rpl_server_number= 2
......
...@@ -21,6 +21,9 @@ INSERT INTO t1 VALUES (1, 0); ...@@ -21,6 +21,9 @@ INSERT INTO t1 VALUES (1, 0);
--connection server_2 --connection server_2
--sync_with_master --sync_with_master
SET sql_log_bin=0;
call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
SET sql_log_bin=1;
--source include/stop_slave.inc --source include/stop_slave.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
......
...@@ -10,7 +10,7 @@ call mtr.add_suppression("Master is configured to log replication events"); ...@@ -10,7 +10,7 @@ call mtr.add_suppression("Master is configured to log replication events");
# If everything is okay, the test will end in several seconds; maybe a minute. # If everything is okay, the test will end in several seconds; maybe a minute.
# If the problem shows up, it will hang until testcase timeout is exceeded. # If the problem shows up, it will hang until testcase timeout is exceeded.
--exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test --exec $MYSQL_SLAP --silent --host=127.0.0.1 -P $SLAVE_MYPORT -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test
# All done. # All done.
......
...@@ -2743,8 +2743,6 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll, ...@@ -2743,8 +2743,6 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll,
Item* conv= (*arg)->safe_charset_converter(thd, coll.collation); Item* conv= (*arg)->safe_charset_converter(thd, coll.collation);
if (conv == *arg) if (conv == *arg)
continue; continue;
if (!conv && ((*arg)->collation.repertoire == MY_REPERTOIRE_ASCII))
conv= new (thd->mem_root) Item_func_conv_charset(thd, *arg, coll.collation, 1);
if (!conv) if (!conv)
{ {
......
...@@ -1441,11 +1441,19 @@ class Item_func_conv_charset :public Item_str_func ...@@ -1441,11 +1441,19 @@ class Item_func_conv_charset :public Item_str_func
/* /*
Conversion from and to "binary" is safe. Conversion from and to "binary" is safe.
Conversion to Unicode is safe. Conversion to Unicode is safe.
Conversion from an expression with the ASCII repertoire
to any character set that can store characters U+0000..U+007F
is safe:
- All supported multibyte character sets can store U+0000..U+007F
- All supported 7bit character sets can store U+0000..U+007F
except those marked with MY_CS_NONASCII (e.g. swe7).
Other kind of conversions are potentially lossy. Other kind of conversions are potentially lossy.
*/ */
safe= (args[0]->collation.collation == &my_charset_bin || safe= (args[0]->collation.collation == &my_charset_bin ||
cs == &my_charset_bin || cs == &my_charset_bin ||
(cs->state & MY_CS_UNICODE)); (cs->state & MY_CS_UNICODE) ||
(args[0]->collation.repertoire == MY_REPERTOIRE_ASCII &&
(cs->mbmaxlen > 1 || !(cs->state & MY_CS_NONASCII))));
} }
} }
bool is_json_type() { return args[0]->is_json_type(); } bool is_json_type() { return args[0]->is_json_type(); }
......
...@@ -3906,6 +3906,7 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -3906,6 +3906,7 @@ bool mysql_show_binlog_events(THD* thd)
{ {
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
List<Item> field_list; List<Item> field_list;
char errmsg_buf[MYSYS_ERRMSG_SIZE];
const char *errmsg = 0; const char *errmsg = 0;
bool ret = TRUE; bool ret = TRUE;
/* /*
...@@ -3920,6 +3921,9 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -3920,6 +3921,9 @@ bool mysql_show_binlog_events(THD* thd)
Master_info *mi= 0; Master_info *mi= 0;
LOG_INFO linfo; LOG_INFO linfo;
LEX_MASTER_INFO *lex_mi= &thd->lex->mi; LEX_MASTER_INFO *lex_mi= &thd->lex->mi;
enum enum_binlog_checksum_alg checksum_alg;
my_off_t binlog_size;
MY_STAT s;
DBUG_ENTER("mysql_show_binlog_events"); DBUG_ENTER("mysql_show_binlog_events");
...@@ -3968,10 +3972,6 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -3968,10 +3972,6 @@ bool mysql_show_binlog_events(THD* thd)
mi= 0; mi= 0;
} }
/* Validate user given position using checksum */
if (lex_mi->pos == pos && !opt_master_verify_checksum)
verify_checksum_once= true;
unit->set_limit(thd->lex->current_select); unit->set_limit(thd->lex->current_select);
limit_start= unit->offset_limit_cnt; limit_start= unit->offset_limit_cnt;
limit_end= unit->select_limit_cnt; limit_end= unit->select_limit_cnt;
...@@ -3995,6 +3995,17 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -3995,6 +3995,17 @@ bool mysql_show_binlog_events(THD* thd)
if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0) if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
goto err; goto err;
my_stat(linfo.log_file_name, &s, MYF(0));
binlog_size= s.st_size;
if (lex_mi->pos > binlog_size)
{
sprintf(errmsg_buf, "Invalid pos specified. Requested from pos:%llu is "
"greater than actual file size:%lu\n", lex_mi->pos,
(ulong)s.st_size);
errmsg= errmsg_buf;
goto err;
}
/* /*
to account binlog event header size to account binlog event header size
*/ */
...@@ -4046,7 +4057,43 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -4046,7 +4057,43 @@ bool mysql_show_binlog_events(THD* thd)
} }
} }
if (lex_mi->pos > BIN_LOG_HEADER_SIZE)
{
checksum_alg= description_event->checksum_alg;
/* Validate user given position using checksum */
if (checksum_alg != BINLOG_CHECKSUM_ALG_OFF &&
checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF)
{
if (!opt_master_verify_checksum)
verify_checksum_once= true;
my_b_seek(&log, pos); my_b_seek(&log, pos);
}
else
{
my_off_t cur_pos= my_b_tell(&log);
ulong next_event_len= 0;
uchar buff[IO_SIZE];
while (cur_pos < pos)
{
my_b_seek(&log, cur_pos + EVENT_LEN_OFFSET);
if (my_b_read(&log, (uchar *)buff, sizeof(next_event_len)))
{
mysql_mutex_unlock(log_lock);
errmsg = "Could not read event_length";
goto err;
}
next_event_len= uint4korr(buff);
cur_pos= cur_pos + next_event_len;
}
if (cur_pos > pos)
{
mysql_mutex_unlock(log_lock);
errmsg= "Invalid input pos specified please provide valid one.";
goto err;
}
my_b_seek(&log, cur_pos);
}
}
for (event_count = 0; for (event_count = 0;
(ev = Log_event::read_log_event(&log, (ev = Log_event::read_log_event(&log,
......
...@@ -5395,6 +5395,7 @@ os_file_set_size( ...@@ -5395,6 +5395,7 @@ os_file_set_size(
errno = err; errno = err;
return false; return false;
case EINVAL: case EINVAL:
case EOPNOTSUPP:
/* fall back to the code below */ /* fall back to the code below */
break; break;
} }
......
...@@ -15,6 +15,7 @@ ConditionPathExists= ...@@ -15,6 +15,7 @@ ConditionPathExists=
Type=oneshot Type=oneshot
Restart=no Restart=no
# Don't install or try to prepare for galera SST.
ExecStartPre= ExecStartPre=
# Override the multi instance service for a bootstrap start instance # Override the multi instance service for a bootstrap start instance
...@@ -22,4 +23,5 @@ ExecStart= ...@@ -22,4 +23,5 @@ ExecStart=
ExecStart=/usr/bin/echo "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster" ExecStart=/usr/bin/echo "Please use galera_new_cluster to start the mariadb service with --wsrep-new-cluster"
ExecStart=/usr/bin/false ExecStart=/usr/bin/false
# This isn't a service meant to execute anything but a message
ExecStartPost= ExecStartPost=
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment