mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-07 19:30:22 -05:00
empty check
This commit is contained in:
@@ -88,7 +88,16 @@ func LoadData() ([]byte, error) {
|
||||
fileMutex.Lock()
|
||||
defer fileMutex.Unlock()
|
||||
|
||||
return ioutil.ReadFile(mysqlDbFilePath)
|
||||
buf, err := ioutil.ReadFile(mysqlDbFilePath)
|
||||
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(buf) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
var _ mysql_db.PrivilegePersistCallback = SavePrivileges
|
||||
|
||||
Reference in New Issue
Block a user