Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.10, 5.5.36, 5.3.12
    • Fix Version/s: 10.0.12, 5.5.38
    • Labels:
      None
    • Global Rank:
      3433

      Description

      CURRENT_TIME is limited to positive time in the range
      from 00:00:00 to 23:59:59. So it should be enough 8 characters
      to store it. However, it uses 10 characters in MariaDB-10.0.

      For this script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 AS SELECT CONCAT(CURRENT_TIME());
      SHOW COLUMNS FROM t1;
      

      MariaDB 5.1 and 5.3 correctly returned length 8
      (but wrong data type varbinary).

      +------------------------+--------------+------+-----+---------+-------+
      | Field                  | Type         | Null | Key | Default | Extra |
      +------------------------+--------------+------+-----+---------+-------+
      | CONCAT(CURRENT_TIME()) | varbinary(8) | NO   |     |         |       |
      +------------------------+--------------+------+-----+---------+-------+
      

      MariaDB 5.5 and 10.0 return wrong length (but correct data type varchar):

      +------------------------+-------------+------+-----+---------+-------+
      | Field                  | Type        | Null | Key | Default | Extra |
      +------------------------+-------------+------+-----+---------+-------+
      | CONCAT(CURRENT_TIME()) | varchar(10) | NO   |     |         |       |
      +------------------------+-------------+------+-----+---------+-------+
      

      MySQL 5.5 and 5.6 return both type and length correctly:

      MySQL-5.5 and MySQL-5.6
      +------------------------+------------+------+-----+---------+-------+
      | Field                  | Type       | Null | Key | Default | Extra |
      +------------------------+------------+------+-----+---------+-------+
      | CONCAT(CURRENT_TIME()) | varchar(8) | NO   |     |         |       |
      +------------------------+------------+------+-----+---------+-------+
      

        Activity

        Hide
        Elena Stepanova added a comment -

        Actually, 5.1 and 5.2 return varbinary(8); 5.3 returns varbinary(10); 5.5 and 10.0 returns varchar(10).

        Show
        Elena Stepanova added a comment - Actually, 5.1 and 5.2 return varbinary(8); 5.3 returns varbinary(10); 5.5 and 10.0 returns varchar(10).

          People

          • Assignee:
            Alexander Barkov
            Reporter:
            Alexander Barkov
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: