bug #1722502 DROP TABLE in export VIEW

This commit is contained in:
Marc Delisle
2007-06-14 17:10:25 +00:00
parent 416e4c8d89
commit bee991f7ef
3 changed files with 7 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ $HeadURL$
2.10.3.0 (not yet released) 2.10.3.0 (not yet released)
- bug #1734285 Copy database with VIEWs - bug #1734285 Copy database with VIEWs
- bug #1722502 DROP TABLE in export VIEW
2.10.2.0 (not yet released) 2.10.2.0 (not yet released)

View File

@@ -327,7 +327,7 @@ $cfg['Export']['sql_disable_fk'] = FALSE;
$cfg['Export']['sql_use_transaction'] = FALSE; $cfg['Export']['sql_use_transaction'] = FALSE;
$cfg['Export']['sql_drop_database'] = FALSE; $cfg['Export']['sql_drop_database'] = FALSE;
$cfg['Export']['sql_drop_table'] = FALSE; $cfg['Export']['sql_drop_table'] = FALSE;
$cfg['Export']['sql_if_not_exists'] = FALSE; $cfg['Export']['sql_if_not_exists'] = TRUE;
$cfg['Export']['sql_procedure_function'] = FALSE; $cfg['Export']['sql_procedure_function'] = FALSE;
$cfg['Export']['sql_auto_increment'] = TRUE; $cfg['Export']['sql_auto_increment'] = TRUE;
$cfg['Export']['sql_backquotes'] = TRUE; $cfg['Export']['sql_backquotes'] = TRUE;

View File

@@ -366,7 +366,11 @@ function PMA_exportDBFooter($db)
* @access public * @access public
*/ */
function PMA_getTableDefStandIn($db, $view, $crlf) { function PMA_getTableDefStandIn($db, $view, $crlf) {
$create_query = 'CREATE TABLE ' . PMA_backquote($view) . ' (' . $crlf; $create_query = 'CREATE TABLE ';
if (isset($GLOBALS['sql_if_not_exists']) && $GLOBALS['sql_if_not_exists']) {
$create_query .= 'IF NOT EXISTS ';
}
$create_query .= PMA_backquote($view) . ' (' . $crlf;
$tmp = array(); $tmp = array();
$columns = PMA_DBI_get_columns_full($db, $view); $columns = PMA_DBI_get_columns_full($db, $view);
foreach($columns as $column_name => $definition) { foreach($columns as $column_name => $definition) {