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

RPAD result varies on row order

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5.17, 11.0.1, 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.6(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 12.2(EOL)
    • 10.6.26, 10.11.17, 11.4.11, 11.8.7, 12.3.2
    • Server
    • Not for Release Notes

    Description

      RPAD result incorrect on following first example. Desired result on the second run wher result order different.

      Server version: 11.0.1-MariaDB-1:11.0.1+maria~ubu2204 mariadb.org binary distribution
       
      MariaDB [beta]> select rpad('zzz',length(a),'*'),a
          ->   from (
          ->   select 'a' a union select 'bb' union select 'cccc'
          -> ) as a
          -> order by a
          -> ;
      +---------------------------+------+
      | rpad('zzz',length(a),'*') | a    |
      +---------------------------+------+
      | z                         | a    |
      | z*                        | bb   |
      | z***                      | cccc |
      +---------------------------+------+
      3 rows in set (0.001 sec)
       
      MariaDB [beta]> select rpad('zzz',length(a),'*'),a
          ->   from (
          ->   select 'a' a union select 'bb' union select 'cccc'
      ;    -> ) as a
          -> order by a desc
          -> ;
      +---------------------------+------+
      | rpad('zzz',length(a),'*') | a    |
      +---------------------------+------+
      | zzz*                      | cccc |
      | zz                        | bb   |
      | z                         | a    |
      +---------------------------+------+
      3 rows in set (0.001 sec)

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              rafu Timo Raitalaakso
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.