diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 45e9fce47..826858437 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -537,10 +537,7 @@ function PMA_DBI_num_fields($result) */ function PMA_DBI_field_len($result, $i) { - $info = mysqli_fetch_field_direct($result, $i); - // stdClass::$length will be integrated in - // mysqli-ext when mysql4.1 has been released. - return @$info->length; + return mysqli_fetch_field_direct($result, $i)->length; } /** @@ -553,8 +550,7 @@ function PMA_DBI_field_len($result, $i) */ function PMA_DBI_field_name($result, $i) { - $info = mysqli_fetch_field_direct($result, $i); - return $info->name; + return mysqli_fetch_field_direct($result, $i)->name; } /** diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index bb543c9f9..a1896c163 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -1890,25 +1890,14 @@ if (! defined('PMA_MINIMUM_COMMON')) { // of the foreign key REFERENCES if ($brackets_level > 1) { $foreign[$foreign_key_number]['ref_index_list'][] = $identifier; - } else { - // for MySQL 4.0.18, identifier is - // `table` or `db`.`table` + } elseif ($arr[$i+1]['type'] == 'punct_qualifier') { + // identifier is `db`.`table` // the first pass will pick the db name - // the next pass will execute the else and pick the - // db name in $db_table[0] - if ($arr[$i+1]['type'] == 'punct_qualifier') { - $foreign[$foreign_key_number]['ref_db_name'] = $identifier; - } else { - // for MySQL 4.0.16, identifier is - // `table` or `db.table` - $db_table = explode('.', $identifier); - if (isset($db_table[1])) { - $foreign[$foreign_key_number]['ref_db_name'] = $db_table[0]; - $foreign[$foreign_key_number]['ref_table_name'] = $db_table[1]; - } else { - $foreign[$foreign_key_number]['ref_table_name'] = $db_table[0]; - } - } + // the next pass will pick the table name + $foreign[$foreign_key_number]['ref_db_name'] = $identifier; + } else { + // identifier is `table` + $foreign[$foreign_key_number]['ref_table_name'] = $identifier; } } }