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

Replace member Item::fixed to virtual method is_fixed()

Details

    Description

      Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

      This includes (list#1):

      • Item_basic_constant
      • Item_param (it still can change its Item::type() when the exact value is bound, but does not really need Item::fixed)
      • Item_ident_for_show
      • Item_copy
      • Item_type_holder
      • Item_sum_field
      • Item_proc

      Items that need Item::fixed are limited only to (list#2):

      • Item_user_var_as_out_param
      • Item_sp_variable
      • Item_name_const
      • Item_result_field

      Under terms of this task we'll create a common parent Item_fixed_hybrid, move items from list#2 into it, and introduce a virtual method Item::is_fixed() as a replacement for the member Item::fixed.

      The top level Item::is_fixed() will return true by default, which will cover list#1.

      Rationale:

      • Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
      • Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
      • Preparation to MDEV-14630, to make its patch easier.

      Additionally, at once we'll collect all literals under a new class Item_literal:

      • Item_num
      • Item_string
      • Item_hex_constant
      • Item_temporal_literal

      They now have some duplicate code. Also, a separate pointer type Item_literal* will be useful for the data type API.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Description Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            bar Alexander Barkov made changes -
            Description Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.
            bar Alexander Barkov made changes -
            Description Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.
            Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.

            Also, at once we'll collect all literals under a new class {{Item_literal}}:
            - Item_num
            - Item_string
            - Item_hex_constant
            - Item_temporal_literal
            They now have some duplicate code. Also, a separate pointer type {{Item_literal*}} will be useful for the data type API.

            bar Alexander Barkov made changes -
            Description Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.

            Also, at once we'll collect all literals under a new class {{Item_literal}}:
            - Item_num
            - Item_string
            - Item_hex_constant
            - Item_temporal_literal
            They now have some duplicate code. Also, a separate pointer type {{Item_literal*}} will be useful for the data type API.

            Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.

            Additionally, at once we'll collect all literals under a new class {{Item_literal}}:
            - Item_num
            - Item_string
            - Item_hex_constant
            - Item_temporal_literal

            They now have some duplicate code. Also, a separate pointer type {{Item_literal*}} will be useful for the data type API.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Description Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type(), but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.

            Additionally, at once we'll collect all literals under a new class {{Item_literal}}:
            - Item_num
            - Item_string
            - Item_hex_constant
            - Item_temporal_literal

            They now have some duplicate code. Also, a separate pointer type {{Item_literal*}} will be useful for the data type API.
            Many Item descendants do not really need Item::fixed, because they get fixed at constructor call time.

            This includes (list#1):
            - Item_basic_constant
            - Item_param (it still can change its Item::type() when the exact value is bound, but does not really need Item::fixed)
            - Item_ident_for_show
            - Item_copy
            - Item_type_holder
            - Item_sum_field
            - Item_proc


            Items that need Item::fixed are limited only to (list#2):

            - Item_user_var_as_out_param
            - Item_sp_variable
            - Item_name_const
            - Item_result_field

            Under terms of this task we'll create a common parent {{Item_fixed_hybrid}}, move items from {{list#2}} into it, and introduce a virtual method {{Item::is_fixed()}} as a replacement for the member {{Item::fixed}}.

            The top level Item::is_fixed() will return {{true}} by default, which will cover list#1.

            Rationale:
            - Simplify simple items (like literals) as much as possible and reduce their size gradually. This will make it easier to create Item_cache and Item_basic_constant (for literals) for new data types.
            - Simplify the code for Item_param, which now has to maintain three things in sync: state, item_type, fixed. After this change there will be only state and item_time (and the latter will be gone after MDEV-14630).
            - Preparation to MDEV-14630, to make its patch easier.

            Additionally, at once we'll collect all literals under a new class {{Item_literal}}:
            - Item_num
            - Item_string
            - Item_hex_constant
            - Item_temporal_literal

            They now have some duplicate code. Also, a separate pointer type {{Item_literal*}} will be useful for the data type API.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2018-06-06 10:12:27.0 2018-06-06 10:12:27.253
            bar Alexander Barkov made changes -
            Fix Version/s 10.4.0 [ 23115 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 87668 ] MariaDB v4 [ 133572 ]

            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.