-
Marc Alff authored
Before this fix, starting a server with --performance-schema-digests-size=1 would cause a crash. The root cause is in function fund_or_create_digest(). When scanning the digest array, the code skip entry [0] which is reserved for the "NULL" digest, and proceeds directly to entry [1]. When --performance-schema-digests-size is 2 or more, the record at index [1] exists, but for a size of exactly 1, using this record causes a failure. The fix is ignore record 0 instead of adjusting to record 1, and let the while loop operate normally, as it accesses records safely already.
Marc Alff authoredBefore this fix, starting a server with --performance-schema-digests-size=1 would cause a crash. The root cause is in function fund_or_create_digest(). When scanning the digest array, the code skip entry [0] which is reserved for the "NULL" digest, and proceeds directly to entry [1]. When --performance-schema-digests-size is 2 or more, the record at index [1] exists, but for a size of exactly 1, using this record causes a failure. The fix is ignore record 0 instead of adjusting to record 1, and let the while loop operate normally, as it accesses records safely already.
Loading