Skip to content

Commit 7b04fb4

Browse files
committed
fix: use null byte for empty prefix key in etcd range queries
1 parent 1948881 commit 7b04fb4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Plugins/EtcdDriverPlugin/EtcdPluginDriver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,8 @@ final class EtcdPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
919919
/// Empty prefix uses null byte (\0) as key to mean "all keys".
920920
private static func allKeysRange(for prefix: String) -> (key: String, rangeEnd: String) {
921921
if prefix.isEmpty {
922-
// Empty key = start from beginning, \0 as range_end = all keys
923-
let b64Key = EtcdHttpClient.base64Encode("")
922+
// \0 as key = start from beginning, \0 as range_end = all keys
923+
let b64Key = EtcdHttpClient.base64Encode("\0")
924924
let b64RangeEnd = EtcdHttpClient.base64Encode("\0")
925925
return (b64Key, b64RangeEnd)
926926
}

0 commit comments

Comments
 (0)