mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	 25b5c63905
			
		
	
	
	25b5c63905
	
	
	
		
			
			This commit adds 3 new status variables to 'show all slaves status':
- Master_last_event_time ; timestamp of the last event read from the
  master by the IO thread.
- Slave_last_event_time ; Master timestamp of the last event committed
  on the slave.
- Master_Slave_time_diff: The difference of the above two timestamps.
All the above variables are NULL until the slave has started and the
slave has read one query event from the master that changes data.
- Added information_schema.slave_status, which allows us to remove:
   - show_master_info(), show_master_info_get_fields(),
     send_show_master_info_data(), show_all_master_info()
   - class Sql_cmd_show_slave_status.
   - Protocol::store(I_List<i_string_pair>* str_list) as it is not
     used anymore.
- Changed old SHOW SLAVE STATUS and SHOW ALL SLAVES STATUS to
  use the SELECT code path, as all other SHOW ... STATUS commands.
Other things:
- Xid_log_time is set to time of commit to allow slave that reads the
  binary log to calculate Master_last_event_time and
  Slave_last_event_time.
  This is needed as there is not 'exec_time' for row events.
- Fixed that Load_log_event calculates exec_time identically to
  Query_event.
- Updated RESET SLAVE to reset Master/Slave_last_event_time
- Updated SQL thread's update on first transaction read-in to
  only update Slave_last_event_time on group events.
- Fixed possible (unlikely) bugs in sql_show.cc ...old_format() functions
  if allocation of 'field' would fail.
Reviewed By:
Brandon Nesterenko <brandon.nesterenko@mariadb.com>
Kristian Nielsen <knielsen@knielsen-hq.org>
		
	
			
		
			
				
	
	
		
			133 lines
		
	
	
	
		
			3.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			133 lines
		
	
	
	
		
			3.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # Bug#18925: subqueries with MIN/MAX functions on INFORMATION_SCHEMA
 | |
| #
 | |
| SELECT t.table_name, c1.column_name
 | |
| FROM information_schema.tables t
 | |
| INNER JOIN
 | |
| information_schema.columns c1
 | |
| ON t.table_schema = c1.table_schema AND
 | |
| t.table_name = c1.table_name
 | |
| WHERE t.table_schema = 'information_schema' AND
 | |
| c1.ordinal_position =
 | |
| ( SELECT COALESCE(MIN(c2.ordinal_position),1)
 | |
| FROM information_schema.columns c2
 | |
| WHERE c2.table_schema = t.table_schema AND
 | |
| c2.table_name = t.table_name AND
 | |
| c2.column_name LIKE '%SCHEMA%'
 | |
|         )
 | |
| AND t.table_name NOT LIKE 'innodb%' and t.table_name NOT LIKE "OPTIMIZER_TRACE%";
 | |
| table_name	column_name
 | |
| ALL_PLUGINS	PLUGIN_NAME
 | |
| APPLICABLE_ROLES	GRANTEE
 | |
| CHARACTER_SETS	CHARACTER_SET_NAME
 | |
| CHECK_CONSTRAINTS	CONSTRAINT_SCHEMA
 | |
| CLIENT_STATISTICS	CLIENT
 | |
| COLLATIONS	COLLATION_NAME
 | |
| COLLATION_CHARACTER_SET_APPLICABILITY	COLLATION_NAME
 | |
| COLUMNS	TABLE_SCHEMA
 | |
| COLUMN_PRIVILEGES	TABLE_SCHEMA
 | |
| ENABLED_ROLES	ROLE_NAME
 | |
| ENGINES	ENGINE
 | |
| EVENTS	EVENT_SCHEMA
 | |
| FILES	TABLE_SCHEMA
 | |
| GEOMETRY_COLUMNS	F_TABLE_SCHEMA
 | |
| GLOBAL_STATUS	VARIABLE_NAME
 | |
| GLOBAL_VARIABLES	VARIABLE_NAME
 | |
| INDEX_STATISTICS	TABLE_SCHEMA
 | |
| KEYWORDS	WORD
 | |
| KEY_CACHES	KEY_CACHE_NAME
 | |
| KEY_COLUMN_USAGE	CONSTRAINT_SCHEMA
 | |
| KEY_PERIOD_USAGE	CONSTRAINT_SCHEMA
 | |
| OPTIMIZER_COSTS	ENGINE
 | |
| PARAMETERS	SPECIFIC_SCHEMA
 | |
| PARTITIONS	TABLE_SCHEMA
 | |
| PERIODS	TABLE_SCHEMA
 | |
| PLUGINS	PLUGIN_NAME
 | |
| PROCESSLIST	ID
 | |
| PROFILING	QUERY_ID
 | |
| REFERENTIAL_CONSTRAINTS	CONSTRAINT_SCHEMA
 | |
| ROUTINES	ROUTINE_SCHEMA
 | |
| SCHEMATA	SCHEMA_NAME
 | |
| SCHEMA_PRIVILEGES	TABLE_SCHEMA
 | |
| SEQUENCES	SEQUENCE_SCHEMA
 | |
| SESSION_STATUS	VARIABLE_NAME
 | |
| SESSION_VARIABLES	VARIABLE_NAME
 | |
| SPATIAL_REF_SYS	SRID
 | |
| SQL_FUNCTIONS	FUNCTION
 | |
| STATISTICS	TABLE_SCHEMA
 | |
| SYSTEM_VARIABLES	VARIABLE_NAME
 | |
| TABLES	TABLE_SCHEMA
 | |
| TABLESPACES	TABLESPACE_NAME
 | |
| TABLE_CONSTRAINTS	CONSTRAINT_SCHEMA
 | |
| TABLE_PRIVILEGES	TABLE_SCHEMA
 | |
| TABLE_STATISTICS	TABLE_SCHEMA
 | |
| TRIGGERS	TRIGGER_SCHEMA
 | |
| USERS	USER
 | |
| USER_PRIVILEGES	GRANTEE
 | |
| USER_STATISTICS	USER
 | |
| VIEWS	TABLE_SCHEMA
 | |
| SELECT t.table_name, c1.column_name
 | |
| FROM information_schema.tables t
 | |
| INNER JOIN
 | |
| information_schema.columns c1
 | |
| ON t.table_schema = c1.table_schema AND
 | |
| t.table_name = c1.table_name
 | |
| WHERE t.table_schema = 'information_schema' AND
 | |
| c1.ordinal_position =
 | |
| ( SELECT COALESCE(MIN(c2.ordinal_position),1)
 | |
| FROM information_schema.columns c2
 | |
| WHERE c2.table_schema = 'information_schema' AND
 | |
| c2.table_name = t.table_name AND
 | |
| c2.column_name LIKE '%SCHEMA%'
 | |
|         )
 | |
| AND t.table_name NOT LIKE 'innodb%' and t.table_name NOT LIKE "OPTIMIZER_TRACE%";
 | |
| table_name	column_name
 | |
| ALL_PLUGINS	PLUGIN_NAME
 | |
| APPLICABLE_ROLES	GRANTEE
 | |
| CHARACTER_SETS	CHARACTER_SET_NAME
 | |
| CHECK_CONSTRAINTS	CONSTRAINT_SCHEMA
 | |
| CLIENT_STATISTICS	CLIENT
 | |
| COLLATIONS	COLLATION_NAME
 | |
| COLLATION_CHARACTER_SET_APPLICABILITY	COLLATION_NAME
 | |
| COLUMNS	TABLE_SCHEMA
 | |
| COLUMN_PRIVILEGES	TABLE_SCHEMA
 | |
| ENABLED_ROLES	ROLE_NAME
 | |
| ENGINES	ENGINE
 | |
| EVENTS	EVENT_SCHEMA
 | |
| FILES	TABLE_SCHEMA
 | |
| GEOMETRY_COLUMNS	F_TABLE_SCHEMA
 | |
| GLOBAL_STATUS	VARIABLE_NAME
 | |
| GLOBAL_VARIABLES	VARIABLE_NAME
 | |
| INDEX_STATISTICS	TABLE_SCHEMA
 | |
| KEYWORDS	WORD
 | |
| KEY_CACHES	KEY_CACHE_NAME
 | |
| KEY_COLUMN_USAGE	CONSTRAINT_SCHEMA
 | |
| KEY_PERIOD_USAGE	CONSTRAINT_SCHEMA
 | |
| OPTIMIZER_COSTS	ENGINE
 | |
| PARAMETERS	SPECIFIC_SCHEMA
 | |
| PARTITIONS	TABLE_SCHEMA
 | |
| PERIODS	TABLE_SCHEMA
 | |
| PLUGINS	PLUGIN_NAME
 | |
| PROCESSLIST	ID
 | |
| PROFILING	QUERY_ID
 | |
| REFERENTIAL_CONSTRAINTS	CONSTRAINT_SCHEMA
 | |
| ROUTINES	ROUTINE_SCHEMA
 | |
| SCHEMATA	SCHEMA_NAME
 | |
| SCHEMA_PRIVILEGES	TABLE_SCHEMA
 | |
| SEQUENCES	SEQUENCE_SCHEMA
 | |
| SESSION_STATUS	VARIABLE_NAME
 | |
| SESSION_VARIABLES	VARIABLE_NAME
 | |
| SPATIAL_REF_SYS	SRID
 | |
| SQL_FUNCTIONS	FUNCTION
 | |
| STATISTICS	TABLE_SCHEMA
 | |
| SYSTEM_VARIABLES	VARIABLE_NAME
 | |
| TABLES	TABLE_SCHEMA
 | |
| TABLESPACES	TABLESPACE_NAME
 | |
| TABLE_CONSTRAINTS	CONSTRAINT_SCHEMA
 | |
| TABLE_PRIVILEGES	TABLE_SCHEMA
 | |
| TABLE_STATISTICS	TABLE_SCHEMA
 | |
| TRIGGERS	TRIGGER_SCHEMA
 | |
| USERS	USER
 | |
| USER_PRIVILEGES	GRANTEE
 | |
| USER_STATISTICS	USER
 | |
| VIEWS	TABLE_SCHEMA
 |