Log in

No account? Create an account

Previous Entry | Next Entry

Brain twister of the evening

So, why does

update tx set service_date = '03-24-2000' where tx_number = 99999999

followed by

select service_date from tx where tx_number=99999999

return a value of June 19, 1894?

More to the point, why does it only do it in one place in the code, and work just fine everywhere else?


(Incidentally, what happened on June 19, 1894, anyway? It doesn't seem to be a round multiple of time from any halfway reasonable epoch....)

UPDATE: because what I actually wrote was

update tx set service_date = 03-24-2000 where tx_number = 99999999,

without the quotes.

3 - 24 - 2000 == -2021.
-2021 / 365 == a little over five and a half years.
A little over five and a half years before January 1, 1900 == June 19, 1894.



( 10 comments — Leave a comment )
May. 31st, 2006 02:56 am (UTC)
Two separate connections, the first hasn't committed yet and the second is seeing the old pre-committed data?

More than one row with tx_number = 99999999 ?

A crazy misbehaving database??

June 19, 1894 sounds like one of the endpoints of a 4-byte datetime field...
(Deleted comment)
May. 31st, 2006 04:37 am (UTC)
Does it work with '2000-03-24'?
May. 31st, 2006 04:47 am (UTC)
someotherguy's response: "Dunno for sure. MySql doesn't like the date format (It expects the date to be entered yyyy-mm-dd, not mm-dd-yyyy). But I think other SQL is more forgiving. It's possible that's it."
May. 31st, 2006 05:32 am (UTC)
Why do I look at that update and think of the mishap with the Mars Polar Observer? Ah, the importance of making sure everything is Just So.

And as for your response to my poll...you're biased, you Amerks fan, you! ~_^ But you're not going to be the only biased towards the Sabres, I know. *laughs*
Jun. 1st, 2006 02:59 am (UTC)

Incidentally, Mary Louisa Campbell received her patent for a firearm hammer guard on June 19, 1894.
Jun. 12th, 2006 05:07 am (UTC)
Jeez, you haven't updated in forever
Hey, are you going to Anthrocon? I know the odds are low but starfallz is looking for carpool help for a friend of hers who is also someone I know but not very well but she doesn't know she knows me, which isn't a problem but I don't think she'd remember anyway. It's not any more coherent than that in real life either, but the short form is that the person needing a ride is a pro artist and perfectly nice in my experience.

All of this is m00t, of course, if you're not going to Anthrocon. ^_^
Jun. 12th, 2006 03:26 pm (UTC)
Re: Jeez, you haven't updated in forever
We're not going to Anthrocon. (Where and when is that anyway?) We'll be going to Gaylaxicon this weekend, though.

And I just got back from the 20th at Deerfield. More on that later....
Jun. 12th, 2006 04:14 pm (UTC)
Re: Jeez, you haven't updated in forever
Where and when is that anyway?
Pittsburgh, PA, this coming weekend. I've never been, but I've heard it's a pretty fun convention.

And I just got back from the 20th at Deerfield. More on that later....
W00t! Yeah, I'll want to hear about that. ^_^
Jul. 19th, 2006 07:07 pm (UTC)
Hi. Didn't mean to be rude. This is nae, of the Simoun list. I added you, hope that's all right. :)
( 10 comments — Leave a comment )