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

Computed column names are limited to ASCII. Bug or feature?

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 10.3.12
    • N/A
    • None
    • Host: VMWare
      OS: Windows 10 Enterprise 64 bit v1809
      OS Build: 17763.253

      Mariadb: mysql Ver 15.1 Distrib 10.3.12-MariaDB, for Win64 (AMD64), source revision faf206a848684bc0f87c93a2b47a55063bbccc6c

    Description

      When column in a query is computed by a function and is not given an alias using "AS", the column name in the results is the text of the function invocation, as in-

      select count(*) from npu_codelist;
      +----------+
      | count(*) |
      +----------+
      |    26712 |
      +----------+
      1 row in set (0.017 sec)

      I have set my installation up (after many hours of trying) to be "unicode clean" top to bottom-

      show variables where variable_name like '%char%' or variable_name like '%coll%';
      +--------------------------+-----------------------------------------------+
      | Variable_name            | Value                                         |
      +--------------------------+-----------------------------------------------+
      | character_set_client     | utf8mb4                                       |
      | character_set_connection | utf8mb4                                       |
      | character_set_database   | utf8mb4                                       |
      | character_set_filesystem | binary                                        |
      | character_set_results    | utf8mb4                                       |
      | character_set_server     | utf8mb4                                       |
      | character_set_system     | utf8                                          |
      | character_sets_dir       | C:\Program Files\MariaDB 10.3\share\charsets\ |
      | collation_connection     | utf8mb4_general_ci                            |
      | collation_database       | utf8mb4_general_ci                            |
      | collation_server         | utf8mb4_general_ci                            |
      +--------------------------+-----------------------------------------------+
      11 rows in set (0.001 sec)

      However I note that computed column names seem to ignore the setting of character_set_results as regards column names, these are always transformed to ASCII-

      select replace('µm', 'µ', 'm');
      +-------------------------+
      | replace('?m', '?', 'm') |
      +-------------------------+
      | mm                      |
      +-------------------------+
       
      MariaDB [uom]> select replace('µm', 'm', 'L');
      +-------------------------+
      | replace('?m', 'm', 'L') |
      +-------------------------+
      | µL                       |
      +-------------------------+

      This is not desirable behaviour, because it means the meaning of the results column is ambiguous. However is it expected behaviour?

      Attachments

        Issue Links

          Activity

            Hi, which client are you using? Is it command line "mysql.exe", or something else?

            bar Alexander Barkov added a comment - Hi, which client are you using? Is it command line "mysql.exe", or something else?
            incansvl VL Incans added a comment -

            I'm using the standard mysql.exe client from the distribution.

            incansvl VL Incans added a comment - I'm using the standard mysql.exe client from the distribution.

            mysql.exe is currently not Unicode aware and is limited to the ANSI code page, which is cp850 on a Western machine.
            Try "mysql.exe --default-character-set=cp850", or configure it in my.cnf.

            Note, there is MDEV-16221 to make mysql.exe Unicode aware.

            bar Alexander Barkov added a comment - mysql.exe is currently not Unicode aware and is limited to the ANSI code page, which is cp850 on a Western machine. Try "mysql.exe --default-character-set=cp850", or configure it in my.cnf. Note, there is MDEV-16221 to make mysql.exe Unicode aware.
            incansvl VL Incans added a comment -

            I spent quite a bit of time grappling with the setup to get it to work with UTF-8 for data and queries, so I'm running the client in a codepage 65001 (Unicode) cmdtool. An ASCII-only client tool is a problem.

            I guess I need to vote-up MDEV-16221

            Thanks for the reply.

            incansvl VL Incans added a comment - I spent quite a bit of time grappling with the setup to get it to work with UTF-8 for data and queries, so I'm running the client in a codepage 65001 (Unicode) cmdtool. An ASCII-only client tool is a problem. I guess I need to vote-up MDEV-16221 Thanks for the reply.

            People

              bar Alexander Barkov
              incansvl VL Incans
              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.