File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -751,6 +751,9 @@ func (c *Config) Valid() error {
751
751
if c .AlterPrimaryKey && c .Experimental .AllowAutoRandom {
752
752
return fmt .Errorf ("allow-auto-random is unavailable when alter-primary-key is enabled" )
753
753
}
754
+ if c .PreparedPlanCache .Capacity < 1 {
755
+ return fmt .Errorf ("capacity in [prepared-plan-cache] should be at least 1" )
756
+ }
754
757
return nil
755
758
}
756
759
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ type SimpleLRUCache struct {
48
48
// NewSimpleLRUCache creates a SimpleLRUCache object, whose capacity is "capacity".
49
49
// NOTE: "capacity" should be a positive value.
50
50
func NewSimpleLRUCache (capacity uint , guard float64 , quota uint64 ) * SimpleLRUCache {
51
- if capacity == 0 {
52
- panic ("capacity of LRU Cache should be positive ." )
51
+ if capacity < 1 {
52
+ panic ("capacity of LRU Cache should be at least 1 ." )
53
53
}
54
54
return & SimpleLRUCache {
55
55
capacity : capacity ,
You can’t perform that action at this time.
0 commit comments