Strange error in DELETE query

2004-11-11 Thread Ronan Lucio
Hi, I have a MySQL-4.0.18 installed on a FreeBSD system. When I run the follow query: DELETE FROM table WHERE client_id = 1 AND row_id IN (2,5,7) only the first record is deleted. Am I doing something wrong or is it a MySQL bug? Thanks Ronan -- MySQL General Mailing List For list

RE: Strange error in DELETE query

2004-11-11 Thread Jay Blanchard
[snip] When I run the follow query: DELETE FROM table WHERE client_id = 1 AND row_id IN (2,5,7) only the first record is deleted. Am I doing something wrong or is it a MySQL bug? [/snip] It is not a bug, just say it out loud AND row_id is 2 OR 5 OR 7 Once the OR condition is satisfied

Re: Strange error in DELETE query

2004-11-11 Thread Michael Stassen
Jay Blanchard wrote: [snip] When I run the follow query: DELETE FROM table WHERE client_id = 1 AND row_id IN (2,5,7) only the first record is deleted. Am I doing something wrong or is it a MySQL bug? [/snip] It is not a bug, just say it out loud AND row_id is 2 OR 5 OR 7 Once the OR condition

Re: Strange error in DELETE query

2004-11-11 Thread Ronan Lucio
Jay, It is not a bug, just say it out loud AND row_id is 2 OR 5 OR 7 Once the OR condition is satisfied once, the query will halt. The problem is that if I use OR in the where clause, MySQL wont use the indexes in the row_id column. One important thing that I forgot to say is I run a

Re: Strange error in DELETE query

2004-11-11 Thread Ronan Lucio
Michael, What are you talikng about? Queries don't halt on the first row matched. For example: It´s my thought, too. But it isn´t happen in my MySQL Server. Now, doing the same tests you did I got the same results of you. Well, I´ll inspect my code again looking for some error that I didn´t

RE: Strange error in DELETE query

2004-11-11 Thread Paul DuBois
At 8:18 -0600 11/11/04, Jay Blanchard wrote: [snip] When I run the follow query: DELETE FROM table WHERE client_id = 1 AND row_id IN (2,5,7) only the first record is deleted. Am I doing something wrong or is it a MySQL bug? [/snip] It is not a bug, just say it out loud AND row_id is 2 OR 5 OR

Re: Strange error in DELETE query

2004-11-11 Thread Michael Stassen
Ronan Lucio wrote: snip The problem is that if I use OR in the where clause, MySQL won't use the indexes in the row_id column. Yes, it will, as long as the OR conditions are on the *same* column. WHERE row_id IN (2,5,7) and WHERE (row_id = 2 OR row_id = 5 OR row_id = 7) are equivalent. I

Fw: Strange error in DELETE query

2004-11-11 Thread Ronan Lucio
Hi, I think I found out what was wrong. ColfFusion has a tag CFQUERYPARAM that prevents SQL Injection. Probably CFQUERYPARAM was removing anything after comma. Without using CFQUERYPARAM the code works perfectly. So, I had to create a UDF to remove everything except digits and commas. Thanks