use NoLock instead of the magic number 0
Started by Junwang Zhaoover 3 years ago1 messages
Inside *add_local_<>_reloption*, we should pass NoLock instead of
the magic 0 to init_<>_reloption, which makes more sense.
--
Regards
Junwang Zhao
Attachments:
0001-use-NoLock-instead-of-the-magic-0.patchapplication/octet-stream; name=0001-use-NoLock-instead-of-the-magic-0.patchDownload
From b4e7d1a5cce0e6657a1555b148de7f939002dd1f Mon Sep 17 00:00:00 2001
From: Junwang Zhao <zhjwpku@gmail.com>
Date: Thu, 1 Sep 2022 16:07:11 +0800
Subject: [PATCH v1] use NoLock instead of the magic 0
Inside add_local_<>_reloption, we should pass NoLock instead of
the magic 0 to init_<>_reloption, which makes more sense.
Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
---
src/backend/access/common/reloptions.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c
index 609329bb21..043ab95057 100644
--- a/src/backend/access/common/reloptions.c
+++ b/src/backend/access/common/reloptions.c
@@ -869,7 +869,7 @@ add_local_bool_reloption(local_relopts *relopts, const char *name,
{
relopt_bool *newoption = init_bool_reloption(RELOPT_KIND_LOCAL,
name, desc,
- default_val, 0);
+ default_val, NoLock);
add_local_reloption(relopts, (relopt_gen *) newoption, offset);
}
@@ -923,7 +923,7 @@ add_local_int_reloption(local_relopts *relopts, const char *name,
{
relopt_int *newoption = init_int_reloption(RELOPT_KIND_LOCAL,
name, desc, default_val,
- min_val, max_val, 0);
+ min_val, max_val, NoLock);
add_local_reloption(relopts, (relopt_gen *) newoption, offset);
}
@@ -978,7 +978,7 @@ add_local_real_reloption(local_relopts *relopts, const char *name,
relopt_real *newoption = init_real_reloption(RELOPT_KIND_LOCAL,
name, desc,
default_val, min_val,
- max_val, 0);
+ max_val, NoLock);
add_local_reloption(relopts, (relopt_gen *) newoption, offset);
}
@@ -1042,7 +1042,7 @@ add_local_enum_reloption(local_relopts *relopts, const char *name,
relopt_enum *newoption = init_enum_reloption(RELOPT_KIND_LOCAL,
name, desc,
members, default_val,
- detailmsg, 0);
+ detailmsg, NoLock);
add_local_reloption(relopts, (relopt_gen *) newoption, offset);
}
@@ -1126,7 +1126,7 @@ add_local_string_reloption(local_relopts *relopts, const char *name,
name, desc,
default_val,
validator, filler,
- 0);
+ NoLock);
add_local_reloption(relopts, (relopt_gen *) newoption, offset);
}
--
2.33.0