Commit 6e5ca12b authored by unknown's avatar unknown

Bug#27327 information_schema status views, variable_value conversion

Type of 'Slave_running' status variable is changed to bool


mysql-test/r/compress.result:
  test result
mysql-test/r/rpl_packet.result:
  test result
mysql-test/t/compress.test:
  test case
mysql-test/t/rpl_packet.test:
  test case
sql/mysqld.cc:
  Type of 'Slave_running' status variable is changed to bool
parent 516b8b21
SHOW STATUS LIKE 'Compression';
Variable_name Value
Compression ON
select * from information_schema.session_status where variable_name= 'COMPRESSION';
VARIABLE_NAME VARIABLE_VALUE
COMPRESSION 1.0000000
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
......
......@@ -14,6 +14,12 @@ INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
count(*)
1
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
Slave_running ON
select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
VARIABLE_NAME VARIABLE_VALUE
SLAVE_RUNNING 1.0000000
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
......
......@@ -10,6 +10,7 @@ connect (comp_con,localhost,root,,,,,COMPRESS);
# Check compression turned on
SHOW STATUS LIKE 'Compression';
select * from information_schema.session_status where variable_name= 'COMPRESSION';
# Source select test case
-- source include/common-tests.inc
......
......@@ -29,6 +29,8 @@ connection slave;
sync_with_master;
eval select count(*) from `$db`.`t1` /* must be 1 */;
SHOW STATUS LIKE 'Slave_running';
select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
connection master;
eval drop database $db;
save_master_pos;
......
......@@ -6513,10 +6513,11 @@ static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff)
static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_CHAR;
var->type= SHOW_MY_BOOL;
pthread_mutex_lock(&LOCK_active_mi);
var->value= const_cast<char*>((active_mi && active_mi->slave_running &&
active_mi->rli.slave_running) ? "ON" : "OFF");
var->value= buff;
*((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running &&
active_mi->rli.slave_running);
pthread_mutex_unlock(&LOCK_active_mi);
return 0;
}
......
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