diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2018-05-22 00:16:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-22 00:16:42 -0700 |
| commit | 03fd66e209a0a8c2c5c854e72ab9ba6182497eef (patch) | |
| tree | 89763905f2d41c6e9bdeaf7ac1dac362f1f1192c | |
| parent | 6ce0097846b8a22de8d77de16d16f49b9af17a87 (diff) | |
| parent | 04c2c5e58d1ea1cd83907e16dbcee979f98371e3 (diff) | |
| download | seaweedfs-03fd66e209a0a8c2c5c854e72ab9ba6182497eef.tar.xz seaweedfs-03fd66e209a0a8c2c5c854e72ab9ba6182497eef.zip | |
Merge pull request #655 from chrislusf/filer1_maintenance_branch
fix mysql bug
| -rw-r--r-- | weed/filer/mysql_store/mysql_store.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/weed/filer/mysql_store/mysql_store.go b/weed/filer/mysql_store/mysql_store.go index 32cf8c567..72a8bb66a 100644 --- a/weed/filer/mysql_store/mysql_store.go +++ b/weed/filer/mysql_store/mysql_store.go @@ -148,10 +148,14 @@ 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) - err = fmt.Errorf("MySqlStore Put operation failed when inserting path %s with fid %s : err is %v", fullFilePath, fid, err) + 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) - err = fmt.Errorf("MySqlStore Put operation failed when updating path %s with fid %s : err is %v", fullFilePath, fid, err) + if err != nil { + err = fmt.Errorf("MySqlStore Put operation failed when updating path %s with fid %s : err is %v", fullFilePath, fid, err) + } } } return |
