List:General Discussion« Previous MessageNext Message »
From:Eric Bergen Date:June 27 2013 1:34am
Subject:Re: NOW() is stuck...
View as plain text  
This is the expected behavior if you set the timestamp variable in
your session. This is the same mechanism that replication uses to
execute transactions on the slave with the correct time. Setting
timestamp back to default or reopening your connection will fix it.

MariaDB [(none)]> set timestamp=1372296737;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> select now(); select sleep(5); select now();
+---------------------+
| now()               |
+---------------------+
| 2013-06-26 21:32:17 |
+---------------------+
1 row in set (0.00 sec)

+----------+
| sleep(5) |
+----------+
|        0 |
+----------+
1 row in set (5.00 sec)

+---------------------+
| now()               |
+---------------------+
| 2013-06-26 21:32:17 |
+---------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> set timestamp=default;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> select now();
+---------------------+
| now()               |
+---------------------+
| 2013-06-26 21:33:53 |
+---------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> select now();
+---------------------+
| now()               |
+---------------------+
| 2013-06-26 21:33:54 |
+---------------------+
1 row in set (0.00 sec)

On Wed, Jun 26, 2013 at 4:18 PM, John Meyer
<johnmeyer@stripped> wrote:
> Well, if you want to get unstuck in time, maybe you need to call Billy
> Pilgrim ;-)
>
> Andy Wallace wrote:
>>
>> We've been having some issues with one of our MySQL servers lately, and
>> currently
>> the dang thing is "stuck". For at least the last hour, NOW() is returning
>> the same
>> value:
>>
>> mysql> select now();
>> +---------------------+
>> | now()               |
>> +---------------------+
>> | 2013-06-26 02:27:14 |
>> +---------------------+
>>
>> The system variable "timestamp" also has that same time value stored in
>> it. How
>> can we kick this loose so that the values are more current with real time?
>> (it is
>> currently 3:08PM here, despite our MySQL instance thinking it's 2am. The
>> system
>> time on the machine is correct:
>>
>> $ date
>> Wed Jun 26 15:08:56 PDT 2013
>>
>>
>> This is MySQL 5.1.46 running on solaris2.10.
>>
>> Any ideas short of restarting the MySQL engine? I'm willing to do that,
>> but would much
>> rather wait and not do it in the middle of the day.
>>
>> Thanks,
>> Andy
>>
>>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
>



-- 
Eric Bergen
eric.bergen@stripped
http://www.ebergen.net
Thread
NOW() is stuck...Andy Wallace26 Jun
  • RE: NOW() is stuck...Rick James26 Jun
  • Re: NOW() is stuck...John Meyer26 Jun
    • Re: NOW() is stuck...Eric Bergen27 Jun
      • Re: NOW() is stuck...Andy Wallace27 Jun
        • Re: NOW() is stuck...Nick Khamis27 Jun
          • Re: NOW() is stuck...Andy Wallace27 Jun
  • Re: NOW() is stuck...Benjamin Stillman27 Jun
    • Re: NOW() is stuck...Andy Wallace27 Jun
      • Re: NOW() is stuck...Benjamin Stillman27 Jun
        • Re: NOW() is stuck...Andy Wallace27 Jun
          • Re: NOW() is stuck...Eric Bergen27 Jun
            • Re: NOW() is stuck...Andy Wallace27 Jun
          • Re: NOW() is stuck...Claudio Nanni27 Jun
            • Re: NOW() is stuck...Andy Wallace27 Jun
          • Re: NOW() is stuck...walter harms28 Jun
            • Re: NOW() is stuck...Andy Wallace28 Jun
              • Re: NOW() is stuck...Claudio Nanni28 Jun
Re: NOW() is stuck...Johan De Meersman27 Jun