mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +02:00
MySQL: Display converting function for binary, bit or geometry fields
This commit is contained in:
@@ -330,6 +330,13 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
}
|
||||
|
||||
function unconvertFunction($field) {
|
||||
return (preg_match("~binary~", $field["type"]) ? "<code class='jush-sql'>UNHEX</code>"
|
||||
: ($field["type"] == "bit" ? doc_link(array('sql' => 'bit-value-literals.html'), "<code>b''</code>")
|
||||
: (preg_match("~geometry|point|linestring|polygon~", $field["type"]) ? "<code class='jush-sql'>GeomFromText</code>"
|
||||
: "")));
|
||||
}
|
||||
|
||||
function insert($table, $set) {
|
||||
return ($set ? parent::insert($table, $set) : queries("INSERT INTO " . table($table) . " ()\nVALUES ()"));
|
||||
}
|
||||
|
@@ -66,6 +66,13 @@ abstract class SqlDriver {
|
||||
function enumLength($field) {
|
||||
}
|
||||
|
||||
/** Function used to convert the value inputted by user
|
||||
* @param array
|
||||
* @return string or null
|
||||
*/
|
||||
function unconvertFunction($field) {
|
||||
}
|
||||
|
||||
/** Select data from table
|
||||
* @param string
|
||||
* @param array result of $adminer->selectColumnsProcess()[0]
|
||||
|
@@ -934,6 +934,7 @@ function input($field, $value, $function) {
|
||||
$field["type"] = "enum";
|
||||
$field["length"] = $enums;
|
||||
}
|
||||
echo $driver->unconvertFunction($field) . " ";
|
||||
if ($field["type"] == "enum") {
|
||||
echo h($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
|
||||
} else {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
Adminer dev:
|
||||
MySQL: Display converting function for binary, bit or geometry fields
|
||||
MySQL: Display default values of binary columns
|
||||
MySQL: Allow setting default values of json column
|
||||
MariaDB: Don't display NULL as default value (regression from 5.0.0)
|
||||
|
2
externals/jush
vendored
2
externals/jush
vendored
Submodule externals/jush updated: 792086f0fd...e095c0d590
Reference in New Issue
Block a user