1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-29 17:19:52 +02:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Jakub Vrana
bb22a965b2 Release 4.17.1 2025-02-25 07:31:42 +01:00
Jakub Vrana
4f0da70733 Move is_c_style_escapes to Min_Driver 2025-02-25 07:26:08 +01:00
Jakub Vrana
a1235f68ff SQLite: Disable backslash escapes 2025-02-25 07:15:57 +01:00
Jakub Vrana
0138f3b0a5 Oracle: Fix foreign key doc link 2025-02-25 07:09:10 +01:00
Jakub Vrana
192ae38d57 MS SQL: Link doc with current version 2025-02-25 06:58:10 +01:00
Jakub Vrana
620e147b8c Check: Add doc link 2025-02-25 06:54:07 +01:00
Jakub Vrana
644cde4855 MS SQL: Update doc_links 2025-02-25 06:52:27 +01:00
Jakub Vrana
c15576bbf8 Use get_rows() 2025-02-25 06:36:32 +01:00
Jakub Vrana
0d8028ddc5 Compile: Do not warn about functions without declared support 2025-02-25 06:30:22 +01:00
Jakub Vrana
242f5a1ed8 MySQL: Fix typo in the date type (regression from 4.17.0) 2025-02-25 05:41:41 +01:00
Jakub Vrana
d12ea17b17 Remove bogus comment 2025-02-25 05:41:12 +01:00
Jakub Vrana
a7365a50b1 Remove border-collapse: separate in designs after removing cellspacing 2025-02-24 16:41:35 +01:00
Jakub Vrana
b5beffb37c Develop 2025-02-24 12:21:15 +01:00
16 changed files with 73 additions and 52 deletions

View File

@@ -25,8 +25,10 @@ if (!$row) {
<form action="" method="post">
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" data-maxlength="64" autocapitalize="off"><?php echo doc_link(array(
'sql' => 'create-table-check-constraints.html',
'mariadb' => 'constraint/',
'sql' => "create-table-check-constraints.html",
'mariadb' => "constraint/",
'pgsql' => "ddl-constraints.html#DDL-CONSTRAINTS-CHECK-CONSTRAINTS",
'mssql' => "relational-databases/tables/create-check-constraints",
)); ?>
<p><?php textarea("clause", $row["clause"]); ?>
<p><input type="submit" value="<?php echo lang('Save'); ?>">

View File

@@ -64,7 +64,7 @@ echo ($_POST["add_x"] || strpos($name, "\n")
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) . doc_link(array(
'sql' => "charset-charsets.html",
'mariadb' => "supported-character-sets-and-collations/",
'mssql' => "ms187963.aspx",
'mssql' => "relational-databases/system-functions/sys-fn-helpcollations-transact-sql",
)) : "");
?>
<input type="submit" value="<?php echo lang('Save'); ?>">

View File

@@ -662,10 +662,6 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
return array();
}
function is_c_style_escapes() {
return false;
}
function show_status() {
return array();
}

View File

@@ -345,6 +345,15 @@ if (!defined("DRIVER")) {
}
}
function hasCStyleEscapes() {
static $c_style;
if ($c_style === null) {
$sql_mode = $this->_conn->result("SHOW VARIABLES LIKE 'sql_mode'", 1);
$c_style = (strpos($sql_mode, 'NO_BACKSLASH_ESCAPES') === false);
}
return $c_style;
}
}
@@ -1070,19 +1079,6 @@ if (!defined("DRIVER")) {
return get_key_vals("SHOW VARIABLES");
}
/** Check if C-style escapes are supported
* @return bool
*/
function is_c_style_escapes() {
global $connection;
static $c_style;
if ($c_style === null) {
$sql_mode = $connection->result("SHOW VARIABLES LIKE 'sql_mode'", 1);
$c_style = (strpos($sql_mode, 'NO_BACKSLASH_ESCAPES') === false);
}
return $c_style;
}
/** Get process list
* @return array [$row]
*/
@@ -1171,7 +1167,7 @@ if (!defined("DRIVER")) {
$structured_types = array(); ///< @var array [$description => array($type, ...), ...]
foreach (array(
lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "decimal" => 66, "float" => 12, "double" => 21),
lang('Date and time') => array("dat`e" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
lang('Lists') => array("enum" => 65535, "set" => 64),
lang('Binary') => array("bit" => 20, "binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),

View File

@@ -165,6 +165,11 @@ if (isset($_GET["oracle"])) {
}
return true;
}
function hasCStyleEscapes() {
return true;
}
}
@@ -484,10 +489,6 @@ AND c_src.TABLE_NAME = " . q($table);
return get_key_vals('SELECT name, display_value FROM v$parameter');
}
function is_c_style_escapes() {
return true;
}
function process_list() {
return get_rows('SELECT sess.process AS "process", sess.username AS "user", sess.schemaname AS "schema", sess.status AS "status", sess.wait_class AS "wait_class", sess.seconds_in_wait AS "seconds_in_wait", sql.sql_text AS "sql_text", sess.machine AS "machine", sess.port AS "port"
FROM v$session sess LEFT OUTER JOIN v$sql sql

View File

@@ -249,6 +249,14 @@ if (isset($_GET["pgsql"])) {
}
}
function hasCStyleEscapes() {
static $c_style;
if ($c_style === null) {
$c_style = ($this->_conn->result("SHOW standard_conforming_strings") == "off");
}
return $c_style;
}
}
@@ -315,7 +323,7 @@ ORDER BY d.datname");
function tables_list() {
$query = "SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = current_schema()";
if (support('materializedview')) { // ' - support("materializedview") could be removed by compile.php
if (support("materializedview")) {
$query .= "
UNION ALL
SELECT matviewname, 'MATERIALIZED VIEW'
@@ -879,15 +887,6 @@ ORDER BY connamespace, conname"
return get_key_vals("SHOW ALL");
}
function is_c_style_escapes() {
global $connection;
static $c_style;
if ($c_style === null) {
$c_style = ($connection->result("SHOW standard_conforming_strings") == "off");
}
return $c_style;
}
function process_list() {
return get_rows("SELECT * FROM pg_stat_activity ORDER BY " . (min_version(9.2) ? "pid" : "procpid"));
}

View File

@@ -758,17 +758,12 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function show_variables() {
global $connection;
$return = array();
$result = $connection->query("PRAGMA pragma_list");
while ($row = $result->fetch_row()) {
$return[$row[0]] = $connection->result("PRAGMA $row[0]");
foreach (get_rows("PRAGMA pragma_list") as $row) {
$return[$row["name"]] = $connection->result("PRAGMA $row[name]");
}
return $return;
}
function is_c_style_escapes() {
return true;
}
function show_status() {
$return = array();
foreach (get_vals("PRAGMA compile_options") as $option) {

View File

@@ -96,8 +96,8 @@ foreach ($row["source"] as $key => $val) {
'sql' => "innodb-foreign-key-constraints.html",
'mariadb' => "foreign-keys/",
'pgsql' => "sql-createtable.html#SQL-CREATETABLE-REFERENCES",
'mssql' => "ms174979.aspx",
'oracle' => "https://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses002.htm#sthref2903",
'mssql' => "t-sql/statements/create-table-transact-sql",
'oracle' => "SQLRF01111",
)); ?>
<p>
<input type="submit" value="<?php echo lang('Save'); ?>">

View File

@@ -193,4 +193,11 @@ function get_driver($id) {
function tableHelp($name) {
}
/** Check if C-style escapes are supported
* @return bool
*/
function hasCStyleEscapes() {
return false;
}
}

View File

@@ -351,7 +351,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
'mariadb' => "auto_increment/",
'sqlite' => "autoinc.html",
'pgsql' => "datatype-numeric.html#DATATYPE-SERIAL",
'mssql' => "ms186775.aspx",
'mssql' => "t-sql/statements/create-table-transact-sql-identity-property",
)); ?>
<td id="label-default"<?php echo $default_class; ?>><?php echo lang('Default value'); ?>
<?php echo (support("comment") ? "<td id='label-comment'$comment_class>" . lang('Comment') : ""); ?>
@@ -616,14 +616,14 @@ function doc_link($paths, $text = "<sup>?</sup>") {
'sql' => "https://dev.mysql.com/doc/refman/$version/en/",
'sqlite' => "https://www.sqlite.org/",
'pgsql' => "https://www.postgresql.org/docs/$version/",
'mssql' => "https://msdn.microsoft.com/library/",
'mssql' => "https://learn.microsoft.com/en-us/sql/",
'oracle' => "https://www.oracle.com/pls/topic/lookup?ctx=db" . preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s', '\1\2', $server_info) . "&id=",
);
if (preg_match('~MariaDB~', $server_info)) {
$urls['sql'] = "https://mariadb.com/kb/en/";
$paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql']));
}
return ($paths[$jush] ? "<a href='" . h($urls[$jush] . $paths[$jush]) . "'" . target_blank() . ">$text</a>" : "");
return ($paths[$jush] ? "<a href='" . h($urls[$jush] . $paths[$jush] . ($jush == 'mssql' ? "?view=sql-server-ver$version" : "")) . "'" . target_blank() . ">$text</a>" : "");
}
/** Wrap gzencode() for usage in ob_start()

View File

@@ -1,2 +1,2 @@
<?php
$VERSION = "4.17.0";
$VERSION = "4.17.1";

View File

@@ -81,7 +81,7 @@ if (!$error && $_POST) {
$offset = $pos + strlen($found);
if ($found && rtrim($found) != $delimiter) { // find matching quote or comment end
$c_style_escapes = is_c_style_escapes() || ($jush == "pgsql" && ($pos > 0 && strtolower($query[$pos - 1]) == "e"));
$c_style_escapes = $driver->hasCStyleEscapes() || ($jush == "pgsql" && ($pos > 0 && strtolower($query[$pos - 1]) == "e"));
$pattern = ($found == '/*' ? '\*/'
: ($found == '[' ? ']'

View File

@@ -1,3 +1,6 @@
Adminer-4.17.1 (released 2025-02-25):
MySQL: Fix typo in the date type (regression from 4.17.0)
Adminer 4.17.0 (released 2025-02-24):
Hide index column options by default
Offer original values in multi-row editing (regression from 4.16.0)

View File

@@ -66,7 +66,29 @@ header("Cache-Control: immutable");
$matches
); //! respect context (extension, class)
$functions = array_combine($matches[1], $matches[0]);
//! do not warn about functions without declared support()
$requires = array(
"check" => array("check_constraints"),
"copy" => array("copy_tables"),
"database" => array("create_database", "rename_database", "drop_databases"),
"dump" => array("use_sql", "create_sql", "truncate_sql", "trigger_sql"),
"indexes" => array("indexes"),
"kill" => array("kill_process", "connection_id", "max_connections"),
"processlist" => array("process_list"),
"routine" => array("routines", "routine", "routine_languages", "create_routine", "routine_id"),
"scheme" => array("schemas", "get_schema", "set_schema"),
"status" => array("show_status"),
"table" => array("search_tables", "is_view"),
"trigger" => array("triggers", "trigger", "trigger_options", "trigger_sql"),
"type" => array("types"),
"variables" => array("show_variables"),
);
foreach ($requires as $support => $fns) {
if (!support($support)) {
foreach ($fns as $fn) {
unset($functions[$fn]);
}
}
}
unset($functions["__construct"], $functions["__destruct"], $functions["set_charset"]);
foreach ($functions as $val) {
if (!strpos($return, "$val(")) {

View File

@@ -81,7 +81,7 @@ code.jush-sql { background: #f0e8d6; }
pre { background: #e0e0e0; }
textarea { font-size: 120%; }
body { width: -moz-fit-content; width: fit-content; }
table, td, th { border: 0; border-collapse: separate; }
table, td, th { border: 0; }
.ltr table { margin: 1.9em 0 0 0; }
.rtl table { margin: 1.9em 0 0 0; }
.rtl table tbody td, .rtl table tbody th { text-align: right; }

View File

@@ -81,7 +81,7 @@ code.jush-sql { background: #d8eaf4; }
pre { background: #aac6d8; }
textarea { font-size: 120%; }
body { width: -moz-fit-content; width: fit-content; }
table, td, th { border: 0; border-collapse: separate; }
table, td, th { border: 0; }
.ltr table { margin: 1.9em 0 0 0; }
.rtl table { margin: 1.9em 0 0 0; }
.rtl table tbody td, .rtl table tbody th { text-align: right; }