Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f46dc96f
Commit
f46dc96f
authored
Sep 16, 2021
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message style improvements
parent
7890a423
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
22 deletions
+17
-22
src/backend/commands/typecmds.c
src/backend/commands/typecmds.c
+3
-3
src/backend/libpq/auth.c
src/backend/libpq/auth.c
+2
-2
src/backend/libpq/be-secure-openssl.c
src/backend/libpq/be-secure-openssl.c
+1
-1
src/backend/utils/adt/jsonbsubs.c
src/backend/utils/adt/jsonbsubs.c
+4
-5
src/backend/utils/adt/multirangetypes.c
src/backend/utils/adt/multirangetypes.c
+5
-9
src/test/regress/expected/jsonb.out
src/test/regress/expected/jsonb.out
+2
-2
No files found.
src/backend/commands/typecmds.c
View file @
f46dc96f
...
@@ -498,7 +498,7 @@ DefineType(ParseState *pstate, List *names, List *parameters)
...
@@ -498,7 +498,7 @@ DefineType(ParseState *pstate, List *names, List *parameters)
analyzeOid
=
findTypeAnalyzeFunction
(
analyzeName
,
typoid
);
analyzeOid
=
findTypeAnalyzeFunction
(
analyzeName
,
typoid
);
/*
/*
* Likewise look up the subscripting
procedure
if any. If it is not
* Likewise look up the subscripting
function
if any. If it is not
* specified, but a typelem is specified, allow that if
* specified, but a typelem is specified, allow that if
* raw_array_subscript_handler can be used. (This is for backwards
* raw_array_subscript_handler can be used. (This is for backwards
* compatibility; maybe someday we should throw an error instead.)
* compatibility; maybe someday we should throw an error instead.)
...
@@ -512,7 +512,7 @@ DefineType(ParseState *pstate, List *names, List *parameters)
...
@@ -512,7 +512,7 @@ DefineType(ParseState *pstate, List *names, List *parameters)
else
else
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"element type cannot be specified without a
valid subscripting procedure
"
)));
errmsg
(
"element type cannot be specified without a
subscripting function
"
)));
}
}
/*
/*
...
@@ -840,7 +840,7 @@ DefineDomain(CreateDomainStmt *stmt)
...
@@ -840,7 +840,7 @@ DefineDomain(CreateDomainStmt *stmt)
analyzeProcedure
=
baseType
->
typanalyze
;
analyzeProcedure
=
baseType
->
typanalyze
;
/*
/*
* Domains don't need a subscript
procedure
, since they are not
* Domains don't need a subscript
function
, since they are not
* subscriptable on their own. If the base type is subscriptable, the
* subscriptable on their own. If the base type is subscriptable, the
* parser will reduce the type to the base type before subscripting.
* parser will reduce the type to the base type before subscripting.
*/
*/
...
...
src/backend/libpq/auth.c
View file @
f46dc96f
...
@@ -368,8 +368,8 @@ set_authn_id(Port *port, const char *id)
...
@@ -368,8 +368,8 @@ set_authn_id(Port *port, const char *id)
* connection continue, either.
* connection continue, either.
*/
*/
ereport
(
FATAL
,
ereport
(
FATAL
,
(
errmsg
(
"
connection was re-authenticated
"
),
(
errmsg
(
"
authentication identifier set more than once
"
),
errdetail_log
(
"previous
ID:
\"
%s
\"
; new ID
:
\"
%s
\"
"
,
errdetail_log
(
"previous
identifier:
\"
%s
\"
; new identifier
:
\"
%s
\"
"
,
port
->
authn_id
,
id
)));
port
->
authn_id
,
id
)));
}
}
...
...
src/backend/libpq/be-secure-openssl.c
View file @
f46dc96f
...
@@ -1392,7 +1392,7 @@ X509_NAME_to_cstring(X509_NAME *name)
...
@@ -1392,7 +1392,7 @@ X509_NAME_to_cstring(X509_NAME *name)
if
(
membuf
==
NULL
)
if
(
membuf
==
NULL
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_OUT_OF_MEMORY
),
(
errcode
(
ERRCODE_OUT_OF_MEMORY
),
errmsg
(
"
failed to
create BIO"
)));
errmsg
(
"
could not
create BIO"
)));
(
void
)
BIO_set_close
(
membuf
,
BIO_CLOSE
);
(
void
)
BIO_set_close
(
membuf
,
BIO_CLOSE
);
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
...
...
src/backend/utils/adt/jsonbsubs.c
View file @
f46dc96f
...
@@ -100,9 +100,8 @@ jsonb_subscript_transform(SubscriptingRef *sbsref,
...
@@ -100,9 +100,8 @@ jsonb_subscript_transform(SubscriptingRef *sbsref,
if
(
targetType
!=
UNKNOWNOID
)
if
(
targetType
!=
UNKNOWNOID
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"subscript type is not supported"
),
errmsg
(
"subscript type %s is not supported"
,
format_type_be
(
subExprType
)),
errhint
(
"Jsonb subscript must be coerced "
errhint
(
"jsonb subscript must be coercible to only one type, integer or text."
),
"only to one type, integer or text."
),
parser_errposition
(
pstate
,
exprLocation
(
subExpr
))));
parser_errposition
(
pstate
,
exprLocation
(
subExpr
))));
targetType
=
targets
[
i
];
targetType
=
targets
[
i
];
...
@@ -115,8 +114,8 @@ jsonb_subscript_transform(SubscriptingRef *sbsref,
...
@@ -115,8 +114,8 @@ jsonb_subscript_transform(SubscriptingRef *sbsref,
if
(
targetType
==
UNKNOWNOID
)
if
(
targetType
==
UNKNOWNOID
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"subscript type
is not supported"
),
errmsg
(
"subscript type
%s is not supported"
,
format_type_be
(
subExprType
)
),
errhint
(
"
Jsonb subscript must be coerced to either integer or text
"
),
errhint
(
"
jsonb subscript must be coercible to either integer or text.
"
),
parser_errposition
(
pstate
,
exprLocation
(
subExpr
))));
parser_errposition
(
pstate
,
exprLocation
(
subExpr
))));
}
}
else
else
...
...
src/backend/utils/adt/multirangetypes.c
View file @
f46dc96f
...
@@ -961,7 +961,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
...
@@ -961,7 +961,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
if
(
PG_ARGISNULL
(
0
))
if
(
PG_ARGISNULL
(
0
))
elog
(
ERROR
,
elog
(
ERROR
,
"multirange values cannot contain
NULL
members"
);
"multirange values cannot contain
null
members"
);
rangeArray
=
PG_GETARG_ARRAYTYPE_P
(
0
);
rangeArray
=
PG_GETARG_ARRAYTYPE_P
(
0
);
...
@@ -973,9 +973,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
...
@@ -973,9 +973,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
rngtypid
=
ARR_ELEMTYPE
(
rangeArray
);
rngtypid
=
ARR_ELEMTYPE
(
rangeArray
);
if
(
rngtypid
!=
rangetyp
->
type_id
)
if
(
rngtypid
!=
rangetyp
->
type_id
)
ereport
(
ERROR
,
elog
(
ERROR
,
"type %u does not match constructor type"
,
rngtypid
);
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"type %u does not match constructor type"
,
rngtypid
)));
/*
/*
* Be careful: we can still be called with zero ranges, like this:
* Be careful: we can still be called with zero ranges, like this:
...
@@ -997,7 +995,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
...
@@ -997,7 +995,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
if
(
nulls
[
i
])
if
(
nulls
[
i
])
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_NULL_VALUE_NOT_ALLOWED
),
(
errcode
(
ERRCODE_NULL_VALUE_NOT_ALLOWED
),
errmsg
(
"multirange values cannot contain
NULL
members"
)));
errmsg
(
"multirange values cannot contain
null
members"
)));
/* make_multirange will do its own copy */
/* make_multirange will do its own copy */
ranges
[
i
]
=
DatumGetRangeTypeP
(
elements
[
i
]);
ranges
[
i
]
=
DatumGetRangeTypeP
(
elements
[
i
]);
...
@@ -1031,16 +1029,14 @@ multirange_constructor1(PG_FUNCTION_ARGS)
...
@@ -1031,16 +1029,14 @@ multirange_constructor1(PG_FUNCTION_ARGS)
if
(
PG_ARGISNULL
(
0
))
if
(
PG_ARGISNULL
(
0
))
elog
(
ERROR
,
elog
(
ERROR
,
"multirange values cannot contain
NULL
members"
);
"multirange values cannot contain
null
members"
);
range
=
PG_GETARG_RANGE_P
(
0
);
range
=
PG_GETARG_RANGE_P
(
0
);
/* Make sure the range type matches. */
/* Make sure the range type matches. */
rngtypid
=
RangeTypeGetOid
(
range
);
rngtypid
=
RangeTypeGetOid
(
range
);
if
(
rngtypid
!=
rangetyp
->
type_id
)
if
(
rngtypid
!=
rangetyp
->
type_id
)
ereport
(
ERROR
,
elog
(
ERROR
,
"type %u does not match constructor type"
,
rngtypid
);
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"type %u does not match constructor type"
,
rngtypid
)));
PG_RETURN_MULTIRANGE_P
(
make_multirange
(
mltrngtypid
,
rangetyp
,
1
,
&
range
));
PG_RETURN_MULTIRANGE_P
(
make_multirange
(
mltrngtypid
,
rangetyp
,
1
,
&
range
));
}
}
...
...
src/test/regress/expected/jsonb.out
View file @
f46dc96f
...
@@ -4822,10 +4822,10 @@ select ('[1, "2", null]'::jsonb)['1'];
...
@@ -4822,10 +4822,10 @@ select ('[1, "2", null]'::jsonb)['1'];
(1 row)
(1 row)
select ('[1, "2", null]'::jsonb)[1.0];
select ('[1, "2", null]'::jsonb)[1.0];
ERROR: subscript type is not supported
ERROR: subscript type
numeric
is not supported
LINE 1: select ('[1, "2", null]'::jsonb)[1.0];
LINE 1: select ('[1, "2", null]'::jsonb)[1.0];
^
^
HINT:
Jsonb subscript must be coerced to either integer or text
HINT:
jsonb subscript must be coercible to either integer or text.
select ('[1, "2", null]'::jsonb)[2];
select ('[1, "2", null]'::jsonb)[2];
jsonb
jsonb
-------
-------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment