Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4dd3fd5

Browse files
CherkashinSergeyza-arthur
authored andcommitted
Remove redundant argument from getVariableInternal()
1 parent51f3ace commit4dd3fd5

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
staticPackage*getPackageByName(text*name,boolcreate,boolstrict);
5353
staticVariable*getVariableInternal(Package*package,
5454
text*name,Oidtypid,
55-
boolstrict,booltype_strict);
55+
boolstrict);
5656
staticVariable*createVariableInternal(Package*package,
5757
text*name,Oidtypid,
5858
boolis_transactional);
@@ -197,7 +197,7 @@ variable_get(text *package_name, text *var_name,
197197
return0;
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 itis 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
staticVariable*
1441-
getVariableInternal(Package*package,text*name,Oidtypid,boolstrict,
1442-
booltype_strict)
1441+
getVariableInternal(Package*package,text*name,Oidtypid,boolstrict)
14431442
{
14441443
Variable*variable;
14451444
charkey[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)

[8]ページ先頭

©2009-2025 Movatter.jp