diff --git a/ChangeLog b/ChangeLog index e80ad9d32..0124abea9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - patch #1895796 [lang] Typo in Japanese lang files, thanks to tyman - acoustype - bug #1935652 [auth] Access denied (show warning about mcrypt on login page) +- bug #1906983 [export] Reimport of FUNCTION fails 2.11.5.1 (2008-03-29) - bug #1909711 [security] Sensitive data in session files diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 9e7d00b8c..a65ff6a87 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -60,7 +60,7 @@ if (isset($plugin_list)) { $drop_clause = 'DROP TABLE'; } } elseif (PMA_MYSQL_INT_VERSION >= 50000) { - $drop_clause = 'DROP TABLE / DROP VIEW'; + $drop_clause = 'DROP TABLE / VIEW / PROCEDURE / FUNCTION'; } else { $drop_clause = 'DROP TABLE'; } @@ -342,6 +342,9 @@ function PMA_exportDBFooter($db) . PMA_exportComment(); foreach($procedure_names as $procedure_name) { + if (! empty($GLOBALS['sql_drop_table'])) { + $procs_funcs .= 'DROP PROCEDURE ' . PMA_backquote($procedure_name) . $delimiter . $crlf; + } $procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf; } } @@ -353,6 +356,9 @@ function PMA_exportDBFooter($db) . PMA_exportComment(); foreach($function_names as $function_name) { + if (! empty($GLOBALS['sql_drop_table'])) { + $procs_funcs .= 'DROP FUNCTION ' . PMA_backquote($function_name) . $delimiter . $crlf; + } $procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf; } }