List:General Discussion« Previous MessageNext Message »
From:Gavin Towey Date:October 4 2010 8:22pm
Subject:RE: update and times
View as plain text  
Those unix_time values don't seem to correspond to the dates you have.

select NOW(), UNIX_TIMESTAMP(NOW());
+---------------------+-----------------------+
| NOW()               | UNIX_TIMESTAMP(NOW()) |
+---------------------+-----------------------+
| 2010-10-04 13:18:08 |            1286223488 |
+---------------------+-----------------------+

1286223428 vs 12862162510269684

Your value has far too many digits. That's also beyond the range of a 32 bit int.  Are you
using BIGINT, or VARCHAR?

I suspect the issues is due because of something different about the values you have in
your table.  Try posting the SHOW CREATE TABLE table \G output, and a sample INSERT
statement to populate the table.  That way someone can try to reproduce the behavior
you're seeing.




-----Original Message-----
From: kalin m [mailto:kalin@stripped]
Sent: Monday, October 04, 2010 1:11 PM
To: [MySQL]
Subject: update and times



hi all...

i'm doing tests with a table that gets updated based on random unix
times it contains. there is a column that has a bunch or random times
that look like:

+---------------------+-------------------+
 | date_time              | unix_time            |
+---------------------+-------------------+
 | 2010-10-01 10:24:52 | 12859430921341418 |
 | 2010-10-01 21:18:13 | 12859822937839442 |
 | 2010-10-01 16:08:00 | 12859636809115039 |
 | 2010-10-01 19:47:43 | 12859768633824661 |
 | 2010-10-01 16:48:30 | 12859661104829142 |
 | 2010-10-01 15:25:37 | 12859611374324533 |
 | 2010-10-01 12:27:28 | 12859504483288358 |
+---------------------+-------------------+


what i'm trying to do is update the column only of one of those times
isn't yet passed. and it works. except sometimes...

like these 2 unix times:

this was in the table under unix time: 12862162385941345...

this 12862162510269684 got passed in the update command as in:

update the_table set updated = 1 where unix_time < 12862162510269684
limit 1;

executing this query didn't update the record.

why?


thanks...



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1


This message contains confidential information and is intended only for the individual
named.  If you are not the named addressee, you are notified that reviewing,
disseminating, disclosing, copying or distributing this e-mail is strictly prohibited. 
Please notify the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed
to be secure or error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not
accept liability for any loss or damage caused by viruses or errors or omissions in the
contents of this message, which arise as a result of e-mail transmission. [FriendFinder
Networks, Inc., 220 Humbolt court, Sunnyvale, CA 94089, USA, FriendFinder.com
Thread
update and timeskalin m4 Oct
  • RE: update and timesGavin Towey4 Oct
    • Re: update and timeskalin m4 Oct
  • Re: update and timesSimcha Younger5 Oct
    • Re: update and timeskalin m6 Oct
      • Re: update and timesSimcha Younger7 Oct