Commit 9d0ee2dc authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.1 into 10.2

parents 78efa109 4c192279
......@@ -1166,7 +1166,7 @@ static int check_version_match(void)
extract_variable_from_show(&ds_version, version_str))
{
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);
return 1; /* Query failed */
}
......
......@@ -10532,6 +10532,18 @@ SELECT CONVERT(1, CHAR) IN ('100', '10', '1');
CONVERT(1, CHAR) IN ('100', '10', '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
#
#
......
......@@ -142,7 +142,7 @@ test
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
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)
FATAL ERROR: Upgrade failed
Run mysql_upgrade with a non existing server socket
......@@ -405,7 +405,7 @@ OK
# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
#
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)
FATAL ERROR: Upgrade failed
#
......
......@@ -615,3 +615,17 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
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`
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;
......@@ -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));
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));
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;
......@@ -34,4 +34,9 @@ while ($pos <= $max_pos)
--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;
......@@ -7,13 +7,20 @@ CREATE TABLE t1 (a INT);
FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (1);
connection slave;
include/stop_slave.inc
connection master;
# Shutdown master
include/rpl_stop_server.inc [server_number=1]
# Move the master binlog files and the index file to a new place
# Restart master with log-bin option set to the new path
# Master has restarted successfully
connection slave;
include/start_slave.inc
connection master;
# Create the master-bin.index file with the old format
connection slave;
include/stop_slave.inc
connection master;
# Shutdown master
include/rpl_stop_server.inc [server_number=1]
# Move back the master binlog files
......@@ -21,6 +28,9 @@ include/rpl_stop_server.inc [server_number=1]
# Restart master with log-bin option set to default
# Master has restarted successfully
connection slave;
include/start_slave.inc
connection master;
connection slave;
# stop slave
include/stop_slave.inc
include/rpl_stop_server.inc [server_number=2]
......
......@@ -9,6 +9,9 @@ ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
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
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
......
......@@ -43,7 +43,7 @@ FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (1);
sync_slave_with_master;
--source include/stop_slave.inc
#
# Test on master
#
......@@ -58,13 +58,15 @@ source include/rpl_stop_server.inc;
--move_file $master_datadir/master-bin.index $tmpdir/master-bin.index
--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
source include/rpl_start_server.inc;
--let $keep_include_silent=0
--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
#
......@@ -85,7 +87,10 @@ if (!$is_windows)
--disable_query_log
source include/write_var_to_file.inc;
--enable_query_log
--sync_slave_with_master
--source include/stop_slave.inc
--connection master
--echo # Shutdown master
--let $rpl_server_number=1
source include/rpl_stop_server.inc;
......@@ -99,14 +104,17 @@ source include/rpl_stop_server.inc;
--remove_file $tmpdir/master-bin.index
--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
source include/rpl_start_server.inc;
--let $keep_include_silent=0
--echo # Master has restarted successfully
--connection slave
--source include/start_slave.inc
connection slave;
--connection master
--sync_slave_with_master
--echo # stop slave
--source include/stop_slave.inc
--let $rpl_server_number= 2
......
......@@ -21,6 +21,9 @@ INSERT INTO t1 VALUES (1, 0);
--connection server_2
--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
--replace_result $MASTER_MYPORT MASTER_PORT
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");
# 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.
--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.
......
......@@ -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');
--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 # End of 10.1 tests
......
......@@ -611,3 +611,19 @@ FROM t1
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;
......@@ -2332,8 +2332,6 @@ bool Item_func_or_sum::agg_item_set_converter(const DTCollation &coll,
Item* conv= (*arg)->safe_charset_converter(thd, coll.collation);
if (conv == *arg)
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)
{
......
......@@ -1198,11 +1198,19 @@ class Item_func_conv_charset :public Item_str_func
/*
Conversion from and to "binary" 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.
*/
safe= (args[0]->collation.collation == &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(); }
......
......@@ -3862,6 +3862,7 @@ bool mysql_show_binlog_events(THD* thd)
{
Protocol *protocol= thd->protocol;
List<Item> field_list;
char errmsg_buf[MYSYS_ERRMSG_SIZE];
const char *errmsg = 0;
bool ret = TRUE;
/*
......@@ -3876,6 +3877,9 @@ bool mysql_show_binlog_events(THD* thd)
Master_info *mi= 0;
LOG_INFO linfo;
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");
......@@ -3924,10 +3928,6 @@ bool mysql_show_binlog_events(THD* thd)
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);
limit_start= unit->offset_limit_cnt;
limit_end= unit->select_limit_cnt;
......@@ -3951,6 +3951,17 @@ bool mysql_show_binlog_events(THD* thd)
if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
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
*/
......@@ -4002,7 +4013,43 @@ bool mysql_show_binlog_events(THD* thd)
}
}
my_b_seek(&log, pos);
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);
}
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;
(ev = Log_event::read_log_event(&log, (mysql_mutex_t*) 0,
......
......@@ -5449,6 +5449,7 @@ os_file_set_size(
errno = err;
return false;
case EINVAL:
case EOPNOTSUPP:
/* fall back to the code below */
break;
}
......
......@@ -2716,6 +2716,7 @@ os_file_set_size(
errno = err;
return false;
case EINVAL:
case EOPNOTSUPP:
/* fall back to the code below */
break;
}
......
......@@ -15,6 +15,7 @@ ConditionPathExists=
Type=oneshot
Restart=no
# Don't install or try to prepare for galera SST.
ExecStartPre=
# Override the multi instance service for a bootstrap start instance
......@@ -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/false
# This isn't a service meant to execute anything but a message
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