MySQL a update casu
Jan Kasprzak
kas na informatics.muni.cz
Pátek Březen 31 15:35:25 CEST 2000
Dobry den,
zda se mi, ze se MySQL chova nekorektne ohledne pocitani casovych
udaju. Podivejte se na nasledujici priklad, a reknete mi
- jestli to tak ma byt
- pokud to tak nema byt, jestli se tak chova i posledni (nebo aspon
jedna z poslednich) verze MySQL. Bohuzel to ted nemuzu vyzkouset.
create table pokus (t datetime);
insert into pokus values (now());
insert into pokus values (now());
insert into pokus values (now());
insert into pokus values (now());
update pokus set t=date_add(now(), interval 1 year);
Podle meho nazoru by v tabulce nyni mely byt ctyri stejne radky s
datem now() + 1 rok. Ale neni tomu tak:
select * from pokus;
+---------------------+
| t |
+---------------------+
| 2001-03-31 15:32:20 |
| 2002-03-31 15:32:20 |
| 2003-03-31 15:32:20 |
| 2004-03-31 15:32:20 |
+---------------------+
4 rows in set (0.01 sec)
Jsou tam ctyri ruzne zaznamy, lisici se presne o jeden rok.
Co si o tom myslite? Nepochopil jsem neco ja nebo MySQL?
Verze 3.22.14, uz by chtela upgradovat, ale co uz.
-Yenya
--
\ Jan "Yenya" Kasprzak <kas at fi.muni.cz> http://www.fi.muni.cz/~kas/
\\ PGP: finger kas at aisa.fi.muni.cz 0D99A7FB206605D7 8B35FCDE05B18A5E //
\\\ Czech Linux Homepage: http://www.linux.cz/ ///
Its purely bandwidth. If it was 40 instances of Miguel reading web pages
flat out over 100baseT you would definitely be right. But its not... (Alan)
Další informace o konferenci Databases