From: jahan Date: April 20 1999 8:06am Subject: Re: BUG:DAYNAME gives wrong name !! List-Archive: http://lists.mysql.com/mysql/2073 Message-Id: <371C359B.30456B30@pc.jaring.my> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Well, its described in manual already.oops. jahan wrote: > Description: > If user asks the system to provide dayname for invalid > date it will give you some day name as long as day field is < = 31. > > mysql> select dayname('1999-03-32'); > +-----------------------+ > | dayname('1999-03-32') | > +-----------------------+ > | NULL | > +-----------------------+ > 1 row in set (0.00 sec) > > mysql> select dayname('1999-02-32'); > +-----------------------+ > | dayname('1999-02-32') | > +-----------------------+ > | NULL | > +-----------------------+ > 1 row in set (0.00 sec) > > mysql> select dayname('1999-02-31'); > +-----------------------+ > | dayname('1999-02-31') | > +-----------------------+ > | Wednesday | > +-----------------------+ > 1 row in set (0.00 sec) > //wrong should be NULL cuz feb has only 28 dayes > mysql> select dayname('1999-04-31'); > +-----------------------+ > | dayname('1999-04-31') | > +-----------------------+ > | Saturday | > +-----------------------+ > 1 row in set (0.00 sec) > //wrong also should be NULL cuz apr has only 30 dayes > > How-To-Repeat: > select dayname(yyyy-mm-(dd+more than month limit && <=31); > > Fix: > Validation should be done in this function. Or it SHOULD be assumed > that all date we feed to mysql, should be considerred correct!! > > Submitter-Id:Jahan ? > Originator: jahan > Organization: > J & J Software Solutions http://www.jjsoft.com > MySQL support: [none] > Synopsis: > Severity: [serious | critical ] if developers does not test the > function(s) at command prompt. > Priority: [ high ] > Category: mysql > Class: [ sw-bug ] > Release: mysql-3.21.33 (Source distribution) > Server: /usr/local/bin/mysqladmin Ver 6.9 Distrib 3.21.33b, for > unknown-freebsd3.0 on i386 > TCX Datakonsult AB, by Monty > > Server version 3.21.33b > Protocol version 10 > Connection localhost via TCP/IP > TCP port 3306 > Uptime: 4 hours 31 min 27 sec > > Running threads: 3 Questions: 198 Opened_tables: 19 Flush tables: 2 > Open tables: 8 > Environment: > > System: FreeBSD jjsoft2.com 3.1-STABLE FreeBSD 3.1-STABLE #5: Sat Apr 3 > 01:43:57 GMT 1999 root@stripped:/usr/src/sys/compile/JJSOFT2 > i386 > > Some paths: /usr/bin/perl /usr/bin/make /usr/local/bin/gmake > /usr/bin/gcc /usr/bin/cc > GCC: gcc version 2.7.2.1 > Compilation info: CC='gcc' CFLAGS='' CXX='gcc' CXXFLAGS='' > LDFLAGS='' > Configure command: --with-unix-socket-path=/var/tmp/mysql.sock > --with-low-memory --with-mit-threads=yes > Perl: This is perl, version 5.005_02 built for i386-freebsd > > --------------------------------------------------------------------- > Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before > posting. To request this thread, e-mail mysql-thread1992@stripped > > To unsubscribe, send a message to the address shown in the > List-Unsubscribe header of this message. If you cannot see it, > e-mail mysql-unsubscribe@stripped instead.