diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index 68e9d8b1f0eb2..d195a893d492d 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -390,23 +390,23 @@ def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 1228 def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL NO NO def information_schema SLAVE_STATUS Connection_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO -def information_schema SLAVE_STATUS Connect_Retry 7 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) select NEVER NULL NO NO +def information_schema SLAVE_STATUS Connect_Retry 7 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Executed_log_entries 59 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Exec_Master_Log_Pos 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Gtid_IO_Pos 46 NULL NO varchar 21844 65532 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21844) select NEVER NULL NO NO def information_schema SLAVE_STATUS Gtid_Slave_Pos 62 NULL NO varchar 21844 65532 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21844) select NEVER NULL NO NO -def information_schema SLAVE_STATUS Last_Errno 21 NULL NO int NULL NULL 10 0 NULL NULL NULL int(4) select NEVER NULL NO NO +def information_schema SLAVE_STATUS Last_Errno 21 NULL NO int NULL NULL 10 0 NULL NULL NULL int(4) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Last_Error 22 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO -def information_schema SLAVE_STATUS Last_IO_Errno 37 NULL NO int NULL NULL 10 0 NULL NULL NULL int(4) select NEVER NULL NO NO +def information_schema SLAVE_STATUS Last_IO_Errno 37 NULL NO int NULL NULL 10 0 NULL NULL NULL int(4) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Last_IO_Error 38 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO -def information_schema SLAVE_STATUS Last_SQL_Errno 39 NULL NO int NULL NULL 10 0 NULL NULL NULL int(4) select NEVER NULL NO NO +def information_schema SLAVE_STATUS Last_SQL_Errno 39 NULL NO int NULL NULL 10 0 NULL NULL NULL int(4) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Last_SQL_Error 40 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_Host 4 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_last_event_time 63 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_Log_File 8 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_Port 6 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_Server_Id 42 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO -def information_schema SLAVE_STATUS Master_Slave_time_diff 65 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) select NEVER NULL NO NO +def information_schema SLAVE_STATUS Master_Slave_time_diff 65 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_SSL_Allowed 29 NULL YES varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_SSL_CA_File 30 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO def information_schema SLAVE_STATUS Master_SSL_CA_Path 31 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO @@ -1070,7 +1070,7 @@ NULL information_schema SEQUENCES INCREMENT bigint NULL NULL NULL NULL bigint(21 3.0000 information_schema SLAVE_STATUS Master_Host varchar 255 765 utf8mb3 utf8mb3_general_ci varchar(255) 3.0000 information_schema SLAVE_STATUS Master_User varchar 384 1152 utf8mb3 utf8mb3_general_ci varchar(384) NULL information_schema SLAVE_STATUS Master_Port smallint NULL NULL NULL NULL smallint(5) unsigned -NULL information_schema SLAVE_STATUS Connect_Retry int NULL NULL NULL NULL int(10) +NULL information_schema SLAVE_STATUS Connect_Retry int NULL NULL NULL NULL int(10) unsigned 3.0000 information_schema SLAVE_STATUS Master_Log_File varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512) NULL information_schema SLAVE_STATUS Read_Master_Log_Pos bigint NULL NULL NULL NULL bigint(20) unsigned 3.0000 information_schema SLAVE_STATUS Relay_Log_File varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512) @@ -1084,7 +1084,7 @@ NULL information_schema SLAVE_STATUS Relay_Log_Pos bigint NULL NULL NULL NULL bi 3.0000 information_schema SLAVE_STATUS Replicate_Ignore_Table varchar 21844 65532 utf8mb3 utf8mb3_general_ci varchar(21844) 3.0000 information_schema SLAVE_STATUS Replicate_Wild_Do_Table varchar 21844 65532 utf8mb3 utf8mb3_general_ci varchar(21844) 3.0000 information_schema SLAVE_STATUS Replicate_Wild_Ignore_Table varchar 21844 65532 utf8mb3 utf8mb3_general_ci varchar(21844) -NULL information_schema SLAVE_STATUS Last_Errno int NULL NULL NULL NULL int(4) +NULL information_schema SLAVE_STATUS Last_Errno int NULL NULL NULL NULL int(4) unsigned 3.0000 information_schema SLAVE_STATUS Last_Error varchar 1024 3072 utf8mb3 utf8mb3_general_ci varchar(1024) NULL information_schema SLAVE_STATUS Skip_Counter int NULL NULL NULL NULL int(10) unsigned NULL information_schema SLAVE_STATUS Exec_Master_Log_Pos bigint NULL NULL NULL NULL bigint(20) unsigned @@ -1100,9 +1100,9 @@ NULL information_schema SLAVE_STATUS Until_Log_Pos bigint NULL NULL NULL NULL bi 3.0000 information_schema SLAVE_STATUS Master_SSL_Key varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512) NULL information_schema SLAVE_STATUS Seconds_Behind_Master bigint NULL NULL NULL NULL bigint(20) unsigned 3.0000 information_schema SLAVE_STATUS Master_SSL_Verify_Server_Cert varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3) -NULL information_schema SLAVE_STATUS Last_IO_Errno int NULL NULL NULL NULL int(4) +NULL information_schema SLAVE_STATUS Last_IO_Errno int NULL NULL NULL NULL int(4) unsigned 3.0000 information_schema SLAVE_STATUS Last_IO_Error varchar 1024 3072 utf8mb3 utf8mb3_general_ci varchar(1024) -NULL information_schema SLAVE_STATUS Last_SQL_Errno int NULL NULL NULL NULL int(4) +NULL information_schema SLAVE_STATUS Last_SQL_Errno int NULL NULL NULL NULL int(4) unsigned 3.0000 information_schema SLAVE_STATUS Last_SQL_Error varchar 1024 3072 utf8mb3 utf8mb3_general_ci varchar(1024) 3.0000 information_schema SLAVE_STATUS Replicate_Ignore_Server_Ids varchar 21844 65532 utf8mb3 utf8mb3_general_ci varchar(21844) NULL information_schema SLAVE_STATUS Master_Server_Id int NULL NULL NULL NULL int(10) unsigned @@ -1128,7 +1128,7 @@ NULL information_schema SLAVE_STATUS Slave_heartbeat_period float NULL NULL NULL 3.0000 information_schema SLAVE_STATUS Gtid_Slave_Pos varchar 21844 65532 utf8mb3 utf8mb3_general_ci varchar(21844) NULL information_schema SLAVE_STATUS Master_last_event_time datetime NULL NULL NULL NULL datetime NULL information_schema SLAVE_STATUS Slave_last_event_time datetime NULL NULL NULL NULL datetime -NULL information_schema SLAVE_STATUS Master_Slave_time_diff int NULL NULL NULL NULL int(10) +NULL information_schema SLAVE_STATUS Master_Slave_time_diff int NULL NULL NULL NULL int(10) unsigned NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smallint(5) 3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512) NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5) diff --git a/sql/slave.cc b/sql/slave.cc index e16834a387da3..0503a894daada 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2955,8 +2955,8 @@ void store_master_info(THD *thd, Master_info *mi, TABLE *table, store_string_or_null(field++, mi->host); store_string_or_null(field++, mi->user); - (*field++)->store((uint32) mi->port); - (*field++)->store((uint32) mi->connect_retry); + (*field++)->store((uint32) mi->port, true); + (*field++)->store((uint32) mi->connect_retry, true); (*field++)->store(mi->master_log_name, strlen(mi->master_log_name), &my_charset_bin); (*field++)->store((ulonglong) mi->master_log_pos, true); @@ -2979,9 +2979,9 @@ void store_master_info(THD *thd, Master_info *mi, TABLE *table, rpl_filter->get_wild_ignore_table(&tmp); (*field++)->store(tmp.ptr(), tmp.length(), &my_charset_bin); - (*field++)->store(mi->rli.last_error().number); + (*field++)->store(mi->rli.last_error().number, true); store_string_or_null(field++, mi->rli.last_error().message); - (*field++)->store((uint32) mi->rli.slave_skip_counter); + (*field++)->store((uint32) mi->rli.slave_skip_counter, true); (*field++)->store((ulonglong) mi->rli.group_master_log_pos, true); (*field++)->store((ulonglong) mi->rli.log_space_total, true); @@ -3069,17 +3069,17 @@ void store_master_info(THD *thd, Master_info *mi, TABLE *table, &my_charset_bin); // Last_IO_Errno - (*field++)->store(mi->last_error().number); + (*field++)->store(mi->last_error().number, true); // Last_IO_Error store_string_or_null(field++, mi->last_error().message); // Last_SQL_Errno - (*field++)->store(mi->rli.last_error().number); + (*field++)->store(mi->rli.last_error().number, true); // Last_SQL_Error store_string_or_null(field++, mi->rli.last_error().message); // Replicate_Ignore_Server_Ids field_store_ids((*field++), &mi->ignore_server_ids); // Master_Server_id - (*field++)->store((uint32) mi->master_id); + (*field++)->store((uint32) mi->master_id, true); // SQL_Delay // Master_Ssl_Crl store_string_or_null(field++, mi->ssl_crl); @@ -3103,7 +3103,8 @@ void store_master_info(THD *thd, Master_info *mi, TABLE *table, (*field++)->store(mode_name, strlen(mode_name), &my_charset_bin); } - (*field++)->store((uint32) mi->rli.get_sql_delay()); + // int32 on paper, unsigned in practice + (*field++)->store((uint32) mi->rli.get_sql_delay(), true); // SQL_Remaining_Delay // THD::proc_info is not protected by any lock, so we read it once // to ensure that we use the same value throughout this function. @@ -3112,7 +3113,7 @@ void store_master_info(THD *thd, Master_info *mi, TABLE *table, if (slave_sql_running_state == stage_sql_thd_waiting_until_delay.m_name) { time_t t= my_time(0), sql_delay_end= mi->rli.get_sql_delay_end(); - (*field++)->store((uint32)(t < sql_delay_end ? sql_delay_end - t : 0)); + (*field++)->store((uint32)(t < sql_delay_end ? sql_delay_end - t : 0), true); } else (*field++)->set_null(); @@ -3146,6 +3147,8 @@ void store_master_info(THD *thd, Master_info *mi, TABLE *table, if ((slave_timestamp= mi->rli.slave_timestamp)) { (*field++)->store_timestamp((my_time_t) slave_timestamp, 0); + // primary's binlog timestamp should be >= replica's replication timestamp + DBUG_ASSERT(master_timestamp >= slave_timestamp); (*field++)->store((uint) (master_timestamp - slave_timestamp), true); } else diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ff8df6eb06da9..f3a674a021636 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -10628,7 +10628,7 @@ ST_FIELD_INFO slave_status_info[]= Column("Master_Host", Varchar(HOSTNAME_LENGTH), NULLABLE), Column("Master_User", Varchar(USERNAME_LENGTH), NULLABLE), Column("Master_Port", Type(&type_handler_ushort, 5, true), NOT_NULL), - Column("Connect_Retry", SLong(10), NOT_NULL), + Column("Connect_Retry", ULong(10), NOT_NULL), Column("Master_Log_File", Varchar(FN_REFLEN), NOT_NULL), Column("Read_Master_Log_Pos", ULonglong(20), NOT_NULL), Column("Relay_Log_File", Varchar(FN_REFLEN), NOT_NULL), @@ -10642,7 +10642,7 @@ ST_FIELD_INFO slave_status_info[]= Column("Replicate_Ignore_Table", Varchar(), NOT_NULL), Column("Replicate_Wild_Do_Table", Varchar(), NOT_NULL), Column("Replicate_Wild_Ignore_Table", Varchar(), NOT_NULL), - Column("Last_Errno", SLong(4), NOT_NULL), + Column("Last_Errno", ULong(4), NOT_NULL), Column("Last_Error", Varchar(MAX_SLAVE_ERRMSG), NULLABLE), Column("Skip_Counter", ULong(10), NOT_NULL), Column("Exec_Master_Log_Pos", ULonglong(20), NOT_NULL), @@ -10658,9 +10658,9 @@ ST_FIELD_INFO slave_status_info[]= Column("Master_SSL_Key", Varchar(FN_REFLEN), NULLABLE), Column("Seconds_Behind_Master", ULonglong(20), NULLABLE), Column("Master_SSL_Verify_Server_Cert", Varchar(sizeof("Yes")-1), NOT_NULL), - Column("Last_IO_Errno", SLong(4), NOT_NULL), + Column("Last_IO_Errno", ULong(4), NOT_NULL), Column("Last_IO_Error", Varchar(MAX_SLAVE_ERRMSG), NULLABLE), - Column("Last_SQL_Errno", SLong(4), NOT_NULL), + Column("Last_SQL_Errno", ULong(4), NOT_NULL), Column("Last_SQL_Error", Varchar(MAX_SLAVE_ERRMSG), NULLABLE), Column("Replicate_Ignore_Server_Ids", Varchar(), NOT_NULL), Column("Master_Server_Id", ULong(10), NOT_NULL), @@ -10686,7 +10686,7 @@ ST_FIELD_INFO slave_status_info[]= Column("Gtid_Slave_Pos", Varchar(), NOT_NULL), Column("Master_last_event_time", Datetime(0), NULLABLE), Column("Slave_last_event_time", Datetime(0), NULLABLE), - Column("Master_Slave_time_diff", SLong(10), NULLABLE), + Column("Master_Slave_time_diff", ULong(10), NULLABLE), CEnd() }; #endif