bug #2839548 [export] Triggers order on export

This commit is contained in:
Marc Delisle
2009-08-30 12:43:07 +00:00
parent ad759126db
commit 19331b9c32
3 changed files with 26 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug [export] Exporting results of a query which contains a LIMIT clause - bug [export] Exporting results of a query which contains a LIMIT clause
inside a subquery inside a subquery
- bug #2837722 [export] Run complex SQL then export does not work - bug #2837722 [export] Run complex SQL then export does not work
- bug #2839548 [export] Triggers order on export
3.2.1.0 (2009-08-09) 3.2.1.0 (2009-08-09)
- bug #2799009 Login with ipv6 IP address breaks redirect - bug #2799009 Login with ipv6 IP address breaks redirect

View File

@@ -444,6 +444,13 @@ if ($export_type == 'server') {
break 3; break 3;
} }
} }
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
}
} }
foreach($views as $view) { foreach($views as $view) {
// no data export for a view // no data export for a view
@@ -485,6 +492,13 @@ if ($export_type == 'server') {
break 2; break 2;
} }
} }
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
}
} }
foreach ($views as $view) { foreach ($views as $view) {
// no data export for a view // no data export for a view
@@ -536,6 +550,13 @@ if ($export_type == 'server') {
break; break;
} }
} }
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS[$what . '_structure'])) {
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
break 2;
}
}
if (!PMA_exportDBFooter($db)) { if (!PMA_exportDBFooter($db)) {
break; break;
} }

View File

@@ -763,6 +763,10 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE,
$dump .= PMA_exportComment($GLOBALS['strTableStructure'] . ' ' . $formatted_table_name) $dump .= PMA_exportComment($GLOBALS['strTableStructure'] . ' ' . $formatted_table_name)
. PMA_exportComment(); . PMA_exportComment();
$dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates); $dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates);
$dump .= PMA_getTableComments($db, $table, $crlf, $relation, $mime);
break;
case 'triggers':
$dump = '';
$triggers = PMA_DBI_get_triggers($db, $table); $triggers = PMA_DBI_get_triggers($db, $table);
if ($triggers) { if ($triggers) {
$dump .= PMA_possibleCRLF() $dump .= PMA_possibleCRLF()
@@ -794,7 +798,6 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE,
$dump .= PMA_getTableDefStandIn($db, $table, $crlf); $dump .= PMA_getTableDefStandIn($db, $table, $crlf);
} // end switch } // end switch
$dump .= PMA_getTableComments($db, $table, $crlf, $relation, $mime);
// this one is built by PMA_getTableDef() to use in table copy/move // this one is built by PMA_getTableDef() to use in table copy/move
// but not in the case of export // but not in the case of export
unset($GLOBALS['sql_constraints_query']); unset($GLOBALS['sql_constraints_query']);