>Description:
When attempting to select rows periodically (as in scheduling) the
INTERVAL function will round the parts of an expression before doing
the calculation of the expression. For example:
now() - INTERVAL 0.1*60 MINUTE == now()
The correct result would be a difference of six minutes! While
this can be corrected if manually entering values, if the 0.1 in
the above example comes from a table column you cannot. Yes, the
system could have been designed to operate in non-fractional minutes
but hours were more convenient.
>How-To-Repeat:
select now(), now() - interval (0.1*60) minute;
>Fix:
Perhaps change the order of operations within the INTERVAL processing
so that a fractional formula is calculated BEFORE rounding the values
in the formula.
>Submitter-Id: n/a
>Originator: Andrew Smith
>Organization: Technotopia
>MySQL support: none
>Synopsis: interval calculation problem
>Severity: serious
>Priority: low
>Category: mysql
>Class: sw-bug
>Release: mysql-3.23.38 (Source distribution)
>Server: /esp/mysql/bin/mysqladmin Ver 8.20 Distrib 3.23.38, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version 3.23.38-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 9 hours 42 min 40 sec
Threads: 5 Questions: 443957 Slow queries: 0 Opens: 101 Flush tables: 1 Open
tables: 64 Queries per second avg: 12.699
>Environment:
System: Linux bugs.esponsive.com 2.4.3-6smp #1 SMP Wed May 16 04:29:16 EDT 2001 i686
unknown
Architecture: i686
Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
Compilation info: CC='gcc' CFLAGS='' CXX='c++' CXXFLAGS='' LDFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 May 9 15:12 /lib/libc.so.6 -> libc-2.2.4.so
-rwxr-xr-x 1 root root 5734740 Apr 2 2002 /lib/libc-2.2.4.so
-rw-r--r-- 1 root root 27332668 Apr 2 2002 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 Apr 2 2002 /usr/lib/libc.so
Configure command: ./configure --prefix=/esp/mysql
---------------------------------------------------------------------
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