[Lazarus] Lazarus, Jedi etc.

Reinier Olislagers reinierolislagers at gmail.com
Tue Jul 16 09:51:46 CEST 2013


On 15-7-2013 18:40, Ludo Brands wrote:
> On 07/15/2013 05:53 PM, Graeme Geldenhuys wrote:
> Need other default (mis)behaviors for MySQL?
> -insert "123test" in an integer field: no error, it inserts 123
> -insert "123test" in a datetime field: no error, it inserts 0000-00-00
> 00:00:00
> -insert 123 in a datetime field: no error, it inserts 2000-01-23
> 00:00:00 . Yes you got that right, inserting integer 11231 translates in
> 2001-12-31 00:00:00. 11232 gives 0000-00-00 00:00:00 again. Insert
> 11231.133 and you get 2001-12-31 00:00:00 again
> -now that you understand the integer to datatime mapping do an UPDATE
> table SET date=date+4, you get 2001-12-31 00:00:04. UPDATE table SET
> date=date+400 and you obtain 2001-12-31 00:04:04.
> -UPDATE table SET date=date*2 results in 0000-00-00 00:00:00. No error.
> -more MySQL arithmetic: insert "2001-1+10+3" into a date field: You get
> 2001-01-10 03:00:00. "2001-1*10/4^2" results in 2001-01-10 04:02:00
> 
> Throw anything at it and MySQL will swallow. Your data are in good hands ;)
> 

It's not a bug, it's a feature: MySQL accepts data other DBs wouldn't
touch with a 10 foot pole ;)
(Don't ask about it proceeding and mangling that data - that's beside
the point ;) )





More information about the Lazarus mailing list