libraries/mult_submits.inc.php -> sql.php // -> db_structure.php and if we got an error on the multi submit, // we must display it here and not call again mult_submits.inc.php if (! isset($error) || FALSE === $error) { require './libraries/mult_submits.inc.php'; } if (empty($message)) { $message = PMA_Message::success(); } } require './libraries/db_common.inc.php'; $url_query .= '&goto=db_structure.php'; // Gets the database structure $sub_part = '_structure'; require './libraries/db_info.inc.php'; require_once './libraries/replication.inc.php'; } // 1. No tables if ($num_tables == 0) { echo '

' . $strNoTablesFound . '

' . "\n"; if (empty($db_is_information_schema)) { require './libraries/display_create_table.lib.php'; } // end if (Create Table dialog) /** * Displays the footer */ require_once './libraries/footer.inc.php'; exit; } // else // 2. Shows table informations - staybyte - 11 June 2001 require_once './libraries/bookmark.lib.php'; require_once './libraries/mysql_charsets.lib.php'; $db_collation = PMA_getDbCollation($db); // in a separate file to avoid redeclaration of functions in some code paths require_once './libraries/db_structure.lib.php'; $titles = array(); if (true == $cfg['PropertiesIconic']) { $titles['Browse'] = '' . $strBrowse . ''; $titles['NoBrowse'] = '' . $strBrowse . ''; $titles['Search'] = '' . $strSearch . ''; $titles['NoSearch'] = '' . $strSearch . ''; $titles['Insert'] = '' . $strInsert . ''; $titles['NoInsert'] = '' . $strInsert . ''; $titles['Structure'] = '' . $strStructure . ''; $titles['Drop'] = '' . $strDrop . ''; $titles['NoDrop'] = '' . $strDrop . ''; $titles['Empty'] = '' . $strEmpty . ''; $titles['NoEmpty'] = '' . $strEmpty . ''; if ('both' === $cfg['PropertiesIconic']) { $titles['Browse'] .= $strBrowse; $titles['Search'] .= $strSearch; $titles['NoBrowse'] .= $strBrowse; $titles['NoSearch'] .= $strSearch; $titles['Insert'] .= $strInsert; $titles['NoInsert'] .= $strInsert; $titles['Structure'] .= $strStructure; $titles['Drop'] .= $strDrop; $titles['NoDrop'] .= $strDrop; $titles['Empty'] .= $strEmpty; $titles['NoEmpty'] .= $strEmpty; } } else { $titles['Browse'] = $strBrowse; $titles['Search'] = $strSearch; $titles['NoBrowse'] = $strBrowse; $titles['NoSearch'] = $strSearch; $titles['Insert'] = $strInsert; $titles['NoInsert'] = $strInsert; $titles['Structure'] = $strStructure; $titles['Drop'] = $strDrop; $titles['NoDrop'] = $strDrop; $titles['Empty'] = $strEmpty; $titles['NoEmpty'] = $strEmpty; } /** * Displays the tables list */ $_url_params = array( 'pos' => $pos, 'db' => $db); // Add the sort options if they exists if (isset($_REQUEST['sort'])) { $_url_params['sort'] = $_REQUEST['sort']; } if (isset($_REQUEST['sort_order'])) { $_url_params['sort_order'] = $_REQUEST['sort_order']; } PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']); ?>
1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0; $row_count = 0; $hidden_fields = array(); $odd_row = true; $sum_row_count_pre = ''; // added by rajk - for blobstreaming $PMA_Config = $_SESSION['PMA_Config']; if (!empty($PMA_Config)) $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES'); // list of blobstreaming tables $tableReductionCount = 0; // the amount to reduce the table count by foreach ($tables as $keyname => $each_table) { if (isset($session_bs_tables)) { // compare table name against blobstreaming tables foreach ($session_bs_tables as $table_key=>$table_val) // if the table is a blobstreaming table, reduce table count and skip outer foreach loop if ($table_key == $keyname) { $tableReductionCount++; continue 2; } } // loic1: Patch from Joshua Nye to get valid // statistics whatever is the table type $table_is_view = false; $table_encoded = urlencode($each_table['TABLE_NAME']); // Sets parameters for links $tbl_url_query = $url_query . '&table=' . $table_encoded; // do not list the previous table's size info for a view $formatted_size = '-'; $unit = ''; switch ( $each_table['ENGINE']) { // MyISAM, ISAM or Heap table: Row count, data size and index size // are accurate; data size is accurate for ARCHIVE case 'MyISAM' : case 'ISAM' : case 'HEAP' : case 'MEMORY' : case 'ARCHIVE' : if ($db_is_information_schema) { $each_table['Rows'] = PMA_Table::countRecords($db, $each_table['Name']); } if ($is_show_stats) { $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']); $sum_size += $tblsize; list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) { list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0); $overhead_size += $each_table['Data_free']; } } break; case 'InnoDB' : // InnoDB table: Row count is not accurate but data and index // sizes are. if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) { $each_table['COUNTED'] = true; $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, $each_table['TABLE_NAME'], $force_exact = true, $is_view = false); } else { $each_table['COUNTED'] = false; } if ($is_show_stats) { $tblsize = $each_table['Data_length'] + $each_table['Index_length']; $sum_size += $tblsize; list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); } //$display_rows = ' - '; break; // Mysql 5.0.x (and lower) uses MRG_MyISAM and MySQL 5.1.x (and higher) uses MRG_MYISAM // Both are aliases for MERGE case 'MRG_MyISAM' : case 'MRG_MYISAM' : case 'MERGE' : case 'BerkeleyDB' : // Merge or BerkleyDB table: Only row count is accurate. if ($is_show_stats) { $formatted_size = ' - '; $unit = ''; } break; // for a view, the ENGINE is sometimes reported as null, // or on some servers it's reported as "SYSTEM VIEW" case null : case 'SYSTEM VIEW' : // if table is broken, Engine is reported as null, so one more test if ($each_table['TABLE_TYPE'] == 'VIEW') { // countRecords() takes care of $cfg['MaxExactCountViews'] $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, $each_table['TABLE_NAME'], $force_exact = true, $is_view = true); $table_is_view = true; } break; default : // Unknown table type. if ($is_show_stats) { $formatted_size = 'unknown'; $unit = ''; } } // end switch if (! PMA_Table::isMerge($db, $each_table['TABLE_NAME'])) { $sum_entries += $each_table['TABLE_ROWS']; } if (isset($each_table['Collation'])) { $collation = '' . $each_table['Collation'] . ''; } else { $collation = '---'; } if ($is_show_stats) { if (isset($formatted_overhead)) { $overhead = '' . $formatted_overhead . ' ' . $overhead_unit . '' . "\n"; unset($formatted_overhead); $overhead_check .= "document.getElementById('checkbox_tbl_" . ($i + 1) . "').checked = true;"; } else { $overhead = '-'; } } // end if $alias = (!empty($tooltip_aliasname) && isset($tooltip_aliasname[$each_table['TABLE_NAME']])) ? str_replace(' ', ' ', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']])) : str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME'])); $truename = (!empty($tooltip_truename) && isset($tooltip_truename[$each_table['TABLE_NAME']])) ? str_replace(' ', ' ', htmlspecialchars($tooltip_truename[$each_table['TABLE_NAME']])) : str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME'])); $i++; $row_count++; if ($table_is_view) { $hidden_fields[] = ''; } if ($each_table['TABLE_ROWS'] > 0) { $browse_table = '' . $titles['Browse'] . ''; $search_table = '' . $titles['Search'] . ''; } else { $browse_table = $titles['NoBrowse']; $search_table = $titles['NoSearch']; } if (! $db_is_information_schema) { if (! empty($each_table['TABLE_ROWS'])) { $empty_table = '' . $titles['Empty'] . ''; } else { $empty_table = $titles['NoEmpty']; } $drop_query = 'DROP ' . ($table_is_view ? 'VIEW' : 'TABLE') . ' ' . PMA_backquote($each_table['TABLE_NAME']); $drop_message = sprintf( $table_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped, str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME']))); } $tracking_icon = ''; if (PMA_Tracker::isActive()) { if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) { $tracking_icon = '' . $strTrackingIsActive . ''; } elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) { $tracking_icon = '' . $strTrackingIsNotActive . ''; } } if ($num_columns > 0 && $num_tables > $num_columns && (($row_count % $num_columns) == 0)) { $row_count = 1; $odd_row = true; ?> 0) || (strlen(array_search($db, $server_slave_Do_DB)) > 0) || (count($server_slave_Do_DB) == 1 && count($server_slave_Ignore_DB) == 1) ) { $do = true; } foreach ($server_slave_Wild_Do_Table as $table) { if (($db == PMA_replication_strout($table)) && (preg_match("@^" . substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true)) - 1) . "@", $truename))) $do = true; } //////////////////////////////////////////////////////////////////// if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { $ignored = true; } foreach ($server_slave_Wild_Ignore_Table as $table) { if (($db == PMA_replication_strout($table)) && (preg_match("@^" . substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true)) - 1) . "@", $truename))) $ignored = true; } }/* elseif ($server_master_status) { if ((strlen(array_search($db, $server_master_Do_DB))>0) || count($server_master_Do_DB)==1) $do = true; elseif ((strlen(array_search($db, $server_master_Ignore_DB))>0) || count($server_master_Ignore_DB)==1) $ignored = true; }*/ ?> /> ' : ''. $do ? ' REPLICATED' : ''; ?> = $GLOBALS['cfg']['MaxExactCountViews']){ $row_count_pre = '~'; $sum_row_count_pre = '~'; $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]'))); } } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) { // InnoDB table: we did not get an accurate row count $row_count_pre = '~'; $sum_row_count_pre = '~'; $show_superscript = ''; } else { $row_count_pre = ''; $show_superscript = ''; } ?> 1)) { ?> - --- - - ' . $GLOBALS['strReplication'] . '' . "\n"; } ?> 1)) { $default_engine = PMA_DBI_get_default_engine(); echo ' ' . "\n" . ' ' .$default_engine . '' . "\n"; // we got a case where $db_collation was empty echo ' ' . "\n"; if (! empty($db_collation)) { echo ' ' . $db_collation . ''; } echo ''; } if ($is_show_stats) { ?>
<?php echo $strWithChecked; ?> / /

50100) { require './libraries/db_events.inc.php'; } /** * Work on the database * redesigned 2004-05-08 by mkkeck */ /* DATABASE WORK */ /* Printable view of a table */ echo '

'; echo ''; if ($cfg['PropertiesIconic']) { echo ''; } echo $strPrintView . ' '; echo ''; if ($cfg['PropertiesIconic']) { echo ''; } echo $strDataDict . ''; echo '

'; if (empty($db_is_information_schema)) { require './libraries/display_create_table.lib.php'; } // end if (Create Table dialog) /** * Displays the footer */ require_once './libraries/footer.inc.php'; ?>