- MySQL released version 8.0.22 which focused on replacing slave terminology with replica terminology as part of being more inclusive, and addressed 136 bugs.
- Key changes included adding support for periodic synchronization when writing files with SELECT statements, and improving replication performance on multithreaded replicas by disabling session state tracking for worker threads.
- The release notes provide details on changes in areas like account management, configuration, optimizations, and plugins.
This document summarizes the history and capabilities of MySQL's geographic information system (GIS) functions. Key points include:
- MySQL has included basic GIS functions since version 4.1 in 2003, with improvements in versions 5.0, 5.7, and 8.0.
- Version 8.0 added support for over 400 spatial reference systems and over 100 new spatial functions.
- MySQL spatial types include POINT, LINESTRING, POLYGON, and GEOMETRYCOLLECTION, and functions allow operations like distance calculations and coordinate transformations.
15. MySQL5.7 新機能:
GENERATED COLUMN
日本語で「生成列」とも。
mysql> CREATE TABLE gentest (a int, b int, c int GENERATED ALWAYS AS (a+b));
mysql> INSERT INTO gentest (a,b) values (3,5),(2,9);
mysql> SELECT * FROM gentest;
+------+------+------+
| a | b | c |
+------+------+------+
| 3 | 5 | 8 |
| 2 | 9 | 11 |
+------+------+------+
mysql> CREATE TABLE gentest2 (a int, b int,
c int GENERATED ALWAYS AS ((a+b)*rand()));
ERROR 3102 (HY000): Expression of generated column 'c' contains a disallowed
function.
17. GENERATED COLUMN
col_name data_type [GENERATED ALWAYS]
AS (expression)
[VIRTUAL | STORED]
[UNIQUE [KEY]] [COMMENT comment]
[[NOT] NULL] [[PRIMARY] KEY]
mysql> CREATE TABLE gentest (a int, b int,
c int GENERATED ALWAYS AS (a+b));
mysql> CREATE TABLE gentest (a int, b int,c int AS (a+b));
19. 例:
SELECT mycode, name, count(*)
FROM tbl1
GROUP BY mycode;
SQL_MODE: ONLY_FULL_GROUP_BY
こんなクエリを書いていませんか?
20. 例:
×
SELECT mycode, name, count(*)
FROM tbl1 GROUP BY mycode;
○
SELECT mycode, name, count(*)
FROM tbl1 GROUP BY mycode, name;
SQL_MODE: ONLY_FULL_GROUP_BY
22. こんな方法もある:
×
SELECT mycode, name, count(*)
FROM tbl1 GROUP BY mycode;
△
SELECT mycode, ANY_VALUE(name), count(*)
FROM tbl1 GROUP BY mycode;
SQL_MODE: ONLY_FULL_GROUP_BY