Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
path = aerospike-client-c
# url = git@github.com:aerospike/aerospike-client-c.git
url = https://github.com/aerospike/aerospike-client-c.git
branch = stage
branch = CLIENT-4844
4 changes: 2 additions & 2 deletions aerospike_helpers/expressions/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ class MapGetKeys(_BaseExpr):
Return a list of keys from a map.
"""

_op = aerospike._AS_EXP_CODE_MAP_KEYS
_op = aerospike._AS_EXP_CODE_MAP_KEYS_IN

def __init__(
self,
Expand All @@ -1516,7 +1516,7 @@ class MapGetValues(_BaseExpr):
Return a list of values from a map.
"""

_op = aerospike._AS_EXP_CODE_MAP_VALUES
_op = aerospike._AS_EXP_CODE_MAP_VALUES_IN

def __init__(
self,
Expand Down
6 changes: 3 additions & 3 deletions src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <aerospike/version.h>

PyObject *py_global_hosts = NULL;
int counter = 0xA8000000;
int counter = 0xAC000000;
bool user_shm_key = false;

PyDoc_STRVAR(client_doc, "client(config) -> client object\n\
Expand Down Expand Up @@ -590,8 +590,8 @@ static struct module_constant_name_to_value module_constants[] = {

EXPOSE_MACRO(_AS_EXP_CODE_REMOVE_RESULT),
EXPOSE_MACRO(_AS_EXP_CODE_IN_LIST),
EXPOSE_MACRO(_AS_EXP_CODE_MAP_KEYS),
EXPOSE_MACRO(_AS_EXP_CODE_MAP_VALUES),
EXPOSE_MACRO(_AS_EXP_CODE_MAP_KEYS_IN),
EXPOSE_MACRO(_AS_EXP_CODE_MAP_VALUES_IN),

EXPOSE_STRING_MACRO_FOR_AEROSPIKE_HELPERS(_CDT_FLAGS_KEY),
EXPOSE_STRING_MACRO_FOR_AEROSPIKE_HELPERS(_CDT_APPLY_MOD_EXP_KEY),
Expand Down
12 changes: 6 additions & 6 deletions src/main/convert_expressions.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ static as_status get_expr_size(int *size_to_alloc, int *intermediate_exprs_size,
[OP_MAP_SIZE] = EXP_SZ(as_exp_map_size(NULL, NIL)),
[OP_MAP_GET_BY_KEY] =
EXP_SZ(as_exp_map_get_by_key(NULL, 0, 0, NIL, NIL)),
[_AS_EXP_CODE_MAP_KEYS] = EXP_SZ(as_exp_map_keys(NIL)),
[_AS_EXP_CODE_MAP_VALUES] = EXP_SZ(as_exp_map_values(NIL)),
[_AS_EXP_CODE_MAP_KEYS_IN] = EXP_SZ(as_exp_map_keys_in(NIL)),
[_AS_EXP_CODE_MAP_VALUES_IN] = EXP_SZ(as_exp_map_values_in(NIL)),
[OP_MAP_SIZE] = EXP_SZ(as_exp_map_size(NULL, NIL)),
[OP_MAP_GET_BY_KEY_RANGE] =
EXP_SZ(as_exp_map_get_by_key_range(NULL, 0, NIL, NIL, NIL)),
Expand Down Expand Up @@ -1245,11 +1245,11 @@ add_expr_macros(AerospikeClient *self, as_static_pool *static_pool,
APPEND_ARRAY(1, as_exp_map_size(temp_expr->ctx,
NIL)); // - 1 for bin
break;
case _AS_EXP_CODE_MAP_KEYS:
APPEND_ARRAY(1, as_exp_map_keys(NIL)); // - 1 for bin
case _AS_EXP_CODE_MAP_KEYS_IN:
APPEND_ARRAY(1, as_exp_map_keys_in(NIL)); // - 1 for bin
break;
case _AS_EXP_CODE_MAP_VALUES:
APPEND_ARRAY(1, as_exp_map_values(NIL)); // - 1 for bin
case _AS_EXP_CODE_MAP_VALUES_IN:
APPEND_ARRAY(1, as_exp_map_values_in(NIL)); // - 1 for bin
break;
case OP_MAP_GET_BY_KEY:
if (get_int64_t(err, AS_PY_MAP_RETURN_KEY, temp_expr->pydict,
Expand Down
27 changes: 27 additions & 0 deletions test/new_tests/test_shared_memory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import aerospike
import pytest


@pytest.mark.usefixtures("connection_config")
class TestSharedMemory:
@pytest.fixture(autouse=True)
def setup(self):
self.__class__.connection_config["shm"] = {}

def test_one_client(self):
client = aerospike.client(self.connection_config)

assert client.is_connected()

client.close()

def test_multiple_clients(self):

client1 = aerospike.client(self.connection_config)
assert client1.is_connected()

client2 = aerospike.client(self.connection_config)
assert client2.is_connected()

client1.close()
client2.close()
Loading