mysqlguy.net

Reply to comment

 Hi,CREATED, LAST_ALTERED,

 Hi,
CREATED, LAST_ALTERED, are in your local timezone, actually the SYSTEM TZ of the server.
OTOH, STARTS, ENDS, LAST_EXECUTED are always UTC and then the `time_zone` field will be used to start them at the right time.
Here is what happened here:
- I createad an event with scheduler enabled
- Then I shut mysqld down
- day++ and let the clock be few minutes earlier
- Started the server and enabled the scheduler
- Waited till the event got exexucuted again

Here is what I had in mysql.event :
- After the first execution
                  db: test
                name: xyz
                body: select 1
             definer: root@localhost
          execute_at: NULL
      interval_value: 1
      interval_field: DAY
             created: 2008-02-14 18:25:01
            modified: 2008-02-14 18:25:01
       last_executed: 2008-02-14 16:25:01
              starts: 2008-02-14 16:25:01
                ends: NULL
              status: ENABLED
       on_completion: DROP
            sql_mode:
             comment:
          originator: 0
           time_zone: SYSTEM
- After the second execution:
                  db: test
                name: xyz
                body: select 1
             definer: root@localhost
          execute_at: NULL
      interval_value: 1
      interval_field: DAY
             created: 2008-02-14 18:25:01
            modified: 2008-02-14 18:25:01
       last_executed: 2008-02-15 16:25:01
              starts: 2008-02-14 16:25:01
                ends: NULL
              status: ENABLED
       on_completion: DROP
            sql_mode:
             comment:
          originator: 0
           time_zone: SYSTEM

My timezone is EET (UTC+2)
mysql> show variables like 'system_time_zone';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| system_time_zone | EET   |
+------------------+-------+
1 row in set (0.00 sec)


created + modified are local, last_executed and starts are UTC (use the internal THD::

Were there any changes to the server configuration? Time switch?
If the docs are not clear let me state something else again - the events are not guaranteed to execute at the same time scheduler - like if scheduled at 12:01:02 the event might be started at 12:01:03  - few secs difference can happen. Kernel scheduling or server load can lead to it. To be safe schedule few secs or a minute before the time you want and then create the appropriate partition. Another event should do something with the old partition, if needed.

You might also drop me an email with your findings.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

MySQL

Yahoo

Recent comments

About Me

Jay Janssen
Yahoo!, Inc.
jayj at yahoo dash inc dot com

MySQL
High Availability
Global Load Balancing
Failover

View Jay Janssen's LinkedIn profileView Jay Janssen's Facebook profile

User login

Friends

  • Super Geeky: Removing Subversion files from a directory with Windows Powershell
  • Sliding content from a partial height with jQuery.
  • Accessing Google Spreadsheet with PHP

Links