Skip to content

Commit a4effbf

Browse files
committed
Fix of MDEV-33856, becaouse we have more then 64 fields
and unsigned long long can not be used as bitfield.
1 parent 337307a commit a4effbf

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

sql/sql_show.cc

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9112,27 +9112,16 @@ static int make_slave_status_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
91129112
Name_resolution_context *context= &thd->lex->first_select_lex()->context;
91139113
DBUG_ASSERT(thd->lex->sql_command == SQLCOM_SHOW_SLAVE_STAT);
91149114
bool all_slaves= thd->lex->mi.show_all_slaves;
9115-
ulonglong used_fields= ~0ULL;
9116-
9117-
if (!all_slaves)
9118-
{
9119-
/*
9120-
Remove 2 first fields (Connection_name and Slave_SQL_State) and all
9121-
fields above and including field 56 (Retried_transactions)
9122-
*/
9123-
used_fields&= ~((1ULL << SLAVE_STATUS_COL_CONNECTION_NAME) |
9124-
(1ULL << SLAVE_STATUS_COL_SLAVE_SQL_STATE));
9125-
used_fields&= ((1ULL << SLAVE_STATUS_COL_RETRIED_TRANSACTIONS) - 1);
9126-
}
91279115

91289116
for (uint i=0; !field_info->end_marker(); field_info++, i++)
91299117
{
9130-
/*
9131-
We have all_slaves here to take into account that we some day may have
9132-
more than 64 fields in the list. If all_slaves is set we should show
9133-
all fields.
9134-
*/
9135-
if (all_slaves || (used_fields & ((1ULL << i))))
9118+
if (all_slaves ||
9119+
// not SLAVE_STATUS_COL_CONNECTION_NAME,
9120+
// SLAVE_STATUS_COL_SLAVE_SQL_STATE
9121+
// and less
9122+
// SLAVE_STATUS_COL_RETRIED_TRANSACTIONS
9123+
!(i <= SLAVE_STATUS_COL_SLAVE_SQL_STATE ||
9124+
i >= SLAVE_STATUS_COL_RETRIED_TRANSACTIONS))
91369125
{
91379126
LEX_CSTRING field_name= field_info->name();
91389127
Item_field *field= new (thd->mem_root)

0 commit comments

Comments
 (0)