error in comparing date with datetime
Paul B van den Berg <[email protected]>
| Newsgroups | gmane.comp.db.mysql.bugs |
|---|---|
| Organization | dept of Social Pharmacy & Pharmacoepidemiology |
| Message-ID | <[email protected]> |
Description: a datetime with no time-information should be equal to a date if de date-parts are identical. How-To-Repeat: create table t (d1 date, d2 datetime); insert into t values (20040320,20040320); select d2=d1 from t; +-------+ | d2=d1 | +-------+ | 0 | +-------+ Fix: select d2=d1+interval 0 second from t; +-------------------------+ | d2=d1+interval 0 second | +-------------------------+ | 1 | +-------------------------+ Submitter-Id: <submitter ID> Originator: paul vd berg Organization: InterAction database, Dept Social pharmacy, Pharmacoepidemiology & Pharmacotherapeutics University of Groningen MySQL support: [none] Synopsis: error in comparing date with datetime Severity: [ non-critical ] (one line) Priority: [ medium ] (one line) Category: mysql Class: [ sw-bug ] (one line) Release: mysql-4.0.16 (Source distribution) Server: /usr/bin/mysqladmin Ver 8.40 Distrib 4.0.16, 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 4.0.16-log Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 13 hours 21 min 16 sec Threads: 2 Questions: 233 Slow queries: 0 Opens: 141 Flush tables: 1 Open tables: 61 Queries per second avg: 0.005 C compiler: 2.95.4 C++ compiler: 2.95.4 Environment: debian woody System: Linux datapot 2.4.18 #1 Tue Mar 4 13:41:06 CET 2003 i686 unknown Architecture: i686 Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs gcc version 2.95.4 20011002 (Debian prerelease) Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' LDFLAGS='' ASFLAGS='' LIBC: lrwxrwxrwx 1 root root 13 Apr 29 2003 /lib/libc.so.6 -> libc-2.2.5.so -rwxr-xr-x 1 root root 1153784 Apr 8 2003 /lib/libc-2.2.5.so -rw-r--r-- 1 root root 2391002 Apr 8 2003 /usr/lib/libc.a -rw-r--r-- 1 root root 178 Apr 8 2003 /usr/lib/libc.so Configure command: ./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--sysconfdir=/etc/mysql' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-raid' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--with-client-ldflags=-lstdc++' '--with-embedded-server' '--with-vio' '--with-openssl' '--without-docs' '--without-bench' '--without-readline' '--with-extra-charsets=all' '--with-berkeley-db' '--with-innodb' -- MySQL Bugs Mailing List For list archives: http://lists.mysql.com/bugs To unsubscribe: http://lists.mysql.com/[email protected]