Date like 1997-00-00

mauri

New member
Hello,

I noticed that if I store dates with 00 in day or month, using mysql directly, then the DaDaBIK update screens for such field show those values as "01".

Upon update, the values will be changed in database too.

As you probably are aware, MySQL can be set to accept these invalid zero values, possibly useful for example to indicate that the exact day was not known.

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-types.html

This is not a big issue, but perhaps you should note this somewhere so when you next time touch the date field code, you might take this into account.

I haven't checked how the behaviour of the database could be queried - there is probably a way to fish these configuration values out of MySQL.

DaDaBIK 4.3
mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu
PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch

Best regards,

Mauri Tikka
mauri@machina.fi
 

eugenio

Administrator
Staff member
Thanks for having reported this. I didn't know about this mysql feature (that actually I would consider a bug :) ).
 

mauri

New member
Hi,

yeah - I also think it is a bad habit to use "special values" to represent special cases in variables like here in MySQL. It will always cause trouble, sooner or later. The "proper" way would instead use separate (off channel) bits to indicate whether the values of the date field are valid or not.

Mauri
 
Top