Skip to content

Commit 39dde69

Browse files
committed
Use different lock to prevent duplicates
1 parent fea1786 commit 39dde69

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ dir='$(top_srcdir)/src/include'
2828
endif
2929

3030
# uncomment this if you need autogeneration
31-
serialize.c deserialize.c: gen_parser.py nodes.h
32-
python gen_parser.py nodes.h $(dir)
31+
#serialize.c deserialize.c: gen_parser.py nodes.h
32+
# python gen_parser.py nodes.h $(dir)

sr_plan.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ sr_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
139139
standard_planner(parse, cursorOptions, boundParams))
140140

141141
if (sr_plan_write_mode)
142-
heap_lock = RowExclusiveLock;
142+
heap_lock = AccessExclusiveLock;
143143

144144
schema_oid = get_sr_plan_schema();
145145
if (!OidIsValid(schema_oid))
@@ -157,8 +157,7 @@ sr_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
157157
else
158158
ReleaseSysCache(ftup);
159159
}
160-
161-
if (!sr_plan_fake_func)
160+
else
162161
{
163162
Oid args[1] = {ANYELEMENTOID};
164163

@@ -220,7 +219,7 @@ sr_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
220219
heap_deform_tuple(local_tuple, sr_plans_heap->rd_att,
221220
search_values, search_nulls);
222221

223-
/* Check enabled and validate field */
222+
/* Check enabled and valid field */
224223
if (DatumGetBool(search_values[4]) && DatumGetBool(search_values[5]))
225224
{
226225
elog(DEBUG1, "Saved plan was found");
@@ -239,7 +238,6 @@ sr_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
239238
if (pl_stmt)
240239
goto cleanup;
241240

242-
/* Invoke original hook if needed */
243241
pl_stmt = call_standard_planner();
244242

245243
/* Ok, we supported duplicate query_hash but only if all plans with query_hash disabled.*/

0 commit comments

Comments
 (0)