bug #1541189, views not displayed in export list

This commit is contained in:
Marc Delisle
2006-10-14 23:17:58 +00:00
parent 106741652c
commit e1e1fdc6bd
3 changed files with 33 additions and 19 deletions

View File

@@ -5,6 +5,13 @@ phpMyAdmin - ChangeLog
$Id$
$HeadURL$
2006-10-14 Marc Delisle <lem9@users.sourceforge.net>
* export.php, db_details_export.php: bug #1541189, views are not displayed
in export list;
However I'm still not sure what should be done if a user only chooses
a view. In the past we ensured to avoid exporting data from a view
because it would create redundant data in the export file
2006-10-13 Marc Delisle <lem9@users.sourceforge.net>
* css/phpmyadmin.css.php: bug #1517428, some IE 6 versions have
problems loading CSS when zlip.output_compression is on,

View File

@@ -36,10 +36,11 @@ $multi_values = '<div align="center"><select name="table_select[]" size="6" mult
$multi_values .= "\n";
foreach ( $tables as $each_table ) {
if ( PMA_MYSQL_INT_VERSION >= 50000 && is_null($each_table['Engine']) ) {
// ok we show also views
//if ( PMA_MYSQL_INT_VERSION >= 50000 && is_null($each_table['Engine']) ) {
// Don't offer to export views yet.
continue;
}
// continue;
//}
if ( ! empty( $unselectall )
|| ( isset( $tmp_select )
&& false !== strpos( $tmp_select, '|' . $each_table['Name'] . '|') ) ) {

View File

@@ -354,22 +354,27 @@ if (!$save_on_server) {
// Check if we have something to export
if ($export_type == 'database') {
$tables = PMA_DBI_get_tables($db);
if (isset($table_select)) {
$tables = $table_select;
} else {
// not sure if this can happen, let's play safe
$tables = PMA_DBI_get_tables($db);
}
$num_tables = count($tables);
if ($num_tables == 0) {
$message = $strNoTablesFound;
$js_to_run = 'functions.js';
require_once('./libraries/header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
require('./server_export.php');
} elseif ($export_type == 'database') {
//if ($export_type == 'server') {
// $active_page = 'server_export.php';
// require('./server_export.php');
//} elseif ($export_type == 'database') {
$active_page = 'db_details_export.php';
require('./db_details_export.php');
} else {
$active_page = 'tbl_properties_export.php';
require('./tbl_properties_export.php');
}
//} else {
// $active_page = 'tbl_properties_export.php';
// require('./tbl_properties_export.php');
//}
exit();
}
}
@@ -456,12 +461,13 @@ if ($export_type == 'server') {
break;
}
if (isset($table_select)) {
$tmp_select = implode($table_select, '|');
$tmp_select = '|' . $tmp_select . '|';
}
//if (isset($table_select)) {
// $tmp_select = implode($table_select, '|');
// $tmp_select = '|' . $tmp_select . '|';
//}
$i = 0;
$views = array();
// $tables contains the choices from the user (via $table_select)
foreach ($tables as $table) {
// if this is a view, collect it for later; views must be exported after
// the tables
@@ -470,8 +476,8 @@ if ($export_type == 'server') {
continue;
}
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $table . '|'))
|| !isset($tmp_select)) {
//if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $table . '|'))
//|| !isset($tmp_select)) {
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates)) {
@@ -483,7 +489,7 @@ if ($export_type == 'server') {
break 2;
}
}
}
//}
}
foreach ($views as $view) {
// no data export for a view