bug #1722502 DROP TABLE in export view structure
This commit is contained in:
@@ -18,6 +18,7 @@ $HeadURL$
|
||||
- bug #1721571 CREATE database privilege not always detected,
|
||||
thanks to Gordon McNaughton
|
||||
- bug #1715709 export in SQL format always includes procedures and functions
|
||||
- bug #1722502 DROP TABLE in export view structure
|
||||
|
||||
2.10.1.0 (2007-04-23)
|
||||
=====================
|
||||
|
10
export.php
10
export.php
@@ -436,7 +436,7 @@ if ($export_type == 'server') {
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
// for a view, export a stand-in definition of the table
|
||||
// to resolve view dependencies
|
||||
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table')) {
|
||||
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ if ($export_type == 'server') {
|
||||
foreach($views as $view) {
|
||||
// no data export for a view
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view')) {
|
||||
if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
@@ -477,7 +477,7 @@ if ($export_type == 'server') {
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
// for a view, export a stand-in definition of the table
|
||||
// to resolve view dependencies
|
||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table')) {
|
||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
@@ -491,7 +491,7 @@ if ($export_type == 'server') {
|
||||
foreach ($views as $view) {
|
||||
// no data export for a view
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view')) {
|
||||
if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,7 @@ if ($export_type == 'server') {
|
||||
|
||||
$is_view = PMA_Table::isView($db, $table);
|
||||
if (isset($GLOBALS[$what . '_structure'])) {
|
||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table')) {
|
||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -659,12 +659,13 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
|
||||
* @param boolean whether to include column comments
|
||||
* @param boolean whether to include mime comments
|
||||
* @param string 'stand_in', 'create_table', 'create_view'
|
||||
* @param string 'server', 'database', 'table'
|
||||
*
|
||||
* @return bool Whether it suceeded
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE, $comments = FALSE, $mime = FALSE, $dates = FALSE, $export_mode)
|
||||
function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE, $comments = FALSE, $mime = FALSE, $dates = FALSE, $export_mode, $export_type)
|
||||
{
|
||||
$formatted_table_name = (isset($GLOBALS['sql_backquotes']))
|
||||
? PMA_backquote($table)
|
||||
@@ -682,8 +683,10 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE,
|
||||
case 'create_view':
|
||||
$dump .= $GLOBALS['comment_marker'] . $GLOBALS['strStructureForView'] . ' ' . $formatted_table_name . $crlf
|
||||
. $GLOBALS['comment_marker'] . $crlf;
|
||||
// delete the stand-in table previously created
|
||||
// delete the stand-in table previously created (if any)
|
||||
if ($export_type != 'table') {
|
||||
$dump .= 'DROP TABLE IF EXISTS ' . PMA_backquote($table) . ';' . $crlf;
|
||||
}
|
||||
$dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates) . ';' . $crlf;
|
||||
break;
|
||||
case 'stand_in':
|
||||
|
Reference in New Issue
Block a user