Skip to content
Permalink
Browse files

Retrieve parameters from $_POST in partition definition

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information...
mauriciofauth committed Nov 10, 2018
1 parent 6fd9bfb commit c36592b4e8dfe6e5b2e7c9197c32abdf155df350
Showing with 18 additions and 18 deletions.
  1. +18 −18 libraries/tbl_partition_definition.inc.php
@@ -18,21 +18,21 @@
'subpartition_by', 'subpartition_expr',
);
foreach ($partitionParams as $partitionParam) {
$partitionDetails[$partitionParam] = isset($_REQUEST[$partitionParam])
? $_REQUEST[$partitionParam] : '';
$partitionDetails[$partitionParam] = isset($_POST[$partitionParam])
? $_POST[$partitionParam] : '';
}
if (Core::isValid($_REQUEST['partition_count'], 'numeric')) {
if (Core::isValid($_POST['partition_count'], 'numeric')) {
// MySQL's limit is 8192, so do not allow more
$partition_count = min(intval($_REQUEST['partition_count']), 8192);
$partition_count = min(intval($_POST['partition_count']), 8192);
} else {
$partition_count = 0;
}
$partitionDetails['partition_count']
= ($partition_count === 0) ? '' : $partition_count;
if (Core::isValid($_REQUEST['subpartition_count'], 'numeric')) {
if (Core::isValid($_POST['subpartition_count'], 'numeric')) {
// MySQL's limit is 8192, so do not allow more
$subpartition_count = min(intval($_REQUEST['subpartition_count']), 8192);
$subpartition_count = min(intval($_POST['subpartition_count']), 8192);
} else {
$subpartition_count = 0;
}
@@ -41,23 +41,23 @@
// Only LIST and RANGE type parameters allow subpartitioning
$partitionDetails['can_have_subpartitions'] = $partition_count > 1
&& isset($_REQUEST['partition_by'])
&& ($_REQUEST['partition_by'] == 'RANGE'
|| $_REQUEST['partition_by'] == 'RANGE COLUMNS'
|| $_REQUEST['partition_by'] == 'LIST'
|| $_REQUEST['partition_by'] == 'LIST COLUMNS');
&& isset($_POST['partition_by'])
&& ($_POST['partition_by'] == 'RANGE'
|| $_POST['partition_by'] == 'RANGE COLUMNS'
|| $_POST['partition_by'] == 'LIST'
|| $_POST['partition_by'] == 'LIST COLUMNS');
// Values are specified only for LIST and RANGE type partitions
$partitionDetails['value_enabled'] = isset($_REQUEST['partition_by'])
&& ($_REQUEST['partition_by'] == 'RANGE'
|| $_REQUEST['partition_by'] == 'RANGE COLUMNS'
|| $_REQUEST['partition_by'] == 'LIST'
|| $_REQUEST['partition_by'] == 'LIST COLUMNS');
$partitionDetails['value_enabled'] = isset($_POST['partition_by'])
&& ($_POST['partition_by'] == 'RANGE'
|| $_POST['partition_by'] == 'RANGE COLUMNS'
|| $_POST['partition_by'] == 'LIST'
|| $_POST['partition_by'] == 'LIST COLUMNS');
// Has partitions
if ($partition_count > 1) {
$partitions = isset($_REQUEST['partitions'])
? $_REQUEST['partitions']
$partitions = isset($_POST['partitions'])
? $_POST['partitions']
: array();
// Remove details of the additional partitions

0 comments on commit c36592b

Please sign in to comment.
You can’t perform that action at this time.