mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +02:00
MySQL: Support geometry in MySQL 8 (bug #574)
This commit is contained in:
@@ -981,6 +981,7 @@ if (!defined("DRIVER")) {
|
||||
* @return string
|
||||
*/
|
||||
function convert_field($field) {
|
||||
global $connection;
|
||||
if (preg_match("~binary~", $field["type"])) {
|
||||
return "HEX(" . idf_escape($field["field"]) . ")";
|
||||
}
|
||||
@@ -988,7 +989,7 @@ if (!defined("DRIVER")) {
|
||||
return "BIN(" . idf_escape($field["field"]) . " + 0)"; // + 0 is required outside MySQLnd
|
||||
}
|
||||
if (preg_match("~geometry|point|linestring|polygon~", $field["type"])) {
|
||||
return "AsWKT(" . idf_escape($field["field"]) . ")";
|
||||
return ($connection->server_info >= 8 ? "ST_" : "") . "AsWKT(" . idf_escape($field["field"]) . ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user