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

Commitb3039de

Browse files
author
Artur Zakirov
committed
Fix the error with strict = false parameter
1 parent9d6c1df commitb3039de

File tree

4 files changed

+731
-0
lines changed

4 files changed

+731
-0
lines changed

‎expected/pg_variables.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
CREATE EXTENSION pg_variables;
22
-- Integer variables
3+
SELECT pgv_get_int('vars', 'int1');
4+
ERROR: unrecognized package "vars"
5+
SELECT pgv_get_int('vars', 'int1', false);
6+
pgv_get_int
7+
-------------
8+
9+
(1 row)
10+
311
SELECT pgv_set_int('vars', 'int1', 101);
412
pgv_set_int
513
-------------

‎pg_variables.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ variable_get(text *package_name, text *var_name,
132132
ScalarVar*scalar;
133133

134134
package=getPackageByName(package_name, false,strict);
135+
if (package==NULL)
136+
{
137+
*is_null= true;
138+
return0;
139+
}
140+
135141
variable=getVariableByNameWithType(package->variablesHash,
136142
var_name,typid, false,strict);
137143

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp