Fix queryPathFromHashPart()

The inner lambda was returning a SQLite-internal char * rather than a
std::string, leading to Hydra errors liks

  Caught exception in Hydra::Controller::Root->narinfo "path ‘ø˜£â€™ is not in the Nix store at /nix/store/6mvvyb8fgwj23miyal5mdr8ik4ixk15w-hydra-0.1.1234.abcdef/libexec/hydra/lib/Hydra/Controller/Root.pm line 352."
This commit is contained in:
Eelco Dolstra 2016-08-24 14:53:33 +02:00
parent d74236d1f2
commit a9d4f2b303

View file

@ -760,7 +760,7 @@ Path LocalStore::queryPathFromHashPart(const string & hashPart)
Path prefix = storeDir + "/" + hashPart;
return retrySQLite<Path>([&]() {
return retrySQLite<Path>([&]() -> std::string {
auto state(_state.lock());
auto useQueryPathFromHashPart(state->stmtQueryPathFromHashPart.use()(prefix));