Description:
1) I create database and tables in database.
2) I backup the database and check the current time
3) I drop database and perform restore .
4) I check the current time after performing restore in every 2 to 5 minute interval and the time doesn't change and becomes stagnant.
How to repeat:
mysql> create database event;
Query OK, 1 row affected (0.00 sec)
mysql> use event;
Database changed
mysql> set time_zone='+0:00';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | GMT |
| time_zone | +00:00 |
+------------------+--------+
2 rows in set (0.01 sec)
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-04-03 15:35:31 |
+---------------------+
1 row in set (0.00 sec)
mysql> create table t1(name varchar(10), start timestamp default 0);
Query OK, 0 rows affected (0.04 sec)
mysql> insert into t1 values('aa','2008-04-03 10:37:34');
Query OK, 1 row affected (0.00 sec)
mysql> select * from t1;
+------+---------------------+
| name | start |
+------+---------------------+
| aa | 2008-04-03 10:37:34 |
+------+---------------------+
1 row in set (0.00 sec)
mysql> backup database event to '/data2/heman/backup_dmp/events/event';
+-----------+
| backup_id |
+-----------+
| 1 |
+-----------+
1 row in set (0.08 sec)
After backup checking the current time.
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-04-03 15:38:23 |
+---------------------+
1 row in set (0.01 sec)
mysql> drop database event;
Query OK, 1 row affected (0.00 sec)
After dropping checking the time ,shows the correct time
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-04-03 15:38:40 |
+---------------------+
1 row in set (0.00 sec)
mysql> restore from '/data2/heman/backup_dmp/events/event';
+-----------+
| backup_id |
+-----------+
| 3 |
+-----------+
1 row in set (0.08 sec)
mysql> select * from t1;
+------+---------------------+
| name | start |
+------+---------------------+
| aa | 2008-04-03 10:37:34 |
+------+---------------------+
1 row in set (0.01 sec)
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-04-03 15:40:50 |
+---------------------+
1 row in set (0.00 sec)
Checking time after 2 minute interval, still shows the same time when restore got completed.
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-04-03 15:40:50 |
+---------------------+
1 row in set (0.00 sec)
checking time after 5 minute interval, shows the same time.
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-04-03 15:40:50 |
+---------------------+
1 row in set (0.00 sec)
mysql> select localtime();
+---------------------+
| localtime() |
+---------------------+
| 2008-04-03 15:40:50 |
+---------------------+
1 row in set (0.01 sec)
mysql> select curtime();
+-----------+
| curtime() |
+-----------+
| 15:40:50 |
+-----------+
1 row in set (0.00 sec)