Skip to content

Commit

Permalink
Oracle: Fix column name in index (thanks to Shirai Takashi)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Feb 18, 2021
1 parent 28996e2 commit f94f291
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions adminer/drivers/oracle.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,7 @@ function indexes($table, $connection2 = null) {
ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row) {
$index_name = $row["INDEX_NAME"];
$column_name = $row["DATA_DEFAULT"];
if ($column_name) {
$column_name = idf_unescape($column_name);
} else {
$column_name = $row["COLUMN_NAME"];
}
$column_name = ($column_name ? trim($column_name, '"') : $row["COLUMN_NAME"]); // trim - possibly wrapped in quotes but never contains quotes inside
$return[$index_name]["type"] = ($row["CONSTRAINT_TYPE"] == "P" ? "PRIMARY" : ($row["CONSTRAINT_TYPE"] == "U" ? "UNIQUE" : "INDEX"));
$return[$index_name]["columns"][] = $column_name;
$return[$index_name]["lengths"][] = ($row["CHAR_LENGTH"] && $row["CHAR_LENGTH"] != $row["COLUMN_LENGTH"] ? $row["CHAR_LENGTH"] : null);
Expand Down

0 comments on commit f94f291

Please sign in to comment.