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

Wrong metadata for DATE_ADD('string', INVERVAL)

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.4
    • None
    • None
    • None

    Description

      CREATE TABLE t1 AS SELECT DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE) AS a;
      SHOW COLUMNS FROM t1;

      correctly reports a VARCHAR column:

      +-------+-------------+------+-----+---------+-------+
      | Field | Type        | Null | Key | Default | Extra |
      +-------+-------------+------+-----+---------+-------+
      | a     | varchar(26) | YES  |     | NULL    |       |
      +-------+-------------+------+-----+---------+-------+

      But "mysql --column-type-info" reports a wrong result:

      $ mysql --column-type-info
       
      MariaDB [(none)]> SELECT DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE);
      Field   1:  `DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE)`
      Type:       STRING
      Collation:  binary (63)
      Length:     26
      Max_length: 19
      Decimals:   31
      Flags:      BINARY 
      +----------------------------------------------------+
      | DATE_ADD('2011-01-02 12:13:14', INTERVAL 1 MINUTE) |
      +----------------------------------------------------+
      | 2011-01-02 12:14:14                                |
      +----------------------------------------------------+

      Notice, collation binary(63), which implies a VARBINARY column type,
      and which is wrong.

      MySQL-5.6 in the same scenario returns "Collation: utf8_general_ci (33)",
      which looks correct and corresponds to the connection character set ut8.

      Attachments

        Activity

          The problem seems to be fixed by some earlier change
          and is not reproducible any longer.
          Only adding a test case into func_time.test.

          bar Alexander Barkov added a comment - The problem seems to be fixed by some earlier change and is not reproducible any longer. Only adding a test case into func_time.test.

          People

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