/** * returns array of partition names for a specific db/table * * @access public * @uses PMA_DBI_fetch_result() * @return array of partition names */ static public function getPartitionNames($db, $table) { if (PMA_Partition::havePartitioning()) { return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'"); } else { return array(); } }
/** * returns array of partition names for a specific db/table * * @param string $db database name * @param string $table table name * * @access public * @return array of partition names */ public static function getPartitionNames($db, $table) { if (PMA_Partition::havePartitioning()) { return PMA_DBI_fetch_result("SELECT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`" . " WHERE `TABLE_SCHEMA` = '" . $db . "' AND `TABLE_NAME` = '" . $table . "'"); } else { return array(); } }
/** * returns array of partition names for a specific db/table * * @param string $db database name * @param string $table table name * * @access public * @return array of partition names */ public static function getPartitionNames($db, $table) { if (PMA_Partition::havePartitioning()) { return $GLOBALS['dbi']->fetchResult("SELECT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`" . " WHERE `TABLE_SCHEMA` = '" . PMA_Util::sqlAddSlashes($db) . "' AND `TABLE_NAME` = '" . PMA_Util::sqlAddSlashes($table) . "'"); } else { return array(); } }
/** * Function to get html for table comments, storage engine, collation and * partition definition * * @return string */ function PMA_getHtmlForTableConfigurations() { $html = '<table>' . '<tr class="vtop">' . '<th>' . __('Table comments:') . '</th>' . '<td width="25"> </td>' . '<th>' . __('Storage Engine:') . PMA_Util::showMySQLDocu('Storage_engines') . '</th>' . '<td width="25"> </td>' . '<th>' . __('Collation:') . '</th>' . '</tr>' . '<tr><td><input type="text" name="comment" size="40" maxlength="80"' . ' value="' . (isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '') . '" class="textfield" />' . '</td>' . '<td width="25"> </td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25"> </td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false, 3) . '</td>' . '</tr>'; if (PMA_Partition::havePartitioning()) { $html .= '<tr class="vtop">' . '<th>' . __('PARTITION definition:') . ' ' . PMA_Util::showMySQLDocu('Partitioning') . '</th>' . '</tr>' . '<tr>' . '<td>' . '<textarea name="partition_definition" id="partitiondefinition"' . ' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"' . ' rows="' . $GLOBALS['cfg']['TextareaRows'] . '"' . ' dir="' . $GLOBALS['text_dir'] . '">' . (isset($_REQUEST['partition_definition']) ? htmlspecialchars($_REQUEST['partition_definition']) : '') . '</textarea>' . '</td>' . '</tr>'; } $html .= '</table>' . '<br />'; return $html; }
/** * returns the partition method used by the table. * * @param string $db database name * @param string $table table name * * @return string partition method */ public static function getPartitionMethod($db, $table) { if (PMA_Partition::havePartitioning()) { $partition_method = $GLOBALS['dbi']->fetchResult("SELECT `PARTITION_METHOD` FROM `information_schema`.`PARTITIONS`" . " WHERE `TABLE_SCHEMA` = '" . PMA_Util::sqlAddSlashes($db) . "'" . " AND `TABLE_NAME` = '" . PMA_Util::sqlAddSlashes($table) . "'"); if (!empty($partition_method)) { return $partition_method[0]; } } return null; }
/** * Function to get html for table comments, storage engine, collation and * partition definition * * @return string */ function PMA_getHtmlForTableConfigurations() { $html = '<table>'; $html .= '<tr class="vtop">' . '<th>' . __('Table comments:') . '</th>' . '<td width="25"> </td>' . '<th>' . __('Collation:') . '</th>' . '<td width="25"> </td>' . '<th>' . __('Storage Engine:') . PMA_Util::showMySQLDocu('Storage_engines') . '</th>' . '<td width="25"> </td>' . '<th>' . __('Connection:') . PMA_Util::showMySQLDocu('federated-create-connection') . '</th>' . '</tr>'; $commentLength = PMA_MYSQL_INT_VERSION >= 50503 ? 2048 : 60; $html .= '<tr>' . '<td><input type="text" name="comment"' . ' size="40" maxlength="' . $commentLength . '"' . ' value="' . (isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '') . '" class="textfield" />' . '</td>' . '<td width="25"> </td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false) . '</td>' . '<td width="25"> </td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25"> </td>' . '<td><input type="text" name="connection" size="40"' . ' value="' . (isset($_REQUEST['connection']) ? htmlspecialchars($_REQUEST['connection']) : '') . '"' . ' placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"' . ' class="textfield" required="required" />' . '</td>' . '</tr>'; if (PMA_Partition::havePartitioning()) { $html .= '<tr class="vtop">' . '<th>' . __('PARTITION definition:') . ' ' . PMA_Util::showMySQLDocu('Partitioning') . '</th>' . '</tr>' . '<tr>' . '<td>' . '<textarea name="partition_definition" id="partitiondefinition"' . ' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"' . ' rows="' . $GLOBALS['cfg']['TextareaRows'] . '"' . ' dir="' . $GLOBALS['text_dir'] . '">' . (isset($_REQUEST['partition_definition']) ? htmlspecialchars($_REQUEST['partition_definition']) : '') . '</textarea>' . '</td>' . '</tr>'; } $html .= '</table>' . '<br />'; return $html; }
</td> <td width="25"> </td> <td> <?php echo PMA_StorageEngine::getHtmlSelect('tbl_type', null, isset($_REQUEST['tbl_type']) ? $_REQUEST['tbl_type'] : null); ?> </td> <td width="25"> </td> <td> <?php echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false, 3); ?> </td> </tr> <?php if (PMA_Partition::havePartitioning()) { ?> <tr valign="top"> <th><?php echo __('PARTITION definition'); ?> : <?php echo PMA_showMySQLDocu('Partitioning', 'Partitioning'); ?> </th> </tr> <tr> <td> <textarea name="partition_definition" id="partitiondefinition" cols="<?php echo $GLOBALS['cfg']['TextareaCols'];