Save bytes
This commit is contained in:
parent
d5b329a1a4
commit
fa09eba15e
|
@ -500,10 +500,11 @@ if (!defined("DRIVER")) {
|
|||
function indexes($table, $connection2 = null) {
|
||||
$return = array();
|
||||
foreach (get_rows("SHOW INDEX FROM " . table($table), $connection2) as $row) {
|
||||
$return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? ($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE")));
|
||||
$return[$row["Key_name"]]["columns"][] = $row["Column_name"];
|
||||
$return[$row["Key_name"]]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
|
||||
$return[$row["Key_name"]]["descs"][] = null;
|
||||
$name = $row["Key_name"];
|
||||
$return[$name]["type"] = ($name == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? ($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE")));
|
||||
$return[$name]["columns"][] = $row["Column_name"];
|
||||
$return[$name]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
|
||||
$return[$name]["descs"][] = null;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue