Skip to content

Commit

Permalink
implementation of PMA_getQueryAndResultForPartition()
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinaa committed Aug 6, 2012
1 parent 165cec1 commit 2d10c24
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
18 changes: 18 additions & 0 deletions libraries/operations.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1550,4 +1550,22 @@ function PMA_getWarningMessagesArray()
return $warning_messages;
}

/**
* Get SQL query and result after ran this SQL query for a partition operation
* has been requested by the user
*
* @return array $sql_query, $result
*/
function PMA_getQueryAndResultForPartition()
{
$sql_query = 'ALTER TABLE '
. $common_functions->backquote($GLOBALS['table']) . ' '
. $_REQUEST['partition_operation']
. ' PARTITION '
. $_REQUEST['partition_name'] . ';';
$result = PMA_DBI_query($sql_query);

return array($sql_query, $result);
}

?>
7 changes: 1 addition & 6 deletions tbl_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,7 @@
if (isset($_REQUEST['submit_partition'])
&& ! empty($_REQUEST['partition_operation'])
) {
$sql_query = 'ALTER TABLE '
. $common_functions->backquote($GLOBALS['table']) . ' '
. $_REQUEST['partition_operation']
. ' PARTITION '
. $_REQUEST['partition_name'] . ';';
$result = PMA_DBI_query($sql_query);
list($sql_query, $result) = PMA_getQueryAndResultForPartition();
} // end if

if ($reread_info) {
Expand Down

0 comments on commit 2d10c24

Please sign in to comment.