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

Aria storage engine uses sizeof(ft_boolean_syntax) as a replacement for strlen() but "ft_boolean_syntax" has "const char *" type.

Details

    Description

      Code in maria_ft_boolean_check_syntax_string() uses sizeof(ft_boolean_syntax), most probably to compute its length. It made sense at the time that code was written, since ft_boolean_syntax had char[15] type. Then at some point type of ft_boolean_syntax was changed to const char *, but maria_ft_boolean_check_syntax_string() still uses sizeof(ft_boolean_syntax).

      The issue is trivial, since maria_ft_boolean_check_syntax_string() function is not used anywhere.

      Attachments

        Activity

          robertbindar Robert Bindar added a comment - - edited

          Hi rinat.ibragimov, there is a PR opened that fixes this issue. Do you mind sharing how you got to see this problem? Did the compiler issue a warning?

          robertbindar Robert Bindar added a comment - - edited Hi rinat.ibragimov , there is a PR opened that fixes this issue. Do you mind sharing how you got to see this problem? Did the compiler issue a warning?

          I was working on a n-gram full-text parser plugin, and during debugging phase visually inspected code parts related to full-text search. So merely by chance.

          rinat.ibragimov Rinat Ibragimov (Inactive) added a comment - I was working on a n-gram full-text parser plugin, and during debugging phase visually inspected code parts related to full-text search. So merely by chance.
          robertbindar Robert Bindar added a comment -

          Hehe, changes were in your favour then, thanks for sharing the story rinat.ibragimov

          robertbindar Robert Bindar added a comment - Hehe, changes were in your favour then, thanks for sharing the story rinat.ibragimov
          robertbindar Robert Bindar added a comment -

          Pull Request merged, thanks rinat.ibragimov for the help on this!

          robertbindar Robert Bindar added a comment - Pull Request merged, thanks rinat.ibragimov for the help on this!

          People

            robertbindar Robert Bindar
            rinat.ibragimov Rinat Ibragimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.