mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Provide an error cursor for "can't subscript" error messages.
Commit c7aba7c14
didn't add this, but after more fooling with the
feature I feel that it'd be useful. To make this possible, refactor
getSubscriptingRoutines() so that the caller is responsible for
throwing any error. (In clauses.c, I just chose to make the
most conservative assumption rather than throwing an error. We don't
expect failures there anyway really, so the code space for an error
message would be a poor investment.)
This commit is contained in:
@ -848,7 +848,7 @@ contain_nonstrict_functions_walker(Node *node, void *context)
|
||||
return true;
|
||||
/* Otherwise we must look up the subscripting support methods */
|
||||
sbsroutines = getSubscriptingRoutines(sbsref->refcontainertype, NULL);
|
||||
if (!sbsroutines->fetch_strict)
|
||||
if (!(sbsroutines && sbsroutines->fetch_strict))
|
||||
return true;
|
||||
/* else fall through to check args */
|
||||
}
|
||||
@ -1144,7 +1144,8 @@ contain_leaked_vars_walker(Node *node, void *context)
|
||||
/* Consult the subscripting support method info */
|
||||
sbsroutines = getSubscriptingRoutines(sbsref->refcontainertype,
|
||||
NULL);
|
||||
if (!(sbsref->refassgnexpr != NULL ?
|
||||
if (!sbsroutines ||
|
||||
!(sbsref->refassgnexpr != NULL ?
|
||||
sbsroutines->store_leakproof :
|
||||
sbsroutines->fetch_leakproof))
|
||||
{
|
||||
|
Reference in New Issue
Block a user