aerospike/aerospike-server — pull request #23 by amirrf (2014-11-04 18:13:44+00:00)
Title: Fixed: UDF execution returns empty bin name in result record when the namespace is single-bin

Executing UDF should return either `SUCCESS` or `FAILURE` as bin-name, and the result or error message as its value.
But when the namespace is configured as *single-bin*, it returns an empty string as bin name and the client libraries do not expect this and throw exceptions.

Bins in the returned record from UDF execution should be something like:
```
{"SUCCESS"=>0}
```
OR
```
{"FAILURE"=>"/opt/aerospike/usr/udf/lua/test_udf.lua:2: MyError"}
```
but when it's a single-bin namespace in both `SUCCESS` and `FAILURE` cases it returns an empty string for bin-name:
```
{""=>0}
```
OR
```
{""=>"/opt/aerospike/usr/udf/lua/test_udf.lua:2: MyError"}
```
This is because for a single-bin namespace an empty string is always returned as the bin-name, therefore the UDF result can't be embedded in the bin name.

**Fix:**
Due to the optimizations done for single-bin namespaces, they have no *vmap* for bin names and accessing `ns->p_bin_name_vmap` is prevented. So the issue is fixed in the wire protocol level, leaving all the optimizations intact.

This fix also sets the ground for returning an optional defualt bin name for single-bin namespaces to the client, which would be useful in case of having an application using a normal namespace as single bin in practice, and deciding to change the namespace config to single-bin for better performance.