From 9d240013045d2c6f91a64d4f5d6c881827eed265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 24 Mar 2003 15:39:39 +0000 Subject: [PATCH] Show result of CHECK/OPTIMIZE/REPAIR queries for multiple tables. --- ChangeLog | 3 +++ db_details_structure.php3 | 24 +++++++++++++++--------- mult_submits.inc.php3 | 33 +++++++++++++++++++++++---------- tbl_alter.php3 | 6 ++---- tbl_properties_structure.php3 | 18 ++++++++++++------ 5 files changed, 55 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7de0044e8..3f58ff1fc 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ $Source$ 2003-03-24 Michal Cihar * db_details_structure.php3, mult_submits.inc.php: Added CHECK TABLE to multisubmit actions (RFE #622603). + * db_details_structure.php3, mult_submits.inc.php3, tbl_alter.php3, + tbl_properties_structure.php3: Show result of CHECK/OPTIMIZE/REPAIR + queries for multiple tables. 2003-03-23 Marc Delisle * libraries/sqlparser.lib.php3, libraries/config_import.lib.php3, diff --git a/db_details_structure.php3 b/db_details_structure.php3 index 57d296b84..515b0f08b 100644 --- a/db_details_structure.php3 +++ b/db_details_structure.php3 @@ -8,20 +8,26 @@ * because there is no table in the database ($is_info is TRUE) */ if (empty($is_info)) { - include('./db_details_common.php3'); - $url_query .= '&goto=db_details_structure.php3'; + if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { + include('./libraries/grab_globals.lib.php3'); + } + if (!defined('PMA_COMMON_LIB_INCLUDED')) { + include('./libraries/common.lib.php3'); + } - // Drops/deletes multiple tables if required - if ((!empty($submit_mult) && isset($selected_tbl)) + // Drops/deletes/etc. multiple tables if required + if ((!empty($submit_mult) && isset($selected_tbl)) || isset($mult_btn)) { $action = 'db_details_structure.php3'; include('./mult_submits.inc.php3'); - } + } + include('./db_details_common.php3'); + $url_query .= '&goto=db_details_structure.php3'; - // Gets the database structure - $sub_part = '_structure'; - include('./db_details_db_info.php3'); - echo "\n"; + // Gets the database structure + $sub_part = '_structure'; + include('./db_details_db_info.php3'); + echo "\n"; } diff --git a/mult_submits.inc.php3 b/mult_submits.inc.php3 index 1d4190531..d730dcc95 100644 --- a/mult_submits.inc.php3 +++ b/mult_submits.inc.php3 @@ -58,6 +58,17 @@ if (!empty($submit_mult) * Displays the confirmation form if required */ if (!empty($submit_mult) && !empty($what)) { + $js_to_run = 'functions.js'; + unset($message); + if (!empty($table)) { + include('./tbl_properties_common.php3'); + $url_query .= '&goto=tbl_properties.php3&back=tbl_properties.php3'; + include('./tbl_properties_table_info.php3'); + } + else { + include('./db_details_common.php3'); + include('./db_details_db_info.php3'); + } // Builds the query $full_query = ''; $selected_cnt = count($selected); @@ -156,20 +167,20 @@ else if ($mult_btn == $strYes) { case 'check_tbl': $sql_query .= (empty($sql_query) ? 'CHECK TABLE ' : ', ') - . PMA_backquote(urldecode($selected[$i])) - . (($i == $selected_cnt-1) ? ';' : ''); + . PMA_backquote(urldecode($selected[$i])); +// . (($i == $selected_cnt-1) ? ';' : ''); break; case 'optimize_tbl': $sql_query .= (empty($sql_query) ? 'OPTIMIZE TABLE ' : ', ') - . PMA_backquote(urldecode($selected[$i])) - . (($i == $selected_cnt-1) ? ';' : ''); + . PMA_backquote(urldecode($selected[$i])); +// . (($i == $selected_cnt-1) ? ';' : ''); break; case 'repair_tbl': $sql_query .= (empty($sql_query) ? 'REPAIR TABLE ' : ', ') - . PMA_backquote(urldecode($selected[$i])) - . (($i == $selected_cnt-1) ? ';' : ''); + . PMA_backquote(urldecode($selected[$i])); +// . (($i == $selected_cnt-1) ? ';' : ''); break; case 'empty_tbl': @@ -201,12 +212,14 @@ else if ($mult_btn == $strYes) { } // end for if ($query_type == 'drop_tbl' - || $query_type == 'drop_fld' - || $query_type == 'repair_tbl' - || $query_type == 'check_tbl' - || $query_type == 'optimize_tbl') { + || $query_type == 'drop_fld') { PMA_mysql_select_db($db); $result = @PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', FALSE, $err_url); + } elseif ($query_type == 'repair_tbl' + || $query_type == 'check_tbl' + || $query_type == 'optimize_tbl') { + include('./sql.php3'); + exit(); } PMA_showMessage($strSuccess); diff --git a/tbl_alter.php3 b/tbl_alter.php3 index aae5ba006..8c816f702 100755 --- a/tbl_alter.php3 +++ b/tbl_alter.php3 @@ -7,10 +7,8 @@ * Gets some core libraries */ require('./libraries/grab_globals.lib.php3'); -if (!isset($submit_mult)) { - $js_to_run = 'functions.js'; - include('./header.inc.php3'); -} +$js_to_run = 'functions.js'; +include('./header.inc.php3'); /** diff --git a/tbl_properties_structure.php3 b/tbl_properties_structure.php3 index c491363cf..32478842a 100755 --- a/tbl_properties_structure.php3 +++ b/tbl_properties_structure.php3 @@ -3,12 +3,12 @@ // vim: expandtab sw=4 ts=4 sts=4: -/** - * Runs common work - */ -require('./tbl_properties_common.php3'); -$url_query .= '&goto=tbl_properties_structure.php3&back=tbl_properties_structure.php3'; - +if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) { + include('./libraries/grab_globals.lib.php3'); +} +if (!defined('PMA_COMMON_LIB_INCLUDED')) { + include('./libraries/common.lib.php3'); +} /** * Drop multiple fields if required @@ -19,6 +19,12 @@ if ((!empty($submit_mult) && isset($selected_fld)) include('./mult_submits.inc.php3'); } +/** + * Runs common work + */ +require('./tbl_properties_common.php3'); +$url_query .= '&goto=tbl_properties_structure.php3&back=tbl_properties_structure.php3'; + /** * Prepares the table structure display