diff --git a/CHANGELOG.md b/CHANGELOG.md index c3065143..8b07f90a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Adminer dev +- Display collation at table structure if different from table - PostgreSQL: Display auto_increment of inserted rows - PostgreSQL: Display description of system variables - PostgreSQL: Avoid warning about crdb_version (bug #924, regression from 5.0.5) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index e9c3c0f4..e813164e 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -318,9 +318,10 @@ class Adminer { /** Print table structure in tabular format * @param array data about individual fields + * @param array * @return null */ - function tableStructurePrint($fields) { + function tableStructurePrint($fields, $tableStatus = null) { global $driver; echo "
\n"; echo "\n"; @@ -329,8 +330,11 @@ class Adminer { foreach ($fields as $field) { echo "
" . h($field["field"]); $type = h($field["full_type"]); - echo "" - . (in_array($type, (array) $structured_types[lang('User types')]) ? "$type" : $type) + $collation = h($field["collation"]); + echo "" + . (in_array($type, (array) $structured_types[lang('User types')]) + ? "$type" + : $type . ($collation && isset($tableStatus["Collation"]) && $collation != $tableStatus["Collation"] ? " $collation" : "")) . "" ; echo ($field["null"] ? " NULL" : ""); diff --git a/adminer/include/plugins.inc.php b/adminer/include/plugins.inc.php index d5bf15b1..dc9cfe2d 100644 --- a/adminer/include/plugins.inc.php +++ b/adminer/include/plugins.inc.php @@ -258,7 +258,7 @@ class Plugins extends Adminer { return $this->applyPlugin(__FUNCTION__, $args); } - function tableStructurePrint($fields) { + function tableStructurePrint($fields, $tableStatus = null) { $args = func_get_args(); return $this->applyPlugin(__FUNCTION__, $args); } diff --git a/adminer/table.inc.php b/adminer/table.inc.php index eda00fbb..378b4e55 100644 --- a/adminer/table.inc.php +++ b/adminer/table.inc.php @@ -6,7 +6,7 @@ $fields = fields($TABLE); if (!$fields) { $error = error(); } -$table_status = table_status1($TABLE, true); +$table_status = table_status1($TABLE); $name = $adminer->tableName($table_status); page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . ($name != "" ? $name : h($TABLE)), $error); @@ -23,7 +23,7 @@ if ($comment != "") { } if ($fields) { - $adminer->tableStructurePrint($fields); + $adminer->tableStructurePrint($fields, $table_status); } if (support("indexes") && $driver->supportsIndex($table_status)) { diff --git a/externals/JsShrink b/externals/JsShrink index 18dcc384..4f8a69bd 160000 --- a/externals/JsShrink +++ b/externals/JsShrink @@ -1 +1 @@ -Subproject commit 18dcc3849adf9b6254d268d6cb01829a39aacc12 +Subproject commit 4f8a69bd80bda24e8233bca428e5f56400e3cb1b diff --git a/plugins/table-structure.php b/plugins/table-structure.php index a2ef3d4a..e4868946 100644 --- a/plugins/table-structure.php +++ b/plugins/table-structure.php @@ -12,7 +12,7 @@ class AdminerTableStructure { * @param array data about individual fields * @return bool */ - function tableStructurePrint($fields) { + function tableStructurePrint($fields, $tableStatus = null) { echo "
\n"; echo "\n"; echo ""