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

Data type of @a:=1e0 depends on the session character set

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1(EOL), 10.2(EOL), 10.3(EOL)
    • 10.3.1
    • OTHER

    Description

      I start mysql --column-type-info test and run this script:

      SET NAMES latin1;
      CREATE OR REPLACE TABLE t1 AS SELECT @:=1e0;
      SELECT * FROM t1;
      

      It reports the following metadata:

      Field   1:  `@:=1e0`
      Type:       DOUBLE
      Collation:  binary (63)
      Length:     3
      Max_length: 1
      Decimals:   31
      

      Now I run the same script, with latin1 changed to utf8:

      SET NAMES utf8;
      CREATE OR REPLACE TABLE t1 AS SELECT @:=1e0;
      SELECT * FROM t1;
      

      Metadata changes to:

      Field   1:  `@:=1e0`
      Type:       DOUBLE
      Collation:  binary (63)
      Length:     9
      Max_length: 1
      Decimals:   31
      

      Notice, it reports length as 3 and 9 for latin1 and utf8 session character sets respectively.
      Looks wrong. It should not depent on the session character set.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.