Details

    Description

      MySQL 5.5.36 has a fix for Bug#12368495 CRASH AND/OR VALGRIND ERRORS WITH REVERSE FUNCTION AND CHARSET CONVERTS

      As usual, there is no test case.

      The patch adds an assert to Item_func_reverse::val_str() (which, apparently, was the reason of a crash in the first place) and changes Item_func_trim::val_str() to check (and re-check, inside a trimming loop!) multi-byte characters of the prefix.

      It is very suspicious, though, that the patch fixes only Item_func_trim::val_str(), but not the completely identical Item_func_ltrim::val_str().


      Analysis revealed that:
      1. the bug is not completely fixed, using TRIM(LEADING ...) instead of TRIM(BOTH ...) hits the unfixed Item_func_ltrim::val_str() and the bug reappears.
      2. Item_func_reverse::val_str() fails, because it relies on my_ismbchar(), but for ucs2 and utf32 this returns a value outside of the string boundary, it's a bug in ismbchar(), not in REVERSE(). This must be fixed.
      3. TRIM returns invalid string because it doesn't set the charset of the returned string correctly. This must be fixed.
      4. upstream patch should be removed.
      5. it's interesting to see whether one can hit this issue in REVERSE() without using TRIM().
      6. additionally we found an inconsistency in how item_sep is used in my_coll_agg_error() and agg_item_collations(). This should be resolved too.

      Attachments

        Activity

          Transition Time In Source Status Execution Times
          Alexander Barkov made transition -
          Open In Progress
          148d 21h 47m 1
          Sergei Golubchik made transition -
          In Progress In Review
          8h 46m 1
          Sergei Golubchik made transition -
          In Review Stalled
          6h 33m 1
          Alexander Barkov made transition -
          Stalled Closed
          2d 10h 9m 1

          People

            bar Alexander Barkov
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.