1
0
mirror of https://github.com/vrana/adminer.git synced 2025-09-06 12:20:48 +02:00

Compare commits

...

77 Commits

Author SHA1 Message Date
Jakub Vrana
1cfc8451ef Release 5.3.0 2025-05-04 18:30:08 +02:00
Jakub Vrana
62a9cf3e3f Editor: Fix bit edit 2025-05-04 15:20:11 +02:00
Jakub Vrana
e707c7a5f4 Editor: Fix bit and enum search (fix #1062) 2025-05-04 15:20:11 +02:00
Alex Yu
c92b127b56 Add lavender-light theme 2025-05-04 15:20:09 +02:00
Pexle Chris
cf52c4c0a8 AdminerDarkSwitcher: Handle first click
Fixed an issue where the Dark Mode Switcher icon did not respond on the first click if the Dark Mode cookie had not been set yet. Now, clicking the icon correctly sets the cookie and immediately toggles Dark Mode.
2025-05-04 13:10:38 +02:00
Jakub Vrana
5f7fb62803 PostgreSQL: Add NOT ILIKE operator (fix #1066) 2025-05-04 13:03:47 +02:00
Jakub Vrana
9b0acfa7c9 PostgreSQL: Align numbers in SQL command right (fix #1071) 2025-05-04 13:03:47 +02:00
Jakub Vrana
45d61803c4 Align money values right (bug #1071) 2025-05-04 13:03:47 +02:00
Jakub Vrana
48160f2cd7 Add border to column actions (fix #1072) 2025-05-04 13:03:46 +02:00
Jakub Vrana
61f2b370df AdminerSelectEmail: Use Adminer translation 2025-04-26 05:53:10 +02:00
Jakub Vrana
e13910b5c5 AdminerSelectEmail: Wrap long lines 2025-04-26 05:51:07 +02:00
Jakub Vrana
de86789bfc Indexes: Link algorithm doc 2025-04-26 05:43:25 +02:00
Jakub Vrana
ebcf4feeb2 Use variable 2025-04-26 05:31:48 +02:00
Jakub Vrana
d881f51deb MySQL: Fix connecting with port (fix #1057, regression from 5.1.1) 2025-04-24 22:31:03 +02:00
Matthaiks
b9c39e77fc Update Polish translation 2025-04-24 16:20:16 +02:00
salacr
c734deca84 PostgreSQL: Partial Indexes 2025-04-24 11:39:59 +02:00
Jakub Vrana
1466051402 Fix type error in Create function (fix #1053) 2025-04-21 08:36:32 +02:00
Joshi yogesh
36e55a3f55 Add Hindi translations for previously untranslated strings (#1052) 2025-04-19 20:05:11 +02:00
Joshi yogesh
155668906d Add Bengali (bn) translations for missing phrases (#1051) 2025-04-18 23:00:45 +02:00
Jakub Vrana
70ce02a798 AdminerTableIndexesStructure: Print algorithm 2025-04-18 15:00:08 +02:00
Jakub Vrana
de3220acc7 MySQL: Hide index algorithm if only one 2025-04-18 14:58:41 +02:00
Jakub Vrana
1030e84904 CSS: Remove icon padding on iOS 2025-04-18 14:37:16 +02:00
Jakub Vrana
f4ca974623 Add forgotten move_col 2025-04-18 06:53:03 +02:00
Jakub Vrana
af627e7116 AdminerForeignSystem: Link pg_catalog 2025-04-17 19:57:14 +02:00
Jakub Vrana
0c5bba47da non-MySQL: Fix computing unique array 2025-04-17 18:07:23 +02:00
Jakub Vrana
e340a2973e Select: Align numeric functions right 2025-04-17 18:00:49 +02:00
Jakub Vrana
be2afb49c5 PostgreSQL: Link COUNT(*) 2025-04-17 17:46:43 +02:00
Jakub Vrana
c8fa515ed5 CSS: Switch between independent adminer[-dark].css 2025-04-17 17:23:57 +02:00
Jakub Vrana
3dad86d279 Plugins: Allow setting dark mode in css() (bug #1049) 2025-04-17 16:58:58 +02:00
Jakub Vrana
d9c1ac00f3 Extract variable 2025-04-17 15:38:16 +02:00
Jakub Vrana
2a4d2cfb39 Fix typo in comment 2025-04-17 15:34:20 +02:00
Jakub Vrana
67a64c8d72 JUSH: PostgreSQL keywords, autocomplate table aliases 2025-04-17 14:26:55 +02:00
Jakub Vrana
d59d6c4075 MySQL: Support index algorithms with MEMORY and NDB engines 2025-04-17 10:54:04 +02:00
Jakub Vrana
dbec3a1b92 Pass $tableStatus to indexMethods, rename 2025-04-17 10:22:32 +02:00
Jakub Vrana
a93f0003ae MySQL: Remove negation from support() 2025-04-17 10:06:56 +02:00
Jakub Vrana
29a31c6b9c Lang: Use GLOB_BRACE 2025-04-17 08:49:53 +02:00
Joshi yogesh
a04823f4c4 Add Hindi (hi) language translation file for Adminer
This commit adds a new Hindi (hi) translation file for Adminer, based on the existing Bengali (bn) language file.

All interface strings have been translated from Bengali to Hindi to make Adminer more accessible to Hindi-speaking users. The structure of the file follows the format used in other language files within the repository.

The translations were carefully reviewed to ensure accuracy, readability, and consistency with the context of the Adminer application.

File added:
- lang/hi.inc.php

Looking forward to your feedback and happy to make any improvements as needed!
2025-04-17 08:43:05 +02:00
Jakub Vrana
82c544514d Move translation 2025-04-17 08:39:00 +02:00
salacr
7185d7854f Add PHP_CodeSniffer to pipeline (#1044) 2025-04-17 08:31:05 +02:00
Matthaiks
d845d4b358 Update Polish translation 2025-04-17 08:27:48 +02:00
salacr
92ce506243 PostgreSQL: Support index algorithms 2025-04-16 09:22:28 +02:00
Jakub Vrana
6d6998c3d3 PostgreSQL: Support calling functions returning table (fix #1040) 2025-04-15 23:22:36 +02:00
Jakub Vrana
45799f4605 AdminerSqlLog: Store schema 2025-04-15 22:47:48 +02:00
Jakub Vrana
b999f123c8 Swap ' and " 2025-04-15 21:59:41 +02:00
Jakub Vrana
7642b00877 Designs: Don't sniff protocol-relative URLs 2025-04-15 21:43:18 +02:00
Jakub Vrana
45be56e4e1 Add todo 2025-04-15 21:38:29 +02:00
Jakub Vrana
e1b92f73aa Issues: Link Docker image repo 2025-04-15 16:43:58 +02:00
Jakub Vrana
63850ebf19 CSS: Highlight anchor 2025-04-15 09:48:33 +02:00
Jakub Vrana
49fd96f8b9 PostgreSQL: Display partition info (bug #1031) 2025-04-15 08:58:24 +02:00
Matthaiks
fcae403f60 Update Polish translation 2025-04-15 08:40:48 +02:00
Jakub Vrana
7dc152b732 CockroachDB: Partitioning 2025-04-15 07:18:22 +02:00
Jakub Vrana
29f7b2df96 Tests PostgreSQL: Partitioning 2025-04-15 06:51:13 +02:00
Jakub Vrana
3466ab730b Partitioning: Compact array earlier 2025-04-15 06:46:23 +02:00
Jakub Vrana
9235cb8350 Doc: Update 2025-04-15 06:20:13 +02:00
Jakub Vrana
020285772b MySQL: Avoid warning on selecting tables with fulltext indexes (fix #1036) 2025-04-14 17:52:55 +02:00
Jakub Vrana
8238838285 Bug template: offer single language 2025-04-14 17:45:47 +02:00
Jakub Vrana
a165d4ed81 PostgreSQL: Export PARTITION BY (bug #1031) 2025-04-14 16:41:31 +02:00
Jakub Vrana
f5b42eae55 PostgreSQL: Allow renaming inherited tables 2025-04-14 16:03:44 +02:00
Jakub Vrana
460a24ea2d PostgreSQL: Creating partitioned tables (fix #1031) 2025-04-14 15:50:17 +02:00
Jakub Vrana
4646298015 Partitioning: Move to MySQL 2025-04-14 15:33:58 +02:00
Jakub Vrana
cde6b9008c Move partitioning functions 2025-04-14 13:54:20 +02:00
Jakub Vrana
8783f4d3ac PostgreSQL: Include inherited tables in table_status (bug #1031) 2025-04-14 13:13:08 +02:00
Jakub Vrana
3d2395fc59 Remove unnecessary aliases 2025-04-14 12:41:36 +02:00
Jakub Vrana
3a73815ba4 Do not attempt allFields without DB (fix #1033) 2025-04-14 09:21:51 +02:00
Jakub Vrana
d0a2de53ef Bug template: Ask for more info 2025-04-14 08:50:17 +02:00
Jakub Vrana
982233d7e5 Code style: Ignore long translations 2025-04-14 07:58:29 +02:00
salacr
cedfe97f40 Generic.Whitespace -> Generic.WhiteSpace 2025-04-14 07:56:56 +02:00
Jakub Vrana
9beb72edc2 PostgreSQL: Simplify OID 2025-04-13 22:42:05 +02:00
Jakub Vrana
9555c96d6a PostgreSQL: Link parent from inherited tables (bug #1031) 2025-04-13 16:59:16 +02:00
Jakub Vrana
a3d0bbba8f Compile: Fix type (fix #1027) 2025-04-13 16:36:15 +02:00
Jakub Vrana
a9bcde334f PostgreSQL: Move partitioned tables from table list to parent table (bug #1031) 2025-04-13 16:36:10 +02:00
Jakub Vrana
a735b795b2 PostgreSQL: Show partitioned tables as tables, not views (bug #1031) 2025-04-13 14:05:54 +02:00
Jakub Vrana
008cd33058 Designs: adminer.css with 'prefers-color-scheme: dark' don't disable dark mode (fix #1009) 2025-04-13 11:44:58 +02:00
Jakub Vrana
036ce4f1c5 Handle unloaded driver plugins 2025-04-13 08:31:56 +02:00
Jakub Vrana
5867b0724f Plugins: Method bodyClass() to add <body class> (fix #309) 2025-04-13 08:24:16 +02:00
Jakub Vrana
71f2578af6 Driver plugins: Show possible extensions 2025-04-12 09:01:30 +02:00
Jakub Vrana
c809216a56 Develop 2025-04-11 22:27:01 +02:00
45 changed files with 1649 additions and 239 deletions

View File

@@ -8,8 +8,11 @@ assignees: ''
--- ---
**Adminer version:** please use latest published or Git **Adminer version:** please use latest published or Git
**Compiled:** single file / single language / source codes / custom compilation
**Driver:** e.g. MySQLi **Driver:** e.g. MySQLi
**Database version:** e.g. 10.2.12-MariaDB **Database version:** e.g. 10.2.12-MariaDB
**Plugins used:**
_Please provide reproducible steps including a SQL dump (with no personal information) if applicable. _Please provide reproducible steps including a SQL dump (with no personal information) if applicable.
Also please include a screenshot._ Also please include a screenshot.
Report issues with Adminer Docker image at https://github.com/TimWolla/docker-adminer._

17
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: CI
on:
pull_request:
branches: [ master ]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
- uses: php-actions/phpcs@v1
with:
path: adminer/
standard: phpcs.xml

View File

@@ -1,3 +1,23 @@
## Adminer 5.3.0 (released 2025-05-04)
- Align numeric functions right
- Autocomplete: Support table aliases
- Fix type error in Create function (bug #1053, regression from 5.1.1)
- Add border to column actions (bug #1072)
- Align money values right (bug #1071)
- MySQL: Avoid warning on selecting tables with fulltext indexes (bug #1036)
- MySQL, PostgreSQL: Support index algorithms (bug #1030)
- MySQL: Fix connecting to localhost:3306 (bug #1057, regression from 5.1.1)
- PostgreSQL, CockroachDB: Creating partitioned tables (bug #1031)
- PostgreSQL: Move partitioned tables from table list to parent table
- PostgreSQL: Support partial indices (bug #1048)
- PostgreSQL: Support calling functions returning table (bug #1040)
- PostgreSQL: Add NOT ILIKE operator (bug #1066)
- Editor: Fix bit and enum search (bug #1062)
- Designs: adminer.css with 'prefers-color-scheme: dark' doesn't disable dark mode
- Plugins: Method bodyClass() to add &lt;body class>
- Plugins: Allow setting dark mode in css()
- Hindi translation
## Adminer 5.2.1 (released 2025-04-11) ## Adminer 5.2.1 (released 2025-04-11)
- Fix search anywhere (bug #1004, regression from 5.1.1) - Fix search anywhere (bug #1004, regression from 5.1.1)
- Fix import without primary key (bug #1017, regression from 5.1.1) - Fix import without primary key (bug #1017, regression from 5.1.1)
@@ -46,8 +66,8 @@
- CSS: Allow more custom styles with dark mode (bug #925) - CSS: Allow more custom styles with dark mode (bug #925)
- CSS: Increase maximum width of string edit (bug #930) - CSS: Increase maximum width of string edit (bug #930)
- CSS: Increase space after SQL result (bug #937) - CSS: Increase space after SQL result (bug #937)
- Plugins: autoload plugins from adminer-plugins/ - Plugins: Autoload plugins from adminer-plugins/
- Plugins: configure plugins with adminer-plugins.php - Plugins: Configure plugins with adminer-plugins.php
- Plugins: Display loaded plugins in server overview - Plugins: Display loaded plugins in server overview
- New plugin: AI prompt in SQL command generating the queries with Google Gemini - New plugin: AI prompt in SQL command generating the queries with Google Gemini
- New plugin: Verify new versions from GitHub - New plugin: Verify new versions from GitHub

View File

@@ -8,7 +8,7 @@ $routine = routine($_GET["call"], (isset($_GET["callf"]) ? "FUNCTION" : "PROCEDU
$in = array(); $in = array();
$out = array(); $out = array();
foreach ($routine["fields"] as $i => $field) { foreach ($routine["fields"] as $i => $field) {
if (substr($field["inout"], -3) == "OUT") { if (substr($field["inout"], -3) == "OUT" && JUSH == 'sql') {
$out[$i] = "@" . idf_escape($field["field"]) . " AS " . idf_escape($field["field"]); $out[$i] = "@" . idf_escape($field["field"]) . " AS " . idf_escape($field["field"]);
} }
if (!$field["inout"] || substr($field["inout"], 0, 2) == "IN") { if (!$field["inout"] || substr($field["inout"], 0, 2) == "IN") {
@@ -29,7 +29,11 @@ if (!$error && $_POST) {
connection()->query("SET @" . idf_escape($field["field"]) . " = $val"); connection()->query("SET @" . idf_escape($field["field"]) . " = $val");
} }
} }
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); if (isset($out[$key])) {
$call[] = "@" . idf_escape($field["field"]);
} elseif (in_array($key, $in)) {
$call[] = $val;
}
} }
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")"; $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";

View File

@@ -2,10 +2,8 @@
namespace Adminer; namespace Adminer;
$TABLE = $_GET["create"]; $TABLE = $_GET["create"];
$partition_by = array(); $partition_by = driver()->partitionBy;
foreach (array('HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY', 'RANGE', 'LIST') as $key) { $partitions_info = driver()->partitionsInfo($TABLE);
$partition_by[$key] = $key;
}
$referencable_primary = referencable_primary($TABLE); $referencable_primary = referencable_primary($TABLE);
$foreign_keys = array(); $foreign_keys = array();
@@ -80,40 +78,26 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
} }
} }
$partitioning = ""; $partitioning = array();
if (support("partitioning")) { if (in_array($row["partition_by"], $partition_by)) {
if (isset($partition_by[$row["partition_by"]])) { foreach ($row as $key => $val) {
$params = array(); if (preg_match('~^partition~', $key)) {
foreach ($row as $key => $val) { $partitioning[$key] = $val;
if (preg_match('~^partition~', $key)) {
$params[$key] = $val;
}
} }
foreach ($params["partition_names"] as $key => $name) {
if ($name == "") {
unset($params["partition_names"][$key]);
unset($params["partition_values"][$key]);
}
}
if ($params != get_partitions_info($TABLE)) {
$partitions = array();
if ($params["partition_by"] == 'RANGE' || $params["partition_by"] == 'LIST') {
foreach ($params["partition_names"] as $key => $name) {
$value = $params["partition_values"][$key];
$partitions[] = "\n PARTITION " . idf_escape($name) . " VALUES " . ($params["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ($value)" : " MAXVALUE"); //! SQL injection
}
}
// $params["partition"] can be expression, not only column
$partitioning .= "\nPARTITION BY $params[partition_by]($params[partition])";
if ($partitions) {
$partitioning .= " (" . implode(",", $partitions) . "\n)";
} elseif ($params["partitions"]) {
$partitioning .= " PARTITIONS " . (+$params["partitions"]);
}
}
} elseif (preg_match("~partitioned~", $table_status["Create_options"])) {
$partitioning .= "\nREMOVE PARTITIONING";
} }
foreach ($partitioning["partition_names"] as $key => $name) {
if ($name == "") {
unset($partitioning["partition_names"][$key]);
unset($partitioning["partition_values"][$key]);
}
}
$partitioning["partition_names"] = array_values($partitioning["partition_names"]);
$partitioning["partition_values"] = array_values($partitioning["partition_values"]);
if ($partitioning == $partitions_info) {
$partitioning = array();
}
} elseif (preg_match("~partitioned~", $table_status["Create_options"])) {
$partitioning = null;
} }
$message = lang('Table has been altered.'); $message = lang('Table has been altered.');
@@ -159,8 +143,8 @@ if (!$_POST) {
$row["fields"][] = $field; $row["fields"][] = $field;
} }
if (support("partitioning")) { if ($partition_by) {
$row += get_partitions_info($TABLE); $row += $partitions_info;
$row["partition_names"][] = ""; $row["partition_names"][] = "";
$row["partition_values"][] = ""; $row["partition_values"][] = "";
} }
@@ -221,10 +205,10 @@ if (support("columns")) {
<input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?> <input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?>
<?php } ?> <?php } ?>
<?php <?php
if (support("partitioning")) { if ($partition_by && (JUSH == 'sql' || $TABLE == "")) {
$partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]); $partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
print_fieldset("partition", lang('Partition by'), $row["partition_by"]); print_fieldset("partition", lang('Partition by'), $row["partition_by"]);
echo "<p>" . html_select("partition_by", array("" => "") + $partition_by, $row["partition_by"]) . on_help("event.target.value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;"); echo "<p>" . html_select("partition_by", array_merge(array(""), $partition_by), $row["partition_by"]) . on_help("event.target.value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;");
echo "(<input name='partition' value='" . h($row["partition"]) . "'>)\n"; echo "(<input name='partition' value='" . h($row["partition"]) . "'>)\n";
echo lang('Partitions') . ": <input type='number' name='partitions' class='size" . ($partition_table || !$row["partition_by"] ? " hidden" : "") . "' value='" . h($row["partitions"]) . "'>\n"; echo lang('Partitions') . ": <input type='number' name='partitions' class='size" . ($partition_table || !$row["partition_by"] ? " hidden" : "") . "' value='" . h($row["partitions"]) . "'>\n";
echo "<table id='partition-table'" . ($partition_table ? "" : " class='hidden'") . ">\n"; echo "<table id='partition-table'" . ($partition_table ? "" : " class='hidden'") . ">\n";

View File

@@ -29,7 +29,7 @@ if (!defined('Adminer\DRIVER')) {
($server . $username . $password != "" ? $password : ini_get("mysqli.default_pw")), ($server . $username . $password != "" ? $password : ini_get("mysqli.default_pw")),
null, null,
(is_numeric($port) ? intval($port) : ini_get("mysqli.default_port")), (is_numeric($port) ? intval($port) : ini_get("mysqli.default_port")),
(is_numeric($port) ? $port : null), (is_numeric($port) ? null : $port),
($ssl ? ($ssl['verify'] !== false ? 2048 : 64) : 0) // 2048 - MYSQLI_CLIENT_SSL, 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16) ($ssl ? ($ssl['verify'] !== false ? 2048 : 64) : 0) // 2048 - MYSQLI_CLIENT_SSL, 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16)
); );
$this->options(MYSQLI_OPT_LOCAL_INFILE, false); $this->options(MYSQLI_OPT_LOCAL_INFILE, false);
@@ -258,6 +258,9 @@ if (!defined('Adminer\DRIVER')) {
$this->types[lang('Numbers')]["vector"] = 16383; $this->types[lang('Numbers')]["vector"] = 16383;
$this->insertFunctions['vector'] = 'string_to_vector'; $this->insertFunctions['vector'] = 'string_to_vector';
} }
if (min_version(5.1, '', $connection)) {
$this->partitionBy = array("HASH", "LINEAR HASH", "KEY", "LINEAR KEY", "RANGE", "LIST");
}
if (min_version(5.7, 10.2, $connection)) { if (min_version(5.7, 10.2, $connection)) {
$this->generated = array("STORED", "VIRTUAL"); $this->generated = array("STORED", "VIRTUAL");
} }
@@ -335,6 +338,17 @@ if (!defined('Adminer\DRIVER')) {
} }
} }
function partitionsInfo(string $table): array {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($table);
$result = connection()->query("SELECT PARTITION_METHOD, PARTITION_EXPRESSION, PARTITION_ORDINAL_POSITION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
$return = array();
list($return["partition_by"], $return["partition"], $return["partitions"]) = $result->fetch_row();
$partitions = get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");
$return["partition_names"] = array_keys($partitions);
$return["partition_values"] = array_values($partitions);
return $return;
}
function hasCStyleEscapes(): bool { function hasCStyleEscapes(): bool {
static $c_style; static $c_style;
if ($c_style === null) { if ($c_style === null) {
@@ -353,6 +367,10 @@ if (!defined('Adminer\DRIVER')) {
} }
return $return; return $return;
} }
function indexAlgorithms(array $tableStatus): array {
return (preg_match('~^(MEMORY|NDB)$~', $tableStatus["Engine"]) ? array("HASH", "BTREE") : array());
}
} }
@@ -544,6 +562,7 @@ if (!defined('Adminer\DRIVER')) {
$return[$name]["columns"][] = $row["Column_name"]; $return[$name]["columns"][] = $row["Column_name"];
$return[$name]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]); $return[$name]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
$return[$name]["descs"][] = null; $return[$name]["descs"][] = null;
$return[$name]["algorithm"] = $row["Index_type"];
} }
return $return; return $return;
} }
@@ -677,9 +696,10 @@ if (!defined('Adminer\DRIVER')) {
* @param list<array{string, list<string>, string}> $fields of [$orig, $process_field, $after] * @param list<array{string, list<string>, string}> $fields of [$orig, $process_field, $after]
* @param string[] $foreign * @param string[] $foreign
* @param numeric-string $auto_increment * @param numeric-string $auto_increment
* @param ?Partitions $partitioning null means remove partitioning
* @return Result|bool * @return Result|bool
*/ */
function alter_table(string $table, string $name, array $fields, array $foreign, ?string $comment, string $engine, string $collation, string $auto_increment, string $partitioning) { function alter_table(string $table, string $name, array $fields, array $foreign, ?string $comment, string $engine, string $collation, string $auto_increment, ?array $partitioning) {
$alter = array(); $alter = array();
foreach ($fields as $field) { foreach ($fields as $field) {
if ($field[1]) { if ($field[1]) {
@@ -700,8 +720,28 @@ if (!defined('Adminer\DRIVER')) {
. ($collation ? " COLLATE " . q($collation) : "") . ($collation ? " COLLATE " . q($collation) : "")
. ($auto_increment != "" ? " AUTO_INCREMENT=$auto_increment" : "") . ($auto_increment != "" ? " AUTO_INCREMENT=$auto_increment" : "")
; ;
if ($partitioning) {
$partitions = array();
if ($partitioning["partition_by"] == 'RANGE' || $partitioning["partition_by"] == 'LIST') {
foreach ($partitioning["partition_names"] as $key => $val) {
$value = $partitioning["partition_values"][$key];
$partitions[] = "\n PARTITION " . idf_escape($val) . " VALUES " . ($partitioning["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ($value)" : " MAXVALUE"); //! SQL injection
}
}
// $partitioning["partition"] can be expression, not only column
$status .= "\nPARTITION BY $partitioning[partition_by]($partitioning[partition])";
if ($partitions) {
$status .= " (" . implode(",", $partitions) . "\n)";
} elseif ($partitioning["partitions"]) {
$status .= " PARTITIONS " . (+$partitioning["partitions"]);
}
} elseif ($partitioning === null) {
$status .= "\nREMOVE PARTITIONING";
}
if ($table == "") { if ($table == "") {
return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status$partitioning"); return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status");
} }
if ($table != $name) { if ($table != $name) {
$alter[] = "RENAME TO " . table($name); $alter[] = "RENAME TO " . table($name);
@@ -709,12 +749,12 @@ if (!defined('Adminer\DRIVER')) {
if ($status) { if ($status) {
$alter[] = ltrim($status); $alter[] = ltrim($status);
} }
return ($alter || $partitioning ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter) . $partitioning) : true); return ($alter ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter)) : true);
} }
/** Run commands to alter indexes /** Run commands to alter indexes
* @param string $table escaped table name * @param string $table escaped table name
* @param list<array{string, string, 'DROP'|list<string>}> $alter of ["index type", "name", ["column definition", ...]] or ["index type", "name", "DROP"] * @param list<array{string, string, 'DROP'|list<string>, 3?: string, 4?: string}> $alter of ["index type", "name", ["column definition", ...], "algorithm", "condition"] or ["index type", "name", "DROP"]
* @return Result|bool * @return Result|bool
*/ */
function alter_indexes(string $table, $alter) { function alter_indexes(string $table, $alter) {
@@ -1012,10 +1052,18 @@ if (!defined('Adminer\DRIVER')) {
} }
/** Check whether a feature is supported /** Check whether a feature is supported
* @param literal-string $feature "check|comment|copy|database|descidx|drop_col|dump|event|indexes|kill|materializedview|partitioning|privileges|procedure|processlist|routine|scheme|sequence|status|table|trigger|type|variables|view|view_trigger" * @param literal-string $feature check|comment|columns|copy|database|descidx|drop_col|dump|event|indexes|kill|materializedview
* |move_col|privileges|procedure|processlist|routine|scheme|sequence|sql|status|table|trigger|type|variables|view|view_trigger
*/ */
function support(string $feature): bool { function support(string $feature): bool {
return !preg_match("~scheme|sequence|type|view_trigger|materializedview" . (min_version(8) ? "" : "|descidx" . (min_version(5.1) ? "" : "|event|partitioning")) . (min_version('8.0.16', '10.2.1') ? "" : "|check") . "~", $feature); return preg_match(
'~^(comment|columns|copy|database|drop_col|dump|indexes|kill|privileges|move_col|procedure|processlist|routine|sql|status|table|trigger|variables|view'
. (min_version(5.1) ? '|event' : '')
. (min_version(8) ? '|descidx' : '')
. (min_version('8.0.16', '10.2.1') ? '|check' : '')
. ')$~',
$feature
);
} }
/** Kill a process /** Kill a process

View File

@@ -391,7 +391,6 @@ ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row
$queries = array(); $queries = array();
foreach ($alter as $val) { foreach ($alter as $val) {
if ($val[0] != "INDEX") { if ($val[0] != "INDEX") {
//! descending UNIQUE indexes results in syntax error
$val[2] = preg_replace('~ DESC$~', '', $val[2]); $val[2] = preg_replace('~ DESC$~', '', $val[2]);
$create = ($val[2] == "DROP" $create = ($val[2] == "DROP"
? "\nDROP CONSTRAINT " . idf_escape($val[1]) ? "\nDROP CONSTRAINT " . idf_escape($val[1])

View File

@@ -127,8 +127,9 @@ if (isset($_GET["pgsql"])) {
$return = new \stdClass; $return = new \stdClass;
$return->orgtable = pg_field_table($this->result, $column); $return->orgtable = pg_field_table($this->result, $column);
$return->name = pg_field_name($this->result, $column); $return->name = pg_field_name($this->result, $column);
$return->type = pg_field_type($this->result, $column); //! map to MySQL numbers $type = pg_field_type($this->result, $column);
$return->charsetnr = ($return->type == "bytea" ? 63 : 0); // 63 - binary $return->type = (preg_match(number_type(), $type) ? 0 : 15);
$return->charsetnr = ($type == "bytea" ? 63 : 0); // 63 - binary
return $return; return $return;
} }
@@ -203,10 +204,12 @@ if (isset($_GET["pgsql"])) {
static $extensions = array("PgSQL", "PDO_PgSQL"); static $extensions = array("PgSQL", "PDO_PgSQL");
static $jush = "pgsql"; static $jush = "pgsql";
public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT ILIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
public $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper"); public $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
public string $nsOid = "(SELECT oid FROM pg_namespace WHERE nspname = current_schema())";
static function connect(?string $server, string $username, string $password) { static function connect(?string $server, string $username, string $password) {
$connection = parent::connect($server, $username, $password); $connection = parent::connect($server, $username, $password);
if (is_string($connection)) { if (is_string($connection)) {
@@ -252,6 +255,10 @@ if (isset($_GET["pgsql"])) {
if (min_version(12, 0, $connection)) { if (min_version(12, 0, $connection)) {
$this->generated = array("STORED"); $this->generated = array("STORED");
} }
$this->partitionBy = array("RANGE", "LIST");
if (!$connection->flavor) {
$this->partitionBy[] = "HASH";
}
} }
function enumLength(array $field) { function enumLength(array $field) {
@@ -324,6 +331,39 @@ if (isset($_GET["pgsql"])) {
} }
} }
function inheritsFrom(string $table): array {
return get_vals("SELECT relname FROM pg_class JOIN pg_inherits ON inhparent = oid WHERE inhrelid = " . $this->tableOid($table) . " ORDER BY 1");
}
function inheritedTables(string $table): array {
return get_vals("SELECT relname FROM pg_inherits JOIN pg_class ON inhrelid = oid WHERE inhparent = " . $this->tableOid($table) . " ORDER BY 1");
}
function partitionsInfo(string $table): array {
$row = connection()->query("SELECT * FROM pg_partitioned_table WHERE partrelid = " . driver()->tableOid($table))->fetch_assoc();
if ($row) {
$attrs = get_vals("SELECT attname FROM pg_attribute WHERE attrelid = $row[partrelid] AND attnum IN (" . str_replace(" ", ", ", $row["partattrs"]) . ")"); //! ordering
$by = array('h' => 'HASH', 'l' => 'LIST', 'r' => 'RANGE');
return array(
"partition_by" => $by[$row["partstrat"]],
"partition" => implode(", ", array_map('Adminer\idf_escape', $attrs)),
);
}
return array();
}
function tableOid(string $table): string {
return "(SELECT oid FROM pg_class WHERE relnamespace = $this->nsOid AND relname = " . q($table) . " AND relkind IN ('r', 'm', 'v', 'f', 'p'))";
}
function indexAlgorithms(array $tableStatus): array {
static $return = array();
if (!$return) {
$return = get_vals("SELECT amname FROM pg_am" . (min_version(9.6) ? " WHERE amtype = 'i'" : "") . " ORDER BY amname = 'btree' DESC, amname");
}
return $return;
}
function supportsIndex(array $table_status): bool { function supportsIndex(array $table_status): bool {
// returns true for "materialized view" // returns true for "materialized view"
return $table_status["Engine"] != "view"; return $table_status["Engine"] != "view";
@@ -406,18 +446,20 @@ ORDER BY 1";
$return = array(); $return = array();
foreach ( foreach (
get_rows("SELECT get_rows("SELECT
c.relname AS \"Name\", relname AS \"Name\",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\"" . ($has_size ? ", CASE relkind WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' ELSE 'table' END AS \"Engine\"" . ($has_size ? ",
pg_table_size(c.oid) AS \"Data_length\", pg_table_size(oid) AS \"Data_length\",
pg_indexes_size(c.oid) AS \"Index_length\"" : "") . ", pg_indexes_size(oid) AS \"Index_length\"" : "") . ",
obj_description(c.oid, 'pg_class') AS \"Comment\", obj_description(oid, 'pg_class') AS \"Comment\",
" . (min_version(12) ? "''" : "CASE WHEN c.relhasoids THEN 'oid' ELSE '' END") . " AS \"Oid\", " . (min_version(12) ? "''" : "CASE WHEN relhasoids THEN 'oid' ELSE '' END") . " AS \"Oid\",
c.reltuples as \"Rows\", reltuples as \"Rows\",
n.nspname inhparent AS inherited,
FROM pg_class c current_schema() AS nspname
JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace) FROM pg_class
LEFT JOIN pg_inherits ON inhrelid = oid
WHERE relkind IN ('r', 'm', 'v', 'f', 'p') WHERE relkind IN ('r', 'm', 'v', 'f', 'p')
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")) as $row //! Index_length, Auto_increment AND relnamespace = " . driver()->nsOid . "
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")) as $row //! Auto_increment
) { ) {
$return[$row["Name"]] = $row; $return[$row["Name"]] = $row;
} }
@@ -444,15 +486,12 @@ WHERE relkind IN ('r', 'm', 'v', 'f', 'p')
format_type(a.atttypid, a.atttypmod) AS full_type, format_type(a.atttypid, a.atttypmod) AS full_type,
pg_get_expr(d.adbin, d.adrelid) AS default, pg_get_expr(d.adbin, d.adrelid) AS default,
a.attnotnull::int, a.attnotnull::int,
col_description(c.oid, a.attnum) AS comment" . (min_version(10) ? ", col_description(a.attrelid, a.attnum) AS comment" . (min_version(10) ? ",
a.attidentity" . (min_version(12) ? ", a.attidentity" . (min_version(12) ? ",
a.attgenerated" : "") : "") . " a.attgenerated" : "") : "") . "
FROM pg_class c FROM pg_attribute a
JOIN pg_namespace n ON c.relnamespace = n.oid LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
JOIN pg_attribute a ON c.oid = a.attrelid WHERE a.attrelid = " . driver()->tableOid($table) . "
LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum
WHERE c.relname = " . q($table) . "
AND n.nspname = current_schema()
AND NOT a.attisdropped AND NOT a.attisdropped
AND a.attnum > 0 AND a.attnum > 0
ORDER BY a.attnum") as $row ORDER BY a.attnum") as $row
@@ -488,18 +527,22 @@ ORDER BY a.attnum") as $row
function indexes($table, $connection2 = null) { function indexes($table, $connection2 = null) {
$connection2 = connection($connection2); $connection2 = connection($connection2);
$return = array(); $return = array();
$table_oid = get_val("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table), 0, $connection2); $table_oid = driver()->tableOid($table);
$columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2); $columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2);
foreach ( foreach (
get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption, (indpred IS NOT NULL)::int as indispartial get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption, (indpred IS NOT NULL)::int as indispartial, pg_am.amname as algorithm, pg_get_expr(pg_index.indpred, pg_index.indrelid, true) AS partial
FROM pg_index i, pg_class ci FROM pg_index
WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid JOIN pg_class ON indexrelid = oid
JOIN pg_am ON pg_am.oid = pg_class.relam
WHERE indrelid = $table_oid
ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row
) { ) {
$relname = $row["relname"]; $relname = $row["relname"];
$return[$relname]["type"] = ($row["indispartial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX"))); $return[$relname]["type"] = ($row["indispartial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")));
$return[$relname]["columns"] = array(); $return[$relname]["columns"] = array();
$return[$relname]["descs"] = array(); $return[$relname]["descs"] = array();
$return[$relname]["algorithm"] = $row["algorithm"];
$return[$relname]["partial"] = $row["partial"];
if ($row["indkey"]) { if ($row["indkey"]) {
foreach (explode(" ", $row["indkey"]) as $indkey) { foreach (explode(" ", $row["indkey"]) as $indkey) {
$return[$relname]["columns"][] = $columns[$indkey]; $return[$relname]["columns"][] = $columns[$indkey];
@@ -518,7 +561,7 @@ ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row
foreach ( foreach (
get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
FROM pg_constraint FROM pg_constraint
WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = " . q($table) . " AND pn.nspname = current_schema()) WHERE conrelid = " . driver()->tableOid($table) . "
AND contype = 'f'::char AND contype = 'f'::char
ORDER BY conkey, conname") as $row ORDER BY conkey, conname") as $row
) { ) {
@@ -538,7 +581,7 @@ ORDER BY conkey, conname") as $row
} }
function view($name) { function view($name) {
return array("select" => trim(get_val("SELECT pg_get_viewdef(" . get_val("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($name)) . ")"))); return array("select" => trim(get_val("SELECT pg_get_viewdef(" . driver()->tableOid($name) . ")")));
} }
function collations() { function collations() {
@@ -621,7 +664,31 @@ ORDER BY conkey, conname") as $row
} }
$alter = array_merge($alter, $foreign); $alter = array_merge($alter, $foreign);
if ($table == "") { if ($table == "") {
array_unshift($queries, "CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)"); $status = "";
if ($partitioning) {
$cockroach = (connection()->flavor == 'cockroach');
$status = " PARTITION BY $partitioning[partition_by]($partitioning[partition])";
if ($partitioning["partition_by"] == 'HASH') {
$partitions = +$partitioning["partitions"];
for ($i=0; $i < $partitions; $i++) {
$queries[] = "CREATE TABLE " . idf_escape($name . "_$i") . " PARTITION OF " . idf_escape($name) . " FOR VALUES WITH (MODULUS $partitions, REMAINDER $i)";
}
} else {
$prev = "MINVALUE";
foreach ($partitioning["partition_names"] as $i => $val) {
$value = $partitioning["partition_values"][$i];
$partition = " VALUES " . ($partitioning["partition_by"] == 'LIST' ? "IN ($value)" : "FROM ($prev) TO ($value)");
if ($cockroach) {
$status .= ($i ? "," : " (") . "\n PARTITION " . (preg_match('~^DEFAULT$~i', $val) ? $val : idf_escape($val)) . "$partition";
} else {
$queries[] = "CREATE TABLE " . idf_escape($name . "_$val") . " PARTITION OF " . idf_escape($name) . " FOR$partition";
}
$prev = $value;
}
$status .= ($cockroach ? "\n)" : "");
}
}
array_unshift($queries, "CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status");
} elseif ($alter) { } elseif ($alter) {
array_unshift($queries, "ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter)); array_unshift($queries, "ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter));
} }
@@ -648,7 +715,7 @@ ORDER BY conkey, conname") as $row
$queries = array(); $queries = array();
foreach ($alter as $val) { foreach ($alter as $val) {
if ($val[0] != "INDEX") { if ($val[0] != "INDEX") {
//! descending UNIQUE indexes results in syntax error //! descending UNIQUE indexes result in syntax error
$create[] = ($val[2] == "DROP" $create[] = ($val[2] == "DROP"
? "\nDROP CONSTRAINT " . idf_escape($val[1]) ? "\nDROP CONSTRAINT " . idf_escape($val[1])
: "\nADD" . ($val[1] != "" ? " CONSTRAINT " . idf_escape($val[1]) : "") . " $val[0] " . ($val[0] == "PRIMARY" ? "KEY " : "") . "(" . implode(", ", $val[2]) . ")" : "\nADD" . ($val[1] != "" ? " CONSTRAINT " . idf_escape($val[1]) : "") . " $val[0] " . ($val[0] == "PRIMARY" ? "KEY " : "") . "(" . implode(", ", $val[2]) . ")"
@@ -656,7 +723,12 @@ ORDER BY conkey, conname") as $row
} elseif ($val[2] == "DROP") { } elseif ($val[2] == "DROP") {
$drop[] = idf_escape($val[1]); $drop[] = idf_escape($val[1]);
} else { } else {
$queries[] = "CREATE INDEX " . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_")) . " ON " . table($table) . " (" . implode(", ", $val[2]) . ")"; $queries[] = "CREATE INDEX " . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_"))
. " ON " . table($table)
. ($val[3] ? " USING $val[3]" : "")
. " (" . implode(", ", $val[2]) . ")"
. ($val[4] ? " WHERE $val[4]" : "")
;
} }
} }
if ($create) { if ($create) {
@@ -798,7 +870,7 @@ ORDER BY SPECIFIC_NAME');
return get_key_vals( return get_key_vals(
"SELECT oid, typname "SELECT oid, typname
FROM pg_type FROM pg_type
WHERE typnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) WHERE typnamespace = " . driver()->nsOid . "
AND typtype IN ('b','d','e') AND typtype IN ('b','d','e')
AND typelem = 0" AND typelem = 0"
); );
@@ -899,8 +971,16 @@ AND typelem = 0"
foreach (driver()->checkConstraints($table) as $conname => $consrc) { foreach (driver()->checkConstraints($table) as $conname => $consrc) {
$return_parts[] = "CONSTRAINT " . idf_escape($conname) . " CHECK $consrc"; $return_parts[] = "CONSTRAINT " . idf_escape($conname) . " CHECK $consrc";
} }
$return .= implode(",\n ", $return_parts) . "\n)";
$return .= implode(",\n ", $return_parts) . "\n) WITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");"; $partition = driver()->partitionsInfo($status['Name']);
if ($partition) {
$return .= "\nPARTITION BY $partition[partition_by]($partition[partition])";
}
//! parse pg_class.relpartbound to create PARTITION OF
//! don't insert partitioned data twice
$return .= "\nWITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");";
// comments for table & fields // comments for table & fields
if ($status['Comment']) { if ($status['Comment']) {
@@ -955,9 +1035,11 @@ AND typelem = 0"
} }
function support($feature) { function support($feature) {
return preg_match('~^(check|database|table|columns|sql|indexes|descidx|comment|view|' . (min_version(9.3) ? 'materializedview|' : '') . 'scheme|' . (min_version(11) ? 'procedure|' : '') . 'routine|sequence|trigger|type|variables|drop_col' return preg_match('~^(check|columns|comment|database|drop_col|dump|descidx|indexes|kill|partial_indexes|routine|scheme|sequence|sql|table|trigger|type|variables|view'
. (min_version(9.3) ? '|materializedview' : '')
. (min_version(11) ? '|procedure' : '')
. (connection()->flavor == 'cockroach' ? '' : '|processlist') // https://github.com/cockroachdb/cockroach/issues/24745 . (connection()->flavor == 'cockroach' ? '' : '|processlist') // https://github.com/cockroachdb/cockroach/issues/24745
. '|kill|dump)$~', $feature) . ')$~', $feature)
; ;
} }

View File

@@ -108,15 +108,24 @@ class Adminer {
return true; return true;
} }
/** Print extra classes in <body class>; must start with a space */
function bodyClass(): void {
echo " adminer";
}
/** Get URLs of the CSS files /** Get URLs of the CSS files
* @return list<string> * @return string[] key is URL, value is either 'light' (supports only light color scheme), 'dark' or '' (both)
*/ */
function css(): array { function css(): array {
$return = array(); $return = array();
foreach (array("", "-dark") as $mode) { foreach (array("", "-dark") as $mode) {
$filename = "adminer$mode.css"; $filename = "adminer$mode.css";
if (file_exists($filename)) { if (file_exists($filename)) {
$return[] = "$filename?v=" . crc32(file_get_contents($filename)); $file = file_get_contents($filename);
$return["$filename?v=" . crc32($file)] = ($mode
? "dark"
: (preg_match('~prefers-color-scheme:\s*dark~', $file) ? '' : 'light')
);
} }
} }
return $return; return $return;
@@ -179,6 +188,7 @@ class Adminer {
* @param ?string $set new item options, NULL for no new item * @param ?string $set new item options, NULL for no new item
*/ */
function selectLinks(array $tableStatus, ?string $set = ""): void { function selectLinks(array $tableStatus, ?string $set = ""): void {
$name = $tableStatus["Name"];
echo '<p class="links">'; echo '<p class="links">';
$links = array("select" => lang('Select data')); $links = array("select" => lang('Select data'));
if (support("table") || support("indexes")) { if (support("table") || support("indexes")) {
@@ -196,7 +206,6 @@ class Adminer {
if ($set !== null) { if ($set !== null) {
$links["edit"] = lang('New item'); $links["edit"] = lang('New item');
} }
$name = $tableStatus["Name"];
foreach ($links as $key => $val) { foreach ($links as $key => $val) {
echo " <a href='" . h(ME) . "$key=" . urlencode($name) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>"; echo " <a href='" . h(ME) . "$key=" . urlencode($name) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
} }
@@ -343,9 +352,15 @@ class Adminer {
/** Print list of indexes on table in tabular format /** Print list of indexes on table in tabular format
* @param Index[] $indexes * @param Index[] $indexes
* @param TableStatus $tableStatus
*/ */
function tableIndexesPrint(array $indexes): void { function tableIndexesPrint(array $indexes, array $tableStatus): void {
$partial = false;
foreach ($indexes as $name => $index) {
$partial |= !!$index["partial"];
}
echo "<table>\n"; echo "<table>\n";
$default_algorithm = first(driver()->indexAlgorithms($tableStatus));
foreach ($indexes as $name => $index) { foreach ($indexes as $name => $index) {
ksort($index["columns"]); // enforce correct columns order ksort($index["columns"]); // enforce correct columns order
$print = array(); $print = array();
@@ -355,7 +370,14 @@ class Adminer {
. ($index["descs"][$key] ? " DESC" : "") . ($index["descs"][$key] ? " DESC" : "")
; ;
} }
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
echo "<tr title='" . h($name) . "'>";
echo "<th>$index[type]" . ($default_algorithm && $index['algorithm'] != $default_algorithm ? " ($index[algorithm])" : "");
echo "<td>" . implode(", ", $print);
if ($partial) {
echo "<td>" . ($index['partial'] ? "<code class='jush-" . JUSH . "'>WHERE " . h($index['partial']) : "");
}
echo "\n";
} }
echo "</table>\n"; echo "</table>\n";
} }
@@ -395,7 +417,7 @@ class Adminer {
foreach ($indexes as $i => $index) { foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT") { if ($index["type"] == "FULLTEXT") {
echo "<div>(<i>" . implode("</i>, <i>", array_map('Adminer\h', $index["columns"])) . "</i>) AGAINST"; echo "<div>(<i>" . implode("</i>, <i>", array_map('Adminer\h', $index["columns"])) . "</i>) AGAINST";
echo " <input type='search' name='fulltext[$i]' value='" . h($_GET["fulltext"][$i]) . "'>"; echo " <input type='search' name='fulltext[$i]' value='" . h(idx($_GET["fulltext"], $i)) . "'>";
echo script("qsl('input').oninput = selectFieldChange;", ""); echo script("qsl('input').oninput = selectFieldChange;", "");
echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL"); echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL");
echo "</div>\n"; echo "</div>\n";
@@ -533,7 +555,7 @@ class Adminer {
function selectSearchProcess(array $fields, array $indexes): array { function selectSearchProcess(array $fields, array $indexes): array {
$return = array(); $return = array();
foreach ($indexes as $i => $index) { foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT" && $_GET["fulltext"][$i] != "") { if ($index["type"] == "FULLTEXT" && idx($_GET["fulltext"], $i) != "") {
$return[] = "MATCH (" . implode(", ", array_map('Adminer\idf_escape', $index["columns"])) . ") AGAINST (" . q($_GET["fulltext"][$i]) . (isset($_GET["boolean"][$i]) ? " IN BOOLEAN MODE" : "") . ")"; $return[] = "MATCH (" . implode(", ", array_map('Adminer\idf_escape', $index["columns"])) . ") AGAINST (" . q($_GET["fulltext"][$i]) . (isset($_GET["boolean"][$i]) ? " IN BOOLEAN MODE" : "") . ")";
} }
} }
@@ -1078,7 +1100,7 @@ class Adminer {
foreach ($tables as $table => $status) { foreach ($tables as $table => $status) {
$table = "$table"; // do not highlight "0" as active everywhere $table = "$table"; // do not highlight "0" as active everywhere
$name = adminer()->tableName($status); $name = adminer()->tableName($status);
if ($name != "") { if ($name != "" && !$status["inherited"]) {
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"' echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"'
. bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select")
. " title='" . lang('Select data') . "'>" . lang('select') . "</a> " . " title='" . lang('Select data') . "'>" . lang('select') . "</a> "

View File

@@ -27,17 +27,13 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
<title><?php echo $title_page; ?></title> <title><?php echo $title_page; ?></title>
<link rel="stylesheet" href="../adminer/static/default.css"> <link rel="stylesheet" href="../adminer/static/default.css">
<?php <?php
$css = adminer()->css(); $css = adminer()->css();
$has_light = false; if (is_int(key($css))) { // legacy return value
$has_dark = false; $css = array_fill_keys($css, 'light');
foreach ($css as $filename) {
if (strpos($filename, "adminer.css") !== false) {
$has_light = true;
}
if (strpos($filename, "adminer-dark.css") !== false) {
$has_dark = true;
}
} }
$has_light = in_array('light', $css) || in_array('', $css);
$has_dark = in_array('dark', $css) || in_array('', $css);
$dark = ($has_light $dark = ($has_light
? ($has_dark ? null : false) // both styles - autoswitching, only adminer.css - light ? ($has_dark ? null : false) // both styles - autoswitching, only adminer.css - light
: ($has_dark ?: null) // only adminer-dark.css - dark, neither - autoswitching : ($has_dark ?: null) // only adminer-dark.css - dark, neither - autoswitching
@@ -47,6 +43,7 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
echo "<link rel='stylesheet'" . ($dark ? "" : $media) . " href='../adminer/static/dark.css'>\n"; echo "<link rel='stylesheet'" . ($dark ? "" : $media) . " href='../adminer/static/dark.css'>\n";
} }
echo "<meta name='color-scheme' content='" . ($dark === null ? "light dark" : ($dark ? "dark" : "light")) . "'>\n"; echo "<meta name='color-scheme' content='" . ($dark === null ? "light dark" : ($dark ? "dark" : "light")) . "'>\n";
// this is matched by compile.php // this is matched by compile.php
echo script_src("../adminer/static/functions.js"); echo script_src("../adminer/static/functions.js");
echo script_src("static/editing.js"); echo script_src("static/editing.js");
@@ -54,10 +51,16 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
echo "<link rel='icon' href='data:image/gif;base64,R0lGODlhEAAQAJEAAAQCBPz+/PwCBAROZCH5BAEAAAAALAAAAAAQABAAAAI2hI+pGO1rmghihiUdvUBnZ3XBQA7f05mOak1RWXrNq5nQWHMKvuoJ37BhVEEfYxQzHjWQ5qIAADs='>\n"; echo "<link rel='icon' href='data:image/gif;base64,R0lGODlhEAAQAJEAAAQCBPz+/PwCBAROZCH5BAEAAAAALAAAAAAQABAAAAI2hI+pGO1rmghihiUdvUBnZ3XBQA7f05mOak1RWXrNq5nQWHMKvuoJ37BhVEEfYxQzHjWQ5qIAADs='>\n";
echo "<link rel='apple-touch-icon' href='../adminer/static/logo.png'>\n"; echo "<link rel='apple-touch-icon' href='../adminer/static/logo.png'>\n";
} }
foreach ($css as $val) { foreach ($css as $url => $mode) {
echo "<link rel='stylesheet'" . (preg_match('~-dark\.~', $val) && !$dark ? $media : "") . " href='" . h($val) . "'>\n"; $attrs = ($mode == 'dark' && !$dark
? $media
: ($mode == 'light' && $has_dark ? " media='(prefers-color-scheme: light)'" : "")
);
echo "<link rel='stylesheet'$attrs href='" . h($url) . "'>\n";
} }
echo "\n<body class='" . lang('ltr') . " nojs'>\n"; echo "\n<body class='" . lang('ltr') . " nojs";
adminer()->bodyClass();
echo "'>\n";
$filename = get_temp_dir() . "/adminer.version"; $filename = get_temp_dir() . "/adminer.version";
if (!$_COOKIE["adminer_version"] && function_exists('openssl_verify') && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds if (!$_COOKIE["adminer_version"] && function_exists('openssl_verify') && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds
$version = unserialize(file_get_contents($filename)); $version = unserialize(file_get_contents($filename));

View File

@@ -7,7 +7,7 @@ function add_driver(string $id, string $name): void {
} }
/** Get driver name */ /** Get driver name */
function get_driver(string $id): string { function get_driver(string $id): ?string {
return SqlDriver::$drivers[$id]; return SqlDriver::$drivers[$id];
} }
@@ -26,6 +26,7 @@ abstract class SqlDriver {
/** @var list<string> */ public $functions = array(); // functions used in select /** @var list<string> */ public $functions = array(); // functions used in select
/** @var list<string> */ public $grouping = array(); // grouping functions used in select /** @var list<string> */ public $grouping = array(); // grouping functions used in select
/** @var string */ public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; // used in foreign_keys() /** @var string */ public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; // used in foreign_keys()
/** @var list<string> */ public $partitionBy = array(); // supported partitioning types
/** @var string */ public $inout = "IN|OUT|INOUT"; // used in routines /** @var string */ public $inout = "IN|OUT|INOUT"; // used in routines
/** @var string */ public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; // regular expression for parsing enum lengths /** @var string */ public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; // regular expression for parsing enum lengths
/** @var list<string> */ public $generated = array(); // allowed types of generated columns /** @var list<string> */ public $generated = array(); // allowed types of generated columns
@@ -217,6 +218,27 @@ abstract class SqlDriver {
function tableHelp(string $name, bool $is_view = false) { function tableHelp(string $name, bool $is_view = false) {
} }
/** Get tables this table inherits from
* @return list<string>
*/
function inheritsFrom(string $table): array {
return array();
}
/** Get inherited tables
* @return list<string>
*/
function inheritedTables(string $table): array {
return array();
}
/** Get partitions info
* @return Partitions
*/
function partitionsInfo(string $table): array {
return array();
}
/** Check if C-style escapes are supported */ /** Check if C-style escapes are supported */
function hasCStyleEscapes(): bool { function hasCStyleEscapes(): bool {
return false; return false;
@@ -236,6 +258,15 @@ abstract class SqlDriver {
return !is_view($table_status); return !is_view($table_status);
} }
/**
* Return list of supported index algorithms, first one is default
* @param TableStatus $tableStatus
* @return list<string>
*/
function indexAlgorithms(array $tableStatus): array {
return array();
}
/** Get defined check constraints /** Get defined check constraints
* @return string[] [$name => $clause] * @return string[] [$name => $clause]
*/ */
@@ -254,14 +285,16 @@ AND CHECK_CLAUSE NOT LIKE '% IS NOT NULL'", $this->conn); // ignore default IS N
*/ */
function allFields(): array { function allFields(): array {
$return = array(); $return = array();
foreach ( if (DB != "") {
get_rows("SELECT TABLE_NAME AS tab, COLUMN_NAME AS field, IS_NULLABLE AS nullable, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH AS length" . (JUSH == 'sql' ? ", COLUMN_KEY = 'PRI' AS `primary`" : "") . " foreach (
get_rows("SELECT TABLE_NAME AS tab, COLUMN_NAME AS field, IS_NULLABLE AS nullable, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH AS length" . (JUSH == 'sql' ? ", COLUMN_KEY = 'PRI' AS `primary`" : "") . "
FROM INFORMATION_SCHEMA.COLUMNS FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = " . q($_GET["ns"] != "" ? $_GET["ns"] : DB) . " WHERE TABLE_SCHEMA = " . q($_GET["ns"] != "" ? $_GET["ns"] : DB) . "
ORDER BY TABLE_NAME, ORDINAL_POSITION", $this->conn) as $row ORDER BY TABLE_NAME, ORDINAL_POSITION", $this->conn) as $row
) { ) {
$row["null"] = ($row["nullable"] == "YES"); $row["null"] = ($row["nullable"] == "YES");
$return[$row["tab"]][] = $row; $return[$row["tab"]][] = $row;
}
} }
return $return; return $return;
} }

View File

@@ -201,20 +201,6 @@ function edit_type(string $key, array $field, array $collations, array $foreign_
); );
} }
/** Get partition info
* @return array{partition_by:string, partition:string, partitions:string, partition_names:list<string>, partition_values:list<string>}
*/
function get_partitions_info(string $table): array {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($table);
$result = connection()->query("SELECT PARTITION_METHOD, PARTITION_EXPRESSION, PARTITION_ORDINAL_POSITION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
$return = array();
list($return["partition_by"], $return["partition"], $return["partitions"]) = $result->fetch_row();
$partitions = get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");
$return["partition_names"] = array_keys($partitions);
$return["partition_values"] = array_values($partitions);
return $return;
}
/** Filter length value including enums */ /** Filter length value including enums */
function process_length(?string $length): string { function process_length(?string $length): string {
$enum_length = driver()->enumLength; $enum_length = driver()->enumLength;

View File

@@ -66,6 +66,7 @@ function langs(): array {
'fr' => 'Français', // Francis Gagné, Aurélien Royer 'fr' => 'Français', // Francis Gagné, Aurélien Royer
'gl' => 'Galego', // Eduardo Penabad Ramos 'gl' => 'Galego', // Eduardo Penabad Ramos
'he' => 'עברית', // Binyamin Yawitz - https://stuff-group.com/ 'he' => 'עברית', // Binyamin Yawitz - https://stuff-group.com/
'hi' => 'हिन्दी', // Joshi yogesh
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu 'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
'id' => 'Bahasa Indonesia', // Ivan Lanin - http://ivan.lanin.org 'id' => 'Bahasa Indonesia', // Ivan Lanin - http://ivan.lanin.org
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti 'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti

View File

@@ -1,4 +1,4 @@
<?php <?php
namespace Adminer; namespace Adminer;
const VERSION = "5.2.1"; const VERSION = "5.3.0";

View File

@@ -4,6 +4,7 @@ namespace Adminer;
$TABLE = $_GET["indexes"]; $TABLE = $_GET["indexes"];
$index_types = array("PRIMARY", "UNIQUE", "INDEX"); $index_types = array("PRIMARY", "UNIQUE", "INDEX");
$table_status = table_status1($TABLE, true); $table_status = table_status1($TABLE, true);
$index_algorithms = driver()->indexAlgorithms($table_status);
if (preg_match('~MyISAM|M?aria' . (min_version(5.6, '10.0.5') ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { if (preg_match('~MyISAM|M?aria' . (min_version(5.6, '10.0.5') ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
$index_types[] = "FULLTEXT"; $index_types[] = "FULLTEXT";
} }
@@ -29,6 +30,8 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
$columns = array(); $columns = array();
$lengths = array(); $lengths = array();
$descs = array(); $descs = array();
$index_condition = (support("partial_indexes") ? $index["partial"] : "");
$index_algorithm = (in_array($index["algorithm"], $index_algorithms) ? $index["algorithm"] : "");
$set = array(); $set = array();
ksort($index["columns"]); ksort($index["columns"]);
foreach ($index["columns"] as $key => $column) { foreach ($index["columns"] as $key => $column) {
@@ -52,6 +55,8 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
&& array_values($existing["columns"]) === $columns && array_values($existing["columns"]) === $columns
&& (!$existing["lengths"] || array_values($existing["lengths"]) === $lengths) && (!$existing["lengths"] || array_values($existing["lengths"]) === $lengths)
&& array_values($existing["descs"]) === $descs && array_values($existing["descs"]) === $descs
&& $existing["partial"] == $index_condition
&& (!$index_algorithms || $existing["algorithm"] == $index_algorithm)
) { ) {
// skip existing index // skip existing index
unset($indexes[$name]); unset($indexes[$name]);
@@ -59,7 +64,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
} }
} }
if ($columns) { if ($columns) {
$alter[] = array($index["type"], $name, $set); $alter[] = array($index["type"], $name, $set, $index_algorithm, $index_condition);
} }
} }
} }
@@ -105,13 +110,28 @@ $show_options = ($_POST ? $_POST["options"] : get_setting("index_options"));
<table class="nowrap"> <table class="nowrap">
<thead><tr> <thead><tr>
<th id="label-type"><?php echo lang('Index Type'); ?> <th id="label-type"><?php echo lang('Index Type'); ?>
<?php
$idxopts = " class='idxopts" . ($show_options ? "" : " hidden") . "'";
if ($index_algorithms) {
echo "<th id='label-algorithm'$idxopts>" . lang('Algorithm') . doc_link(array(
'sql' => 'create-index.html#create-index-storage-engine-index-types',
'mariadb' => 'storage-engine-index-types/',
'pgsql' => 'indexes-types.html',
));
}
?>
<th><input type="submit" class="wayoff"><?php <th><input type="submit" class="wayoff"><?php
echo lang('Columns') . ($lengths ? "<span class='idxopts" . ($show_options ? "" : " hidden") . "'> (" . lang('length') . ")</span>" : ""); echo lang('Columns') . ($lengths ? "<span$idxopts> (" . lang('length') . ")</span>" : "");
if ($lengths || support("descidx")) { if ($lengths || support("descidx")) {
echo checkbox("options", 1, $show_options, lang('Options'), "indexOptionsShow(this.checked)", "jsonly") . "\n"; echo checkbox("options", 1, $show_options, lang('Options'), "indexOptionsShow(this.checked)", "jsonly") . "\n";
} }
?> ?>
<th id="label-name"><?php echo lang('Name'); ?> <th id="label-name"><?php echo lang('Name'); ?>
<?php
if (support("partial_indexes")) {
echo "<th id='label-condition'$idxopts>" . lang('Condition');
}
?>
<th><noscript><?php echo icon("plus", "add[0]", "+", lang('Add next')); ?></noscript> <th><noscript><?php echo icon("plus", "add[0]", "+", lang('Add next')); ?></noscript>
</thead> </thead>
<?php <?php
@@ -128,6 +148,10 @@ foreach ($row["indexes"] as $index) {
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) { if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow.call(this);" : ""), "label-type"); echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow.call(this);" : ""), "label-type");
if ($index_algorithms) {
echo "<td$idxopts>" . html_select("indexes[$j][algorithm]", array_merge(array(""), $index_algorithms), $index['algorithm'], "label-algorithm");
}
echo "<td>"; echo "<td>";
ksort($index["columns"]); ksort($index["columns"]);
$i = 1; $i = 1;
@@ -138,7 +162,7 @@ foreach ($row["indexes"] as $index) {
$column, $column,
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape(JUSH == "sql" ? "" : $_GET["indexes"] . "_") . "')" "partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape(JUSH == "sql" ? "" : $_GET["indexes"] . "_") . "')"
); );
echo "<span class='idxopts" . ($show_options ? "" : " hidden") . "'>"; echo "<span$idxopts>";
echo ($lengths ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h(idx($index["lengths"], $key)) . "' title='" . lang('Length') . "'>" : ""); echo ($lengths ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h(idx($index["lengths"], $key)) . "' title='" . lang('Length') . "'>" : "");
echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, idx($index["descs"], $key), lang('descending')) : ""); echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, idx($index["descs"], $key), lang('descending')) : "");
echo "</span> </span>"; echo "</span> </span>";
@@ -146,6 +170,9 @@ foreach ($row["indexes"] as $index) {
} }
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n"; echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
if (support("partial_indexes")) {
echo "<td$idxopts><input name='indexes[$j][partial]' value='" . h($index["partial"]) . "' autocapitalize='off' aria-labelledby='label-condition'>\n";
}
echo "<td>" . icon("cross", "drop_col[$j]", "x", lang('Remove')) . script("qsl('button').onclick = partial(editingRemoveRow, 'indexes\$1[type]');"); echo "<td>" . icon("cross", "drop_col[$j]", "x", lang('Remove')) . script("qsl('button').onclick = partial(editingRemoveRow, 'indexes\$1[type]');");
} }
$j++; $j++;

View File

@@ -259,6 +259,56 @@ Lang::$translations = array(
'Permanent link' => 'স্থায়ী লিংক', 'Permanent link' => 'স্থায়ী লিংক',
'Edit all' => 'সবগুলো সম্পাদনা করুন', 'Edit all' => 'সবগুলো সম্পাদনা করুন',
'HH:MM:SS' => 'HH:MM:SS', 'HH:MM:SS' => 'HH:MM:SS',
'Check has been dropped.' => 'চেক ড্রপ করা হয়েছে।',
'Check has been altered.' => 'চেক পরিবর্তন করা হয়েছে।',
'Check has been created.' => 'চেক তৈরি করা হয়েছে।',
'Alter check' => 'চেক পরিবর্তন করুন',
'Create check' => 'চেক তৈরি করুন',
'Drop %s?' => '%s ড্রপ করবেন?',
'Tables have been optimized.' => 'টেবিলগুলি অপ্টিমাইজ করা হয়েছে।',
'Materialized view' => 'মেটেরিয়ালাইজড ভিউ',
'Vacuum' => 'ভ্যাকুয়াম',
'Selected' => 'নির্বাচিত',
'overwrite' => 'ওভাররাইট',
'DB' => 'ডিবি',
'Algorithm' => 'অ্যালগরিদম',
'Columns' => 'কলাম',
'Ctrl+click on a value to modify it.' => 'একটি মান পরিবর্তন করতে Ctrl+ক্লিক করুন।',
'File must be in UTF-8 encoding.' => 'ফাইলটি UTF-8 এনকোডিংয়ে হতে হবে।',
'Modify' => 'পরিবর্তন করুন',
'Load more data' => 'আরও ডেটা লোড করুন',
'Loading' => 'লোড হচ্ছে',
'ATTACH queries are not supported.' => 'ATTACH কোয়েরি সমর্থিত নয়।',
'Warnings' => 'সতর্কতা',
'%d / ' => array('%d / '),
'Limit rows' => 'সারি সীমিত করুন',
'Inherits from' => 'থেকে উত্তরাধিকারসূত্রে প্রাপ্ত',
'Checks' => 'চেকস',
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer পাসওয়ার্ড ছাড়া ডাটাবেস অ্যাক্সেস সমর্থন করে না, <a href="https://www.adminer.org/en/password/"%s>আরও তথ্য</a>।',
'Default value' => 'ডিফল্ট মান',
'Full table scan' => 'সম্পূর্ণ টেবিল স্ক্যান',
'Too many unsuccessful logins, try again in %d minute(s).' => array('অনেকগুলি ব্যর্থ লগইন প্রচেষ্টা, %d মিনিট পরে আবার চেষ্টা করুন।'),
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Adminer ব্যবহার করার জন্য ধন্যবাদ, <a href="https://www.adminer.org/en/donation/">দান করার</a> কথা বিবেচনা করুন।',
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'মাস্টার পাসওয়ার্ডের মেয়াদ শেষ হয়েছে। এটিকে স্থায়ী করতে <a href="https://www.adminer.org/en/extension/"%s>ইমপ্লিমেন্ট</a> %s মেথড।',
'The action will be performed after successful login with the same credentials.' => 'একই ক্রেডেনশিয়ালস দিয়ে সফলভাবে লগইন করার পরে এই কর্মটি সম্পাদন করা হবে।',
'Connecting to privileged ports is not allowed.' => 'প্রিভিলেজড পোর্টে সংযোগ করা অনুমোদিত নয়।',
'There is a space in the input password which might be the cause.' => 'ইনপুট পাসওয়ার্ডে একটি স্পেস রয়েছে যা এর কারণ হতে পারে।',
'If you did not send this request from Adminer then close this page.' => 'আপনি যদি Adminer থেকে এই অনুরোধ না করে থাকেন তবে এই পৃষ্ঠাটি বন্ধ করুন।',
'You can upload a big SQL file via FTP and import it from server.' => 'আপনি FTP এর মাধ্যমে একটি বড় SQL ফাইল আপলোড করতে পারেন এবং সার্ভার থেকে এটি ইম্পোর্ট করতে পারেন।',
'Size' => 'আকার',
'Compute' => 'কম্পিউট',
'Loaded plugins' => 'লোড করা প্লাগইনগুলি',
'screenshot' => 'স্ক্রিনশট',
'You are offline.' => 'আপনি অফলাইনে আছেন।',
'You have no privileges to update this table.' => 'এই টেবিল আপডেট করার জন্য আপনার কোন অনুমতি নেই।',
'Saving' => 'সংরক্ষণ করা হচ্ছে',
'Unknown error.' => 'অজানা ত্রুটি।',
'%s must <a%s>return an array</a>.' => '%s অবশ্যই <a%s>একটি অ্যারে রিটার্ন করতে হবে</a>।',
'<a%s>Configure</a> %s in %s.' => '<a%s>কনফিগার করুন</a> %s এ %s।',
'Disable %s or enable %s or %s extensions.' => '%s নিষ্ক্রিয় করুন অথবা %s বা %s এক্সটেনশন সক্রিয় করুন।',
'Database does not support password.' => 'ডাটাবেস পাসওয়ার্ড সমর্থন করে না।',
'yes' => 'হ্যাঁ',
'no' => 'না',
); );
// run `php ../../lang.php bn` to update this file // run `php ../../lang.php bn` to update this file

View File

@@ -194,6 +194,7 @@ Lang::$translations = array(
'Partitions' => 'Oddíly', 'Partitions' => 'Oddíly',
'Partition name' => 'Název oddílu', 'Partition name' => 'Název oddílu',
'Values' => 'Hodnoty', 'Values' => 'Hodnoty',
'Inherits from' => 'Zděděná z',
'View' => 'Pohled', 'View' => 'Pohled',
'Materialized view' => 'Materializovaný pohled', 'Materialized view' => 'Materializovaný pohled',
@@ -209,6 +210,8 @@ Lang::$translations = array(
'Add next' => 'Přidat další', 'Add next' => 'Přidat další',
'Index Type' => 'Typ indexu', 'Index Type' => 'Typ indexu',
'length' => 'délka', 'length' => 'délka',
'Algorithm' => 'Algoritmus',
'Condition' => 'Podmínka',
'Foreign keys' => 'Cizí klíče', 'Foreign keys' => 'Cizí klíče',
'Foreign key' => 'Cizí klíč', 'Foreign key' => 'Cizí klíč',

314
adminer/lang/hi.inc.php Normal file
View File

@@ -0,0 +1,314 @@
<?php
namespace Adminer;
Lang::$translations = array(
'Login' => 'लॉगिन',
'Logout successful.' => 'सफलतापूर्वक लॉगआउट हो गया।',
'Invalid credentials.' => 'गलत पासवर्ड।',
'Server' => 'सर्वर',
'Username' => 'उपयोगकर्ता नाम',
'Password' => 'पासवर्ड',
'Select database' => 'डेटाबेस चुनें',
'Invalid database.' => 'अमान्य डेटाबेस।',
'Table has been dropped.' => 'टेबल हटा दिया गया है।',
'Table has been altered.' => 'टेबल बदल दिया गया है।',
'Table has been created.' => 'टेबल बनाया गया है।',
'Alter table' => 'टेबल बदलें',
'Create table' => 'टेबल बनाएं',
'Table name' => 'टेबल का नाम',
'engine' => 'इंजन',
'collation' => 'कॉलेशन',
'Column name' => 'कॉलम का नाम',
'Type' => 'प्रकार',
'Length' => 'लंबाई',
'Auto Increment' => 'ऑटो इंक्रीमेंट',
'Options' => 'विकल्प',
'Save' => 'सहेजें',
'Drop' => 'हटाएं',
'Database has been dropped.' => 'डेटाबेस हटा दिया गया है।',
'Database has been created.' => 'डेटाबेस बनाया गया है।',
'Database has been renamed.' => 'डेटाबेस का नाम बदल दिया गया है।',
'Database has been altered.' => 'डेटाबेस बदल दिया गया है।',
'Alter database' => 'डेटाबेस बदलें',
'Create database' => 'डेटाबेस बनाएं',
'SQL command' => 'SQL कमांड',
'Logout' => 'लॉगआउट',
'Use' => 'उपयोग करें',
'No tables.' => 'कोई टेबल नहीं।',
'select' => 'चुनें',
'Item has been deleted.' => 'आइटम हटा दिया गया है।',
'Item has been updated.' => 'आइटम अपडेट किया गया है।',
'Item%s has been inserted.' => 'आइटम%s डाला गया है।',
'Edit' => 'संपादित करें',
'Insert' => 'डालें',
'Save and insert next' => 'सहेजें और अगला डालें',
'Delete' => 'हटाएं',
'Database' => 'डेटाबेस',
'Routines' => 'रूटीन्स',
'Indexes have been altered.' => 'इंडेक्स बदल दिए गए हैं।',
'Indexes' => 'इंडेक्स',
'Alter indexes' => 'इंडेक्स बदलें',
'Add next' => 'अगला जोड़ें',
'Language' => 'भाषा',
'Select' => 'चुनें',
'New item' => 'नया आइटम',
'Search' => 'खोजें',
'Sort' => 'क्रमबद्ध करें',
'descending' => 'अवरोही',
'Limit' => 'सीमा',
'No rows.' => 'कोई पंक्ति नहीं।',
'Action' => 'कार्रवाई',
'edit' => 'संपादित करें',
'Page' => 'पृष्ठ',
'Query executed OK, %d row(s) affected.' => array('क्वेरी सफलतापूर्वक निष्पादित, %d पंक्ति प्रभावित।', 'क्वेरी सफलतापूर्वक निष्पादित, %d पंक्तियां प्रभावित।'),
'Error in query' => 'क्वेरी में त्रुटि',
'Execute' => 'निष्पादित करें',
'Table' => 'टेबल',
'Foreign keys' => 'फॉरेन की',
'Triggers' => 'ट्रिगर्स',
'View' => 'व्यू',
'Unable to select the table' => 'टेबल चुनने में असमर्थ',
'Invalid CSRF token. Send the form again.' => 'अमान्य CSRF टोकन। फॉर्म फिर से भेजें।',
'Comment' => 'टिप्पणी',
'Default values' => 'डिफ़ॉल्ट मान',
'%d byte(s)' => array('%d बाइट', '%d बाइट्स'),
'No commands to execute.' => 'निष्पादित करने के लिए कोई कमांड नहीं।',
'Unable to upload a file.' => 'फाइल अपलोड करने में असमर्थ।',
'File upload' => 'फाइल अपलोड',
'File uploads are disabled.' => 'फाइल अपलोड अक्षम हैं।',
'Routine has been called, %d row(s) affected.' => array('रूटीन कॉल किया गया, %d पंक्ति प्रभावित।', 'रूटीन कॉल किया गया, %d पंक्तियां प्रभावित।'),
'Call' => 'कॉल',
'No extension' => 'कोई एक्सटेंशन नहीं',
'None of the supported PHP extensions (%s) are available.' => 'कोई समर्थित PHP एक्सटेंशन (%s) उपलब्ध नहीं है।',
'Session support must be enabled.' => 'सेशन सपोर्ट सक्षम होना चाहिए।',
'Session expired, please login again.' => 'सेशन समाप्त, कृपया फिर से लॉगिन करें।',
'Text length' => 'टेक्स्ट लंबाई',
'Foreign key has been dropped.' => 'फॉरेन की हटा दी गई है।',
'Foreign key has been altered.' => 'फॉरेन की बदल दी गई है।',
'Foreign key has been created.' => 'फॉरेन की बनाई गई है।',
'Foreign key' => 'फॉरेन की',
'Target table' => 'लक्ष्य टेबल',
'Change' => 'बदलें',
'Source' => 'स्रोत',
'Target' => 'लक्ष्य',
'Add column' => 'कॉलम जोड़ें',
'Alter' => 'बदलें',
'Add foreign key' => 'फॉरेन की जोड़ें',
'ON DELETE' => 'ऑन डिलीट',
'ON UPDATE' => 'ऑन अपडेट',
'Index Type' => 'इंडेक्स प्रकार',
'length' => 'लंबाई',
'View has been dropped.' => 'व्यू हटा दिया गया है।',
'View has been altered.' => 'व्यू बदल दिया गया है।',
'View has been created.' => 'व्यू बनाया गया है।',
'Alter view' => 'व्यू बदलें',
'Create view' => 'व्यू बनाएं',
'Name' => 'नाम',
'Process list' => 'प्रक्रिया सूची',
'%d process(es) have been killed.' => array('%d प्रक्रिया समाप्त की गई है।', '%d प्रक्रियाएं समाप्त की गई हैं।'),
'Kill' => 'समाप्त करें',
'Parameter name' => 'पैरामीटर नाम',
'Database schema' => 'डेटाबेस स्कीमा',
'Create procedure' => 'प्रक्रिया बनाएं',
'Create function' => 'फंक्शन बनाएं',
'Routine has been dropped.' => 'रूटीन हटा दिया गया है।',
'Routine has been altered.' => 'रूटीन बदल दिया गया है।',
'Routine has been created.' => 'रूटीन बनाया गया है।',
'Alter function' => 'फंक्शन बदलें',
'Alter procedure' => 'प्रक्रिया बदलें',
'Return type' => 'वापसी प्रकार',
'Add trigger' => 'ट्रिगर जोड़ें',
'Trigger has been dropped.' => 'ट्रिगर हटा दिया गया है।',
'Trigger has been altered.' => 'ट्रिगर बदल दिया गया है।',
'Trigger has been created.' => 'ट्रिगर बनाया गया है।',
'Alter trigger' => 'ट्रिगर बदलें',
'Create trigger' => 'ट्रिगर बनाएं',
'Time' => 'समय',
'Event' => 'घटना',
'%s version: %s through PHP extension %s' => 'संस्करण %s: %s, PHP एक्सटेंशन %s के माध्यम से',
'%d row(s)' => array('%d पंक्ति', '%d पंक्तियां'),
'Remove' => 'हटाएं',
'Are you sure?' => 'क्या आप सुनिश्चित हैं?',
'Privileges' => 'विशेषाधिकार',
'Create user' => 'उपयोगकर्ता बनाएं',
'User has been dropped.' => 'उपयोगकर्ता हटा दिया गया है।',
'User has been altered.' => 'उपयोगकर्ता बदल दिया गया है।',
'User has been created.' => 'उपयोगकर्ता बनाया गया है।',
'Hashed' => 'हैश्ड',
'Column' => 'कॉलम',
'Routine' => 'रूटीन',
'Grant' => 'अनुदान',
'Revoke' => 'रद्द करें',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'बहुत बड़ा POST डेटा। डेटा कम करें या %s कॉन्फ़िगरेशन निर्देश बढ़ाएं।',
'Logged as: %s' => '%s के रूप में लॉगिन',
'Move up' => 'ऊपर ले जाएं',
'Move down' => 'नीचे ले जाएं',
'Functions' => 'फंक्शन्स',
'Aggregation' => 'एग्रीगेशन',
'Export' => 'निर्यात',
'Output' => 'आउटपुट',
'open' => 'खोलें',
'save' => 'सहेजें',
'Format' => 'प्रारूप',
'Tables' => 'टेबल्स',
'Data' => 'डेटा',
'Event has been dropped.' => 'घटना हटा दी गई है।',
'Event has been altered.' => 'घटना बदल दी गई है।',
'Event has been created.' => 'घटना बनाई गई है।',
'Alter event' => 'घटना बदलें',
'Create event' => 'घटना बनाएं',
'At given time' => 'निर्धारित समय पर',
'Every' => 'हर',
'Events' => 'घटनाएं',
'Schedule' => 'अनुसूची',
'Start' => 'शुरू',
'End' => 'समाप्त',
'Status' => 'स्थिति',
'On completion preserve' => 'पूरा होने पर संरक्षित करें',
'Tables and views' => 'टेबल्स और व्यूज',
'Data Length' => 'डेटा लंबाई',
'Index Length' => 'इंडेक्स लंबाई',
'Data Free' => 'डेटा मुक्त',
'Collation' => 'कॉलेशन',
'Analyze' => 'विश्लेषण',
'Optimize' => 'अनुकूलित',
'Check' => 'जांच',
'Repair' => 'मरम्मत',
'Truncate' => 'ट्रंकेट',
'Tables have been truncated.' => 'टेबल्स ट्रंकेट कर दिए गए हैं।',
'Rows' => 'पंक्तियां',
',' => ',',
'0123456789' => '०१२३४५६७८९',
'Tables have been moved.' => 'टेबल्स स्थानांतरित कर दिए गए हैं।',
'Move to other database' => 'अन्य डेटाबेस में स्थानांतरित करें',
'Move' => 'स्थानांतरित करें',
'Engine' => 'इंजन',
'Save and continue edit' => 'सहेजें और संपादन जारी रखें',
'original' => 'मूल',
'Tables have been dropped.' => 'टेबल्स हटा दिए गए हैं।',
'%d item(s) have been affected.' => '%d आइटम प्रभावित हुए हैं।',
'Whole result' => 'पूरा परिणाम',
'Clone' => 'क्लोन',
'Maximum number of allowed fields exceeded. Please increase %s.' => 'अनुमत फील्ड्स की अधिकतम संख्या पार हो गई। कृपया %s बढ़ाएं।',
'Partition by' => 'द्वारा विभाजन',
'Partitions' => 'पार्टीशन्स',
'Partition name' => 'पार्टीशन नाम',
'Values' => 'मान',
'%d row(s) have been imported.' => array('%d पंक्ति आयात की गई है।', '%d पंक्तियां आयात की गई हैं।'),
'anywhere' => 'कहीं भी',
'Import' => 'आयात',
'Stop on error' => 'त्रुटि पर रुकें',
'%.3f s' => '%.3f सेकंड',
'$1-$3-$5' => '$1-$3-$5',
'[yyyy]-mm-dd' => '[yyyy]-mm-dd',
'History' => 'इतिहास',
'Variables' => 'चर',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'स्रोत और लक्ष्य कॉलम्स का डेटा प्रकार समान होना चाहिए, लक्ष्य कॉलम्स पर एक इंडेक्स होना चाहिए और संदर्भित डेटा मौजूद होना चाहिए।',
'Relations' => 'संबंध',
'Run file' => 'फाइल चलाएं',
'Clear' => 'साफ़ करें',
'Maximum allowed file size is %sB.' => 'अधिकतम अनुमत फाइल आकार %sB है।',
'Numbers' => 'संख्याएं',
'Date and time' => 'तिथि और समय',
'Strings' => 'स्ट्रिंग्स',
'Binary' => 'बाइनरी',
'Lists' => 'सूचियां',
'Editor' => 'संपादक',
'Webserver file %s' => 'वेबसर्वर फाइल %s',
'File does not exist.' => 'फाइल मौजूद नहीं है।',
'%d in total' => 'कुल %d',
'Permanent login' => 'स्थायी लॉगिन',
'Databases have been dropped.' => 'डेटाबेस हटा दिए गए हैं।',
'Search data in tables' => 'टेबल्स में डेटा खोजें',
'Schema' => 'स्कीमा',
'Alter schema' => 'स्कीमा बदलें',
'Create schema' => 'स्कीमा बनाएं',
'Schema has been dropped.' => 'स्कीमा हटा दी गई है।',
'Schema has been created.' => 'स्कीमा बनाई गई है।',
'Schema has been altered.' => 'स्कीमा बदल दी गई है।',
'Sequences' => 'अनुक्रम',
'Create sequence' => 'अनुक्रम बनाएं',
'Alter sequence' => 'अनुक्रम बदलें',
'Sequence has been dropped.' => 'अनुक्रम हटा दिया गया है।',
'Sequence has been created.' => 'अनुक्रम बनाया गया है।',
'Sequence has been altered.' => 'अनुक्रम बदल दिया गया है।',
'User types' => 'उपयोगकर्ता प्रकार',
'Create type' => 'प्रकार बनाएं',
'Alter type' => 'प्रकार बदलें',
'Type has been dropped.' => 'प्रकार हटा दिया गया है।',
'Type has been created.' => 'प्रकार बनाया गया है।',
'Use edit link to modify this value.' => 'इस मान को संशोधित करने के लिए संपादन लिंक का उपयोग करें।',
'last' => 'अंतिम',
'From server' => 'सर्वर से',
'System' => 'सिस्टम',
'Select data' => 'डेटा चुनें',
'Show structure' => 'संरचना दिखाएं',
'empty' => 'खाली',
'Network' => 'नेटवर्क',
'Geometry' => 'ज्यामिति',
'File exists.' => 'फाइल मौजूद है।',
'%d query(s) executed OK.' => array('%d क्वेरी सफलतापूर्वक निष्पादित।', '%d क्वेरीज़ सफलतापूर्वक निष्पादित।'),
'Show only errors' => 'केवल त्रुटियां दिखाएं',
'Refresh' => 'ताज़ा करें',
'Invalid schema.' => 'अमान्य स्कीमा।',
'Please use one of the extensions %s.' => 'कृपया %s एक्सटेंशन्स में से एक का उपयोग करें।',
'now' => 'अब',
'ltr' => 'ltr',
'Tables have been copied.' => 'टेबल्स कॉपी कर दिए गए हैं।',
'Copy' => 'कॉपी',
'Permanent link' => 'स्थायी लिंक',
'Edit all' => 'सभी संपादित करें',
'HH:MM:SS' => 'HH:MM:SS',
'Check has been dropped.' => 'चेक हटा दिया गया है।',
'Check has been altered.' => 'चेक को बदल दिया गया है।',
'Check has been created.' => 'चेक बनाया गया है।',
'Alter check' => 'चेक बदलें',
'Create check' => 'चेक बनाएँ',
'Drop %s?' => '%s हटाएँ?',
'Tables have been optimized.' => 'टेबल्स को ऑप्टिमाइज़ कर दिया गया है।',
'Materialized view' => 'मटेरियलाइज़्ड व्यू',
'Vacuum' => 'वैक्यूम',
'Selected' => 'चयनित',
'overwrite' => 'ओवरराइट',
'DB' => 'डेटाबेस',
'Algorithm' => 'एल्गोरिदम',
'Columns' => 'कॉलम',
'Ctrl+click on a value to modify it.' => 'किसी मान को संशोधित करने के लिए Ctrl+क्लिक करें।',
'File must be in UTF-8 encoding.' => 'फ़ाइल UTF-8 एन्कोडिंग में होनी चाहिए।',
'Modify' => 'संशोधित करें',
'Load more data' => 'और डेटा लोड करें',
'Loading' => 'लोड हो रहा है',
'ATTACH queries are not supported.' => 'संलग्न क्वेरीज़ समर्थित नहीं हैं।',
'Warnings' => 'चेतावनियाँ',
'%d / ' => '%d / ',
'Limit rows' => 'पंक्तियाँ सीमित करें',
'Inherits from' => 'इनहेरिट करता है',
'Checks' => 'चेक्स',
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'एडमिनर बिना पासवर्ड के डेटाबेस एक्सेस करने का समर्थन नहीं करता, <a href="https://www.adminer.org/en/password/"%s>अधिक जानकारी</a>।',
'Default value' => 'डिफ़ॉल्ट मान',
'Full table scan' => 'पूरी टेबल स्कैन',
'Too many unsuccessful logins, try again in %d minute(s).' => 'बहुत अधिक असफल लॉगिन प्रयास, %d मिनट बाद पुनः प्रयास करें।',
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'एडमिनर उपयोग करने के लिए धन्यवाद, <a href="https://www.adminer.org/en/donation/">दान</a> करने पर विचार करें।',
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'मास्टर पासवर्ड समाप्त हो गया। इसे स्थायी बनाने के लिए %s मेथड <a href="https://www.adminer.org/en/extension/"%s>इम्प्लीमेंट</a> करें।',
'The action will be performed after successful login with the same credentials.' => 'यह क्रिया उसी क्रेडेंशियल्स से सफल लॉगिन के बाद की जाएगी।',
'Connecting to privileged ports is not allowed.' => 'प्रिविलेज्ड पोर्ट्स से कनेक्ट करने की अनुमति नहीं है।',
'There is a space in the input password which might be the cause.' => 'इनपुट पासवर्ड में एक स्पेस है जो कारण हो सकता है।',
'If you did not send this request from Adminer then close this page.' => 'अगर आपने यह अनुरोध एडमिनर से नहीं भेजा है तो इस पेज को बंद करें।',
'You can upload a big SQL file via FTP and import it from server.' => 'आप एक बड़ी SQL फ़ाइल FTP के माध्यम से अपलोड कर सकते हैं और सर्वर से इम्पोर्ट कर सकते हैं।',
'Size' => 'आकार',
'Compute' => 'कम्प्यूट',
'Loaded plugins' => 'लोडेड प्लगइन्स',
'screenshot' => 'स्क्रीनशॉट',
'You are offline.' => 'आप ऑफ़लाइन हैं।',
'You have no privileges to update this table.' => 'आपके पास इस टेबल को अपडेट करने की अनुमति नहीं है।',
'Saving' => 'सेव हो रहा है',
'Unknown error.' => 'अज्ञात त्रुटि।',
'%s must <a%s>return an array</a>.' => '%s को <a%s>एक ऐरे रिटर्न</a> करना चाहिए।',
'<a%s>Configure</a> %s in %s.' => '<a%s>कॉन्फ़िगर</a> %s में %s।',
'Disable %s or enable %s or %s extensions.' => '%s को डिसेबल करें या %s या %s एक्सटेंशन्स को एनेबल करें।',
'Database does not support password.' => 'डेटाबेस पासवर्ड का समर्थन नहीं करता।',
'yes' => 'हाँ',
'no' => 'नहीं',
);
// run `php ../../lang.php hi` to update this file

View File

@@ -13,9 +13,6 @@ Lang::$translations = array(
'Logged as: %s' => 'Zalogowany jako: %s', 'Logged as: %s' => 'Zalogowany jako: %s',
'Logout successful.' => 'Wylogowano pomyślnie.', 'Logout successful.' => 'Wylogowano pomyślnie.',
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Dziękujemy za używanie Adminera, rozważ <a href="https://www.adminer.org/pl/donation/">dotację</a>.', 'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Dziękujemy za używanie Adminera, rozważ <a href="https://www.adminer.org/pl/donation/">dotację</a>.',
'Loaded plugins' => 'Wczytane wtyczki',
'%s must <a%s>return an array</a>.' => '%s musi <a%s>zwrócić tablicę</a>.',
'<a%s>Configure</a> %s in %s.' => '<a%s>Skonfiguruj</a> %s w %s.',
'Invalid credentials.' => 'Nieprawidłowe dane logowania.', 'Invalid credentials.' => 'Nieprawidłowe dane logowania.',
'There is a space in the input password which might be the cause.' => 'W haśle wejściowym znajduje się spacja, która może być przyczyną.', 'There is a space in the input password which might be the cause.' => 'W haśle wejściowym znajduje się spacja, która może być przyczyną.',
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nie obsługuje dostępu do bazy danych bez hasła, <a href="https://www.adminer.org/pl/password/"%s>więcej informacji</a>.', 'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nie obsługuje dostępu do bazy danych bez hasła, <a href="https://www.adminer.org/pl/password/"%s>więcej informacji</a>.',
@@ -90,6 +87,7 @@ Lang::$translations = array(
'Output' => 'Rezultat', 'Output' => 'Rezultat',
'open' => 'otwórz', 'open' => 'otwórz',
'save' => 'zapisz', 'save' => 'zapisz',
'Saving' => 'Zapisywanie',
'Format' => 'Format', 'Format' => 'Format',
'Data' => 'Dane', 'Data' => 'Dane',
@@ -197,6 +195,7 @@ Lang::$translations = array(
'Partitions' => 'Partycje', 'Partitions' => 'Partycje',
'Partition name' => 'Nazwa partycji', 'Partition name' => 'Nazwa partycji',
'Values' => 'Wartości', 'Values' => 'Wartości',
'Inherits from' => 'Dziedziczy po',
'View' => 'Perspektywa', 'View' => 'Perspektywa',
'Materialized view' => 'Zmaterializowana perspektywa', 'Materialized view' => 'Zmaterializowana perspektywa',
@@ -212,6 +211,8 @@ Lang::$translations = array(
'Add next' => 'Dodaj następny', 'Add next' => 'Dodaj następny',
'Index Type' => 'Typ indeksu', 'Index Type' => 'Typ indeksu',
'length' => 'długość', 'length' => 'długość',
'Algorithm' => 'Algorytm',
'Condition' => 'Warunek',
'Foreign keys' => 'Klucze obce', 'Foreign keys' => 'Klucze obce',
'Foreign key' => 'Klucz obcy', 'Foreign key' => 'Klucz obcy',
@@ -288,7 +289,6 @@ Lang::$translations = array(
'Edit' => 'Edytuj', 'Edit' => 'Edytuj',
'Insert' => 'Dodaj', 'Insert' => 'Dodaj',
'Save' => 'Zapisz zmiany', 'Save' => 'Zapisz zmiany',
'Saving' => 'Zapisywanie',
'Save and continue edit' => 'Zapisz i kontynuuj edycję', 'Save and continue edit' => 'Zapisz i kontynuuj edycję',
'Save and insert next' => 'Zapisz i dodaj następny', 'Save and insert next' => 'Zapisz i dodaj następny',
'Selected' => 'Zaznaczone', 'Selected' => 'Zaznaczone',
@@ -352,6 +352,11 @@ Lang::$translations = array(
'Check has been created.' => 'Kontrola została utworzona.', 'Check has been created.' => 'Kontrola została utworzona.',
'Check has been altered.' => 'Kontrola została zmieniona.', 'Check has been altered.' => 'Kontrola została zmieniona.',
'Check has been dropped.' => 'Kontrola została usunięta.', 'Check has been dropped.' => 'Kontrola została usunięta.',
'Loaded plugins' => 'Wczytane wtyczki',
'%s must <a%s>return an array</a>.' => '%s musi <a%s>zwrócić tablicę</a>.',
'<a%s>Configure</a> %s in %s.' => '<a%s>Skonfiguruj</a> %s w %s.',
'screenshot' => 'zrzut ekranu',
); );
// run `php ../../lang.php pl` to update this file // run `php ../../lang.php pl` to update this file

View File

@@ -196,6 +196,7 @@ Lang::$translations = array(
'Partitions' => 'Xx', 'Partitions' => 'Xx',
'Partition name' => 'Xx', 'Partition name' => 'Xx',
'Values' => 'Xx', 'Values' => 'Xx',
'Inherits from' => 'Xx',
'View' => 'Xx', 'View' => 'Xx',
'Materialized view' => 'Xx', 'Materialized view' => 'Xx',
@@ -211,6 +212,8 @@ Lang::$translations = array(
'Add next' => 'Xx', 'Add next' => 'Xx',
'Index Type' => 'Xx', 'Index Type' => 'Xx',
'length' => 'xx', 'length' => 'xx',
'Algorithm' => 'Xx',
'Condition' => 'Xx',
'Foreign keys' => 'Xx', 'Foreign keys' => 'Xx',
'Foreign key' => 'Xx', 'Foreign key' => 'Xx',

View File

@@ -56,7 +56,7 @@ echo ($collations ? "<datalist id='collations'>" . optionlist($collations) . "</
edit_fields($row["fields"], $collations, $routine); edit_fields($row["fields"], $collations, $routine);
if (isset($_GET["function"])) { if (isset($_GET["function"])) {
echo "<tr><td>" . lang('Return type'); echo "<tr><td>" . lang('Return type');
edit_type("returns", $row["returns"], $collations, array(), (JUSH == "pgsql" ? array("void", "trigger") : array())); edit_type("returns", (array) $row["returns"], $collations, array(), (JUSH == "pgsql" ? array("void", "trigger") : array()));
} }
?> ?>
</table> </table>

View File

@@ -354,7 +354,7 @@ if (!$columns && support("table")) {
echo "<th id='th[" . h(bracket_escape($key)) . "]'>" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", ""); echo "<th id='th[" . h(bracket_escape($key)) . "]'>" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", "");
$fun = apply_sql_function($val["fun"], $name); //! columns looking like functions $fun = apply_sql_function($val["fun"], $name); //! columns looking like functions
$sortable = isset($field["privileges"]["order"]) || $fun; $sortable = isset($field["privileges"]["order"]) || $fun;
echo ($sortable ? '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . '">' . "$fun</a>" : $fun); // $order[0] == $key - COUNT(*) echo ($sortable ? "<a href='" . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . "'>$fun</a>" : $fun); // $order[0] == $key - COUNT(*)
echo "<span class='column hidden'>"; echo "<span class='column hidden'>";
if ($sortable) { if ($sortable) {
echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>"; echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>";
@@ -389,10 +389,12 @@ if (!$columns && support("table")) {
$unique_array = unique_array($rows[$n], $indexes); $unique_array = unique_array($rows[$n], $indexes);
if (!$unique_array) { if (!$unique_array) {
$unique_array = array(); $unique_array = array();
reset($select);
foreach ($rows[$n] as $key => $val) { foreach ($rows[$n] as $key => $val) {
if (!preg_match('~^(COUNT\((\*|(DISTINCT )?`(?:[^`]|``)+`)\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\(`(?:[^`]|``)+`\))$~', $key)) { //! columns looking like functions if (!preg_match('~^(COUNT|AVG|GROUP_CONCAT|MAX|MIN|SUM)\(~', current($select))) {
$unique_array[$key] = $val; $unique_array[$key] = $val;
} }
next($select);
} }
} }
$unique_idf = ""; $unique_idf = "";
@@ -410,8 +412,10 @@ if (!$columns && support("table")) {
. ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "' class='edit'>" . lang('edit') . "</a>") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "' class='edit'>" . lang('edit') . "</a>")
); );
reset($select);
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
if (isset($names[$key])) { if (isset($names[$key])) {
$column = current($select);
$field = (array) $fields[$key]; $field = (array) $fields[$key];
$val = driver()->value($val, $field); $val = driver()->value($val, $field);
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) { if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
@@ -439,7 +443,7 @@ if (!$columns && support("table")) {
} }
} }
} }
if ($key == "COUNT(*)") { //! columns looking like functions if ($column == "COUNT(*)") {
$link = ME . "select=" . urlencode($TABLE); $link = ME . "select=" . urlencode($TABLE);
$i = 0; $i = 0;
foreach ((array) $_GET["where"] as $v) { foreach ((array) $_GET["where"] as $v) {
@@ -456,8 +460,10 @@ if (!$columns && support("table")) {
$id = h("val[$unique_idf][" . bracket_escape($key) . "]"); $id = h("val[$unique_idf][" . bracket_escape($key) . "]");
$posted = idx(idx($_POST["val"], $unique_idf), bracket_escape($key)); $posted = idx(idx($_POST["val"], $unique_idf), bracket_escape($key));
$editable = !is_array($row[$key]) && is_utf8($html) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"]; $editable = !is_array($row[$key]) && is_utf8($html) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"];
$text = preg_match('~text|json|lob~', $field["type"]); $type = (preg_match('~^(AVG|MIN|MAX)\((.+)\)~', $column, $match) ? $fields[idf_unescape($match[2])]["type"] : $field["type"]);
echo "<td id='$id'" . (preg_match(number_type(), $field["type"]) && ($val === null || is_numeric(strip_tags($html))) ? " class='number'" : ""); $text = preg_match('~text|json|lob~', $type);
$is_number = preg_match(number_type(), $type) || preg_match('~^(CHAR_LENGTH|ROUND|FLOOR|CEIL|TIME_TO_SEC|COUNT|SUM)\(~', $column);
echo "<td id='$id'" . ($is_number && ($val === null || is_numeric(strip_tags($html)) || $type == "money") ? " class='number'" : "");
if (($_GET["modify"] && $editable && $val !== null) || $posted !== null) { if (($_GET["modify"] && $editable && $val !== null) || $posted !== null) {
$h_value = h($posted !== null ? $posted : $row[$key]); $h_value = h($posted !== null ? $posted : $row[$key]);
echo ">" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>"); echo ">" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>");
@@ -469,6 +475,7 @@ if (!$columns && support("table")) {
; ;
} }
} }
next($select);
} }
if ($backward_keys) { if ($backward_keys) {

View File

@@ -4,17 +4,16 @@ html {
--bg: #002240; --bg: #002240;
--fg: #829bb0; --fg: #829bb0;
--dim: #154269; --dim: #154269;
--lit: #011d35;
} }
a { color: #618CB3; } a, a:visited { color: #618cb3; }
a:visited { color: #618CB3; }
a:link:hover, a:visited:hover { color: #9bc0e1; } a:link:hover, a:visited:hover { color: #9bc0e1; }
h1 { border-color: #5e94c1; color: #ffddbf; } h1 { border-color: #5e94c1; color: #ffddbf; }
h2 { border-color: #a3bdd3; color: #000; background: #3c678d; } h2 { border-color: #a3bdd3; color: #000; background: #3c678d; }
table, td, th { border-color: #0e416d; } table, td, th, .js .column { border-color: #0e416d; }
th { background: #11385a; } th { background: #11385a; }
thead td, thead th { color: #a8b05f; background: #011d35; } thead td, thead th, thead th a { color: #a8b05f; }
thead th a { color: #a8b05f; }
fieldset { border-color: #16548a; } fieldset { border-color: #16548a; }
code { background: #11385a; } code { background: #11385a; }
tbody tr:hover td, tbody tr:hover th { background: #133553; } tbody tr:hover td, tbody tr:hover th { background: #133553; }
@@ -22,7 +21,6 @@ pre.jush { background: #11385a; }
input.default { box-shadow: 1px 1px 1px #888; } input.default { box-shadow: 1px 1px 1px #888; }
input.required, input.maxlength { box-shadow: 1px 1px 1px red; } input.required, input.maxlength { box-shadow: 1px 1px 1px red; }
.version { color: #888; } .version { color: #888; }
.js .column { background: #011d35; }
.error { color: red; background: #efdada; border: 1px solid #e76f6f; } .error { color: red; background: #efdada; border: 1px solid #e76f6f; }
.error b { background: #efeaea; } .error b { background: #efeaea; }
.message { color: #0b860b; background: #efe; border: 1px solid #7fbd7f; } .message { color: #0b860b; background: #efe; border: 1px solid #7fbd7f; }
@@ -45,3 +43,4 @@ input.required, input.maxlength { box-shadow: 1px 1px 1px red; }
#schema div.table a { color: #3c7bb3; } #schema div.table a { color: #3c7bb3; }
#menu .active { color: #398c8d; } #menu .active { color: #398c8d; }
#edit-fields tbody tr:hover td, #edit-fields tbody tr:hover th { background: #3b6f9d; } #edit-fields tbody tr:hover td, #edit-fields tbody tr:hover th { background: #3b6f9d; }
:target { color: #a8b05f; }

View File

@@ -4,6 +4,7 @@ html {
--bg: #fff; --bg: #fff;
--fg: #000; --fg: #000;
--dim: #eee; --dim: #eee;
--lit: #ddf;
} }
body { color: var(--fg); background: var(--bg); font: 90%/1.25 Verdana, Arial, Helvetica, sans-serif; margin: 0; min-width: fit-content; } body { color: var(--fg); background: var(--bg); font: 90%/1.25 Verdana, Arial, Helvetica, sans-serif; margin: 0; min-width: fit-content; }
@@ -13,17 +14,17 @@ a:link:hover, a:visited:hover { color: red; text-decoration: underline; }
a.text:hover { text-decoration: none; } a.text:hover { text-decoration: none; }
a.jush-help:hover { color: inherit; } a.jush-help:hover { color: inherit; }
h1 { font-size: 150%; margin: 0; padding: .8em .667em; border-bottom: 1px solid #999; font-weight: normal; color: #777; background: var(--dim); } h1 { font-size: 150%; margin: 0; padding: .8em .667em; border-bottom: 1px solid #999; font-weight: normal; color: #777; background: var(--dim); }
h2 { font-size: 150%; margin: 0 0 20px -18px; padding: .8em 1em; border-bottom: 1px solid var(--fg); font-weight: normal; background: #ddf; } h2 { font-size: 150%; margin: 0 0 20px -18px; padding: .8em 1em; border-bottom: 1px solid var(--fg); font-weight: normal; background: var(--lit); }
h3 { font-weight: normal; font-size: 130%; margin: 1em 0 0; } h3 { font-weight: normal; font-size: 130%; margin: 1em 0 0; }
form { margin: 0; } form { margin: 0; }
td table { width: 100%; margin: 0; } td table { width: 100%; margin: 0; }
table { margin: 1em 20px 0 0; font-size: 90%; border-spacing: 0; border-width: 1px 0 0 1px; } table { margin: 1em 20px 0 0; font-size: 90%; border-spacing: 0; border-width: 1px 0 0 1px; }
table, td, th { border-color: #999; border-style: solid; } table, td, th, .js .column { border-color: #999; border-style: solid; }
td, th { border-width: 0 1px 1px 0; padding: .2em .3em; margin: 0; } td, th { border-width: 0 1px 1px 0; padding: .2em .3em; margin: 0; }
th { background: var(--dim); text-align: left; } th { background: var(--dim); text-align: left; }
thead { position: sticky; top: 0; } thead { position: sticky; top: 0; }
thead th { text-align: center; padding: .2em .5em; } thead th { text-align: center; padding: .2em .5em; }
thead td, thead th { background: #ddf; } thead td, thead th { background: var(--lit); }
fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: .8em .5em 0 0; border: 1px solid #999; border-radius: 5px; } fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: .8em .5em 0 0; border: 1px solid #999; border-radius: 5px; }
p { margin: .8em 20px 0 0; } p { margin: .8em 20px 0 0; }
img { vertical-align: middle; border: 0; } img { vertical-align: middle; border: 0; }
@@ -44,7 +45,7 @@ input.wayoff { left: -1000px; position: absolute; }
.block { display: block; } .block { display: block; }
.version { color: #777; font-size: 62%; } .version { color: #777; font-size: 62%; }
.js .hidden, .nojs .jsonly { display: none; } .js .hidden, .nojs .jsonly { display: none; }
.js .column { position: absolute; background: #ddf; padding: .27em 1ex .3em 0; margin-top: -.27em; } .js .column { position: absolute; background: var(--lit); padding: .27em 1ex .33em 0; margin-top: -.37em; border-width: 1px 1px 1px 0; border-radius: 0 8px 8px 0; }
.nowrap td, .nowrap th, td.nowrap, p.nowrap { white-space: pre; } .nowrap td, .nowrap th, td.nowrap, p.nowrap { white-space: pre; }
.wrap td { white-space: normal; } .wrap td { white-space: normal; }
.error { color: red; background: #fee; } .error { color: red; background: #fee; }
@@ -57,7 +58,7 @@ input.wayoff { left: -1000px; position: absolute; }
.enum { color: #007F7F; } .enum { color: #007F7F; }
.binary { color: red; } .binary { color: red; }
.odds tbody tr:nth-child(2n) { background: #F5F5F5; } .odds tbody tr:nth-child(2n) { background: #F5F5F5; }
.js .checkable .checked td, .js .checkable .checked th { background: #ddf; } .js .checkable .checked td, .js .checkable .checked th { background: var(--lit); }
.time { color: silver; font-size: 70%; } .time { color: silver; font-size: 70%; }
.function, .number, .datetime { text-align: right; } .function, .number, .datetime { text-align: right; }
.type { width: 15ex; } .type { width: 15ex; }
@@ -67,7 +68,7 @@ input.wayoff { left: -1000px; position: absolute; }
.sqlarea { width: 98%; } .sqlarea { width: 98%; }
.sql-footer { margin-bottom: 2.5em; } .sql-footer { margin-bottom: 2.5em; }
.explain table { white-space: pre; } .explain table { white-space: pre; }
.icon { width: 18px; height: 18px; background: navy center no-repeat; border: 0; vertical-align: middle; } .icon { width: 18px; height: 18px; background: navy center no-repeat; border: 0; padding: 0; vertical-align: middle; }
.icon span { display: none; } .icon span { display: none; }
.icon:hover { background-color: red; } .icon:hover { background-color: red; }
.size { width: 7ex; } .size { width: 7ex; }
@@ -96,6 +97,7 @@ input.wayoff { left: -1000px; position: absolute; }
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; } #schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; } #schema .references { position: absolute; }
#help { position: absolute; border: 1px solid #999; background: var(--dim); padding: 5px; font-family: monospace; z-index: 1; } #help { position: absolute; border: 1px solid #999; background: var(--dim); padding: 5px; font-family: monospace; z-index: 1; }
:target { background: var(--lit); }
/* inlined here and not in compile.php because otherwise the development version flickers a little bit when loading the images */ /* inlined here and not in compile.php because otherwise the development version flickers a little bit when loading the images */
.icon-up { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIghI+py+0PTQhRTgrvfRP0nmEVOIoReZphxbauAMfyHBcAOw==); } .icon-up { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIghI+py+0PTQhRTgrvfRP0nmEVOIoReZphxbauAMfyHBcAOw==); }

View File

@@ -22,7 +22,19 @@ if ($comment != "") {
echo "<p class='nowrap'>" . lang('Comment') . ": " . h($comment) . "\n"; echo "<p class='nowrap'>" . lang('Comment') . ": " . h($comment) . "\n";
} }
if ($fields) { function tables_links($tables) {
echo "<ul>\n";
foreach ($tables as $table) {
echo "<li><a href='" . h(ME . "table=" . urlencode($table)) . "'>" . h($table) . "</a>";
}
echo "</ul>\n";
}
$inherits = driver()->inheritsFrom($TABLE);
if ($inherits) {
echo "<h3>" . lang('Inherits from') . "</h3>\n";
tables_links($inherits);
} elseif ($fields) {
adminer()->tableStructurePrint($fields, $table_status); adminer()->tableStructurePrint($fields, $table_status);
} }
@@ -30,7 +42,7 @@ if (support("indexes") && driver()->supportsIndex($table_status)) {
echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n"; echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n";
$indexes = indexes($TABLE); $indexes = indexes($TABLE);
if ($indexes) { if ($indexes) {
adminer()->tableIndexesPrint($indexes); adminer()->tableIndexesPrint($indexes, $table_status);
} }
echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n"; echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
} }
@@ -95,3 +107,13 @@ if (support(is_view($table_status) ? "view_trigger" : "trigger")) {
} }
echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n"; echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
} }
$inherited = driver()->inheritedTables($TABLE);
if ($inherited) {
echo "<h3 id='partitions'>" . lang('Partitions') . "</h3>\n";
$partition = driver()->partitionsInfo($TABLE);
if ($partition) {
echo "<p><code class='jush-" . JUSH . "'>BY " . h("$partition[partition_by]($partition[partition])") . "</code>\n";
}
tables_links($inherited);
}

View File

@@ -165,7 +165,7 @@ function put_file_lang($match) {
case "' . $lang . '": $compressed = "' . add_quo_slashes(lzw_compress(implode("\n", $translation_ids))) . '"; break;'; case "' . $lang . '": $compressed = "' . add_quo_slashes(lzw_compress(implode("\n", $translation_ids))) . '"; break;';
} }
$translations_version = crc32($return); $translations_version = crc32($return);
return 'Lang::$translations = $_SESSION["translations"]; return 'Lang::$translations = (array) $_SESSION["translations"];
if ($_SESSION["translations_version"] != LANG . ' . $translations_version . ') { if ($_SESSION["translations_version"] != LANG . ' . $translations_version . ') {
Lang::$translations = array(); Lang::$translations = array();
$_SESSION["translations_version"] = LANG . ' . $translations_version . '; $_SESSION["translations_version"] = LANG . ' . $translations_version . ';

View File

@@ -0,0 +1,2 @@
## Screenshot
![screenshot](https://www.adminer.org/static/designs/lavender-light/screenshot.png)

View File

@@ -0,0 +1,283 @@
/**
* lavender-light theme for Adminer
* by Alex Yu
*
* Color palette from:
* https://color.adobe.com/Lavender-v2-color-theme-294b8aa6-1935-401f-a763-13b98ec68b90/
*
* - white
* - ghostwhite (f8f8ff)
* - lavender (f0f0ff)
* - darkslateblue (483d8b)
* - aliceblue (f0f8ff)
* - gray (313b43), (21282e)
* - blue (001dff), (002799)
*/
body {
display: grid;
column-gap: 1rem;
row-gap: 20px;
width: 100%;
height: auto;
grid-template-areas:
"menu content";
grid-template-rows: 1fr;
grid-template-columns: 21rem 1fr;
align-items: stretch;
justify-items: start;
font: 0.96rem/1.2rem sans-serif !important;
}
a {
color: #001dff;
text-underline-offset: 1px;
transition-property: all;
transition-timing-function: cubic-bezier(.4,0,.2,1);
transition-duration: .15s;
}
/*
* Basic tags
*/
a:visited {
color: #002799;
}
a:link:hover, a:visited:hover {
color: #7388c9;
text-underline-offset: 4px;
}
h1 {
border: 0;
}
h2 {
margin: 0 0 20px 0px;
line-height: 1.68rem;
border-bottom: 1px solid #20165a; /* darkslateblue; */
background: #3c3085;
color: white;
}
#h1 {
font-size: 1.2rem;
font-style: normal;
font-weight: bold;
text-transform: uppercase;
color: #333;
}
#h1 img {
display: none;
}
/*
* Tables
*/
table {
border-left: 1px solid silver;
}
#table .column {
display: none;
}
td, th {
font-size: 1.05em;
border-right: 1px solid silver;
border-bottom: 1px solid silver;
padding: .3em .6em;
background: none;
}
thead th, thead td {
background: #313b43;
color: white;
border-right: 1px solid #21282e;
border-bottom: 1px solid #21282e;
padding: .5em .5em;
}
thead th a, thead td a,
thead th a:visited, thead td a:visited,
thead th a:hover, thead td a:hover {
color: #eee;
}
th span.column a.text {
color: #2980b9;
}
.js span.column {
background: white;
}
table#table thead .checked td,
table#table thead .checked th {
background: #313b43;
}
.pages {
border: none;
box-shadow: -1px -1px 4px silver;
}
/*
* Common sections
*/
#breadcrumb {
position: static;
top: initial;
left: initial;
margin: 0;
padding: 0.6rem 0 0.4rem 0;
color: #596167;
background: none;
}
#breadcrumb a {
color: #002799;
}
#content {
grid-area: content;
margin: 0;
padding: 0 20px 0 0;
width: calc(100% - 20px);
}
#logout {
font-weight: bold;
text-transform: uppercase;
padding: 0.3rem 0.7rem;
}
#menu {
grid-area: menu;
position: initial;
margin: 0;
padding: 1rem 1.5rem;
width: 18rem;
background: ghostwhite;
overflow-y: auto;
}
#menu h1 {
padding: 0 0 1rem 0;
background: none;
}
#menu #dbs {
padding: 3rem 0 1.5rem;
}
#menu p, #logins, #tables {
padding: .8em 0em 1.2rem;
}
#menu #tables a[href*="&select="] {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHISURBVDjLpVPNK0RRFP+9D98syMwUspHkm9I0YkFZWBFKkZ0s7a3Ewh+ilChK7FgoZCJFKYlYKB8zk2+Z5t0P577He29kQU7dd+6575zf+d1zztWklPiPmOozt/U4SThjXIoyIQS4AJjSXO0lGGlvcXAm6Vzsz4xUhm0AIeX4QLig+C+ZpxbOG1wGhGYHr1zMUmZGWRgs0ha3PE1nX/8mWmdgWTzLB+DUYbhm9FfZ35IEyrhXA3VXJfPbsV8B9LQUIeUHYJ8ASobag1jcucNgW8g9W4reYSDi2YnnZDoDiwCokDANct6NwTB0LEdj0HRA/wxa2SN25JNBEdWluUhZ366gqmAaGvrCAXKOozccTGPgt8+vn8GYSGcgyTYp3dpBnBg42nbQPRBTo5bTvqYkmxL6AQhNTWQGBXY3B7BxlEBXozcW64dxRKoKUZBju+P06gl5WaaviMJBM3TNDlbypemIZgHYOnlwASsCmW7nHADGnBoQ3c76YmweJ9BR5zFYjsbRHwm4tmJg6PhWA7pCXXk+bu7fURHKweXtq/sWaksz7SC/CCGFrwtyZ3r+rCnFRZ7qr1qc6mLZj4f9OEyPL8lVpbX/PucPv5QPKHB1TdEAAAAASUVORK5CYII=) no-repeat scroll right bottom;
display: inline-block;
height: 16px;
margin-right: 4px;
vertical-align: middle;
overflow: hidden;
padding-left: 18px;
border-left: 1px solid transparent;
width: 0;
}
#menu #tables a.active {
border-left: 1px solid #20165a;
}
#menu .links {
display: inline-flex;
flex-direction: column;
flex-wrap: wrap;
padding: 1rem 0 0 1.6rem;
border: 0;
}
#menu #tables li {
list-style: none;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: stretch;
flex-direction: row;
}
#menu #tables li a+a {
padding-left: 0.3rem;
}
#lang {
position: absolute;
top: 4rem;
z-index: 100;
padding: 0 0 0 1.5rem;
}
#logins a, #tables a, #tables span {
background: initial;
}
/*
* Elements
*/
sup {
padding: 3px 7px;
background: #3498db;
color: white;
border-radius: 2em;
}
code.jush-sql {
display: block;
padding: .4em .7em;
line-height: 1.5em;
}
.jush-bac, .jush-php_bac, .jush-bra, .jush-mssql_bra, .jush-sqlite_quo {
color: #dc33f9;
}
pre, textarea {
padding: 1.5rem;
font: 100% / 1.25 monospace;
}
pre, code {
background: #f2f2ff;
}
pre.sqlarea {
padding: 1rem !important;
border: 2px solid #a9a9a9 !important;
border-radius: 4px;
background: #fff;
}
a.jush-custom:link, a.jush-custom:visited {
color: midnightblue;
}
select, input {
padding: 2px;
}

View File

@@ -252,7 +252,8 @@ This extracts them for translation and applies translations if available.
Translations are updated via [lang.php](/lang.php), which also checks for style consistency, such as matching punctuation. Translations are updated via [lang.php](/lang.php), which also checks for style consistency, such as matching punctuation.
Plurals are stored as arrays, with selection logic handled in [lang.inc.php](/adminer/include/lang.inc.php). Plurals are stored as arrays, with selection logic handled in [lang.inc.php](/adminer/include/lang.inc.php).
Plugins extending [`Adminer\Plugin`](/adminer/include/plugin.inc.php) can use `$this->lang()` and store translations in `static $translations = array('en' => array('' => 'Plugin description'))`. Plugins extending [`Adminer\Plugin`](/adminer/include/plugin.inc.php) can use `$this->lang()` and store translations in `$translations = array('en' => array('' => 'Plugin description'))`.
The website translations are managed at https://www.adminer.org/en/translations/. The website translations are managed at https://www.adminer.org/en/translations/.
## Compilation ## Compilation

View File

@@ -70,12 +70,20 @@ class Adminer {
return true; return true;
} }
function bodyClass(): void {
echo " editor";
}
function css() { function css() {
$return = array(); $return = array();
foreach (array("", "-dark") as $mode) { foreach (array("", "-dark") as $mode) {
$filename = "adminer$mode.css"; $filename = "adminer$mode.css";
if (file_exists($filename)) { if (file_exists($filename)) {
$return[] = "$filename?v=" . crc32(file_get_contents($filename)); $file = file_get_contents($filename);
$return["$filename?v=" . crc32($file)] = ($mode
? "dark"
: (preg_match('~prefers-color-scheme:\s*dark~', $file) ? '' : 'light')
);
} }
} }
return $return; return $return;
@@ -256,10 +264,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row
if (preg_match("~enum~", $field["type"]) || like_bool($field)) { //! set - uses 1 << $i and FIND_IN_SET() if (preg_match("~enum~", $field["type"]) || like_bool($field)) { //! set - uses 1 << $i and FIND_IN_SET()
$key = $keys[$name]; $key = $keys[$name];
$i--; $i--;
echo "<div>" . h($desc) . input_hidden("where[$i][col]", $name) . ":"; echo "<div>" . h($desc) . ":" . input_hidden("where[$i][col]", $name);
$val = idx($where[$key], "val");
echo (like_bool($field) echo (like_bool($field)
? " <select name='where[$i][val]'>" . optionlist(array("" => "", lang('no'), lang('yes')), $where[$key]["val"], true) . "</select>" ? "<select name='where[$i][val]'>" . optionlist(array("" => "", lang('no'), lang('yes')), $val, true) . "</select>"
: enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $where[$key]["val"], ($field["null"] ? 0 : null)) : enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $val, ($field["null"] ? 0 : null))
); );
echo "</div>\n"; echo "</div>\n";
unset($columns[$name]); unset($columns[$name]);
@@ -357,14 +366,14 @@ ORDER BY ORDINAL_POSITION", null, "") as $row
if ($col != "" || is_numeric($val) || !preg_match(number_type(), $field["type"])) { if ($col != "" || is_numeric($val) || !preg_match(number_type(), $field["type"])) {
$name = idf_escape($name); $name = idf_escape($name);
if ($col != "" && $field["type"] == "enum") { if ($col != "" && $field["type"] == "enum") {
$conds[] = (in_array(0, $val) ? "$name IS NULL OR " : "") . "$name IN (" . implode(", ", array_map('intval', $val)) . ")"; $conds[] = (in_array(0, $val) ? "$name IS NULL OR " : "") . "$name IN (" . implode(", ", array_map('Adminer\q', $val)) . ")";
} else { } else {
$text_type = preg_match('~char|text|enum|set~', $field["type"]); $text_type = preg_match('~char|text|enum|set~', $field["type"]);
$value = adminer()->processInput($field, (!$op && $text_type && preg_match('~^[^%]+$~', $val) ? "%$val%" : $val)); $value = adminer()->processInput($field, (!$op && $text_type && preg_match('~^[^%]+$~', $val) ? "%$val%" : $val));
$conds[] = driver()->convertSearch($name, $where, $field) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") . " $value" $conds[] = driver()->convertSearch($name, $where, $field) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") . " $value"
: (in_array($op, adminer()->operators()) || $op == "=" ? " $op $value" : (in_array($op, adminer()->operators()) || $op == "=" ? " $op $value"
: ($text_type ? " LIKE $value" : ($text_type ? " LIKE $value"
: " IN (" . str_replace(",", "', '", $value) . ")" : " IN (" . ($value[0] == "'" ? str_replace(",", "', '", $value) : $value) . ")"
))); )));
if ($key < 0 && $val == "0") { if ($key < 0 && $val == "0") {
$conds[] = "$name IS NULL"; $conds[] = "$name IS NULL";
@@ -492,7 +501,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row
if (preg_match('~date|timestamp~', $field["type"]) && preg_match('(^' . str_replace('\$1', '(?P<p1>\d*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\2>\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) { if (preg_match('~date|timestamp~', $field["type"]) && preg_match('(^' . str_replace('\$1', '(?P<p1>\d*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\2>\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) {
$return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match); $return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match);
} }
$return = ($field["type"] == "bit" && preg_match('~^[0-9]+$~', $value) ? $return : q($return)); $return = q($return);
if ($value == "" && like_bool($field)) { if ($value == "" && like_bool($field)) {
$return = "'0'"; $return = "'0'";
} elseif ($value == "" && ($field["null"] || !preg_match('~char|text~', $field["type"]))) { } elseif ($value == "" && ($field["null"] || !preg_match('~char|text~', $field["type"]))) {

View File

@@ -1,6 +1,10 @@
<?php <?php
namespace Adminer; namespace Adminer;
function doc_link(array $paths, string $text = ""): string {
return "";
}
/** Encode e-mail header in UTF-8 */ /** Encode e-mail header in UTF-8 */
function email_header(string $header): string { function email_header(string $header): string {
// iconv_mime_encode requires iconv, imap_8bit requires IMAP extension // iconv_mime_encode requires iconv, imap_8bit requires IMAP extension

2
externals/jush vendored

View File

@@ -12,15 +12,7 @@ if (isset($_SESSION["lang"])) {
} }
$messages_all = array(); $messages_all = array();
foreach ( foreach (glob(__DIR__ . "/{adminer,adminer/include,adminer/drivers,editor,editor/include}/*.php", GLOB_BRACE) as $include) {
array_merge(
glob(__DIR__ . "/adminer/*.php"),
glob(__DIR__ . "/adminer/include/*.php"),
glob(__DIR__ . "/adminer/drivers/*.php"),
glob(__DIR__ . "/editor/*.php"),
glob(__DIR__ . "/editor/include/*.php")
) as $include
) {
$file = file_get_contents($include); $file = file_get_contents($include);
if (preg_match_all("~[^>]lang\\(('(?:[^\\\\']+|\\\\.)*')([),])~", $file, $matches)) { // lang() always uses apostrophes if (preg_match_all("~[^>]lang\\(('(?:[^\\\\']+|\\\\.)*')([),])~", $file, $matches)) { // lang() always uses apostrophes
$messages_all += array_combine($matches[1], $matches[2]); $messages_all += array_combine($matches[1], $matches[2]);
@@ -53,7 +45,7 @@ function update_translations($lang, $messages, $filename, $pattern, $tabs = "\t"
$start = $match[2][1]; $start = $match[2][1];
preg_match_all("~^(\\s*(?:// [^'].*\\s+)?)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => (.*[^,\n])),?~m", $match[2][0], $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); preg_match_all("~^(\\s*(?:// [^'].*\\s+)?)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => (.*[^,\n])),?~m", $match[2][0], $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
$s = ""; $s = "";
$fullstop = ($lang == "bn" ? '।' : (preg_match('~^(ja|zh)~', $lang) ? '。' : ($lang == 'he' ? '[^.]' : '\.'))); $fullstop = ($lang == 'bn' || $lang == 'hi' ? '।' : (preg_match('~^(ja|zh)~', $lang) ? '。' : ($lang == 'he' ? '[^.]' : '\.')));
foreach ($matches as $match) { foreach ($matches as $match) {
list(, list($indent), list($line, $offset), list($en), list($translation)) = $match; list(, list($indent), list($line, $offset), list($en), list($translation)) = $match;
if (isset($messages[$en])) { if (isset($messages[$en])) {

View File

@@ -10,7 +10,7 @@
<exclude-pattern>/(adminer|editor)[-.]</exclude-pattern> <exclude-pattern>/(adminer|editor)[-.]</exclude-pattern>
<rule ref="PSR12"> <rule ref="PSR12">
<exclude name="Generic.Whitespace.DisallowTabIndent"/><!-- Replaced by: Generic.Whitespace.DisallowSpaceIndent --> <exclude name="Generic.WhiteSpace.DisallowTabIndent"/><!-- Replaced by: Generic.WhiteSpace.DisallowSpaceIndent -->
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/> <exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses"/> <exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses"/>
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/><!-- Replaced by: Generic.Classes.OpeningBraceSameLine --> <exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/><!-- Replaced by: Generic.Classes.OpeningBraceSameLine -->
@@ -58,6 +58,7 @@
<property name="lineLimit" value="250"/> <property name="lineLimit" value="250"/>
</properties> </properties>
<exclude-pattern>adminer/lang/</exclude-pattern> <exclude-pattern>adminer/lang/</exclude-pattern>
<exclude-pattern>plugins/foreign-system.php</exclude-pattern>
</rule> </rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"> <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
@@ -86,7 +87,7 @@
<rule ref="Generic.PHP.ForbiddenFunctions"/> <rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.Strings.UnnecessaryHeredoc"/> <rule ref="Generic.Strings.UnnecessaryHeredoc"/>
<rule ref="Generic.VersionControl.GitMergeConflict"/> <rule ref="Generic.VersionControl.GitMergeConflict"/>
<rule ref="Generic.Whitespace.DisallowSpaceIndent"/> <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing"/> <rule ref="Generic.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/> <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>

View File

@@ -61,12 +61,13 @@ parameters:
max: 80499 max: 80499
typeAliases: typeAliases:
TableStatus: "array{Name:string, Engine?:?string, Comment?:string, Oid?:numeric-string, Rows?:?numeric-string, Collation?:string, Auto_increment?:?numeric-string, Data_length?:numeric-string, Index_length?:numeric-string, Data_free?:numeric-string, Create_options?:string, nspname?:string}" TableStatus: "array{Name:string, Engine?:?string, Comment?:string, Oid?:numeric-string, Rows?:?numeric-string, Collation?:string, Auto_increment?:?numeric-string, Data_length?:numeric-string, Index_length?:numeric-string, Data_free?:numeric-string, Create_options?:string, inherited?:numeric-string, nspname?:string}"
Field: "array{field?:string, full_type:string, type:string, length:numeric-string, unsigned:string, default?:string, null:bool, auto_increment:bool, collation:string, privileges:int[], comment:string, primary:bool, generated:string, orig?:string, on_update?:string, on_delete?:string, default_constraint?: string}" Field: "array{field?:string, full_type:string, type:string, length:numeric-string, unsigned:string, default?:string, null:bool, auto_increment:bool, collation:string, privileges:int[], comment:string, primary:bool, generated:string, orig?:string, on_update?:string, on_delete?:string, default_constraint?: string}"
FieldType: "array{type:string, length:numeric-string, unsigned:string, collation:string}" # subset of RoutineField and Field FieldType: "array{type:string, length:numeric-string, unsigned:string, collation:string}" # subset of RoutineField and Field
RoutineField: "array{field:string, type:string, length:numeric-string, unsigned:string, null:bool, full_type:string, collation:string, inout?:string}" RoutineField: "array{field:string, type:string, length:numeric-string, unsigned:string, null:bool, full_type:string, collation:string, inout?:string}"
Index: "array{type:string, columns:list<string>, lengths:list<numeric-string>, descs:list<?bool>}" Index: "array{type:string, columns:list<string>, lengths:list<numeric-string>, descs:list<?bool>, algorithm?:string, partial?:string}"
ForeignKey: "array{db?:string, ns?:string, table:string, source:list<string>, target:list<?string>, on_delete:string, on_update?:string, definition?:string, deferrable?:string}" ForeignKey: "array{db?:string, ns?:string, table:string, source:list<string>, target:list<?string>, on_delete:string, on_update?:string, definition?:string, deferrable?:string}"
Trigger: "array{Trigger?:string, Timing?:string, Event?:string, Of?:string, Type?:string, Statement?:string}" Trigger: "array{Trigger?:string, Timing?:string, Event?:string, Of?:string, Type?:string, Statement?:string}"
Routine: "array{name?:string, fields:list<RoutineField>, comment:string, returns?:FieldType, definition:string, language?:string}" Routine: "array{name?:string, fields:list<RoutineField>, comment:string, returns?:FieldType, definition:string, language?:string}"
Partitions: "array{partition_by?:string, partition?:string, partitions?:numeric-string, partition_names?:list<string>, partition_values?:list<string>}"
BackwardKey: "array{name:string, keys:string[][]}" BackwardKey: "array{name:string, keys:string[][]}"

View File

@@ -28,6 +28,8 @@ const saved = document.cookie.match(/adminer_dark=(\d)/);
if (saved) { if (saved) {
adminerDark = +saved[1]; adminerDark = +saved[1];
adminerDarkSet(); adminerDarkSet();
} else {
adminerDark = +matchMedia('(prefers-color-scheme: dark)').matches;
} }
</script> </script>
<?php <?php
@@ -35,7 +37,7 @@ if (saved) {
function navigation($missing) { function navigation($missing) {
echo "<big style='position: fixed; bottom: .5em; right: .5em; cursor: pointer;'>☀</big>" echo "<big style='position: fixed; bottom: .5em; right: .5em; cursor: pointer;'>☀</big>"
. Adminer\script("if (adminerDark != null) adminerDarkSet(); qsl('big').onclick = adminerDarkSwitch;") . "\n" . Adminer\script("adminerDarkSet(); qsl('big').onclick = adminerDarkSwitch;") . "\n"
; ;
} }

View File

@@ -27,7 +27,7 @@ class AdminerDesigns extends Adminer\Plugin {
function css() { function css() {
$return = array(); $return = array();
if (array_key_exists($_SESSION["design"], $this->designs)) { if (array_key_exists($_SESSION["design"], $this->designs)) {
$return[] = $_SESSION["design"]; $return[$_SESSION["design"]] = (preg_match('~-dark~', $_SESSION["design"]) ? "dark" : "light");
} }
return $return; return $return;
} }

View File

@@ -1,6 +1,6 @@
<?php <?php
/** Link system tables (in "mysql" and "information_schema" databases) by foreign keys /** Link system tables (in "mysql", "information_schema" and "pg_catalog" schemas) by foreign keys
* @link https://www.adminer.org/plugins/#use * @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/ * @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
@@ -29,7 +29,8 @@ class AdminerForeignSystem extends Adminer\Plugin {
"time_zone_transition_type" => array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id"))), "time_zone_transition_type" => array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id"))),
); );
return $return[$table]; return $return[$table];
} elseif (Adminer\DB == "information_schema") {
} elseif (Adminer\DB == "information_schema" || $_GET["ns"] == "information_schema") {
$schemata = $this->schemata("TABLE"); $schemata = $this->schemata("TABLE");
$tables = $this->tables("TABLE"); $tables = $this->tables("TABLE");
$columns = array("table" => "COLUMNS", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME")); $columns = array("table" => "COLUMNS", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"));
@@ -85,10 +86,88 @@ class AdminerForeignSystem extends Adminer\Plugin {
"VIEWS" => array($schemata, $this->character_sets("CHARACTER_SET_CLIENT"), $this->collations("COLLATION_CONNECTION")), "VIEWS" => array($schemata, $this->character_sets("CHARACTER_SET_CLIENT"), $this->collations("COLLATION_CONNECTION")),
"VIEW_TABLE_USAGE" => array($schemata, $this->schemata("VIEW"), $tables, array("table" => "VIEWS", "source" => array("VIEW_CATALOG", "VIEW_SCHEMA", "VIEW_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"))), "VIEW_TABLE_USAGE" => array($schemata, $this->schemata("VIEW"), $tables, array("table" => "VIEWS", "source" => array("VIEW_CATALOG", "VIEW_SCHEMA", "VIEW_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"))),
); );
return $return[$table]; if ($_GET["ns"] == "information_schema") {
$return = $this->lowerCase($return);
}
return $return[strtoupper($table)];
} elseif (Adminer\DRIVER == "pgsql" && $_GET["ns"] == "pg_catalog") {
$mapping = array(
'pg_aggregate' => array('aggfnoid.proc', 'aggtransfn.proc', 'aggfinalfn.proc', 'aggcombinefn.proc', 'aggserialfn.proc', 'aggdeserialfn.proc', 'aggmtransfn.proc', 'aggminvtransfn.proc', 'aggmfinalfn.proc', 'aggsortop.operator', 'aggtranstype.type', 'aggmtranstype.type'),
'pg_am' => array('amhandler.proc'),
'pg_amop' => array('amopfamily.opfamily', 'amoplefttype.type', 'amoprighttype.type', 'amopopr.operator', 'amopmethod.am', 'amopsortfamily.opfamily'),
'pg_amproc' => array('amprocfamily.opfamily', 'amproclefttype.type', 'amprocrighttype.type', 'amproc.proc'),
'pg_attrdef' => array('adrelid.class', 'adnum.attribute.attnum'),
'pg_attribute' => array('attrelid.class', 'atttypid.type', 'attcollation.collation'),
'pg_auth_members' => array('roleid.authid', 'member.authid', 'grantor.authid'),
'pg_cast' => array('castsource.type', 'casttarget.type', 'castfunc.proc'),
'pg_class' => array('relnamespace.namespace', 'reltype.type', 'reloftype.type', 'relowner.authid', 'relam.am', 'reltablespace.tablespace', 'reltoastrelid.class', 'relrewrite.class'),
'pg_collation' => array('collnamespace.namespace', 'collowner.authid'),
'pg_constraint' => array('connamespace.namespace', 'conrelid.class', 'contypid.type', 'conindid.class', 'conparentid.constraint', 'confrelid.class', 'conkey.attribute.attnum', 'confkey.attribute.attnum', 'conpfeqop.operator', 'conppeqop.operator', 'conffeqop.operator', 'confdelsetcols.attribute.attnum', 'conexclop.operator'),
'pg_conversion' => array('connamespace.namespace', 'conowner.authid', 'conproc.proc'),
'pg_database' => array('datdba.authid', 'dattablespace.tablespace'),
'pg_db_role_setting' => array('setdatabase.database', 'setrole.authid'),
'pg_default_acl' => array('defaclrole.authid', 'defaclnamespace.namespace'),
'pg_depend' => array('classid.class', 'refclassid.class'),
'pg_description' => array('classoid.class'),
'pg_enum' => array('enumtypid.type'),
'pg_event_trigger' => array('evtowner.authid', 'evtfoid.proc'),
'pg_extension' => array('extowner.authid', 'extnamespace.namespace', 'extconfig.class'),
'pg_foreign_data_wrapper' => array('fdwowner.authid', 'fdwhandler.proc', 'fdwvalidator.proc'),
'pg_foreign_server' => array('srvowner.authid', 'srvfdw.foreign_data_wrapper'),
'pg_foreign_table' => array('ftrelid.class', 'ftserver.foreign_server'),
'pg_index' => array('indexrelid.class', 'indrelid.class', 'indkey.attribute.attnum', 'indcollation.collation', 'indclass.opclass'),
'pg_inherits' => array('inhrelid.class', 'inhparent.class'),
'pg_init_privs' => array('classoid.class'),
'pg_language' => array('lanowner.authid', 'lanplcallfoid.proc', 'laninline.proc', 'lanvalidator.proc'),
'pg_largeobject' => array('loid.largeobject_metadata'),
'pg_largeobject_metadata' => array('lomowner.authid'),
'pg_namespace' => array('nspowner.authid'),
'pg_opclass' => array('opcmethod.am', 'opcnamespace.namespace', 'opcowner.authid', 'opcfamily.opfamily', 'opcintype.type', 'opckeytype.type'),
'pg_operator' => array('oprnamespace.namespace', 'oprowner.authid', 'oprleft.type', 'oprright.type', 'oprresult.type', 'oprcom.operator', 'oprnegate.operator', 'oprcode.proc', 'oprrest.proc', 'oprjoin.proc'),
'pg_opfamily' => array('opfmethod.am', 'opfnamespace.namespace', 'opfowner.authid'),
'pg_partitioned_table' => array('partrelid.class', 'partdefid.class', 'partattrs.attribute.attnum', 'partclass.opclass', 'partcollation.collation'),
'pg_policy' => array('polrelid.class', 'polroles.authid'),
'pg_proc' => array('pronamespace.namespace', 'proowner.authid', 'prolang.language', 'provariadic.type', 'prosupport.proc', 'prorettype.type', 'proargtypes.type', 'proallargtypes.type', 'protrftypes.type'),
'pg_publication' => array('pubowner.authid'),
'pg_publication_namespace' => array('pnpubid.publication', 'pnnspid.namespace'),
'pg_publication_rel' => array('prpubid.publication', 'prrelid.class', 'prattrs.attribute.attnum'),
'pg_range' => array('rngtypid.type', 'rngsubtype.type', 'rngmultitypid.type', 'rngcollation.collation', 'rngsubopc.opclass', 'rngcanonical.proc', 'rngsubdiff.proc'),
'pg_rewrite' => array('ev_class.class'),
'pg_seclabel' => array('classoid.class'),
'pg_sequence' => array('seqrelid.class', 'seqtypid.type'),
'pg_shdepend' => array('dbid.database', 'classid.class', 'refclassid.class'),
'pg_shdescription' => array('classoid.class'),
'pg_shseclabel' => array('classoid.class'),
'pg_statistic' => array('starelid.class', 'staattnum.attribute.attnum', 'staop.operator', 'stacoll.collation'),
'pg_statistic_ext' => array('stxrelid.class', 'stxnamespace.namespace', 'stxowner.authid', 'stxkeys.attribute.attnum'),
'pg_statistic_ext_data' => array('stxoid.statistic_ext'),
'pg_subscription' => array('subdbid.database', 'subowner.authid'),
'pg_subscription_rel' => array('srsubid.subscription', 'srrelid.class'),
'pg_tablespace' => array('spcowner.authid'),
'pg_transform' => array('trftype.type', 'trflang.language', 'trffromsql.proc', 'trftosql.proc'),
'pg_trigger' => array('tgrelid.class', 'tgparentid.trigger', 'tgfoid.proc', 'tgconstrrelid.class', 'tgconstrindid.class', 'tgconstraint.constraint', 'tgattr.attribute.attnum'),
'pg_ts_config' => array('cfgnamespace.namespace', 'cfgowner.authid', 'cfgparser.ts_parser'),
'pg_ts_config_map' => array('mapcfg.ts_config', 'mapdict.ts_dict'),
'pg_ts_dict' => array('dictnamespace.namespace', 'dictowner.authid', 'dicttemplate.ts_template'),
'pg_ts_parser' => array('prsnamespace.namespace', 'prsstart.proc', 'prstoken.proc', 'prsend.proc', 'prsheadline.proc', 'prslextype.proc'),
'pg_ts_template' => array('tmplnamespace.namespace', 'tmplinit.proc', 'tmpllexize.proc'),
'pg_type' => array('typnamespace.namespace', 'typowner.authid', 'typrelid.class', 'typsubscript.proc', 'typelem.type', 'typarray.type', 'typinput.proc', 'typoutput.proc', 'typreceive.proc', 'typsend.proc', 'typmodin.proc', 'typmodout.proc', 'typanalyze.proc', 'typbasetype.type', 'typcollation.collation'),
'pg_user_mapping' => array('umuser.authid', 'umserver.foreign_server'),
);
$return = array();
foreach ((array) $mapping[$table] as $val) {
list($source, $target, $column) = explode(".", "$val.oid");
$return[] = array("table" => "pg_$target", "source" => array($source), "target" => array($column));
}
return $return;
} }
} }
private function lowerCase($value) {
return (is_array($value) ? array_map(array($this, 'lowerCase'), $value) : strtolower($value));
}
private function schemata($catalog, $schema = null) { private function schemata($catalog, $schema = null) {
return array("table" => "SCHEMATA", "source" => array($catalog . "_CATALOG", ($schema ?: $catalog) . "_SCHEMA"), "target" => array("CATALOG_NAME", "SCHEMA_NAME")); return array("table" => "SCHEMATA", "source" => array($catalog . "_CATALOG", ($schema ?: $catalog) . "_SCHEMA"), "target" => array("CATALOG_NAME", "SCHEMA_NAME"));
} }

View File

@@ -36,7 +36,7 @@ class AdminerMenuLinks extends Adminer\Plugin {
foreach ($tables as $table => $status) { foreach ($tables as $table => $status) {
$table = "$table"; // do not highlight "0" as active everywhere $table = "$table"; // do not highlight "0" as active everywhere
$name = Adminer\adminer()->tableName($status); $name = Adminer\adminer()->tableName($status);
if ($name != "") { if ($name != "" && !$status["inherited"]) {
echo '<li>'; echo '<li>';
if (!$menu) { if (!$menu) {
echo '<a href="' . Adminer\h(Adminer\ME) . 'select=' . urlencode($table) . '"' echo '<a href="' . Adminer\h(Adminer\ME) . 'select=' . urlencode($table) . '"'

View File

@@ -18,7 +18,7 @@ class AdminerSelectEmail extends Adminer\Plugin {
echo $this->lang('Subject') . ": <input name='email_subject' value='" . Adminer\h($_POST["email_subject"]) . "'>\n"; echo $this->lang('Subject') . ": <input name='email_subject' value='" . Adminer\h($_POST["email_subject"]) . "'>\n";
echo "<p><textarea name='email_message' rows='15' cols='75'>" . Adminer\h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea>\n"; echo "<p><textarea name='email_message' rows='15' cols='75'>" . Adminer\h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea>\n";
echo "<p>" . Adminer\script("qsl('p').onkeydown = partialArg(bodyKeydown, 'email_append');", "") . Adminer\html_select("email_addition", $columns, $_POST["email_addition"]) echo "<p>" . Adminer\script("qsl('p').onkeydown = partialArg(bodyKeydown, 'email_append');", "") . Adminer\html_select("email_addition", $columns, $_POST["email_addition"])
. " <input type='submit' name='email_append' value='" . $this->lang('Insert') . "'>\n"; //! JavaScript . " <input type='submit' name='email_append' value='" . Adminer\lang('Insert') . "'>\n"; //! JavaScript
echo "<p>" . $this->lang('Attachments') . ": <input type='file' name='email_files[]'>" . Adminer\script("qsl('input').onchange = emailFileChange;"); echo "<p>" . $this->lang('Attachments') . ": <input type='file' name='email_files[]'>" . Adminer\script("qsl('input').onchange = emailFileChange;");
echo "<p>" . (count($emailFields) == 1 ? Adminer\input_hidden("email_field", key($emailFields)) : Adminer\html_select("email_field", $emailFields)); echo "<p>" . (count($emailFields) == 1 ? Adminer\input_hidden("email_field", key($emailFields)) : Adminer\html_select("email_field", $emailFields));
echo "<input type='submit' name='email' value='" . $this->lang('Send') . "'>" . Adminer\confirm(); echo "<input type='submit' name='email' value='" . $this->lang('Send') . "'>" . Adminer\confirm();
@@ -101,50 +101,361 @@ class AdminerSelectEmail extends Adminer\Plugin {
} }
protected $translations = array( protected $translations = array(
'ar' => array('E-mail' => 'البريد الإلكتروني', 'From' => 'من', 'Subject' => 'الموضوع', 'Send' => 'إرسال', '%d e-mail(s) have been sent.' => 'تم إرسال %d رسالة.', 'Attachments' => 'ملفات مرفقة'), 'ar' => array(
'bg' => array('E-mail' => 'E-mail', 'From' => 'От', 'Subject' => 'Тема', 'Attachments' => 'Прикачени', 'Send' => 'Изпращане', '%d e-mail(s) have been sent.' => array('%d писмо беше изпратено.', '%d писма бяха изпратени.')), 'E-mail' => 'البريد الإلكتروني',
'bn' => array('E-mail' => '​​ই-মেইল', 'From' => 'থেকে', 'Subject' => 'বিষয়', 'Send' => 'পাঠান', '%d e-mail(s) have been sent.' => array('%d ইমেইল(গুলি) পাঠানো হয়েছে।', '%d ইমেইল(গুলি) পাঠানো হয়েছে।'), 'Attachments' => 'সংযুক্তিগুলো'), 'From' => 'من',
'bs' => array('E-mail' => 'El. pošta', 'From' => 'Od', 'Subject' => 'Naslov', 'Attachments' => 'Prilozi', 'Send' => 'Pošalji', '%d e-mail(s) have been sent.' => array('%d poruka el. pošte je poslata.', '%d poruke el. pošte su poslate.', '%d poruka el. pošte je poslato.')), 'Subject' => 'الموضوع',
'ca' => array('E-mail' => 'Correu electrònic', 'From' => 'De', 'Subject' => 'Assumpte', 'Send' => 'Envia', '%d e-mail(s) have been sent.' => array('S\'ha enviat %d correu electrònic.', 'S\'han enviat %d correus electrònics.'), 'Attachments' => 'Adjuncions'), 'Send' => 'إرسال',
'cs' => array('' => 'Umožňuje posílat e-maily na adresy v tabulce', 'E-mail' => 'E-mail', 'From' => 'Odesílatel', 'Subject' => 'Předmět', 'Attachments' => 'Přílohy', 'Send' => 'Odeslat', '%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.')), '%d e-mail(s) have been sent.' => 'تم إرسال %d رسالة.',
'da' => array('E-mail' => 'E-mail', 'From' => 'Fra', 'Subject' => 'Titel', 'Attachments' => 'Vedhæft', 'Send' => 'Send', '%d e-mail(s) have been sent.' => array('%d email sendt.', '%d emails sendt.')), 'Attachments' => 'ملفات مرفقة',
'de' => array('E-mail' => 'E-Mail', 'From' => 'Von', 'Subject' => 'Betreff', 'Send' => 'Abschicken', '%d e-mail(s) have been sent.' => array('%d E-Mail abgeschickt.', '%d E-Mails abgeschickt.'), 'Attachments' => 'Anhänge'), ),
'el' => array('E-mail' => 'E-mail', 'From' => 'Από', 'Subject' => 'Θέμα', 'Attachments' => 'Συνημμένα', 'Send' => 'Αποστολή', '%d e-mail(s) have been sent.' => array('%d e-mail απεστάλη.', '%d e-mail απεστάλησαν.')), 'bg' => array(
'en' => array('%d e-mail(s) have been sent.' => array('%d e-mail has been sent.', '%d e-mails have been sent.')), 'E-mail' => 'E-mail',
'es' => array('E-mail' => 'Email', 'From' => 'De', 'Subject' => 'Asunto', 'Send' => 'Enviar', '%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'), 'Attachments' => 'Adjuntos'), 'From' => 'От',
'et' => array('E-mail' => 'E-post', 'From' => 'Kellelt', 'Subject' => 'Pealkiri', 'Send' => 'Saada', '%d e-mail(s) have been sent.' => 'Saadetud kirju: %d.', 'Attachments' => 'Manused'), 'Subject' => 'Тема',
'fa' => array('E-mail' => 'پست الکترونیک', 'From' => 'فرستنده', 'Subject' => 'موضوع', 'Attachments' => 'پیوست ها', 'Send' => 'ارسال', '%d e-mail(s) have been sent.' => array('%d ایمیل ارسال شد.', '%d ایمیل ارسال شد.')), 'Attachments' => 'Прикачени',
'fi' => array('E-mail' => 'S-posti', 'From' => 'Lähettäjä', 'Subject' => 'Aihe', 'Attachments' => 'Liitteet', 'Send' => 'Lähetä', '%d e-mail(s) have been sent.' => array('% sähköpostiviestiä lähetetty.', '% sähköpostiviestiä lähetetty.')), 'Send' => 'Изпращане',
'fr' => array('E-mail' => 'Courriel', 'From' => 'De', 'Subject' => 'Sujet', 'Send' => 'Envoyer', '%d e-mail(s) have been sent.' => array('%d message a été envoyé.', '%d messages ont été envoyés.'), 'Attachments' => 'Pièces jointes'), '%d e-mail(s) have been sent.' => array('%d писмо беше изпратено.', '%d писма бяха изпратени.'),
'gl' => array('E-mail' => 'Email', 'From' => 'De', 'Subject' => 'Asunto', 'Send' => 'Enviar', '%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'), 'Attachments' => 'Adxuntos'), ),
'he' => array('E-mail' => 'דוא"ל', 'From' => 'מ:', 'Subject' => 'נושא', 'Send' => 'שלח', '%d e-mail(s) have been sent.' => '%d הודעות דוא"ל נשלחו', 'Attachments' => 'קבצים מצורפים'), 'bn' => array(
'hu' => array('E-mail' => 'E-mail', 'From' => 'Feladó', 'Subject' => 'Tárgy', 'Send' => 'Küldés', '%d e-mail(s) have been sent.' => array('%d e-mail elküldve.', '%d e-mail elküldve.', '%d e-mail elküldve.'), 'Attachments' => 'Csatolmány'), 'E-mail' => '​​ই-মেইল',
'id' => array('E-mail' => 'Surel', 'From' => 'Dari', 'Subject' => 'Judul', 'Attachments' => 'Lampiran', 'Send' => 'Kirim', '%d e-mail(s) have been sent.' => '%d surel berhasil dikirim.'), 'From' => 'থেকে',
'it' => array('E-mail' => 'E-mail', 'From' => 'Da', 'Subject' => 'Oggetto', 'Send' => 'Invia', '%d e-mail(s) have been sent.' => array('%d e-mail inviata.', '%d e-mail inviate.'), 'Attachments' => 'Allegati'), 'Subject' => 'বিষয়',
'ja' => array('' => 'テーブルに含まれるアドレスにメールを送信', 'E-mail' => 'メール', 'From' => '差出人', 'Subject' => '題名', 'Send' => '送信', '%d e-mail(s) have been sent.' => '%d メールを送信しました。', 'Attachments' => '添付ファイル'), 'Send' => 'পাঠান',
'ka' => array('E-mail' => 'ელ. ფოსტა', 'From' => 'ავტორი:', 'Subject' => 'თემა', 'Send' => 'გაგზავნა', '%d e-mail(s) have been sent.' => 'გაიგზავნა %d წერილი.', 'Attachments' => 'მიმაგრებული ფაილები'), '%d e-mail(s) have been sent.' => array('%d ইমেইল(গুলি) পাঠানো হয়েছে।', '%d ইমেইল(গুলি) পাঠানো হয়েছে।'),
'ko' => array('%d e-mail(s) have been sent.' => '%d개 메일을 보냈습니다.', 'Attachments' => '첨부 파일', 'E-mail' => '메일', 'From' => '보낸 사람', 'Send' => '보내기', 'Subject' => '제목'), 'Attachments' => 'সংযুক্তিগুলো',
'lt' => array('E-mail' => 'El. paštas', 'From' => 'Nuo', 'Subject' => 'Antraštė', 'Attachments' => 'Priedai', 'Send' => 'Siųsti', '%d e-mail(s) have been sent.' => array('Išsiųstas %d laiškas.', 'Išsiųsti %d laiškai.', 'Išsiųsta %d laiškų.')), ),
'lv' => array('E-mail' => 'Epasts', 'From' => 'No', 'Subject' => 'Tēma', 'Send' => 'Sūtīt', '%d e-mail(s) have been sent.' => array('Nosūtīts %d epasts.', 'Nosūtīti %d epasti.', 'Nosūtīti %d epasti.'), 'Attachments' => 'Pielikumi'), 'bs' => array(
'ms' => array('E-mail' => 'Emel', 'From' => 'Dari', 'Subject' => 'Subjek', 'Attachments' => 'Lampiran', 'Send' => 'Hantar', '%d e-mail(s) have been sent.' => '%d emel telah dihantar.'), 'E-mail' => 'El. pošta',
'nl' => array('E-mail' => 'E-mail', 'From' => 'Van', 'Subject' => 'Onderwerp', 'Send' => 'Verzenden', '%d e-mail(s) have been sent.' => array('%d e-mail verzonden.', '%d e-mails verzonden.'), 'Attachments' => 'Bijlagen'), 'From' => 'Od',
'no' => array('E-mail' => 'E-post', 'From' => 'Fra', 'Subject' => 'Tittel', 'Attachments' => 'Vedlegg', 'Send' => 'Send', '%d e-mail(s) have been sent.' => array('%d epost sendt.', '%d eposter sendt.')), 'Subject' => 'Naslov',
'pl' => array('E-mail' => 'E-mail', 'From' => 'Nadawca', 'Subject' => 'Temat', 'Attachments' => 'Załączniki', 'Send' => 'Wyślij', '%d e-mail(s) have been sent.' => array('Wysłano %d e-mail.', 'Wysłano %d e-maile.', 'Wysłano %d e-maili.')), 'Attachments' => 'Prilozi',
'pt-br' => array('E-mail' => 'E-mail', 'From' => 'De', 'Subject' => 'Assunto', 'Send' => 'Enviar', '%d e-mail(s) have been sent.' => array('%d email foi enviado.', '%d emails foram enviados.'), 'Attachments' => 'Anexos'), 'Send' => 'Pošalji',
'pt' => array('E-mail' => 'E-mail', 'From' => 'De', 'Subject' => 'Assunto', 'Send' => 'Enviar', '%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'), 'Attachments' => 'Anexos'), '%d e-mail(s) have been sent.' => array('%d poruka el. pošte je poslata.', '%d poruke el. pošte su poslate.', '%d poruka el. pošte je poslato.'),
'ro' => array('E-mail' => 'Poșta electronică', 'From' => 'De la', 'Subject' => 'Pentru', 'Send' => 'Trimite', '%d e-mail(s) have been sent.' => array('A fost trimis %d mail.', 'Au fost trimise %d mail-uri.'), 'Attachments' => 'Fișiere atașate'), ),
'ru' => array('E-mail' => 'Эл. почта', 'From' => 'От', 'Subject' => 'Тема', 'Send' => 'Послать', '%d e-mail(s) have been sent.' => array('Было отправлено %d письмо.', 'Было отправлено %d письма.', 'Было отправлено %d писем.'), 'Attachments' => 'Прикреплённые файлы'), 'ca' => array(
'sk' => array('E-mail' => 'E-mail', 'From' => 'Odosielateľ', 'Subject' => 'Predmet', 'Send' => 'Odoslať', '%d e-mail(s) have been sent.' => array('Bol odoslaný %d e-mail.', 'Boli odoslané %d e-maily.', 'Bolo odoslaných %d e-mailov.'), 'Attachments' => 'Prílohy'), 'E-mail' => 'Correu electrònic',
'sl' => array('E-mail' => 'E-mail', 'From' => 'Od', 'Subject' => 'Zadeva', 'Attachments' => 'Priponke', 'Send' => 'Pošlji', '%d e-mail(s) have been sent.' => array('Poslan je %d e-mail.', 'Poslana sta %d e-maila.', 'Poslani so %d e-maili.', 'Poslanih je %d e-mailov.')), 'From' => 'De',
'sr' => array('E-mail' => 'Ел. пошта', 'From' => 'Од', 'Subject' => 'Наслов', 'Attachments' => 'Прилози', 'Send' => 'Пошаљи', '%d e-mail(s) have been sent.' => array('%d порука ел. поште је послата.', '%d поруке ел. поште су послате.', '%d порука ел. поште је послато.')), 'Subject' => 'Assumpte',
'sv' => array('E-mail' => 'Email', 'From' => 'Från', 'Subject' => 'Ämne', 'Attachments' => 'Bilagor', 'Send' => 'Skicka', '%d e-mail(s) have been sent.' => array('%d email har blivit skickat.', '%d email har blivit skickade.')), 'Send' => 'Envia',
'ta' => array('E-mail' => 'மின்ன‌ஞ்ச‌ல்', 'From' => 'அனுப்புனர்', 'Subject' => 'பொருள்', 'Send' => 'அனுப்பு', '%d e-mail(s) have been sent.' => array('%d மின்ன‌ஞ்ச‌ல் அனுப்ப‌ப‌ட்ட‌து.', '%d மின்ன‌ஞ்ச‌ல்க‌ள் அனுப்ப‌ப்ப‌ட்ட‌ன‌.'), 'Attachments' => 'இணைப்புக‌ள்'), '%d e-mail(s) have been sent.' => array('S\'ha enviat %d correu electrònic.', 'S\'han enviat %d correus electrònics.'),
'th' => array('E-mail' => 'อีเมล์', 'From' => 'จาก', 'Subject' => 'หัวข้อ', 'Send' => 'ส่ง', '%d e-mail(s) have been sent.' => 'มี %d อีเมล์ ถูกส่งออกแล้ว.', 'Attachments' => 'ไฟล์แนบ'), 'Attachments' => 'Adjuncions',
'tr' => array('E-mail' => 'E-posta', 'From' => 'Gönderen', 'Subject' => 'Konu', 'Attachments' => 'Ekler', 'Send' => 'Gönder', '%d e-mail(s) have been sent.' => array('%d e-posta gönderildi.', '%d adet e-posta gönderildi.')), ),
'uk' => array('E-mail' => 'E-mail', 'From' => 'Від', 'Subject' => 'Заголовок', 'Attachments' => 'Додатки', 'Send' => 'Надіслати', '%d e-mail(s) have been sent.' => array('Було надіслано %d повідомлення.', 'Було надіслано %d повідомлення.', 'Було надіслано %d повідомлень.')), 'cs' => array(
'uz' => array('E-mail' => 'E-pochta', 'From' => 'Kimdan', 'Subject' => 'Mavzu', 'Attachments' => 'Ilovalar', 'Send' => 'Yuborish', '%d e-mail(s) have been sent.' => array('%d e-pochta yuborildi.', '%d e-pochtalar yuborildi.')), '' => 'Umožňuje posílat e-maily na adresy v tabulce',
'vi' => array('E-mail' => 'Địa chỉ email', 'From' => 'Người gửi', 'Subject' => 'Chủ đề', 'Attachments' => 'Đính kèm', 'Send' => 'Gửi', '%d e-mail(s) have been sent.' => '%d thư đã gửi.'), 'E-mail' => 'E-mail',
'zh-tw' => array('E-mail' => '電子郵件', 'From' => '來自', 'Subject' => '主旨', 'Attachments' => '附件', 'Send' => '寄出', '%d e-mail(s) have been sent.' => '已寄出 %d 封郵件。'), 'From' => 'Odesílatel',
'zh' => array('E-mail' => '电子邮件', 'From' => '来自', 'Subject' => '主题', 'Attachments' => '附件', 'Send' => '发送', '%d e-mail(s) have been sent.' => '%d 封邮件已发送。'), 'Subject' => 'Předmět',
'Attachments' => 'Přílohy',
'Send' => 'Odeslat',
'%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.'),
),
'da' => array(
'E-mail' => 'E-mail',
'From' => 'Fra',
'Subject' => 'Titel',
'Attachments' => 'Vedhæft',
'Send' => 'Send',
'%d e-mail(s) have been sent.' => array('%d email sendt.', '%d emails sendt.'),
),
'de' => array(
'E-mail' => 'E-Mail',
'From' => 'Von',
'Subject' => 'Betreff',
'Send' => 'Abschicken',
'%d e-mail(s) have been sent.' => array('%d E-Mail abgeschickt.', '%d E-Mails abgeschickt.'),
'Attachments' => 'Anhänge',
),
'el' => array(
'E-mail' => 'E-mail',
'From' => 'Από',
'Subject' => 'Θέμα',
'Attachments' => 'Συνημμένα',
'Send' => 'Αποστολή',
'%d e-mail(s) have been sent.' => array('%d e-mail απεστάλη.', '%d e-mail απεστάλησαν.'),
),
'en' => array(
'%d e-mail(s) have been sent.' => array('%d e-mail has been sent.', '%d e-mails have been sent.'),
),
'es' => array(
'E-mail' => 'Email',
'From' => 'De',
'Subject' => 'Asunto',
'Send' => 'Enviar',
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
'Attachments' => 'Adjuntos',
),
'et' => array(
'E-mail' => 'E-post',
'From' => 'Kellelt',
'Subject' => 'Pealkiri',
'Send' => 'Saada',
'%d e-mail(s) have been sent.' => 'Saadetud kirju: %d.',
'Attachments' => 'Manused',
),
'fa' => array(
'E-mail' => 'پست الکترونیک',
'From' => 'فرستنده',
'Subject' => 'موضوع',
'Attachments' => 'پیوست ها',
'Send' => 'ارسال',
'%d e-mail(s) have been sent.' => array('%d ایمیل ارسال شد.', '%d ایمیل ارسال شد.'),
),
'fi' => array(
'E-mail' => 'S-posti',
'From' => 'Lähettäjä',
'Subject' => 'Aihe',
'Attachments' => 'Liitteet',
'Send' => 'Lähetä',
'%d e-mail(s) have been sent.' => array('% sähköpostiviestiä lähetetty.', '% sähköpostiviestiä lähetetty.'),
),
'fr' => array(
'E-mail' => 'Courriel',
'From' => 'De',
'Subject' => 'Sujet',
'Send' => 'Envoyer',
'%d e-mail(s) have been sent.' => array('%d message a été envoyé.', '%d messages ont été envoyés.'),
'Attachments' => 'Pièces jointes',
),
'gl' => array(
'E-mail' => 'Email',
'From' => 'De',
'Subject' => 'Asunto',
'Send' => 'Enviar',
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
'Attachments' => 'Adxuntos',
),
'he' => array(
'E-mail' => 'דוא"ל',
'From' => 'מ:',
'Subject' => 'נושא',
'Send' => 'שלח',
'%d e-mail(s) have been sent.' => '%d הודעות דוא"ל נשלחו',
'Attachments' => 'קבצים מצורפים',
),
'hu' => array(
'E-mail' => 'E-mail',
'From' => 'Feladó',
'Subject' => 'Tárgy',
'Send' => 'Küldés',
'%d e-mail(s) have been sent.' => array('%d e-mail elküldve.', '%d e-mail elküldve.', '%d e-mail elküldve.'),
'Attachments' => 'Csatolmány',
),
'id' => array(
'E-mail' => 'Surel',
'From' => 'Dari',
'Subject' => 'Judul',
'Attachments' => 'Lampiran',
'Send' => 'Kirim',
'%d e-mail(s) have been sent.' => '%d surel berhasil dikirim.',
),
'it' => array(
'E-mail' => 'E-mail',
'From' => 'Da',
'Subject' => 'Oggetto',
'Send' => 'Invia',
'%d e-mail(s) have been sent.' => array('%d e-mail inviata.', '%d e-mail inviate.'),
'Attachments' => 'Allegati',
),
'ja' => array(
'' => 'テーブルに含まれるアドレスにメールを送信',
'E-mail' => 'メール',
'From' => '差出人',
'Subject' => '題名',
'Send' => '送信',
'%d e-mail(s) have been sent.' => '%d メールを送信しました。',
'Attachments' => '添付ファイル',
),
'ka' => array(
'E-mail' => 'ელ. ფოსტა',
'From' => 'ავტორი:',
'Subject' => 'თემა',
'Send' => 'გაგზავნა',
'%d e-mail(s) have been sent.' => 'გაიგზავნა %d წერილი.',
'Attachments' => 'მიმაგრებული ფაილები',
),
'ko' => array(
'%d e-mail(s) have been sent.' => '%d개 메일을 보냈습니다.',
'Attachments' => '첨부 파일',
'E-mail' => '메일',
'From' => '보낸 사람',
'Send' => '보내기',
'Subject' => '제목',
),
'lt' => array(
'E-mail' => 'El. paštas',
'From' => 'Nuo',
'Subject' => 'Antraštė',
'Attachments' => 'Priedai',
'Send' => 'Siųsti',
'%d e-mail(s) have been sent.' => array('Išsiųstas %d laiškas.', 'Išsiųsti %d laiškai.', 'Išsiųsta %d laiškų.'),
),
'lv' => array(
'E-mail' => 'Epasts',
'From' => 'No',
'Subject' => 'Tēma',
'Send' => 'Sūtīt',
'%d e-mail(s) have been sent.' => array('Nosūtīts %d epasts.', 'Nosūtīti %d epasti.', 'Nosūtīti %d epasti.'),
'Attachments' => 'Pielikumi',
),
'ms' => array(
'E-mail' => 'Emel',
'From' => 'Dari',
'Subject' => 'Subjek',
'Attachments' => 'Lampiran',
'Send' => 'Hantar',
'%d e-mail(s) have been sent.' => '%d emel telah dihantar.',
),
'nl' => array(
'E-mail' => 'E-mail',
'From' => 'Van',
'Subject' => 'Onderwerp',
'Send' => 'Verzenden',
'%d e-mail(s) have been sent.' => array('%d e-mail verzonden.', '%d e-mails verzonden.'),
'Attachments' => 'Bijlagen',
),
'no' => array(
'E-mail' => 'E-post',
'From' => 'Fra',
'Subject' => 'Tittel',
'Attachments' => 'Vedlegg',
'Send' => 'Send',
'%d e-mail(s) have been sent.' => array('%d epost sendt.', '%d eposter sendt.'),
),
'pl' => array(
'E-mail' => 'E-mail',
'From' => 'Nadawca',
'Subject' => 'Temat',
'Attachments' => 'Załączniki',
'Send' => 'Wyślij',
'%d e-mail(s) have been sent.' => array('Wysłano %d e-mail.', 'Wysłano %d e-maile.', 'Wysłano %d e-maili.'),
),
'pt-br' => array(
'E-mail' => 'E-mail',
'From' => 'De',
'Subject' => 'Assunto',
'Send' => 'Enviar',
'%d e-mail(s) have been sent.' => array('%d email foi enviado.', '%d emails foram enviados.'),
'Attachments' => 'Anexos',
),
'pt' => array(
'E-mail' => 'E-mail',
'From' => 'De',
'Subject' => 'Assunto',
'Send' => 'Enviar',
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
'Attachments' => 'Anexos',
),
'ro' => array(
'E-mail' => 'Poșta electronică',
'From' => 'De la',
'Subject' => 'Pentru',
'Send' => 'Trimite',
'%d e-mail(s) have been sent.' => array('A fost trimis %d mail.', 'Au fost trimise %d mail-uri.'),
'Attachments' => 'Fișiere atașate',
),
'ru' => array(
'E-mail' => 'Эл. почта',
'From' => 'От',
'Subject' => 'Тема',
'Send' => 'Послать',
'%d e-mail(s) have been sent.' => array('Было отправлено %d письмо.', 'Было отправлено %d письма.', 'Было отправлено %d писем.'),
'Attachments' => 'Прикреплённые файлы',
),
'sk' => array(
'E-mail' => 'E-mail',
'From' => 'Odosielateľ',
'Subject' => 'Predmet',
'Send' => 'Odoslať',
'%d e-mail(s) have been sent.' => array('Bol odoslaný %d e-mail.', 'Boli odoslané %d e-maily.', 'Bolo odoslaných %d e-mailov.'),
'Attachments' => 'Prílohy',
),
'sl' => array(
'E-mail' => 'E-mail',
'From' => 'Od',
'Subject' => 'Zadeva',
'Attachments' => 'Priponke',
'Send' => 'Pošlji',
'%d e-mail(s) have been sent.' => array('Poslan je %d e-mail.', 'Poslana sta %d e-maila.', 'Poslani so %d e-maili.', 'Poslanih je %d e-mailov.'),
),
'sr' => array(
'E-mail' => 'Ел. пошта',
'From' => 'Од',
'Subject' => 'Наслов',
'Attachments' => 'Прилози',
'Send' => 'Пошаљи',
'%d e-mail(s) have been sent.' => array('%d порука ел. поште је послата.', '%d поруке ел. поште су послате.', '%d порука ел. поште је послато.'),
),
'sv' => array(
'E-mail' => 'Email',
'From' => 'Från',
'Subject' => 'Ämne',
'Attachments' => 'Bilagor',
'Send' => 'Skicka',
'%d e-mail(s) have been sent.' => array('%d email har blivit skickat.', '%d email har blivit skickade.'),
),
'ta' => array(
'E-mail' => 'மின்ன‌ஞ்ச‌ல்',
'From' => 'அனுப்புனர்',
'Subject' => 'பொருள்',
'Send' => 'அனுப்பு',
'%d e-mail(s) have been sent.' => array('%d மின்ன‌ஞ்ச‌ல் அனுப்ப‌ப‌ட்ட‌து.', '%d மின்ன‌ஞ்ச‌ல்க‌ள் அனுப்ப‌ப்ப‌ட்ட‌ன‌.'),
'Attachments' => 'இணைப்புக‌ள்',
),
'th' => array(
'E-mail' => 'อีเมล์',
'From' => 'จาก',
'Subject' => 'หัวข้อ',
'Send' => 'ส่ง',
'%d e-mail(s) have been sent.' => 'มี %d อีเมล์ ถูกส่งออกแล้ว.',
'Attachments' => 'ไฟล์แนบ',
),
'tr' => array(
'E-mail' => 'E-posta',
'From' => 'Gönderen',
'Subject' => 'Konu',
'Attachments' => 'Ekler',
'Send' => 'Gönder',
'%d e-mail(s) have been sent.' => array('%d e-posta gönderildi.', '%d adet e-posta gönderildi.'),
),
'uk' => array(
'E-mail' => 'E-mail',
'From' => 'Від',
'Subject' => 'Заголовок',
'Attachments' => 'Додатки',
'Send' => 'Надіслати',
'%d e-mail(s) have been sent.' => array('Було надіслано %d повідомлення.', 'Було надіслано %d повідомлення.', 'Було надіслано %d повідомлень.'),
),
'uz' => array(
'E-mail' => 'E-pochta',
'From' => 'Kimdan',
'Subject' => 'Mavzu',
'Attachments' => 'Ilovalar',
'Send' => 'Yuborish',
'%d e-mail(s) have been sent.' => array('%d e-pochta yuborildi.', '%d e-pochtalar yuborildi.'),
),
'vi' => array(
'E-mail' => 'Địa chỉ email',
'From' => 'Người gửi',
'Subject' => 'Chủ đề',
'Attachments' => 'Đính kèm',
'Send' => 'Gửi',
'%d e-mail(s) have been sent.' => '%d thư đã gửi.',
),
'zh-tw' => array(
'E-mail' => '電子郵件',
'From' => '來自',
'Subject' => '主旨',
'Attachments' => '附件',
'Send' => '寄出',
'%d e-mail(s) have been sent.' => '已寄出 %d 封郵件。',
),
'zh' => array(
'E-mail' => '电子邮件',
'From' => '来自',
'Subject' => '主题',
'Attachments' => '附件',
'Send' => '发送',
'%d e-mail(s) have been sent.' => '%d 封邮件已发送。'),
); );
} }

View File

@@ -26,7 +26,7 @@ class AdminerSqlLog extends Adminer\Plugin {
private function log($query) { private function log($query) {
if ($this->filename == "") { if ($this->filename == "") {
$this->filename = Adminer\adminer()->database() . ".sql"; // no database goes to ".sql" to avoid collisions $this->filename = Adminer\adminer()->database() . ($_GET["ns"] != "" ? ".$_GET[ns]" : "") . ".sql"; // no database goes to ".sql" to avoid collisions
} }
$fp = fopen($this->filename, "a"); $fp = fopen($this->filename, "a");
flock($fp, LOCK_EX); flock($fp, LOCK_EX);

View File

@@ -8,14 +8,11 @@
*/ */
class AdminerTableIndexesStructure extends Adminer\Plugin { class AdminerTableIndexesStructure extends Adminer\Plugin {
/** Print table structure in tabular format function tableIndexesPrint($indexes, $tableStatus): bool {
* @param Index[] $indexes data about all indexes on a table
*/
function tableIndexesPrint($indexes): bool {
echo "<table>\n"; echo "<table>\n";
echo "<thead><tr><th>" . Adminer\lang('Name') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Columns') . "</thead>\n"; echo "<thead><tr><th>" . Adminer\lang('Name') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Algorithm') . "<th>" . Adminer\lang('Columns') . "</thead>\n";
foreach ($indexes as $name => $index) { foreach ($indexes as $name => $index) {
echo "<tr><th>" . Adminer\h($name) . "<td>" . $index['type']; echo "<tr><th>" . Adminer\h($name) . "<td>$index[type]<td>$index[algorithm]";
ksort($index["columns"]); // enforce correct columns order ksort($index["columns"]); // enforce correct columns order
$print = array(); $print = array();
foreach ($index["columns"] as $key => $val) { foreach ($index["columns"] as $key => $val) {

View File

@@ -375,6 +375,41 @@
<tr><td>verifyTextPresent</td><td>No tables.</td><td></td></tr> <tr><td>verifyTextPresent</td><td>No tables.</td><td></td></tr>
</tbody></table> </tbody></table>
<table cellpadding="1" cellspacing="1" border="1">
<thead><tr><td rowspan="1" colspan="3" data-tags="">Partitioning</td></tr></thead>
<tbody>
<tr><td>open</td><td>/adminer/?pgsql=localhost:26257&amp;username=ODBC&amp;db=adminer_test&amp;ns=public&amp;create=</td><td></td></tr>
<tr><td>type</td><td>name=name</td><td>range</td></tr>
<tr><td>click</td><td>//input[@name='auto_increment_col' and @value='1']</td><td></td></tr>
<tr><td>click</td><td>link=Partition by</td><td></td></tr>
<tr><td>select</td><td>name=partition_by</td><td>label=RANGE</td></tr>
<tr><td>type</td><td>name=partition</td><td>id</td></tr>
<tr><td>type</td><td>name=partition_names[]</td><td>old</td></tr>
<tr><td>type</td><td>name=partition_values[]</td><td>10</td></tr>
<tr><td>type</td><td>xpath=//table[@id='partition-table']/tr/td/input</td><td>new</td></tr>
<tr><td>type</td><td>xpath=//table[@id='partition-table']/tr/td[2]/input</td><td>MAXVALUE</td></tr>
<tr><td>click</td><td>//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION BY RANGE(id)</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION "old" VALUES FROM (MINVALUE) TO (10)</td><td></td></tr>
<tr><td>click</td><td>link=Create table</td><td></td></tr>
<tr><td>type</td><td>name=name</td><td>list</td></tr>
<tr><td>click</td><td>//input[@name='auto_increment_col' and @value='1']</td><td></td></tr>
<tr><td>click</td><td>link=Partition by</td><td></td></tr>
<tr><td>select</td><td>name=partition_by</td><td>label=LIST</td></tr>
<tr><td>type</td><td>name=partition</td><td>id</td></tr>
<tr><td>type</td><td>name=partition_names[]</td><td>odd</td></tr>
<tr><td>type</td><td>name=partition_values[]</td><td>1,3,5</td></tr>
<tr><td>click</td><td>xpath=//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION BY LIST(id)</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION "odd" VALUES IN (1,3,5)</td><td></td></tr>
<tr><td>click</td><td>link=public</td><td></td></tr>
<tr><td>click</td><td>//input[@name='tables[]' and @value='list']</td><td></td></tr>
<tr><td>click</td><td>//input[@name='tables[]' and @value='range']</td><td></td></tr>
<tr><td>chooseOkOnNextConfirmation</td><td>Are you sure?</td><td></td></tr>
<tr><td>click</td><td>name=drop</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>No tables.</td><td></td></tr>
</tbody></table>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead><tr><td rowspan="1" colspan="3">Variables</td></tr></thead> <thead><tr><td rowspan="1" colspan="3">Variables</td></tr></thead>
<tbody> <tbody>

View File

@@ -31,6 +31,9 @@
<tr><td>type</td><td>fields[1.1][field]</td><td>name</td></tr> <tr><td>type</td><td>fields[1.1][field]</td><td>name</td></tr>
<tr><td>select</td><td>fields[1.1][type]</td><td>label=character varying</td></tr> <tr><td>select</td><td>fields[1.1][type]</td><td>label=character varying</td></tr>
<tr><td>type</td><td>fields[1.1][length]</td><td>50</td></tr> <tr><td>type</td><td>fields[1.1][length]</td><td>50</td></tr>
<tr><td>type</td><td>fields[1.11][field]</td><td>surname</td></tr>
<tr><td>select</td><td>fields[1.11][type]</td><td>label=character varying</td></tr>
<tr><td>type</td><td>fields[1.11][length]</td><td>50</td></tr>
<tr><td>uncheck</td><td>name=comments</td><td></td></tr> <tr><td>uncheck</td><td>name=comments</td><td></td></tr>
<tr><td>clickAndWait</td><td>name=comments</td><td></td></tr> <tr><td>clickAndWait</td><td>name=comments</td><td></td></tr>
<tr><td>type</td><td>fields[1.1][comment]</td><td>Interpret</td></tr> <tr><td>type</td><td>fields[1.1][comment]</td><td>Interpret</td></tr>
@@ -50,8 +53,16 @@
<tr><td>clickAndWait</td><td>//input[@value='Save']</td><td></td></tr> <tr><td>clickAndWait</td><td>//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>multiple primary keys for table "interprets" are not allowed</td><td></td></tr> <tr><td>verifyTextPresent</td><td>multiple primary keys for table "interprets" are not allowed</td><td></td></tr>
<tr><td>select</td><td>indexes[2][type]</td><td>label=INDEX</td></tr> <tr><td>select</td><td>indexes[2][type]</td><td>label=INDEX</td></tr>
<tr><td>click</td><td>//input[@name='options']</td><td></td></tr>
<tr><td>select</td><td>indexes[3][type]</td><td>label=INDEX</td></tr>
<tr><td>select</td><td>indexes[3][columns][1]</td><td>label=surname</td></tr>
<tr><td>select</td><td>indexes[3][algorithm]</td><td>label=hash</td></tr>
<tr><td>type</td><td>indexes[3][partial]</td><td>surname IS NOT NULL</td></tr>
<tr><td>clickAndWait</td><td>//input[@value='Save']</td><td></td></tr> <tr><td>clickAndWait</td><td>//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>Indexes have been altered.</td><td></td></tr> <tr><td>verifyTextPresent</td><td>Indexes have been altered.</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>//tr[@title='interprets_surname']</td><td>INDEX (hash)</td></tr>
<tr><td>verifyTextPresent</td><td>//tr[@title='interprets_surname']</td><td>surname</td></tr>
<tr><td>verifyTextPresent</td><td>//tr[@title='interprets_surname']</td><td>WHERE surname IS NOT NULL</td></tr>
</tbody></table> </tbody></table>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
@@ -384,6 +395,54 @@
<tr><td>verifyTextPresent</td><td>No tables.</td><td></td></tr> <tr><td>verifyTextPresent</td><td>No tables.</td><td></td></tr>
</tbody></table> </tbody></table>
<table cellpadding="1" cellspacing="1" border="1">
<thead><tr><td rowspan="1" colspan="3" data-tags="">Partitioning</td></tr></thead>
<tbody>
<tr><td>open</td><td>/adminer/?pgsql=&amp;username=ODBC&amp;db=adminer_test&amp;ns=public&amp;create=</td><td></td></tr>
<tr><td>type</td><td>name=name</td><td>range</td></tr>
<tr><td>click</td><td>//input[@name='auto_increment_col' and @value='1']</td><td></td></tr>
<tr><td>click</td><td>link=Partition by</td><td></td></tr>
<tr><td>select</td><td>name=partition_by</td><td>label=RANGE</td></tr>
<tr><td>type</td><td>name=partition</td><td>id</td></tr>
<tr><td>type</td><td>name=partition_names[]</td><td>old</td></tr>
<tr><td>type</td><td>name=partition_values[]</td><td>10</td></tr>
<tr><td>type</td><td>xpath=//table[@id='partition-table']/tr/td/input</td><td>new</td></tr>
<tr><td>type</td><td>xpath=//table[@id='partition-table']/tr/td[2]/input</td><td>MAXVALUE</td></tr>
<tr><td>click</td><td>//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION BY RANGE(id)</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>"range_old" PARTITION OF "range" FOR VALUES FROM (MINVALUE) TO (10)</td><td></td></tr>
<tr><td>click</td><td>link=Create table</td><td></td></tr>
<tr><td>type</td><td>name=name</td><td>list</td></tr>
<tr><td>click</td><td>//input[@name='auto_increment_col' and @value='1']</td><td></td></tr>
<tr><td>click</td><td>link=Partition by</td><td></td></tr>
<tr><td>select</td><td>name=partition_by</td><td>label=LIST</td></tr>
<tr><td>type</td><td>name=partition</td><td>id</td></tr>
<tr><td>type</td><td>name=partition_names[]</td><td>odd</td></tr>
<tr><td>type</td><td>name=partition_values[]</td><td>1,3,5</td></tr>
<tr><td>click</td><td>xpath=//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION BY LIST(id)</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>"list_odd" PARTITION OF "list" FOR VALUES IN (1,3,5)</td><td></td></tr>
<tr><td>click</td><td>link=Create table</td><td></td></tr>
<tr><td>type</td><td>name=name</td><td>hash</td></tr>
<tr><td>click</td><td>//input[@name='auto_increment_col' and @value='1']</td><td></td></tr>
<tr><td>click</td><td>link=Partition by</td><td></td></tr>
<tr><td>select</td><td>name=partition_by</td><td>label=HASH</td></tr>
<tr><td>type</td><td>name=partition</td><td>id</td></tr>
<tr><td>type</td><td>name=partitions</td><td>4</td></tr>
<tr><td>click</td><td>xpath=//input[@value='Save']</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>PARTITION BY HASH(id)</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>"hash_0" PARTITION OF "hash" FOR VALUES WITH (MODULUS 4, REMAINDER 0)</td><td></td></tr>
<tr><td>click</td><td>link=hash_0</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>Inherits from</td><td></td></tr>
<tr><td>click</td><td>link=public</td><td></td></tr>
<tr><td>click</td><td>//input[@name='tables[]' and @value='hash']</td><td></td></tr>
<tr><td>click</td><td>//input[@name='tables[]' and @value='list']</td><td></td></tr>
<tr><td>click</td><td>//input[@name='tables[]' and @value='range']</td><td></td></tr>
<tr><td>chooseOkOnNextConfirmation</td><td>Are you sure?</td><td></td></tr>
<tr><td>click</td><td>name=drop</td><td></td></tr>
<tr><td>verifyTextPresent</td><td>No tables.</td><td></td></tr>
</tbody></table>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead><tr><td rowspan="1" colspan="3">Variables</td></tr></thead> <thead><tr><td rowspan="1" colspan="3">Variables</td></tr></thead>
<tbody> <tbody>