This commit is contained in:
Alexander M. Turek
2002-11-07 22:25:40 +00:00
parent 1480adb634
commit 78fe6381b9
2 changed files with 23 additions and 12 deletions

View File

@@ -8,8 +8,9 @@ $Source$
2002-11-07 Alexander M. Turek <rabus@users.sourceforge.net>
* libraries/config_import.lib.php3: Fixed a small inconsistance.
* config.inc.php3: Added a note about bug #634931.
* tbl_properties_operations.php3: Fixed bug #628581 (Check referential
integrity and NULL foreign key).
* tbl_properties_operations.php3:
- Fixed bug #628581 (Check referential integrity and NULL foreign key).
- Fixed bug #628583 (Check referential integrity and self-linked table).
2002-11-06 Alexander M. Turek <rabus@users.sourceforge.net>
* translators.html, lang/*.inc.php3: Fixed some typos.

View File

@@ -308,21 +308,31 @@ if ($cfgRelation['relwork']) {
<?php
echo "\n";
while (list($master, $arr) = each($foreign)){
$join_query = 'SELECT ' . PMA_backquote($table) . '.* FROM '
. PMA_backquote($table) . ' LEFT JOIN '
. PMA_backquote($arr['foreign_table']);
if ($arr['foreign_table'] == $table) {
$foreign_table = $table . '1';
$join_query .= ' AS ' . PMA_backquote($foreign_table);
} else {
$foreign_table = $arr['foreign_table'];
}
$join_query .= ' ON '
. PMA_backquote($table) . '.' . PMA_backquote($master)
. ' = ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($arr['foreign_field'])
. ' WHERE '
. PMA_backquote($foreign_table) . '.' . PMA_backquote($arr['foreign_field'])
. ' IS NULL AND '
. PMA_backquote($table) . '.' . PMA_backquote($master)
. ' IS NOT NULL';
echo ' '
. '<a href="sql.php3?' . $url_query
. '&amp;sql_query='
. urlencode('SELECT ' . PMA_backquote($table) . '.* FROM '
. PMA_backquote($table) . ' LEFT JOIN '
. PMA_backquote($arr['foreign_table']) . ' ON '
. PMA_backquote($table) . '.' . PMA_backquote($master)
. ' = ' . PMA_backquote($arr['foreign_table']) . '.' . PMA_backquote($arr['foreign_field'])
. ' WHERE '
. PMA_backquote($arr['foreign_table']) . '.' . PMA_backquote($arr['foreign_field'])
. ' IS NULL AND '
. PMA_backquote($table) . '.' . PMA_backquote($master)
. ' IS NOT NULL')
. urlencode($join_query)
. '">' . $master . '&nbsp;->&nbsp;' . $arr['foreign_table'] . '.' . $arr['foreign_field']
. '</a><br />' . "\n";
unset($foreign_table);
unset($join_query);
} // end while
?>
</div>