facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.59k stars 6.32k forks source link

import_column_family bug #6753

Open x-x-p opened 4 years ago

x-x-p commented 4 years ago

when sorted_files.size() is 0, sorted_files.size() - 1 is overflow, sorted_files[i + 1] operator[] fatal

https://github.com/facebook/rocksdb/blob/e04f3bce4fbe0453457047ea36e858888f0343e9/db/import_column_family_job.cc#L65-L70

zhichao-cao commented 4 years ago

@x-x-p Thanks, a good catch. You are right, size_t is unsigned. Will create a PR to fix it.