bug 913630 deleted rows 0
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2004-03-13 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
|
* sql.php: bug 913630: did not detect correctly DELETE FROM table
|
||||||
|
and even if detected, was calling a non-existent PMA_DBI_result()
|
||||||
|
|
||||||
2004-03-10 Marc Delisle <lem9@users.sourceforge.net>
|
2004-03-10 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/relation.lib.php: bug 877359, no CONSTRAINT in
|
* libraries/relation.lib.php: bug 877359, no CONSTRAINT in
|
||||||
SHOW CREATE TABLE on older MySQL versions
|
SHOW CREATE TABLE on older MySQL versions
|
||||||
|
7
sql.php
7
sql.php
@@ -294,12 +294,13 @@ 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)
|
||||||
|
|
||||||
if ($is_delete
|
if ($is_delete
|
||||||
&& preg_match('@^DELETE([[:space:]].+)?([[: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])) {
|
||||||
$cnt_all_result = @PMA_DBI_try_query('SELECT COUNT(*) as count' . $parts[2]);
|
$cnt_all_result = @PMA_DBI_try_query('SELECT COUNT(*) as count ' . $parts[2]);
|
||||||
if ($cnt_all_result) {
|
if ($cnt_all_result) {
|
||||||
$num_rows = PMA_DBI_result($cnt_all_result, 0, 'count');
|
list($num_rows) = PMA_DBI_fetch_row($cnt_all_result);
|
||||||
PMA_DBI_free_result($cnt_all_result);
|
PMA_DBI_free_result($cnt_all_result);
|
||||||
} else {
|
} else {
|
||||||
$num_rows = 0;
|
$num_rows = 0;
|
||||||
|
Reference in New Issue
Block a user