affected rows are returned in case of DELETE with no WHERE clause, at least since MySQL 4.0.x
This commit is contained in:
3
sql.php
3
sql.php
@@ -353,7 +353,9 @@ else {
|
|||||||
// If the query is a DELETE query with no WHERE clause, get the number of
|
// If the query is a DELETE query with no WHERE clause, get the number of
|
||||||
// rows that will be deleted (mysql_affected_rows will always return 0 in
|
// rows that will be deleted (mysql_affected_rows will always return 0 in
|
||||||
// this case)
|
// this case)
|
||||||
|
// Note: testing shows that this no longer applies since MySQL 4.0.x
|
||||||
|
|
||||||
|
if (PMA_MYSQL_INT_VERSION < 40000) {
|
||||||
if ($is_delete
|
if ($is_delete
|
||||||
&& preg_match('@^DELETE([[:space:]].+)?(FROM[[:space:]](.+))$@i', $sql_query, $parts)
|
&& preg_match('@^DELETE([[:space:]].+)?(FROM[[:space:]](.+))$@i', $sql_query, $parts)
|
||||||
&& !preg_match('@[[:space:]]WHERE[[:space:]]@i', $parts[3])) {
|
&& !preg_match('@[[:space:]]WHERE[[:space:]]@i', $parts[3])) {
|
||||||
@@ -365,6 +367,7 @@ else {
|
|||||||
$num_rows = 0;
|
$num_rows = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// E x e c u t e t h e q u e r y
|
// E x e c u t e t h e q u e r y
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user