Fix FileLog engine unnesessary create meta data directory when create table failed.

fix style
This commit is contained in:
feng lv 2021-11-30 03:55:53 +00:00
parent 2d7ff774fd
commit 0efabb39cf
3 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,8 @@ void StorageFileLog::loadMetaFiles(bool attach)
"Metadata files already exist by path: {}, remove them manually if it is intended",
root_meta_path);
}
std::filesystem::create_directories(root_meta_path);
/// We do not create the root_meta_path directory at creation time, create it at the moment of serializing
/// meta files, such that can avoid unnecessarily create this directory if create table failed.
}
}

View File

@ -0,0 +1,3 @@
CREATE TABLE log (A String) ENGINE= FileLog('/tmp/aaa.csv', 'CSV'); -- {serverError 36 }
CREATE TABLE log (A String) ENGINE= FileLog('/tmp/aaa.csv', 'CSV'); -- {serverError 36 }
CREATE TABLE log (A String) ENGINE= FileLog('/tmp/aaa.csv', 'CSV'); -- {serverError 36 }