Skip to content

Commit 8b609fc

Browse files
committed
Fix: fixed the early mark to include EX, PX, EXAT as well
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
1 parent 1f7ab9a commit 8b609fc

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/t_hash.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ void hsetexCommand(client *c) {
11901190
int changes = 0;
11911191
robj **new_argv = NULL;
11921192
int new_argc = 0;
1193-
int need_rewrite_for_nx_xx_fnx_fxx = 0;
1193+
int need_rewrite_for_nx_xx_fnx_fxx_ex_px_exat = 0;
11941194

11951195
for (; fields_index < c->argc - 1; fields_index++) {
11961196
if (!strcasecmp(c->argv[fields_index]->ptr, "fields")) {
@@ -1210,8 +1210,8 @@ void hsetexCommand(client *c) {
12101210
if (checkType(c, o, OBJ_HASH))
12111211
return;
12121212

1213-
if (flags & (ARGS_SET_NX | ARGS_SET_XX | ARGS_SET_FNX | ARGS_SET_FXX)) {
1214-
need_rewrite_for_nx_xx_fnx_fxx = 1;
1213+
if (flags & (ARGS_SET_NX | ARGS_SET_XX | ARGS_SET_FNX | ARGS_SET_FXX | ARGS_EX | ARGS_PX | ARGS_EXAT)) {
1214+
need_rewrite_for_nx_xx_fnx_fxx_ex_px_exat = 1;
12151215
}
12161216

12171217
/* Check NX/XX key-level conditions before creating a new object */
@@ -1273,7 +1273,7 @@ void hsetexCommand(client *c) {
12731273
incrRefCount(shared.hdel);
12741274
new_argv[new_argc++] = c->argv[1];
12751275
incrRefCount(c->argv[1]);
1276-
} else if (need_rewrite_for_nx_xx_fnx_fxx) {
1276+
} else if (need_rewrite_for_nx_xx_fnx_fxx_ex_px_exat) {
12771277
/* We use new_argv for rewrite */
12781278
new_argv = zmalloc(sizeof(robj *) * c->argc);
12791279
int j = 0;
@@ -1316,7 +1316,7 @@ void hsetexCommand(client *c) {
13161316
} else {
13171317
hashTypeSet(o, c->argv[i]->ptr, c->argv[i + 1]->ptr, when, set_flags);
13181318
changes++;
1319-
if (need_rewrite_for_nx_xx_fnx_fxx) {
1319+
if (need_rewrite_for_nx_xx_fnx_fxx_ex_px_exat) {
13201320
new_argv[new_argc++] = c->argv[i];
13211321
incrRefCount(c->argv[i]);
13221322
}
@@ -1334,7 +1334,7 @@ void hsetexCommand(client *c) {
13341334
notifyKeyspaceEvent(NOTIFY_HASH, "hexpired", c->argv[1], c->db->id);
13351335
} else {
13361336
notifyKeyspaceEvent(NOTIFY_HASH, "hset", c->argv[1], c->db->id);
1337-
if (need_rewrite_for_nx_xx_fnx_fxx) {
1337+
if (need_rewrite_for_nx_xx_fnx_fxx_ex_px_exat) {
13381338
replaceClientCommandVector(c, new_argc, new_argv);
13391339
}
13401340
if (expire) {

0 commit comments

Comments
 (0)