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

LPAD/RPAD with an empty padstr return NULL (MySQL returns the original string)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.11, 11.4, 11.8, 12.3, 13.0, 13.1
    • N/A
    • Data types
    • Not for Release Notes

    Description

      SELECT LPAD('abc', 10, ''), RPAD('abc', 10, '');
      – MariaDB: NULL NULL <-- empty padstr makes the whole function NULL
      – MySQL: abc abc <-- returns the original string when padding is impossible/unneeded
      SELECT LPAD('abc', 3, '') AS l2; – length already satisfied, no pad needed at all:
      – MariaDB: NULL MySQL: abc

      Attachments

        Activity

          People

            raghunandan.bhat Raghunandan Bhat
            chunlingqin chunlingqin
            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.