Browse Source
Merge pull request #655 from chrislusf/filer1_maintenance_branch
fix mysql bug
pull/657/head
Chris Lu
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
2 deletions
-
weed/filer/mysql_store/mysql_store.go
|
|
@ -148,12 +148,16 @@ func (s *MySqlStore) Put(fullFilePath string, fid string) (err error) { |
|
|
|
} else { |
|
|
|
if len(old_fid) == 0 { |
|
|
|
err = s.insert(fullFilePath, fid, s.dbs[instance_offset], tableFullName) |
|
|
|
if err != nil { |
|
|
|
err = fmt.Errorf("MySqlStore Put operation failed when inserting path %s with fid %s : err is %v", fullFilePath, fid, err) |
|
|
|
} |
|
|
|
} else { |
|
|
|
err = s.update(fullFilePath, fid, s.dbs[instance_offset], tableFullName) |
|
|
|
if err != nil { |
|
|
|
err = fmt.Errorf("MySqlStore Put operation failed when updating path %s with fid %s : err is %v", fullFilePath, fid, err) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|