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
This commit is contained in:
parent
516b8b2137
commit
6e5ca12b6a
@ -1,6 +1,9 @@
|
|||||||
SHOW STATUS LIKE 'Compression';
|
SHOW STATUS LIKE 'Compression';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Compression ON
|
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;
|
drop table if exists t1,t2,t3,t4;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
|
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 */;
|
select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
|
||||||
count(*)
|
count(*)
|
||||||
1
|
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_____________________;
|
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||||
SET @@global.max_allowed_packet=4096;
|
SET @@global.max_allowed_packet=4096;
|
||||||
SET @@global.net_buffer_length=4096;
|
SET @@global.net_buffer_length=4096;
|
||||||
|
@ -10,6 +10,7 @@ connect (comp_con,localhost,root,,,,,COMPRESS);
|
|||||||
|
|
||||||
# Check compression turned on
|
# Check compression turned on
|
||||||
SHOW STATUS LIKE 'Compression';
|
SHOW STATUS LIKE 'Compression';
|
||||||
|
select * from information_schema.session_status where variable_name= 'COMPRESSION';
|
||||||
|
|
||||||
# Source select test case
|
# Source select test case
|
||||||
-- source include/common-tests.inc
|
-- source include/common-tests.inc
|
||||||
|
@ -29,6 +29,8 @@ connection slave;
|
|||||||
sync_with_master;
|
sync_with_master;
|
||||||
eval select count(*) from `$db`.`t1` /* must be 1 */;
|
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;
|
connection master;
|
||||||
eval drop database $db;
|
eval drop database $db;
|
||||||
save_master_pos;
|
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)
|
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);
|
pthread_mutex_lock(&LOCK_active_mi);
|
||||||
var->value= const_cast<char*>((active_mi && active_mi->slave_running &&
|
var->value= buff;
|
||||||
active_mi->rli.slave_running) ? "ON" : "OFF");
|
*((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running &&
|
||||||
|
active_mi->rli.slave_running);
|
||||||
pthread_mutex_unlock(&LOCK_active_mi);
|
pthread_mutex_unlock(&LOCK_active_mi);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user