Forum Moderators: open

Message Too Old, No Replies

Intermittent query error

         

rocknbil

5:59 am on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Task: generate a simple time query, one field formatted for display, one for a valid MIME mail header, both for EST time.

Platform: Linux, and I believe the mySQL is 5.1

Problem: usually it works, sometimes it dud'nt. :-)

Error: Lost connection to server during query. Which usually means it's malformed or too big of a query, but it's not. Is it?


select date_format(date_sub(utc_timestamp(),interval 4 hour),'%a, %d %b %Y %H:%i:%s -0400'), ___
date_format(date_sub(utc_timestamp(),interval 4 hour),'%a, %d %b %Y %h:%i:%s');

coopster

12:23 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Looks fine to me. Have you gone through the checklist [dev.mysql.com] yet?

coopster

12:24 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Additional thought ... why not just append the EST time (-0400) string in your application logic instead? Looks like it is applied as a static literal string anyway.

rocknbil

10:40 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, of course I did. :-) However, I've talked myself into a hole anyway. As it turns out, it really wasn't this select that had a problem, it was that by the time my script got to it there was some problem with memory or resources due to ANOTHER problem that preceded it.

This select (and many many more) was launched in the child process of a fork, with the parent immediately redirecting to another page (closed STDOUT at the top of the child so this worked right.) Forks are really great for background processes but it robs you of that server-response so useful for debugging. So you have to store your errors in some physical location and weep over your oversights later. Which I did. :-)

Yeah the -004 was the first thing to go, it still died right there from time to time anyway. But thank you, I didn't think there was anything wrong with it . . . .

coopster

9:53 pm on Oct 20, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, of course I did. :-)

Figured as much from a guy like you, but still, I had] to ask ... protocol you know! Goes back to the old help desk days ;)

redirecting

Understood. Glad you got it sorted.