SV: WHERE ignored

2002-04-28 Thread Carsten Gehling
> -Oprindelig meddelelse- > Fra: Mike Hall [mailto:[EMAIL PROTECTED]] > Sendt: 28. april 2002 12:28 > Til: [EMAIL PROTECTED] > Emne: Fw: WHERE ignored > > > Corrupt index, hmm? I'll check that in a moment - thanks. After looking at your fault-free script

Fw: WHERE ignored

2002-04-28 Thread Mike Hall
L 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 yo

Re: WHERE ignored

2002-04-27 Thread Benjamin Pflugmann
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

Re: WHERE ignored

2002-04-27 Thread Mike Hall
> I think you better show us the script. This might help to figure out the > problem. Okay, here it is: -- Start #!/usr/local/bin/php -q write('Mailer is locked - terminating'); exit; } // Create a lock file $log->write('Locking mailer'); @touch($lock); @chmod($lock, 0666); // Internal mai

SV: WHERE ignored

2002-04-27 Thread Carsten Gehling
> -Oprindelig meddelelse- > Fra: Mike Hall [mailto:[EMAIL PROTECTED]] > Sendt: 27. april 2002 00:04 > 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 ign

Re: WHERE ignored

2002-04-26 Thread Mike Hall
> 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

Re: WHERE ignored

2002-04-26 Thread Michael Bacarella
On Fri, Apr 26, 2002 at 10:20:41PM +0100, Mike Hall wrote: > SELECT MailID, MailBody, MailHeaders FROM Mail WHERE Sent = 0; > UPDATE Mail SET Sent = 1 WHERE MailID = [whatever]; [..snip..] > As I said, this script runs every five minutes - which means this query has > been ran around 83,000 time

WHERE ignored

2002-04-26 Thread Mike Hall
Okay, I am having some trouble with MySQL that could *potentially* be quite serious. A little background first. I'm running PHP 4.2.0 (Release) and MySQL 3.23.49a over five servers. One server is a MySQL Master with PHP CGI version, two are MySQL slaves and the other two are Apache webservers wit