Use TRUNCATE instead of DELETE when using MySQL 4.

This commit is contained in:
Alexander M. Turek
2002-04-22 21:32:29 +00:00
parent 70c89bbb87
commit f267e10870
4 changed files with 43 additions and 10 deletions

View File

@@ -224,11 +224,19 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
<?php
if (!empty($sts_data['Rows'])) {
echo '<a href="sql.php3?' . $url_query
. '&amp;sql_query='
. urlencode('DELETE FROM ' . PMA_backquote($table))
. '&amp;zero_rows='
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
. '" onclick="return confirmLink(this, \'DELETE FROM ' . PMA_jsFormat($table) . '\')">' . $strEmpty . '</a>';
. '&amp;sql_query=';
if (PMA_MYSQL_INT_VERSION >= 40000) {
echo urlencode('TRUNCATE ' . PMA_backquote($table))
. '&amp;zero_rows='
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
. '" onclick="return confirmLink(this, \'TRUNCATE ';
} else {
echo urlencode('DELETE FROM ' . PMA_backquote($table))
. '&amp;zero_rows='
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
. '" onclick="return confirmLink(this, \'DELETE FROM ';
}
echo PMA_jsFormat($table) . '\')">' . $strEmpty . '</a>';
} else {
echo $strEmpty;
}