Remove unused argument "isSlice" from transformAssignmentSubscripts()
authorMichael Paquier <michael@paquier.xyz>
Sun, 18 Sep 2022 06:33:16 +0000 (15:33 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sun, 18 Sep 2022 06:33:16 +0000 (15:33 +0900)
Since c7aba7c, the transform method used during parse analysis of a
subcripting construct has moved from transformAssignmentSubscripts() to
the per-type transform method (arrays or arbitrary types) the step that
checks for slicing support, but transformAssignmentSubscripts() has kept
traces of it.  Removing it simplifies the code, so let's clean up all
that.

Author: Zhang Mingli
Reviewed-by: Richard Guo
Discussion: https://postgr.es/m/0d7041ac-c704-48ad-86fd-e05feddf08ed@Spark

src/backend/parser/parse_target.c

index 4e1593d9008293ccad692853f78cc2c9e014e447..bd8057bc3e747d52cb213b8c7bc6a3cd6cef43a2 100644 (file)
@@ -41,7 +41,6 @@ static Node *transformAssignmentSubscripts(ParseState *pstate,
                                           int32 targetTypMod,
                                           Oid targetCollation,
                                           List *subscripts,
-                                          bool isSlice,
                                           List *indirection,
                                           ListCell *next_indirection,
                                           Node *rhs,
@@ -697,7 +696,6 @@ transformAssignmentIndirection(ParseState *pstate,
 {
    Node       *result;
    List       *subscripts = NIL;
-   bool        isSlice = false;
    ListCell   *i;
 
    if (indirection_cell && !basenode)
@@ -727,11 +725,7 @@ transformAssignmentIndirection(ParseState *pstate,
        Node       *n = lfirst(i);
 
        if (IsA(n, A_Indices))
-       {
            subscripts = lappend(subscripts, n);
-           if (((A_Indices *) n)->is_slice)
-               isSlice = true;
-       }
        else if (IsA(n, A_Star))
        {
            ereport(ERROR,
@@ -763,7 +757,6 @@ transformAssignmentIndirection(ParseState *pstate,
                                                     targetTypMod,
                                                     targetCollation,
                                                     subscripts,
-                                                    isSlice,
                                                     indirection,
                                                     i,
                                                     rhs,
@@ -853,7 +846,6 @@ transformAssignmentIndirection(ParseState *pstate,
                                             targetTypMod,
                                             targetCollation,
                                             subscripts,
-                                            isSlice,
                                             indirection,
                                             NULL,
                                             rhs,
@@ -907,7 +899,6 @@ transformAssignmentSubscripts(ParseState *pstate,
                              int32 targetTypMod,
                              Oid targetCollation,
                              List *subscripts,
-                             bool isSlice,
                              List *indirection,
                              ListCell *next_indirection,
                              Node *rhs,