mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
StorageTinyLog: add regression test for UB due to unlock from different thread
Refs: #22560
This commit is contained in:
parent
5ced6e2e9a
commit
5d795661ed
@ -358,6 +358,9 @@ void TinyLogBlockOutputStream::writeSuffix()
|
|||||||
storage.file_checker.update(file);
|
storage.file_checker.update(file);
|
||||||
storage.file_checker.save();
|
storage.file_checker.save();
|
||||||
|
|
||||||
|
/// unlock should be done from the same thread as lock, and dtor may be
|
||||||
|
/// called from different thread, so it should be done here (at least in
|
||||||
|
/// case of no exceptions occurred)
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
tests/queries/0_stateless/01795_TinyLog_rwlock_ub.sql
Normal file
5
tests/queries/0_stateless/01795_TinyLog_rwlock_ub.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
DROP TABLE IF EXISTS underlying_01795;
|
||||||
|
CREATE TABLE underlying_01795 (key UInt64) Engine=TinyLog();
|
||||||
|
INSERT INTO FUNCTION remote('127.1', currentDatabase(), underlying_01795) SELECT toUInt64(number) FROM system.numbers LIMIT 1;
|
||||||
|
SELECT * FROM underlying_01795 FORMAT Null;
|
||||||
|
DROP TABLE underlying_01795;
|
Loading…
Reference in New Issue
Block a user