On Friday 21 March 2003 11:13, Filip Rachunek wrote: > I have this problem with MySQL 4.0.12. When I run the following SQL query, > I get this result: > > mysql> select last_move_date_time, days_per_move, > (unix_timestamp(last_move_date > _time) + 7 * 24 * 60 * 60 - 1048188722) as time_left from two_player_game > where > id = 44970; > +---------------------+---------------+-----------+ > > | last_move_date_time | days_per_move | time_left | > > +---------------------+---------------+-----------+ > > | 2003-03-10 08:45:27 | 7 | -301595 | > > +---------------------+---------------+-----------+ > 1 row in set (0.00 sec) > > The result is correct, of course. But when I replace the "7" number by > "days_per_move" column [which contains the same value], it gives another > result for the "time_left" column: > > mysql> select last_move_date_time, days_per_move, > (unix_timestamp(last_move_date > _time) + days_per_move * 24 * 60 * 60 - 1048188722) as time_left from > two_player > _game where id = 44970; > +---------------------+---------------+----------------------+ > > | last_move_date_time | days_per_move | time_left | > > +---------------------+---------------+----------------------+ > > | 2003-03-10 08:45:27 | 7 | 18446744073709250021 | > > +---------------------+---------------+----------------------+ > 1 row in set (0.00 sec) > > I have no such problem on MySQL 3.23.53, in both cases I get the same > result. Is it a MySQL 4.x.x bug? And what can I do to avoid it in the > future?
Is days_per_move have UNSIGNED? If so the result will be UNSIGNED, too. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php