bug #1906980 [Export] Import of VIEWs fails if temp table exists
This commit is contained in:
@@ -58,6 +58,8 @@ danbarry
|
|||||||
+ [lang] Russian update, thanks to Victor Volkov
|
+ [lang] Russian update, thanks to Victor Volkov
|
||||||
- bug #1910485 [core] Unsetting the whitelist during the loop,
|
- bug #1910485 [core] Unsetting the whitelist during the loop,
|
||||||
thanks to Jeroen Vrijkorte - jv_map
|
thanks to Jeroen Vrijkorte - jv_map
|
||||||
|
- bug #1906980 [Export] Import of VIEWs fails if temp table exists,
|
||||||
|
thanks to Falk Nisius - klaf
|
||||||
|
|
||||||
2.11.5.0 (2008-03-01)
|
2.11.5.0 (2008-03-01)
|
||||||
- bug #1862661 [GUI] Warn about rename deleting database
|
- bug #1862661 [GUI] Warn about rename deleting database
|
||||||
|
@@ -389,7 +389,13 @@ function PMA_exportDBFooter($db)
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_getTableDefStandIn($db, $view, $crlf) {
|
function PMA_getTableDefStandIn($db, $view, $crlf) {
|
||||||
$create_query = 'CREATE TABLE ';
|
$create_query = '';
|
||||||
|
if (! empty($GLOBALS['sql_drop_table'])) {
|
||||||
|
$create_query .= 'DROP VIEW IF EXISTS ' . PMA_backquote($view) . ';' . $crlf;
|
||||||
|
}
|
||||||
|
|
||||||
|
$create_query .= 'CREATE TABLE ';
|
||||||
|
|
||||||
if (isset($GLOBALS['sql_if_not_exists']) && $GLOBALS['sql_if_not_exists']) {
|
if (isset($GLOBALS['sql_if_not_exists']) && $GLOBALS['sql_if_not_exists']) {
|
||||||
$create_query .= 'IF NOT EXISTS ';
|
$create_query .= 'IF NOT EXISTS ';
|
||||||
}
|
}
|
||||||
@@ -464,14 +470,9 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
|
|
||||||
$schema_create .= $new_crlf;
|
$schema_create .= $new_crlf;
|
||||||
|
|
||||||
if (!empty($sql_drop_table)) {
|
// no need to generate a DROP VIEW here, it was done earlier
|
||||||
if (PMA_Table::isView($db,$table)) {
|
if (! empty($sql_drop_table) && ! PMA_Table::isView($db,$table)) {
|
||||||
$drop_clause = 'DROP VIEW';
|
$schema_create .= 'DROP TABLE IF EXISTS ' . PMA_backquote($table, $sql_backquotes) . ';' . $crlf;
|
||||||
} else {
|
|
||||||
$drop_clause = 'DROP TABLE';
|
|
||||||
}
|
|
||||||
$schema_create .= $drop_clause . ' IF EXISTS ' . PMA_backquote($table, $sql_backquotes) . ';' . $crlf;
|
|
||||||
unset($drop_clause);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Steve Alberty's patch for complete table dump,
|
// Steve Alberty's patch for complete table dump,
|
||||||
|
Reference in New Issue
Block a user