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

View file

@ -1,6 +1,7 @@
Adminer 4.4.1-dev:
Adminer: Fix Search data in tables (regression from 4.4.0)
CSP: Allow any styles, images, media and fonts, disallow base-uri
MySQL: Support geometry in MySQL 8 (bug #574)
SQLite: Enable foreign key checks
PostgreSQL: Respect NULL default value
PostgreSQL: Do not export triggers if not requested