Skip to content

Commit 7b0820b

Browse files
committed
cleanup: redundant my_casedn_str()
hashing/comparison uses case-insensitive collation anyway
1 parent ab71860 commit 7b0820b

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

mysql-test/suite/rpl/r/rpl_master_pos_wait.result

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ NULL
4343
select master_pos_wait('master-bin.000001',1000000,1,"my_slave");
4444
master_pos_wait('master-bin.000001',1000000,1,"my_slave")
4545
-1
46+
select master_pos_wait('master-bin.000001',1000000,1,"MY_SLAVE");
47+
master_pos_wait('master-bin.000001',1000000,1,"MY_SLAVE")
48+
-1
4649
STOP SLAVE 'my_slave';
4750
RESET SLAVE 'my_slave' ALL;
4851
change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';

mysql-test/suite/rpl/t/rpl_master_pos_wait.test

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ select master_pos_wait('master-bin.000001',1000000,1);
4848

4949
--echo # Call with a valid connection name -- hangs before MDEV-7130 fix (expected -1)
5050
select master_pos_wait('master-bin.000001',1000000,1,"my_slave");
51+
select master_pos_wait('master-bin.000001',1000000,1,"MY_SLAVE");
5152

5253
STOP SLAVE 'my_slave';
5354
RESET SLAVE 'my_slave' ALL;

sql/rpl_mi.cc

+6-12
Original file line numberDiff line numberDiff line change
@@ -1369,27 +1369,21 @@ Master_info_index::get_master_info(const LEX_CSTRING *connection_name,
13691369
Sql_condition::enum_warning_level warning)
13701370
{
13711371
Master_info *mi;
1372-
char buff[MAX_CONNECTION_NAME+1], *res;
1373-
size_t buff_length;
13741372
DBUG_ENTER("get_master_info");
13751373
DBUG_PRINT("enter",
13761374
("connection_name: '%.*s'", (int) connection_name->length,
13771375
connection_name->str));
13781376

1379-
/* Make name lower case for comparison */
1380-
res= strmake(buff, connection_name->str, connection_name->length);
1381-
my_casedn_str(system_charset_info, buff);
1382-
buff_length= (size_t) (res-buff);
1383-
1377+
if (!connection_name->str)
1378+
connection_name= &empty_clex_str;
13841379
mi= (Master_info*) my_hash_search(&master_info_hash,
1385-
(uchar*) buff, buff_length);
1380+
(uchar*) connection_name->str,
1381+
connection_name->length);
13861382
if (!mi && warning != Sql_condition::WARN_LEVEL_NOTE)
13871383
{
13881384
my_error(WARN_NO_MASTER_INFO,
1389-
MYF(warning == Sql_condition::WARN_LEVEL_WARN ? ME_WARNING :
1390-
0),
1391-
(int) connection_name->length,
1392-
connection_name->str);
1385+
MYF(warning == Sql_condition::WARN_LEVEL_WARN ? ME_WARNING : 0),
1386+
(int) connection_name->length, connection_name->str);
13931387
}
13941388
DBUG_RETURN(mi);
13951389
}

0 commit comments

Comments
 (0)