Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8228

Move Item_func_like out of Item_bool_func2

Details

    Description

      Item_func_like is erroneously inherited from Item_bool_func2.
      Unlike the other Item_bool_func2, Item_func_like:

      • does not need Arg_comparator
      • does not need abort_on_null, as we don't support LIKE for rows: (x1,y1,z1) LIKE (x2,y2,z2)

      Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

      See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.

      Derive Item_func_like directly from Item_bool_func.

      Another option would be to move Arg_comparator from Item_bool_func2 to Item_bool_rowready_func2.

      Attachments

        Activity

          bar Alexander Barkov created issue -
          bar Alexander Barkov made changes -
          Field Original Value New Value
          Description Item_func_like is erroneously inherited from Item_bool_func2.
          Unlike the other Item_bool_func2, Item_func_like does not need Arg_comparator.

          Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

          See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.
          Item_func_like is erroneously inherited from Item_bool_func2.
          Unlike the other Item_bool_func2, Item_func_like does not need Arg_comparator.

          Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

          See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.

          Derive Item_func_like directly from Item_bool_func.
          bar Alexander Barkov made changes -
          Description Item_func_like is erroneously inherited from Item_bool_func2.
          Unlike the other Item_bool_func2, Item_func_like does not need Arg_comparator.

          Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

          See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.

          Derive Item_func_like directly from Item_bool_func.
          Item_func_like is erroneously inherited from Item_bool_func2.
          Unlike the other Item_bool_func2, Item_func_like:
          - does not need Arg_comparator
          - does not need abort_on_null, as we don't support LIKE for rows: (x1,y1,z1) LIKE (x2,y2,z2)

          Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

          See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.

          Derive Item_func_like directly from Item_bool_func.
          bar Alexander Barkov made changes -
          Description Item_func_like is erroneously inherited from Item_bool_func2.
          Unlike the other Item_bool_func2, Item_func_like:
          - does not need Arg_comparator
          - does not need abort_on_null, as we don't support LIKE for rows: (x1,y1,z1) LIKE (x2,y2,z2)

          Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

          See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.

          Derive Item_func_like directly from Item_bool_func.
          Item_func_like is erroneously inherited from Item_bool_func2.
          Unlike the other Item_bool_func2, Item_func_like:
          - does not need Arg_comparator
          - does not need abort_on_null, as we don't support LIKE for rows: (x1,y1,z1) LIKE (x2,y2,z2)

          Wrong inheritance needs excessive casts and functype() calls and potentially more buggy.

          See MDEV-8222 as an example of a bug introduced because of this wrong inheritance.

          Derive Item_func_like directly from Item_bool_func.

          Another option would be to move Arg_comparator from Item_bool_func2 to Item_bool_rowready_func2.

          It turned out that the goal of this task was reached by a few of earlier 10.1 patches, using the second alternative.

          • Arg_comparator was moved from Item_bool_func2 to Item_bool_rowready_func2
          • abort_on_null was moved from Item_bool_func2 to Item_func_eq

          Now Item_func_like does not have unused members. No other coding is needed.

          bar Alexander Barkov added a comment - It turned out that the goal of this task was reached by a few of earlier 10.1 patches, using the second alternative. Arg_comparator was moved from Item_bool_func2 to Item_bool_rowready_func2 abort_on_null was moved from Item_bool_func2 to Item_func_eq Now Item_func_like does not have unused members. No other coding is needed.
          bar Alexander Barkov made changes -
          Fix Version/s 10.0.6 [ 13202 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          bar Alexander Barkov made changes -
          Labels refactoring unused-code
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 67714 ] MariaDB v4 [ 132623 ]

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.