show master/slave status分别是查看主数据库以及副数据库的状态,是一种能查看主从复制运行情况的方式。

这里仅仅讨论linux下的nysql5.7.13版本的执行情况

一、show master status

开始与show global status类似,都是分配一个线程去处理该连接的命令(图1)

 show master/slave status求根溯源

                        图1 show master status命令处理流程

1.在sql_yacc.cc:yyparse中

show master/slave status求根溯源

(1)初始化内存

show master/slave status求根溯源

(2)初始化解析后命令选项 SQLCOM_SHOW_MASTER_STAT

show master/slave status求根溯源

(3)初始化为单查询(此处无用)

2.show master status命令处理流程

 show master/slave status求根溯源

            图2. show_master_status的处理流程

(1)在mysql_execute_command(图2#3)中

进入该选项分支

1   case SQLCOM_SHOW_MASTER_STAT:
2   {
3     /* Accept one of two privileges */
4     if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL))
5       goto error;
6     res = show_master_status(thd);
7     break;
8   }
View Code

相关文章:

  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-03
  • 2021-06-20
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2021-07-15
  • 2021-10-12
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案