📄 tbl_operations.php
字号:
<option value="1" <?php if ($pack_keys == '1') echo 'selected="selected"'; ?> >1</option> </select> </td> </tr> <?php} // end if (MYISAM|ISAM)if ($is_myisam_or_maria) { ?> <tr><td><label for="new_checksum">CHECKSUM</label></td> <td><input type="checkbox" name="new_checksum" id="new_checksum" value="1" <?php echo (isset($checksum) && $checksum == 1) ? ' checked="checked"' : ''; ?> /> </td> </tr> <tr><td><label for="new_delay_key_write">DELAY_KEY_WRITE</label></td> <td><input type="checkbox" name="new_delay_key_write" id="new_delay_key_write" value="1" <?php echo (isset($delay_key_write) && $delay_key_write == 1) ? ' checked="checked"' : ''; ?> /> </td> </tr> <?php} // end if (MYISAM)if ($is_maria) { ?> <tr><td><label for="new_transactional">TRANSACTIONAL</label></td> <td><input type="checkbox" name="new_transactional" id="new_transactional" value="1" <?php echo (isset($transactional) && $transactional == 1) ? ' checked="checked"' : ''; ?> /> </td> </tr> <tr><td><label for="new_page_checksum">PAGE_CHECKSUM</label></td> <td><input type="checkbox" name="new_page_checksum" id="new_page_checksum" value="1" <?php echo (isset($page_checksum) && $page_checksum == 1) ? ' checked="checked"' : ''; ?> /> </td> </tr> <?php} // end if (MARIA)if (isset($auto_increment) && strlen($auto_increment) > 0 && ($is_myisam_or_maria || $is_innodb || $is_pbxt)) { ?> <tr><td><label for="auto_increment_opt">AUTO_INCREMENT</label></td> <td><input type="text" name="new_auto_increment" id="auto_increment_opt" value="<?php echo $auto_increment; ?>" /></td> </tr> <?php} // end if (MYISAM|INNODB)$possible_row_formats = array( 'MARIA' => array('FIXED','DYNAMIC','PAGE'), 'MYISAM' => array('FIXED','DYNAMIC'), 'PBXT' => array('FIXED','DYNAMIC'), 'INNODB' => array('COMPACT','REDUNDANT'));// for MYISAM there is also COMPRESSED but it can be set only by the// myisampack utility, so don't offer here the choice because if we// try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)// does not return a warning// (if the table was compressed, it can be seen on the Structure page)if (isset($possible_row_formats[$tbl_type])) { $current_row_format = strtoupper($showtable['Row_format']); echo '<tr><td><label for="new_row_format">ROW_FORMAT</label></td>'; echo '<td>'; PMA_generate_html_dropdown('new_row_format', $possible_row_formats[$tbl_type], $current_row_format); unset($possible_row_formats, $current_row_format); echo '</td>'; echo '</tr>';}?> </table></fieldset><fieldset class="tblFooters"> <input type="submit" name="submitoptions" value="<?php echo $strGo; ?>" /></fieldset></form></div><!-- Copy table --><div id="div_table_copy"><form method="post" action="tbl_move_copy.php" onsubmit="return emptyFormElements(this, 'new_name')"><?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?><input type="hidden" name="reload" value="1" /><fieldset> <legend><?php echo $strCopyTable; ?></legend><?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {?> <input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/><?php } else {?> <select name="target_db"> <?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?> </select><?php } // end if?> <strong>.</strong> <input type="text" size="20" name="new_name" onfocus="this.select()" /><br /><?php $choices = array( 'structure' => $strStrucOnly, 'data' => $strStrucData, 'dataonly' => $strDataOnly); PMA_generate_html_radio('what', $choices, 'data', true); unset($choices);?> <input type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop" /> <label for="checkbox_drop"><?php echo sprintf($strAddClause, 'DROP TABLE'); ?></label><br /> <input type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment_cp" /> <label for="checkbox_auto_increment_cp"><?php echo $strAddAutoIncrement; ?></label><br /> <?php // display "Add constraints" choice only if there are // foreign keys if (PMA_getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'foreign')) { ?> <input type="checkbox" name="add_constraints" value="1" id="checkbox_constraints" /> <label for="checkbox_constraints"><?php echo $strAddConstraints; ?></label><br /> <?php } // endif if (isset($_COOKIE['pma_switch_to_new']) && $_COOKIE['pma_switch_to_new'] == 'true') { $pma_switch_to_new = 'true'; } ?> <input type="checkbox" name="switch_to_new" value="true" id="checkbox_switch"<?php echo isset($pma_switch_to_new) && $pma_switch_to_new == 'true' ? ' checked="checked"' : ''; ?> /> <label for="checkbox_switch"><?php echo $strSwitchToTable; ?></label></fieldset><fieldset class="tblFooters"> <input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" /></fieldset></form></div><br class="clearfloat"/><div id="div_table_maintenance"><fieldset> <legend><?php echo $strTableMaintenance; ?></legend><ul><?php// Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1if ($is_myisam_or_maria || $is_innodb || $is_berkeleydb) { if ($is_myisam_or_maria || $is_innodb) { $this_url_params = array_merge($url_params, array('sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table']))); ?> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strCheckTable; ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?> </li> <?php } if ($is_innodb) { $this_url_params = array_merge($url_params, array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ENGINE = InnoDB')); ?> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strDefragment; ?></a> <?php echo PMA_showMySQLDocu('Table_types', 'InnoDB_File_Defragmenting'); ?> </li> <?php } if ($is_myisam_or_maria || $is_berkeleydb) { $this_url_params = array_merge($url_params, array('sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table']))); ?> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strAnalyzeTable; ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?> </li> <?php } if ($is_myisam_or_maria) { $this_url_params = array_merge($url_params, array('sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table']))); ?> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strRepairTable; ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?> </li> <?php } if ($is_myisam_or_maria || $is_innodb || $is_berkeleydb) { $this_url_params = array_merge($url_params, array('sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table']))); ?> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strOptimizeTable; ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?> </li> <?php }} // end MYISAM or BERKELEYDB case$this_url_params = array_merge($url_params, array( 'sql_query' => 'FLUSH TABLE ' . PMA_backquote($GLOBALS['table']), 'zero_rows' => sprintf($strTableHasBeenFlushed, htmlspecialchars($GLOBALS['table'])), 'reload' => 1, ));?> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strFlushTable; ?></a> <?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH'); ?> </li></ul></fieldset></div><?php if (PMA_Partition::havePartitioning()) { $partition_names = PMA_Partition::getPartitionNames($db, $table); // show the Partition maintenance section only if we detect a partition if (! is_null($partition_names[0])) { ?><div id="div_partition_maintenance"><form method="post" action="tbl_operations.php"><?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?><fieldset> <legend><?php echo $strPartitionMaintenance; ?></legend><?php $html_select = '<select name="partition_name">' . "\n"; foreach($partition_names as $one_partition) { $one_partition = htmlspecialchars($one_partition); $html_select .= '<option value="' . $one_partition . '">' . $one_partition . '</option>' . "\n"; } $html_select .= '</select>' . "\n"; printf($GLOBALS['strPartition'], $html_select); unset($partition_names, $one_partition, $html_select); $choices = array( 'ANALYZE' => $strAnalyze, 'CHECK' => $strCheck, 'OPTIMIZE' => $strOptimize, 'REBUILD' => $strRebuild, 'REPAIR' => $strRepair); PMA_generate_html_radio('partition_operation', $choices, '', false); unset($choices); echo PMA_showMySQLDocu('partitioning_maintenance', 'partitioning_maintenance'); // I'm not sure of the best way to display that; this link does // not depend on the Go button $this_url_params = array_merge($url_params, array( 'sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' REMOVE PARTITIONING' ));?> <br /><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <?php echo $strRemovePartitioning; ?></a></fieldset><fieldset class="tblFooters"> <input type="submit" name="submit_partition" value="<?php echo $strGo; ?>" /></fieldset></form></div><?php } // end if } // end if// Referential integrity check// The Referential integrity check was intended for the non-InnoDB// tables for which the relations are defined in pmadb// so I assume that if the current table is InnoDB, I don't display// this choice (InnoDB maintains integrity by itself)if ($cfgRelation['relwork'] && ! $is_innodb) { PMA_DBI_select_db($GLOBALS['db']); $foreign = PMA_getForeigners($GLOBALS['db'], $GLOBALS['table']); if ($foreign) { ?> <!-- Referential integrity check --><div id="div_referential_integrity"><fieldset> <legend><?php echo $strReferentialIntegrity; ?></legend> <ul> <?php echo "\n"; foreach ($foreign AS $master => $arr) { $join_query = 'SELECT ' . PMA_backquote($GLOBALS['table']) . '.* FROM ' . PMA_backquote($GLOBALS['table']) . ' LEFT JOIN ' . PMA_backquote($arr['foreign_table']); if ($arr['foreign_table'] == $GLOBALS['table']) { $foreign_table = $GLOBALS['table'] . '1'; $join_query .= ' AS ' . PMA_backquote($foreign_table); } else { $foreign_table = $arr['foreign_table']; } $join_query .= ' ON ' . PMA_backquote($GLOBALS['table']) . '.' . PMA_backquote($master) . ' = ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($arr['foreign_field']) . ' WHERE ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($arr['foreign_field']) . ' IS NULL AND ' . PMA_backquote($GLOBALS['table']) . '.' . PMA_backquote($master) . ' IS NOT NULL'; $this_url_params = array_merge($url_params, array('sql_query' => $join_query)); echo ' <li>' . '<a href="sql.php' . PMA_generate_common_url($this_url_params) . '">' . $master . ' -> ' . $arr['foreign_table'] . '.' . $arr['foreign_field'] . '</a></li>' . "\n"; } // foreach $foreign unset($foreign_table, $join_query); ?> </ul> </fieldset> </div> <?php } // end if ($foreign)} // end if (!empty($cfg['Server']['relation']))/** * Displays the footer */require_once './libraries/footer.inc.php';function PMA_set_global_variables_for_engine($tbl_type) { global $is_myisam_or_maria, $is_innodb, $is_isam, $is_berkeleydb, $is_maria, $is_pbxt; $is_myisam_or_maria = $is_isam = $is_innodb = $is_berkeleydb = $is_maria = $is_pbxt = false; $upper_tbl_type = strtoupper($tbl_type); //Options that apply to MYISAM usually apply to MARIA $is_myisam_or_maria = ($upper_tbl_type == 'MYISAM' || $upper_tbl_type == 'MARIA'); $is_maria = ($upper_tbl_type == 'MARIA'); $is_isam = ($upper_tbl_type == 'ISAM'); $is_innodb = ($upper_tbl_type == 'INNODB'); $is_berkeleydb = ($upper_tbl_type == 'BERKELEYDB'); $is_pbxt = ($upper_tbl_type == 'PBXT');}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -