forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
108032: sql: Make tochar.FormatCache thread safe r=otan,rafiss a=ecwall Fixes cockroachdb#95424 `FormatCache.lookup()` previously wrapped calls to `cache.UnorderedCache.Get()` in `RWMutex.RLock()`/`RWMutex.RUnlock()` which allowed for data races because `UnorderedCache.Get()` can modify the state of its LRU cache. This PR fixes the race condition by changing the `RWMutex` to a `Mutex` to handle cases where the LRU cache is modified. Release note (bug fix): Fix nil pointer dereference caused by race condition when using to_char builtin. Co-authored-by: Evan Wall <[email protected]>
- Loading branch information
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters