1
0
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:
Jakub Vrana
2018-01-22 20:56:35 +01:00
parent a2adb67d2f
commit c789c147b7
2 changed files with 3 additions and 1 deletions

View File

@@ -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"]) . ")";
}
}