Skip to content

Commit

Permalink
Use ST_SRID() in mysql driver for MySQL 8
Browse files Browse the repository at this point in the history
`SRID()` is no longer available in MySQL 8 and has been replaced with `ST_SRID`
  • Loading branch information
bcremer authored and vrana committed May 23, 2021
1 parent 1f173e1 commit db01282
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion adminer/drivers/mysql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,8 @@ function unconvert_field($field, $return) {
$return = "CONV($return, 2, 10) + 0";
}
if (preg_match("~geometry|point|linestring|polygon~", $field["type"])) {
$return = (min_version(8) ? "ST_" : "") . "GeomFromText($return, SRID($field[field]))";
$prefix = (min_version(8) ? "ST_" : "");
$return = $prefix . "GeomFromText($return, $prefix" . "SRID($field[field]))";
}
return $return;
}
Expand Down
2 changes: 1 addition & 1 deletion adminer/include/version.inc.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
$VERSION = "4.8.1";
$VERSION = "4.8.2-dev";
3 changes: 3 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Adminer 4.8.2-dev:
MySQL: Use ST_SRID() instead of SRID() for MySQL 8 (PR #418)

Adminer 4.8.1 (released 2021-05-14):
Internet Explorer or PDO in Adminer 4.7.8-4.8.0: Fix XSS in doc_link (bug #797)
Fix more PHP 8 warnings (bug #781)
Expand Down

1 comment on commit db01282

@104979058
Copy link

@104979058 104979058 commented on db01282 Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SELECT count(tid) AS cut FROM q_thread (0.31s)
SELECT count(tid) AS cut FROM q_thread WHERE cid (0.08s)

innodb. why?

Please sign in to comment.