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

In trigger's CREATED time microseconds are misinterpreted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: N/A
    • Component/s: Triggers
    • Labels:
      None

      Description

      use test;
      drop table if exists t1;
      create table t1 (i int);
       
      SET TIMESTAMP=UNIX_TIMESTAMP('2016-01-01 10:10:10.33');
      select now(2);
      create or replace trigger tr1 after insert on t1 for each row set @a=@a+1;
       
      SET TIMESTAMP=UNIX_TIMESTAMP('2016-01-01 10:10:10.99');
      select now(2);
      create or replace trigger tr2 after insert on t1 for each row set @a=@a+1;
       
      select now(2);
      select trigger_name, action_order, created from information_schema.triggers 
        where event_object_table = 't1' and trigger_schema='test';
        
      drop table t1;
      

      MariaDB [test]> select trigger_name, action_order, created from information_schema.triggers 
          ->   where event_object_table = 't1' and trigger_schema='test';
      +--------------+--------------+------------------------+
      | trigger_name | action_order | created                |
      +--------------+--------------+------------------------+
      | tr1          |            1 | 2016-01-01 10:10:13.30 |
      | tr2          |            2 | 2016-01-01 10:10:19.90 |
      +--------------+--------------+------------------------+
      

      It looks like microseconds are shifted one position left.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              monty Michael Widenius
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: