Corrupt index, hmm? I'll check that in a moment - thanks. Probably a sensible idea to limit the query too - I think I'll order by date desc too just to make sure that recent mail gets sent.
Cheers --Mike ----- Original Message ----- From: "Benjamin Pflugmann" <[EMAIL PROTECTED]> To: "Mike Hall" <[EMAIL PROTECTED]> Cc: "Michael Bacarella" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, April 27, 2002 9:23 PM Subject: Re: WHERE ignored > Hi. > > First a praticial hint to prevent further harm: I presume you can set > an upper limit for how many rows should be returned (say 1000?). If > there are more, complain and refuse to do anything in your script. > > Or also select the "sent" value and compare in your script that it is > 0 before sending mail. I doubt you would really get a wrong value in > the selected column, too. > > > What you describe sounds like a corrupt index or something alike. It > is not uncommon that _if_ an index is corrupted, you get far more or > less results than expected. So check your tables. > > I don't think that getting too many rows for a hardcoded query is > possible by an error in your script. But to be sure: From what you > said, you seem to have the query log. Check that the log really > contains what should be there for the time window in question. > I.e. that the hardcoded query was sent undamaged to MySQL and so on. > > Bye, > > Benjamin. > > > On Fri, Apr 26, 2002 at 11:04:00PM +0100, [EMAIL PROTECTED] wrote: > > > Is there any chance at all that a field name is appearing in your > > > WHERE clause? For example: > > > > > > UPDATE foo SET flag = 0 WHERE foo_id = foo_id; > > > > > > foo_id = foo_id of course matches all. > > > > No, the query is hard coded to "WHERE Sent = 0". > > > > > Not much room for that kind of error in this example, but > > > perhaps in other scripts that deal with the table in question? > > > > No other scripts perform UPDATEs on that table, only INSERTs. But MySQL > > returned the correct data at 8:55 and again at 9:05. It was only when it ran > > at 9am that it appeared to ignore the WHERE. According to my binary log, the > > Mail table wasn't changed at all during this time - so the results of all > > three queries should have been identical. > > -- > [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php