Use TRUNCATE instead of DELETE when using MySQL 4.
This commit is contained in:
@@ -5,7 +5,7 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2002-04-21 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
2002-04-22 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* lang/slovak-win1250.inc.php3: completed, thanks to Peter Svec.
|
||||
|
||||
2002-04-22 Marc Delisle <lem9@users.sourceforge.net>
|
||||
@@ -14,6 +14,8 @@ $Source$
|
||||
2002-04-22 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||
* 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 <rabus@users.sourceforge.net>
|
||||
* main.php3: Restarted work on patch #538740 (get users priv. with
|
||||
|
@@ -224,11 +224,19 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
|
||||
<?php
|
||||
if (!empty($sts_data['Rows'])) {
|
||||
echo '<a href="sql.php3?' . $url_query
|
||||
. '&sql_query='
|
||||
. urlencode('DELETE FROM ' . PMA_backquote($table))
|
||||
. '&zero_rows='
|
||||
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
|
||||
. '" onclick="return confirmLink(this, \'DELETE FROM ' . PMA_jsFormat($table) . '\')">' . $strEmpty . '</a>';
|
||||
. '&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 . '</a>';
|
||||
} else {
|
||||
echo $strEmpty;
|
||||
}
|
||||
|
@@ -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])))
|
||||
. ';<br />';
|
||||
break;
|
||||
|
||||
|
@@ -158,8 +158,27 @@ if ($num_rows > 0) {
|
||||
<b><?php echo $strSelect; ?></b></a> ]
|
||||
[ <a href="tbl_change.php3?<?php echo $url_query; ?>">
|
||||
<b><?php echo $strInsert; ?></b></a> ]
|
||||
[ <a href="sql.php3?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('DELETE FROM ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table))); ?>"
|
||||
onclick="return confirmLink(this, 'DELETE FROM <?php echo PMA_jsFormat($table); ?>')">
|
||||
[ <?php
|
||||
echo '<a href="sql.php3?' . $url_query . '&sql_query=';
|
||||
if (PMA_MYSQL_INT_VERSION >= 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";
|
||||
?>
|
||||
<b><?php echo $strEmpty; ?></b></a> ]
|
||||
[ <a href="sql.php3?<?php echo ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query); ?>&back=tbl_properties.php3&reload=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
|
||||
onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
|
||||
|
Reference in New Issue
Block a user