diff --git a/ChangeLog b/ChangeLog index fb6941572..a2a6c902a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ phpMyAdmin - Changelog $Id$ $Source$ -2002-04-21 Loïc Chapeaux +2002-04-22 Loïc Chapeaux * lang/slovak-win1250.inc.php3: completed, thanks to Peter Svec. 2002-04-22 Marc Delisle @@ -14,6 +14,8 @@ $Source$ 2002-04-22 Alexander M. Turek * lang/russian-koi8.inc.php3: fixed a typo (bug #546981). * lang/german.inc.php3: better syntax. + * db_details.php3, mult_submits.inx.php3, tbl_properties.php3: + Use TRUNCATE instead of DELETE when using MySQL 4. 2002-04-21 Alexander M. Turek * main.php3: Restarted work on patch #538740 (get users priv. with diff --git a/db_details.php3 b/db_details.php3 index 150113805..91ca91eb5 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -224,11 +224,19 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) { ' . $strEmpty . ''; + . '&sql_query='; + if (PMA_MYSQL_INT_VERSION >= 40000) { + echo urlencode('TRUNCATE ' . PMA_backquote($table)) + . '&zero_rows=' + . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table))) + . '" onclick="return confirmLink(this, \'TRUNCATE '; + } else { + echo urlencode('DELETE FROM ' . PMA_backquote($table)) + . '&zero_rows=' + . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table))) + . '" onclick="return confirmLink(this, \'DELETE FROM '; + } + echo PMA_jsFormat($table) . '\')">' . $strEmpty . ''; } else { echo $strEmpty; } diff --git a/mult_submits.inc.php3 b/mult_submits.inc.php3 index dd9746e42..412751990 100644 --- a/mult_submits.inc.php3 +++ b/mult_submits.inc.php3 @@ -75,8 +75,12 @@ if (!empty($submit_mult) && !empty($what)) { // break; case 'empty_tbl': - $full_query .= 'DELETE FROM ' - . PMA_backquote(htmlspecialchars(urldecode($selected[$i]))) + if (PMA_MYSQL_INT_VERSION >= 40000) { + $full_query .= 'TRUNCATE '; + } else { + $full_query .= 'DELETE FROM '; + } + $full_query .= PMA_backquote(htmlspecialchars(urldecode($selected[$i]))) . ';
'; break; diff --git a/tbl_properties.php3 b/tbl_properties.php3 index a1dd832d5..4e103ce81 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -158,8 +158,27 @@ if ($num_rows > 0) { ]    [ ]    - [ + [ = 40000) { + echo urlencode('TRUNCATE ' . PMA_backquote($table)) + . '&zero_rows=' + . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table))) + . '"' . "\n" + . ' onclick="return confirmLink(this, \'TRUNCATE '; + } // end if + else { + echo urlencode('DELETE FROM ' . PMA_backquote($table)) + . '&zero_rows=' + . urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table))) + . '"' + . "\n" + . ' onclick="return confirmLink(this, \'DELETE FROM '; + } // end else + echo PMA_jsFormat($table) + . '\')">' + . "\n"; + ?> ]       [