bug 772765
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2003-07-24 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
|
* libraries/sqlparser.lib.php3 /relation.lib.php3 /get_foreign.lib.php3:
|
||||||
|
bug 772765, InnoDB and multi-columns foreign key
|
||||||
|
|
||||||
2003-07-23 Alexander M. Turek <rabus@users.sourceforge.net>
|
2003-07-23 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||||
* libraries/mysql_charsets.lib.php3:
|
* libraries/mysql_charsets.lib.php3:
|
||||||
- better method for retrieving the supported MySQL charsets;
|
- better method for retrieving the supported MySQL charsets;
|
||||||
|
@@ -31,11 +31,12 @@
|
|||||||
|
|
||||||
if ($the_total < 200) {
|
if ($the_total < 200) {
|
||||||
// foreign_display can be FALSE if no display field defined:
|
// foreign_display can be FALSE if no display field defined:
|
||||||
|
|
||||||
$foreign_display = PMA_getDisplayField($foreign_db, $foreign_table);
|
$foreign_display = PMA_getDisplayField($foreign_db, $foreign_table);
|
||||||
$dispsql = 'SELECT ' . PMA_backquote($foreign_field)
|
$dispsql = 'SELECT ' . PMA_backquote($foreign_field)
|
||||||
. (($foreign_display == FALSE) ? '' : ', ' . PMA_backquote($foreign_display))
|
. (($foreign_display == FALSE) ? '' : ', ' . PMA_backquote($foreign_display))
|
||||||
. ' FROM ' . PMA_backquote($foreign_db) . '.' . PMA_backquote($foreign_table)
|
. ' FROM ' . PMA_backquote($foreign_db) . '.' . PMA_backquote($foreign_table)
|
||||||
. ' ORDER BY ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($foreign_display);
|
. (($foreign_display == FALSE) ? '' :' ORDER BY ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($foreign_display));
|
||||||
$disp = PMA_mysql_query($dispsql);
|
$disp = PMA_mysql_query($dispsql);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -314,9 +314,9 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
|||||||
|
|
||||||
while (list(,$one_key) = each ($analyzed_sql[0]['foreign_keys'])) {
|
while (list(,$one_key) = each ($analyzed_sql[0]['foreign_keys'])) {
|
||||||
|
|
||||||
// TODO: the analyzer may return more than one column name in the
|
// the analyzer may return more than one column name in the
|
||||||
// index list or the ref_index_list but for now we take the first
|
// index list or the ref_index_list
|
||||||
$field = $one_key['index_list'][0];
|
while (list($i,$field) = each($one_key['index_list'])) {
|
||||||
|
|
||||||
// TODO: SHOW CREATE TABLE does not return the db name in
|
// TODO: SHOW CREATE TABLE does not return the db name in
|
||||||
// the REFERENCES, so we assume the same db as master
|
// the REFERENCES, so we assume the same db as master
|
||||||
@@ -327,7 +327,8 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
|||||||
|
|
||||||
$foreign[$field]['foreign_db'] = $db;
|
$foreign[$field]['foreign_db'] = $db;
|
||||||
$foreign[$field]['foreign_table'] = $one_key['ref_table_name'];
|
$foreign[$field]['foreign_table'] = $one_key['ref_table_name'];
|
||||||
$foreign[$field]['foreign_field'] = $one_key['ref_index_list'][0];
|
$foreign[$field]['foreign_field'] = $one_key['ref_index_list'][$i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -699,7 +699,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
|||||||
* I create all sub-values empty, even if they are
|
* I create all sub-values empty, even if they are
|
||||||
* not present (for example no select_expression alias).
|
* not present (for example no select_expression alias).
|
||||||
*
|
*
|
||||||
* There is a debug section at the end of the main loop, if you want to
|
* There is a debug section at the end of loop #1, if you want to
|
||||||
* see the exact contents of select_expr and table_ref
|
* see the exact contents of select_expr and table_ref
|
||||||
*
|
*
|
||||||
* lem9: queryflags
|
* lem9: queryflags
|
||||||
@@ -1183,7 +1183,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
|||||||
$in_from = FALSE;
|
$in_from = FALSE;
|
||||||
|
|
||||||
for ($i = 0; $i < $size; $i++) {
|
for ($i = 0; $i < $size; $i++) {
|
||||||
//echo "trace loop2 <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br>";
|
//DEBUG echo "trace loop2 <b>" . $arr[$i]['data'] . "</b> (" . $arr[$i]['type'] . ")<br>";
|
||||||
|
|
||||||
// need_confirm
|
// need_confirm
|
||||||
//
|
//
|
||||||
@@ -1369,6 +1369,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
|||||||
if ($upper_data == 'FOREIGN') {
|
if ($upper_data == 'FOREIGN') {
|
||||||
$seen_foreign = TRUE;
|
$seen_foreign = TRUE;
|
||||||
$seen_references = FALSE;
|
$seen_references = FALSE;
|
||||||
|
$foreign_key_number++;
|
||||||
}
|
}
|
||||||
if ($upper_data == 'REFERENCES') {
|
if ($upper_data == 'REFERENCES') {
|
||||||
$seen_foreign = FALSE;
|
$seen_foreign = FALSE;
|
||||||
@@ -1392,8 +1393,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
|
|||||||
if ($seen_foreign && $in_bracket) {
|
if ($seen_foreign && $in_bracket) {
|
||||||
// remove backquotes
|
// remove backquotes
|
||||||
$identifier = str_replace('`','',$arr[$i]['data']);
|
$identifier = str_replace('`','',$arr[$i]['data']);
|
||||||
// new foreign key
|
//$foreign_key_number++;
|
||||||
$foreign_key_number++;
|
|
||||||
$foreign[$foreign_key_number]['index_list'][] = $identifier;
|
$foreign[$foreign_key_number]['index_list'][] = $identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user