diff --git a/lib/rocksdb/env_spdk.cc b/lib/rocksdb/env_spdk.cc index bc9d3f1b1d..08573cd6ce 100644 --- a/lib/rocksdb/env_spdk.cc +++ b/lib/rocksdb/env_spdk.cc @@ -293,7 +293,12 @@ public: result->reset(new SpdkSequentialFile(file)); return Status::OK(); } else { - return IOError(fname, rc); + /* Myrocks engine uses errno(ENOENT) as one + * special condition, for the purpose to + * support MySQL, set the errno to right value. + */ + errno = -rc; + return IOError(fname, errno); } } else { return PosixEnv::NewSequentialFile(fname, result, options);