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

Remove const from get_foreign_key_list/get_parent_foreign_key_list by merging 10.11 to 11.2

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 11.2.6, 11.4.4
    • N/A
    • Data types
    • None

    Description

      MariaDB 11.4.4 is removed const from get_foreign_key_list/get_parent_foreign_key_list by merging 10.11 to 11.2.

      Addition const to get_foreign_key_list/get_parent_foreign_key_list committed https://github.com/MariaDB/server/commit/b3f988d2602d261aedeee63c0f5d8f3aba2ade5c#diff-1ce608c2a9731ad3adb799562b94ac165e3df6ca0b5e87cd61d6b9bbe1e06fc4R4434.

      However, MariaDB 11.4.4 is removed by https://github.com/MariaDB/server/commit/12a91b57e27b979819924cf89614e6e51f24b37b.

      Is it correct modification?

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            Seems it was correct. Reapplying the same original patch and compiling:

            home/dan/repos/mariadb-server-11.4/storage/innobase/handler/ha_innodb.cc:15529:29: error: cannot initialize a parameter of type 'THD *' with an lvalue of type 'const THD *'
             15529 |                                 f_key_info.set_nullable(thd, false, i,
                   |                                                         ^~~
            /home/dan/repos/mariadb-server-11.4/sql/table.h:2026:26: note: passing argument to parameter 'thd' here
             2026 |   void set_nullable(THD *thd, bool referenced,
                  |                          ^
            /home/dan/repos/mariadb-server-11.4/storage/innobase/handler/ha_innodb.cc:15540:29: error: cannot initialize a parameter of type 'THD *' with an lvalue of type 'const THD *'
             15540 |                                 f_key_info.set_nullable(thd, true, i,
                   |                                                         ^~~
            /home/dan/repos/mariadb-server-11.4/sql/table.h:2026:26: note: passing argument to parameter 'thd' here
             2026 |   void set_nullable(THD *thd, bool referenced,
                  |                          ^
            

            The set_nullable can call assign_nullable which ultimately allocated onto the mem_root of the THD which isn't const.

            danblack Daniel Black added a comment - Seems it was correct. Reapplying the same original patch and compiling: home/dan/repos/mariadb-server-11.4/storage/innobase/handler/ha_innodb.cc:15529:29: error: cannot initialize a parameter of type 'THD *' with an lvalue of type 'const THD *' 15529 | f_key_info.set_nullable(thd, false, i, | ^~~ /home/dan/repos/mariadb-server-11.4/sql/table.h:2026:26: note: passing argument to parameter 'thd' here 2026 | void set_nullable(THD *thd, bool referenced, | ^ /home/dan/repos/mariadb-server-11.4/storage/innobase/handler/ha_innodb.cc:15540:29: error: cannot initialize a parameter of type 'THD *' with an lvalue of type 'const THD *' 15540 | f_key_info.set_nullable(thd, true, i, | ^~~ /home/dan/repos/mariadb-server-11.4/sql/table.h:2026:26: note: passing argument to parameter 'thd' here 2026 | void set_nullable(THD *thd, bool referenced, | ^ The set_nullable can call assign_nullable which ultimately allocated onto the mem_root of the THD which isn't const.
            danblack Daniel Black added a comment -

            nikitamalyavin I assume if const is to be restored the innodb handling of FK nulls in MDEV-34392 would need to be moved.

            danblack Daniel Black added a comment - nikitamalyavin I assume if const is to be restored the innodb handling of FK nulls in MDEV-34392 would need to be moved.

            I see.

            I understand that https://github.com/MariaDB/server/commit/12a91b57e27b979819924cf89614e6e51f24b37b was correct by your comment.
            Thank you for your comment.

            komainu8 Horimoto Yasuhiro added a comment - I see. I understand that https://github.com/MariaDB/server/commit/12a91b57e27b979819924cf89614e6e51f24b37b was correct by your comment. Thank you for your comment.
            danblack Daniel Black added a comment -

            Thanks komainu8 for keeping an eye on changes. Its quite reassuring to know someone is watching

            danblack Daniel Black added a comment - Thanks komainu8 for keeping an eye on changes. Its quite reassuring to know someone is watching

            People

              nikitamalyavin Nikita Malyavin
              komainu8 Horimoto Yasuhiro
              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.