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

REVERSE(0x...) returns inconsistent output in mysqltest vs MySQL server

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.6.24
    • 10.6
    • None
    • None

    Description

      mysqltest implicitly casts the binary result of REVERSE() to a numeric context, which interprets the reversed binary bytes as a number (0x563412 → 6403911).

      However MySQL server, treats the output as a binary string, displaying printable characters ('V', '4') and leaving non-printable bytes invisible.

      Test Case:

      let $rv45 = $(reverse(0x123456));
      -- echo reverse(0x123456) -> $rv45;
      

      Mysqltest output:

      worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029
      reverse(0x123456) -> 6403911;     
      main.rev                                 [ pass ]       
      

      Server output:

      MariaDB [(none)]> select reverse(0x123456);
      +-------------------+
      | reverse(0x123456) |
      +-------------------+
      | V4               |
      +-------------------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              poojalamba16 Pooja Rani Lamba
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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