Skip to content

Commit

Permalink
Use same query for display and execution when dropping index
Browse files Browse the repository at this point in the history
Fixes phpmyadmin#12872

Signed-off-by: Michal Čihař <[email protected]>
  • Loading branch information
nijel committed Jan 6, 2017
1 parent 03cc225 commit 8efea21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ phpMyAdmin - ChangeLog
- issue #12841 Fixed moving of columns with whitespace in name
- issue #12847 Fixed editing of virtual columns
- issue #12859 Changed WHERE condition to 0 instead of 1 for SQL query window to avoid accidents
- issue #12872 Use same query for display and execution when dropping index

4.6.5.2 (2016-12-05)
- issue #12765 Fixed SQL export with newlines
Expand Down
11 changes: 2 additions & 9 deletions libraries/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,22 +727,15 @@ static public function getHtmlForIndexes($table, $schema, $print_mode = false)
. ' DROP PRIMARY KEY;';
$this_params['message_to_show']
= __('The primary key has been dropped.');
$js_msg = PMA_jsFormat(
'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'
);
$js_msg = PMA_jsFormat($this_params['sql_query']);
} else {
$this_params['sql_query'] = 'ALTER TABLE '
. Util::backquote($table) . ' DROP INDEX '
. Util::backquote($index->getName()) . ';';
$this_params['message_to_show'] = sprintf(
__('Index %s has been dropped.'), htmlspecialchars($index->getName())
);

$js_msg = PMA_jsFormat(
'ALTER TABLE ' . $table . ' DROP INDEX '
. $index->getName() . ';'
);

$js_msg = PMA_jsFormat($this_params['sql_query']);
}

$r .= '<td ' . $row_span . ' class="print_ignore">';
Expand Down

0 comments on commit 8efea21

Please sign in to comment.