Rajesh Kumar wrote:
> Hans van Harten unknowingly asked us:
>
>> create database data_test ;
>> use data_test;
>> create table test3 (a date);
>> insert into test3 values (
>> from_unixtime(unix_timestamp('2002-1111102-31'),'%Y-%m-%d' ));
>> insert into test3 values (
>> from_unixtime(unix_timestamp('1996-02-31'),'%Y-%m-%d' ));
>> insert into test3 values (
>> from_unixtime(unix_timestamp('1996-67-31'),'%Y-%m-%d' ));
>> insert into test3 values ( from_unixtime(-2147483646));
>> select * from test3;
>> still resulting in a mash:
>> 1970-01-01
>> 1996-03-01
>> 1970-01-01
>> 1900-01-00
>> that comes with neither warnings nor errors reported ...
>>
>> I don't like to organise my dates this way ...
>>
>
> Why don't you use some middleware to validate your dates?
> MySql is not intented to check the dates. It is up to the programmer
> to validate the dates, and make sure legit dates are being inserted.
Why not throw away all types and just store anything as a blob of bytes, no
more fuz about types at all, but in the programmers logic...
Programmer wil have to check everything and anything anyway, as even
create database TEST;
create table TEST (FUN int);
insert TEST (FUN ) value ( 1212121212121212121212.12 );
select * from TEST;
returns garbage (2147483647) with neither warnings nor errors !!!
HansH
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]