1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-28131 Unexpected warning while selecting from information_schema.processlist

Problem:

DECIMAL columns in I_S must be explicitly set of some value.

I_S columns do not have `DEFAULT 0` (after MDEV-18918), so during
restore_record() their record fragments pointed by Field::ptr are
initialized to zero bytes 0x00.
But an array of 0x00's is not a valid binary DECIMAL value.
So val_decimal() called for such Field_new_decimal generated a warning
when seeing a wrong binary encoded DECIMAL value in the record.

Fix:

Explicitly setting INFORMATION_SCHEMA.PROCESSLIST.PROGRESS
to the decimal value of 0 if no progress information is available.
This commit is contained in:
Alexander Barkov
2022-03-21 16:42:58 +04:00
parent fbc1cc974e
commit 0812d0de8d
3 changed files with 65 additions and 0 deletions

View File

@ -3351,6 +3351,16 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
table->field[11]->store((double) tmp->progress.counter /
(double) max_counter*100.0);
}
else
{
/*
This is a DECIMAL column without DEFAULT.
restore_record() fills its Field::ptr to zero bytes,
according to pack_length(). But an array of zero bytes
is not a valid decimal. Set it explicitly to 0.
*/
table->field[11]->store((longlong) 0, true);
}
mysql_mutex_unlock(&tmp->LOCK_thd_data);
}