bug #1764735 [core] Designer: PDF error when deleting a table
This commit is contained in:
@@ -11,6 +11,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
||||
- bug #1798841 [relations] Copying db does not copy internal relations
|
||||
- bug #1798646 [display] Character '+' in query wrongly interpreted
|
||||
- bug #1801919 [themes] Do not use NaviDatabaseNameColor for fieldset legend
|
||||
- bug #1764735 [core] Designer: PDF error when deleting a table
|
||||
|
||||
2.11.1.0 (2007-09-20)
|
||||
|
||||
|
@@ -798,8 +798,19 @@ class PMA_Table {
|
||||
*/
|
||||
}
|
||||
|
||||
if ($GLOBALS['cfgRelation']['designerwork']) {
|
||||
$table_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords'])
|
||||
. ' SET table_name = \'' . PMA_sqlAddslashes($target_table) . '\','
|
||||
. ' db_name = \'' . PMA_sqlAddslashes($target_db) . '\''
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($source_table) . '\'';
|
||||
PMA_query_as_cu($table_query);
|
||||
unset($table_query);
|
||||
}
|
||||
$GLOBALS['sql_query'] .= "\n\n" . $sql_drop_query . ';';
|
||||
// end if ($move)
|
||||
} else {
|
||||
// we are copying
|
||||
// garvin: Create new entries as duplicates from old PMA DBs
|
||||
if ($what != 'dataonly' && !isset($maintain_relations)) {
|
||||
if ($GLOBALS['cfgRelation']['commwork']) {
|
||||
@@ -853,6 +864,12 @@ class PMA_Table {
|
||||
$where_fields = array('foreign_db' => $source_db, 'foreign_table' => $source_table);
|
||||
$new_fields = array('master_db' => $target_db, 'foreign_db' => $target_db, 'foreign_table' => $target_table);
|
||||
PMA_Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields);
|
||||
|
||||
|
||||
$get_fields = array('x', 'y', 'v', 'h');
|
||||
$where_fields = array('db_name' => $source_db, 'table_name' => $source_table);
|
||||
$new_fields = array('db_name' => $target_db, 'table_name' => $target_table);
|
||||
PMA_Table::duplicateInfo('designerwork', 'designer_coords', $get_fields, $where_fields, $new_fields);
|
||||
|
||||
/**
|
||||
* @todo garvin: Can't get duplicating PDFs the right way. The
|
||||
@@ -1013,6 +1030,18 @@ class PMA_Table {
|
||||
unset($table_query);
|
||||
}
|
||||
|
||||
if ($GLOBALS['cfgRelation']['designerwork']) {
|
||||
$table_query = '
|
||||
UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
|
||||
. PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) . '
|
||||
SET `db_name` = \'' . PMA_sqlAddslashes($new_db) . '\',
|
||||
`table_name` = \'' . PMA_sqlAddslashes($new_name) . '\'
|
||||
WHERE `db_name` = \'' . PMA_sqlAddslashes($old_db) . '\'
|
||||
AND `table_name` = \'' . PMA_sqlAddslashes($old_name) . '\'';
|
||||
PMA_query_as_cu($table_query);
|
||||
unset($table_query);
|
||||
}
|
||||
|
||||
$this->messages[] = sprintf($GLOBALS['strRenameTableOK'],
|
||||
htmlspecialchars($old_name), htmlspecialchars($new_name));
|
||||
return true;
|
||||
|
@@ -76,6 +76,14 @@ function PMA_relationsCleanupTable($db, $table) {
|
||||
unset($remove_query);
|
||||
}
|
||||
|
||||
if ($cfgRelation['designerwork']) {
|
||||
$remove_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['designer_coords'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
|
||||
$rmv_rs = PMA_query_as_cu($remove_query);
|
||||
unset($remove_query);
|
||||
}
|
||||
|
||||
if ($cfgRelation['relwork']) {
|
||||
$remove_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])
|
||||
. ' WHERE master_db = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
@@ -127,6 +135,13 @@ function PMA_relationsCleanupDatabase($db) {
|
||||
unset($remove_query);
|
||||
}
|
||||
|
||||
if ($cfgRelation['designerwork']) {
|
||||
$remove_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['designer_coords'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||
$rmv_rs = PMA_query_as_cu($remove_query);
|
||||
unset($remove_query);
|
||||
}
|
||||
|
||||
if ($cfgRelation['relwork']) {
|
||||
$remove_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])
|
||||
. ' WHERE master_db = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||
|
Reference in New Issue
Block a user