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

Microseconds precision is allowed to contain a decimal point

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Won't Fix
    • 5.5.25
    • 5.5.31
    • None
    • None

    Description

      I presume it affects 5.3 too, but I didn't check. In any case, I am not sure it's worth changing, since no harm is done, but it differs from the doc (https://kb.askmonty.org/en/microseconds-in-mariadb/) which says that the precision is an INTEGER number, so I thought it makes sense to check.

      Normally the syntax for microseconds precision doesn't allow anything but digits, but it makes an exception for a decimal points. A precision value with a fractional part is truncated.

      create table t1 (f time(5.8));
      # Query OK, 0 rows affected (0.14 sec)
       
      show create table t1;
      # +-------+---------------------------------------------------------------------------------------+
      # | Table | Create Table                                                                          |
      # +-------+---------------------------------------------------------------------------------------+
      # | t1    | CREATE TABLE `t1` (
      #   `f` time(5) DEFAULT NULL
      # ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      # +-------+---------------------------------------------------------------------------------------+
       
      select cast('12:12:12.12' as time(0.5));
      # +----------------------------------+
      # | cast('12:12:12.12' as time(0.5)) |
      # +----------------------------------+
      # | 12:12:12                         |
      # +----------------------------------+

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            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.