----- Original Message ----- From: "Ralf Narozny" <[EMAIL PROTECTED]> To: "Bhavin Vyas" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, July 15, 2002 9:16 AM Subject: Re: Interesting
> Bhavin Vyas wrote: [snip] > Hello! > > Whenever deleting without a WHERE clause, there's always this '0 rows > affected' message. I consider that a bug. > > Greetings > Ralf > MySQL optimizes DELETEs with no where clause to a truncate-style operation. Because of this, it does not know the number of rows that were deleted. It does this, because it does it in a much faster way than having to delete row-by-row. (see http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#DEL ETE) It is usally good practice to never issue DELETEs without WHERE clauses, as they can be disasterous, and in most cases it is not what you want to do. If you want to have a row count, you can put in a bogus WHERE clause that evaluates to true, e.g: DELETE FROM blah WHERE 1=1 -Mark --------------------------------------------------------------------- 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