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

select '123' 'x'; unexpected result

    XMLWordPrintable

Details

    Description

      SELECT 123 AS x is the same as SELECT 123 x. Extending to strings, SELECT '123' AS 'x' gives:

      MariaDB [test]> SELECT '123' AS 'x';
      +-----+
      | x   |
      +-----+
      | 123 |
      +-----+
      1 row in set (0.000 sec)
      

      Which is what one would expect.
      However, SELECT '123' 'x' yields an unexpected result:

      MariaDB [test]> SELECT '123' 'x';
      +------+
      | 123  |
      +------+
      | 123x |
      +------+
      1 row in set (0.001 sec)
      

      In the last example, the column name should match the returned value (123x or similar).

      Attachments

        Activity

          People

            Gosselin Dave Gosselin
            Gosselin Dave Gosselin
            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.