You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-17 01:02:23 +03:00
Fixed something I noticed in IOC::list_directory()
This commit is contained in:
@@ -358,9 +358,9 @@ int IOCoordinator::open(const char *filename, int openmode, struct stat *out)
|
|||||||
return meta.stat(out);
|
return meta.stat(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
int IOCoordinator::listDirectory(const char *filename, vector<string> *listing)
|
int IOCoordinator::listDirectory(const char *dirname, vector<string> *listing)
|
||||||
{
|
{
|
||||||
bf::path p(metaPath / filename);
|
bf::path p(metaPath / dirname);
|
||||||
|
|
||||||
listing->clear();
|
listing->clear();
|
||||||
if (!bf::exists(p))
|
if (!bf::exists(p))
|
||||||
@@ -376,7 +376,7 @@ int IOCoordinator::listDirectory(const char *filename, vector<string> *listing)
|
|||||||
|
|
||||||
bf::directory_iterator it(p), end;
|
bf::directory_iterator it(p), end;
|
||||||
for (bf::directory_iterator it(p); it != end; it++)
|
for (bf::directory_iterator it(p); it != end; it++)
|
||||||
listing->push_back(it->path().filename().string());
|
listing->push_back(it->path().stem().string());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -660,8 +660,10 @@ bool listdirtask()
|
|||||||
|
|
||||||
bf::create_directories(tmpPath);
|
bf::create_directories(tmpPath);
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
|
|
||||||
string file(tmpPath.string() + "/dummy" + to_string(i));
|
string file(tmpPath.string() + "/dummy" + to_string(i));
|
||||||
files.insert(file);
|
files.insert(file);
|
||||||
|
file += ".meta";
|
||||||
err = ::open(file.c_str(), O_CREAT | O_WRONLY, 0600);
|
err = ::open(file.c_str(), O_CREAT | O_WRONLY, 0600);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
fdMinders.push_back(err);
|
fdMinders.push_back(err);
|
||||||
@@ -687,7 +689,6 @@ bool listdirtask()
|
|||||||
assert(resp->header.flags == 0);
|
assert(resp->header.flags == 0);
|
||||||
assert(resp->returnCode == 0);
|
assert(resp->returnCode == 0);
|
||||||
listdir_resp *r = (listdir_resp *) resp->payload;
|
listdir_resp *r = (listdir_resp *) resp->payload;
|
||||||
cout << "resp has " << r->elements << " elements" << endl;
|
|
||||||
assert(r->elements == 10);
|
assert(r->elements == 10);
|
||||||
int off = sizeof(sm_response) + sizeof(listdir_resp);
|
int off = sizeof(sm_response) + sizeof(listdir_resp);
|
||||||
int fileCounter = 0;
|
int fileCounter = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user