Peter Dillinger
59633e36ed
Bug fix: Reject empty string as a column family name ( #14732 )
...
Summary:
Previously, calling `DB::CreateColumnFamily(opts, "", &handle)` returned `Status::OK()` with a usable handle, but the column family was not persisted in the manifest. Any data written to the empty-named CF was silently lost on DB reopen, and `ListColumnFamilies` would not show it.
The empty string is also reserved as a sentinel meaning "no/unknown column family" in various RocksDB APIs and serialization formats (e.g. `TablePropertiesCollectorFactory::Context::kUnknownColumnFamily` and table properties), so allowing it as a real CF name is ambiguous in addition to being broken.
This change rejects an empty CF name with `Status::InvalidArgument` at the top of `DBImpl::CreateColumnFamilyImpl`, which covers the single-CF `CreateColumnFamily` API as well as both `CreateColumnFamilies` overloads (by-names and by-descriptors).
Pull Request resolved: https://github.com/facebook/rocksdb/pull/14732
Test Plan: * Added `ColumnFamilyTest.EmptyNameRejected` covering all three Create entry points; verifies `IsInvalidArgument()` and that no spurious handles are returned.
Reviewed By: hx235
Differential Revision: D104753911
Pulled By: pdillinger
fbshipit-source-id: e52d792830b965484a618f4e55981eee4eb6f515
2026-05-12 16:06:58 -07:00
..
2026-05-12 15:29:27 -07:00
2026-05-11 17:02:22 -07:00
2026-05-12 16:06:58 -07:00
2026-05-12 15:29:27 -07:00
2025-05-05 17:42:57 -07:00
2025-08-08 10:33:36 -07:00
2024-04-16 08:45:38 -07:00
2024-11-04 18:06:07 -08:00
2026-04-18 00:38:50 -07:00
2026-04-16 16:45:13 -07:00
2026-04-03 22:47:51 -07:00
2026-04-03 22:47:51 -07:00
2026-04-08 18:58:40 -07:00
2026-04-08 18:58:40 -07:00
2026-05-12 16:06:58 -07:00
2026-04-28 14:30:52 -07:00
2026-04-28 14:30:52 -07:00
2026-02-17 23:33:39 -08:00
2026-02-17 23:33:39 -08:00
2026-02-17 13:05:44 -08:00
2026-02-17 13:05:44 -08:00
2026-02-17 23:33:39 -08:00
2026-02-17 23:33:39 -08:00
2026-05-11 17:02:22 -07:00
2026-05-11 17:02:22 -07:00
2026-02-19 16:45:51 -08:00
2023-05-18 13:25:01 -07:00
2026-01-30 05:53:04 -08:00
2024-03-22 13:40:42 -07:00
2026-05-11 17:02:22 -07:00
2024-12-19 10:58:40 -08:00
2025-07-09 10:40:28 -07:00
2025-11-07 09:04:52 -08:00
2026-04-02 07:31:56 -07:00
2026-05-12 15:29:27 -07:00
2025-10-03 14:28:37 -07:00
2024-02-05 10:26:41 -08:00
2022-06-27 16:37:09 -07:00
2025-06-04 10:44:17 -07:00
2025-05-05 17:42:57 -07:00
2025-05-05 17:42:57 -07:00
2026-05-11 17:02:22 -07:00
2026-05-11 17:02:22 -07:00
2026-05-11 17:02:22 -07:00
2025-04-11 10:08:29 -07:00
2026-02-19 20:26:38 -08:00
2026-02-17 23:33:39 -08:00
2026-03-24 17:16:14 -07:00
2025-02-18 11:01:19 -08:00
2026-02-17 23:33:39 -08:00
2026-04-08 18:58:40 -07:00
2026-01-08 15:15:31 -08:00
2026-03-24 17:16:14 -07:00
2026-02-17 23:33:39 -08:00
2025-10-09 14:31:47 -07:00
2026-02-17 23:33:39 -08:00
2026-05-12 15:29:27 -07:00
2026-04-02 07:31:56 -07:00
2026-02-17 23:33:39 -08:00
2026-04-24 13:51:20 -07:00
2024-12-19 10:58:40 -08:00
2026-05-12 15:29:27 -07:00
2026-03-24 15:39:27 -07:00
2026-04-03 16:48:09 -07:00
2026-05-11 17:02:22 -07:00
2025-08-05 23:19:09 -07:00
2026-03-02 16:18:14 -08:00
2026-02-17 23:33:39 -08:00
2026-01-20 14:10:41 -08:00
2022-05-19 18:39:41 -07:00
2022-05-19 18:39:41 -07:00
2026-03-09 15:17:31 -07:00
2026-01-05 20:47:46 -08:00
2026-05-11 17:02:22 -07:00
2024-11-22 17:53:35 -08:00
2026-04-03 22:47:51 -07:00
2025-01-24 22:28:41 -08:00
2026-02-17 23:33:39 -08:00
2026-03-02 16:18:14 -08:00
2024-12-19 16:57:51 -08:00
2026-04-06 19:47:36 -07:00
2023-01-27 13:14:19 -08:00
2026-02-13 11:56:22 -08:00
2026-04-10 17:04:47 -07:00
2026-04-14 19:07:29 -07:00
2025-08-22 16:05:56 -07:00
2026-02-19 22:10:47 -08:00
2026-04-21 14:59:40 -07:00
2022-11-02 14:34:24 -07:00
2023-07-03 09:41:48 -07:00
2022-11-02 14:34:24 -07:00
2022-11-02 14:34:24 -07:00
2026-04-03 22:47:51 -07:00
2026-04-16 16:45:13 -07:00
2026-04-14 19:07:29 -07:00
2026-02-17 23:33:39 -08:00
2025-01-15 13:11:40 -08:00
2025-05-05 17:42:57 -07:00
2023-02-22 12:28:18 -08:00
2026-02-17 13:05:44 -08:00
2023-06-15 12:25:04 -07:00
2026-02-17 23:33:39 -08:00
2026-01-30 05:53:04 -08:00
2026-01-30 05:53:04 -08:00
2026-04-02 07:31:56 -07:00
2023-04-25 12:08:23 -07:00
2026-05-11 17:02:22 -07:00
2024-12-26 13:20:35 -08:00
2026-04-27 12:17:09 -07:00
2026-04-27 12:17:09 -07:00
2026-04-27 12:17:09 -07:00
2026-05-07 13:10:59 -07:00
2026-05-07 13:10:59 -07:00
2022-11-02 14:34:24 -07:00
2022-11-02 14:34:24 -07:00
2024-02-07 10:44:11 -08:00
2024-12-19 10:58:40 -08:00
2024-12-06 13:29:52 -08:00
2024-12-06 13:29:52 -08:00
2026-02-17 23:33:39 -08:00
2026-03-24 17:16:14 -07:00
2026-05-12 15:29:27 -07:00
2026-05-12 15:29:27 -07:00
2026-05-12 15:29:27 -07:00
2026-05-12 15:29:27 -07:00
2025-02-10 17:15:47 -08:00
2026-04-10 17:04:47 -07:00
2026-04-18 00:38:50 -07:00
2025-10-15 13:43:53 -07:00
2025-09-08 13:11:28 -07:00
2026-04-10 17:04:47 -07:00
2024-11-04 18:06:07 -08:00
2026-04-08 18:58:40 -07:00
2026-03-26 09:24:04 -07:00
2026-04-08 18:58:40 -07:00
2026-02-17 23:33:39 -08:00
2024-01-31 16:30:26 -08:00
2024-01-31 16:30:26 -08:00
2026-02-17 23:33:39 -08:00
2026-03-27 14:43:52 -07:00
2026-02-28 13:43:55 -08:00
2025-07-01 11:07:51 -07:00
2024-02-07 10:44:11 -08:00
2026-02-17 23:33:39 -08:00
2022-06-10 16:07:03 -07:00
2021-09-10 10:00:26 -07:00
2026-02-19 16:45:51 -08:00
2022-10-25 11:33:04 -07:00
2025-12-04 12:28:01 -08:00
2025-12-04 12:28:01 -08:00
2024-03-22 13:40:42 -07:00
2026-04-07 16:34:24 -07:00
2026-04-07 16:34:24 -07:00
2024-10-14 12:28:35 -07:00
2026-04-03 22:47:51 -07:00
2024-12-19 10:58:40 -08:00
2026-01-20 14:10:41 -08:00
2026-02-17 23:33:39 -08:00
2025-03-04 17:44:01 -08:00
2025-03-04 17:44:01 -08:00
2024-10-25 09:32:14 -07:00
2022-11-02 14:34:24 -07:00
2022-11-02 14:34:24 -07:00
2026-03-02 16:18:14 -08:00
2026-04-28 14:30:52 -07:00
2026-04-28 14:30:52 -07:00
2024-11-01 10:08:35 -07:00
2022-11-02 14:34:24 -07:00
2024-06-18 10:51:29 -07:00
2024-12-19 10:58:40 -08:00
2025-02-13 21:49:51 -08:00
2022-11-02 14:34:24 -07:00
2026-01-20 14:10:41 -08:00
2026-03-02 16:18:14 -08:00
2026-03-02 16:18:14 -08:00
2026-05-07 13:10:59 -07:00
2026-05-07 13:10:59 -07:00
2026-04-14 19:07:29 -07:00
2026-05-11 17:02:22 -07:00
2026-05-07 11:44:37 -07:00
2026-03-09 16:42:41 -07:00
2026-05-12 15:29:27 -07:00
2026-05-12 15:29:27 -07:00
2026-05-12 15:29:27 -07:00
2026-03-02 16:18:14 -08:00
2026-03-02 16:18:14 -08:00
2022-07-21 13:35:36 -07:00
2022-07-21 13:35:36 -07:00
2022-07-21 13:35:36 -07:00
2025-11-07 09:04:52 -08:00
2025-10-24 17:10:48 -07:00
2024-12-19 10:58:40 -08:00
2026-04-02 07:31:56 -07:00
2026-04-10 17:04:47 -07:00
2026-04-10 17:04:47 -07:00
2026-02-17 23:33:39 -08:00
2022-11-02 14:34:24 -07:00
2022-11-02 14:34:24 -07:00
2023-04-05 14:42:31 -07:00
2024-01-29 10:38:08 -08:00
2024-12-05 15:00:17 -08:00
2026-04-08 18:58:40 -07:00