Hi Barry,

This will happen when comparing against a TIMESTAMP field.

CREATE TABLE a ( t TIMESTAMP );

SELECT * FROM a WHERE t > '0001-01-01 00:00:00';

I understand that TIMESTAMP cannot handle this date. But I would hope to be able to compare against this date without MySQL giving the warnings which crash MySql.Data.dll.

MySQL version 5.1.6

Just a suggestion for later versions of MySQL :)

Ben

Barry wrote:
Ben Clewett schrieb:
To whom it may concern,

I'm involved in lots of C# coding with several coders.

I have a gripe with MySQL which may be easy to solve in future development.

C# has two DateTime constants:

    DateTime.MinValue = '0001-01-01 00:00:00.000'
    DateTime.MaxValue = '9999-12-31 23:59:59.999'

These are very useful to denote a date always beyond some data, or a date always before some data.

Further, C# does not let you set DateTime to NULL. (very annoying!) These values therefore tend to creep into code where NULL would be better used.

MySQL really doesn't like these values, it shows warnings:

+---------+------+-------------------------------------------------+
| Level   | Code | Message                                         |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0001-01-01 00:00:00' |
+---------+------+-------------------------------------------------+

The real problem with these warning is:

1. This date is legal, if a little unlikely.
2. Any warning crash MySql.Data.dll!!!


If there is a kindly developer watching these mailing lists, can I suggest MySQL accepts these values, at least for comparisons, a little cleaner?

For what it's worth, and to help us C# coders...

Ben


When does this happen?

What query had you run?

A more insight might help fix the problem ;)

Barry



--
Ben Clewett
+44(0)1923 460000
Project Manager
Road Tech Computer Systems Ltd
http://www.roadrunner.uk.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to