Hi all,
A map/list/bit/HLL/expression read on a bin named "" returns the entire record instead of the operation’s result, with no error. "" is a legitimate bin name: namespaces migrated from single-bin to 6.4+ keep their data in it.
Repro (server CE 8.1.2.0, bin "" holds {a:{x:1}, b:{x:2}, c:{x:3}}):
rec, _ := client.Operate(nil, key, as.MapGetByKeyOp("", "b", as.MapReturnType.VALUE))
// rec.Bins[""] -> all 3 entries; expected {"x": 2}
The C client behaves the same, and so do Python, Node and PHP, which are built on it. Java is correct. The same read combined with a write in one operate is rejected outright (PARAMETER_ERROR / REQUEST_INVALID).
Cause: the clients set INFO1_GET_ALL for any read op with an empty bin name. With that flag set, the server discards the op list and returns every bin. The server’s own op_is_read_all only treats a plain READ as read-all, and the C client’s batch path already checks the operator type.
- Go:
operate_args.go(newOperateArgs) andbatch_attr.go(newBatchAttrOps,adjustWrite) - C:
aerospike_key.c(as_operate_init)
Fix: set the flag only when the operator is a plain read. Both include tests and are based on stage:
- C: PR fix: map/CDT/bit/HLL/expression reads on bin "" no longer set INFO1_GET_ALL by VineetKaur · Pull Request #308 · aerospike/aerospike-client-c · GitHub
- Go: branch GitHub - VineetKaur/aerospike-client-go at fix-cdt-read-empty-bin · GitHub
Verified against CE 8.1.2.0. Before the fix, map_get_by_key / map_size on "" return the whole map. After it they return the requested entry or the count, and a read-all-bins request still returns every bin.
The C PR is open. For Go I couldn’t open one: aerospike-client-go is limited to prior contributors. Could a maintainer open the Go PR from that branch, or pick up the change? Happy to adjust anything.
Thanks!
(Investigation and patch prepared with help from Claude Code.)