Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4dd3fd5

Browse files
CherkashinSergeyza-arthur
authored andcommitted
Remove redundant argument from getVariableInternal()
1 parent 51f3ace commit 4dd3fd5

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

pg_variables.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void getKeyFromName(text *name, char *key);
5252
static Package *getPackageByName(text *name, bool create, bool strict);
5353
static Variable *getVariableInternal(Package *package,
5454
text *name, Oid typid,
55-
bool strict, bool type_strict);
55+
bool strict);
5656
static Variable *createVariableInternal(Package *package,
5757
text *name, Oid typid,
5858
bool is_transactional);
@@ -197,7 +197,7 @@ variable_get(text *package_name, text *var_name,
197197
return 0;
198198
}
199199

200-
variable = getVariableInternal(package, var_name, typid, strict, true);
200+
variable = getVariableInternal(package, var_name, typid, strict);
201201

202202
if (variable == NULL)
203203
{
@@ -455,7 +455,7 @@ variable_update(PG_FUNCTION_ARGS)
455455
strncmp(VARDATA_ANY(var_name), GetName(LastVariable),
456456
VARSIZE_ANY_EXHDR(var_name)) != 0)
457457
{
458-
variable = getVariableInternal(package, var_name, RECORDOID, true, true);
458+
variable = getVariableInternal(package, var_name, RECORDOID, true);
459459
LastVariable = variable;
460460
}
461461
else
@@ -543,7 +543,7 @@ variable_delete(PG_FUNCTION_ARGS)
543543
strncmp(VARDATA_ANY(var_name), GetName(LastVariable),
544544
VARSIZE_ANY_EXHDR(var_name)) != 0)
545545
{
546-
variable = getVariableInternal(package, var_name, RECORDOID, true, true);
546+
variable = getVariableInternal(package, var_name, RECORDOID, true);
547547
LastVariable = variable;
548548
}
549549
else
@@ -592,7 +592,7 @@ variable_select(PG_FUNCTION_ARGS)
592592
var_name = PG_GETARG_TEXT_PP(1);
593593

594594
package = getPackageByName(package_name, false, true);
595-
variable = getVariableInternal(package, var_name, RECORDOID, true, true);
595+
variable = getVariableInternal(package, var_name, RECORDOID, true);
596596

597597
record = &(GetActualValue(variable).record);
598598

@@ -667,7 +667,7 @@ variable_select_by_value(PG_FUNCTION_ARGS)
667667
}
668668

669669
package = getPackageByName(package_name, false, true);
670-
variable = getVariableInternal(package, var_name, RECORDOID, true, true);
670+
variable = getVariableInternal(package, var_name, RECORDOID, true);
671671

672672
if (!value_is_null)
673673
check_record_key(variable, value_type);
@@ -736,7 +736,7 @@ variable_select_by_values(PG_FUNCTION_ARGS)
736736
var_name = PG_GETARG_TEXT_PP(1);
737737

738738
package = getPackageByName(package_name, false, true);
739-
variable = getVariableInternal(package, var_name, RECORDOID, true, true);
739+
variable = getVariableInternal(package, var_name, RECORDOID, true);
740740

741741
check_record_key(variable, ARR_ELEMTYPE(values));
742742

@@ -870,9 +870,9 @@ remove_variable(PG_FUNCTION_ARGS)
870870
var_name = PG_GETARG_TEXT_PP(1);
871871

872872
package = getPackageByName(package_name, false, true);
873-
variable = getVariableInternal(package, var_name, 0, true, false);
873+
variable = getVariableInternal(package, var_name, InvalidOid, true);
874874

875-
/* Add package to changes list, so we can remove it if it */
875+
/* Add package to changes list, so we can remove it if it is empty */
876876
if (!isObjectChangedInCurrentTrans(&package->transObject))
877877
{
878878
createSavepoint(&package->transObject, TRANS_PACKAGE);
@@ -1438,8 +1438,7 @@ getPackageByName(text *name, bool create, bool strict)
14381438
* flag 'is_transactional' of this variable is unknown.
14391439
*/
14401440
static Variable *
1441-
getVariableInternal(Package *package, text *name, Oid typid, bool strict,
1442-
bool type_strict)
1441+
getVariableInternal(Package *package, text *name, Oid typid, bool strict)
14431442
{
14441443
Variable *variable;
14451444
char key[NAMEDATALEN];
@@ -1456,7 +1455,7 @@ getVariableInternal(Package *package, text *name, Oid typid, bool strict,
14561455
/* Check variable type */
14571456
if (found)
14581457
{
1459-
if (type_strict && variable->typid != typid)
1458+
if (typid != InvalidOid && variable->typid != typid)
14601459
{
14611460
char *var_type = DatumGetCString(DirectFunctionCall1(regtypeout,
14621461
ObjectIdGetDatum(variable->typid)));

0 commit comments

Comments
 (0)