KUNTUL | JINGKONTOT
JINGKONTOT


Server : Apache/2.4.41 (Ubuntu)
System : Linux journalup 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/phpwinfx/libraries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/phpwinfx/libraries/tbl_partition_definition.inc.php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Table partition definition
 *
 * @package PhpMyAdmin
 */

use PhpMyAdmin\Core;

if (!isset($partitionDetails)) {

    $partitionDetails = array();

    // Extract some partitioning and subpartitioning parameters from the request
    $partitionParams = array(
        'partition_by', 'partition_expr',
        'subpartition_by', 'subpartition_expr',
    );
    foreach ($partitionParams as $partitionParam) {
        $partitionDetails[$partitionParam] = isset($_REQUEST[$partitionParam])
            ? $_REQUEST[$partitionParam] : '';
    }

    if (Core::isValid($_REQUEST['partition_count'], 'numeric')) {
        // MySQL's limit is 8192, so do not allow more
        $partition_count = min(intval($_REQUEST['partition_count']), 8192);
    } else {
        $partition_count = 0;
    }
    $partitionDetails['partition_count']
        = ($partition_count === 0) ? '' : $partition_count;
    if (Core::isValid($_REQUEST['subpartition_count'], 'numeric')) {
        // MySQL's limit is 8192, so do not allow more
        $subpartition_count = min(intval($_REQUEST['subpartition_count']), 8192);
    } else {
        $subpartition_count = 0;
    }
    $partitionDetails['subpartition_count']
        = ($subpartition_count === 0) ? '' : $subpartition_count;

    // 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');

    // 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');

    // Has partitions
    if ($partition_count > 1) {
        $partitions = isset($_REQUEST['partitions'])
            ? $_REQUEST['partitions']
            : array();

        // Remove details of the additional partitions
        // when number of partitions have been reduced
        array_splice($partitions, $partition_count);

        for ($i = 0; $i < $partition_count; $i++) {
            if (! isset($partitions[$i])) { // Newly added partition
                $partitions[$i] = array(
                    'name' => 'p' . $i,
                    'value_type' => '',
                    'value' => '',
                    'engine' => '',
                    'comment' => '',
                    'data_directory' => '',
                    'index_directory' => '',
                    'max_rows' => '',
                    'min_rows' => '',
                    'tablespace' => '',
                    'node_group' => '',
                );
            }

            $partition =& $partitions[$i];
            $partition['prefix'] = 'partitions[' . $i . ']';

            // Changing from HASH/KEY to RANGE/LIST
            if (! isset($partition['value_type'])) {
                $partition['value_type'] = '';
                $partition['value'] = '';
            }
            if (! isset($partition['engine'])) { // When removing subpartitioning
                $partition['engine'] = '';
                $partition['comment'] = '';
                $partition['data_directory'] = '';
                $partition['index_directory'] = '';
                $partition['max_rows'] = '';
                $partition['min_rows'] = '';
                $partition['tablespace'] = '';
                $partition['node_group'] = '';
            }

            if ($subpartition_count > 1
                && $partitionDetails['can_have_subpartitions'] == true
            ) { // Has subpartitions
                $partition['subpartition_count'] = $subpartition_count;

                if (! isset($partition['subpartitions'])) {
                    $partition['subpartitions'] = array();
                }
                $subpartitions =& $partition['subpartitions'];

                // Remove details of the additional subpartitions
                // when number of subpartitions have been reduced
                array_splice($subpartitions, $subpartition_count);

                for ($j = 0; $j < $subpartition_count; $j++) {
                    if (! isset($subpartitions[$j])) { // Newly added subpartition
                        $subpartitions[$j] = array(
                            'name' => $partition['name'] . '_s' . $j,
                            'engine' => '',
                            'comment' => '',
                            'data_directory' => '',
                            'index_directory' => '',
                            'max_rows' => '',
                            'min_rows' => '',
                            'tablespace' => '',
                            'node_group' => '',
                        );
                    }

                    $subpartition =& $subpartitions[$j];
                    $subpartition['prefix'] = 'partitions[' . $i . ']'
                        . '[subpartitions][' . $j . ']';
                }
            } else { // No subpartitions
                unset($partition['subpartitions']);
                unset($partition['subpartition_count']);
            }
        }
        $partitionDetails['partitions'] = $partitions;
    }
}

KUNTUL | JINGKONTOT |