MariaDB Development
  1. MariaDB Development
  2. MDEV-4843

Wrong data type for TIMESTAMP('2001-01-01','10:10:10')

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.3, 5.5.32, 5.3.12
    • Fix Version/s: 10.0.5, 5.5.33, 5.3.13
    • Labels:
      None
    • Global Rank:
      3403

      Description

      This script

      drop table if exists t1;
      create table t1 as  select timestamp('2001-01-01','10:10:10') as a;
      show columns from t1;
      

      creates a VARCHAR(26) column:

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

      The expected result is a DATETIME column.

      Note: MySQL-5.6 correctly creates a DATETIME column in this scenario.

        Issue Links

          Activity

          Hide
          Alexander Barkov added a comment -

          This problem should be fixed after MDEV-4724, to avoid a field of type TIME(6)
          being always created, even with a smaller number of fractional digits.

          Show
          Alexander Barkov added a comment - This problem should be fixed after MDEV-4724 , to avoid a field of type TIME(6) being always created, even with a smaller number of fractional digits.
          Hide
          Alexander Barkov added a comment -

          Fixed in 5.3.13 and 5.5.53

          Show
          Alexander Barkov added a comment - Fixed in 5.3.13 and 5.5.53

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 minutes
                7m