bug #1825172 [export] Exporting and functions

This commit is contained in:
Marc Delisle
2007-11-03 14:52:05 +00:00
parent 528a29afe3
commit d6da079aaf
2 changed files with 21 additions and 14 deletions

View File

@@ -21,6 +21,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
thanks to yarodin thanks to yarodin
- wrong default charset in case of broken session - wrong default charset in case of broken session
- bug #1824506 [profiling] Profile command repeated on older MySQL servers - bug #1824506 [profiling] Profile command repeated on older MySQL servers
- bug #1825172 [export] Exporting and functions
2.11.2.0 (2007-10-27) 2.11.2.0 (2007-10-27)
- patch #1791576 HTTP auth: support REDIRECT_REMOTE_USER, thanks to Allard - patch #1791576 HTTP auth: support REDIRECT_REMOTE_USER, thanks to Allard

View File

@@ -307,36 +307,42 @@ function PMA_exportDBFooter($db)
if (isset($GLOBALS['sql_structure']) && isset($GLOBALS['sql_procedure_function'])) { if (isset($GLOBALS['sql_structure']) && isset($GLOBALS['sql_procedure_function'])) {
$procs_funcs = ''; $procs_funcs = '';
$delimiter = '$$';
$procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE'); $procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');
$function_names = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($procedure_names || $function_names) {
$procs_funcs .= $crlf
. 'DELIMITER ' . $delimiter . $crlf;
}
if ($procedure_names) { if ($procedure_names) {
$delimiter = '$$'; $procs_funcs .=
$procs_funcs = $crlf PMA_exportComment()
. PMA_exportComment()
. PMA_exportComment($GLOBALS['strProcedures']) . PMA_exportComment($GLOBALS['strProcedures'])
. PMA_exportComment()
. 'DELIMITER ' . $delimiter . $crlf
. PMA_exportComment(); . PMA_exportComment();
foreach($procedure_names as $procedure_name) { foreach($procedure_names as $procedure_name) {
$procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf; $procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf;
} }
$procs_funcs .= PMA_exportComment()
. 'DELIMITER ;' . $crlf
. PMA_exportComment();
} }
$function_names = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($function_names) { if ($function_names) {
$procs_funcs .= PMA_exportComment($GLOBALS['strFunctions']) $procs_funcs .=
. PMA_exportComment() . $crlf; PMA_exportComment()
. PMA_exportComment($GLOBALS['strFunctions'])
. PMA_exportComment();
foreach($function_names as $function_name) { foreach($function_names as $function_name) {
$procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'FUNCTION', $function_name) . $crlf . $crlf; $procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf;
} }
} }
if ($procedure_names || $function_names) {
$procs_funcs .= 'DELIMITER ;' . $crlf;
}
if (!empty($procs_funcs)) { if (!empty($procs_funcs)) {
$result = PMA_exportOutputHandler($procs_funcs); $result = PMA_exportOutputHandler($procs_funcs);
} }